質問編集履歴

1

リファクタリングの反映

2020/02/23 04:52

投稿

Savanof
Savanof

スコア33

test CHANGED
File without changes
test CHANGED
@@ -34,6 +34,8 @@
34
34
 
35
35
  ```Python3
36
36
 
37
+
38
+
37
39
  import sys
38
40
 
39
41
  N = int(input())
@@ -44,40 +46,30 @@
44
46
 
45
47
  if N==1:
46
48
 
47
- print("Yes")
49
+ print("Yes")
48
50
 
49
- sys.exit()
51
+ sys.exit()
50
52
 
51
53
  else:
52
54
 
53
- for i in range(N-1):
55
+ for i in range(N-1):
54
56
 
55
- if H[i] > H[i+1]:
57
+ if H[i] > H[i+1]:
56
58
 
57
- H[i] = (H[i] - 1)
59
+ H[i] -= 1
58
60
 
59
61
 
60
62
 
61
- count = 0
62
-
63
63
  for i in range(N-1):
64
64
 
65
- if H[i] > H[i+1]:
65
+ if H[i] > H[i+1]:
66
66
 
67
- count = count + 1
67
+ print("No")
68
+
69
+ sys.exit()
68
70
 
69
71
 
70
72
 
71
-
72
-
73
- if count == 0:
74
-
75
- print("Yes")
73
+ print("Yes")
76
-
77
- else:
78
-
79
- print("No")
80
-
81
-
82
74
 
83
75
  ```