File tree 10 files changed +105
-0
lines changed
10 files changed +105
-0
lines changed Original file line number Diff line number Diff line change
1
+ N = int (input ())
2
+ if N == 12 :
3
+ print (1 )
4
+ else :
5
+ print (N + 1 )
Original file line number Diff line number Diff line change
1
+ S = input ()
2
+ print (S .capitalize ())
Original file line number Diff line number Diff line change
1
+ N = int (input ())
2
+ ng = [int (input ()) for i in range (3 )]
3
+ ng .sort (reverse = True )
4
+ ng3 = [i % 3 for i in ng ]
5
+ #print(ng3)
6
+ if N in ng :
7
+ print ("NO" )
8
+ exit ()
9
+ count = 0
10
+ # for i in ng3:
11
+ # if i == N%3:
12
+ # N = N-3*((N - i)//3)
13
+ # count += (N - i)//3
14
+ # N -= 4
15
+ # count += 2
16
+ while N > 0 :
17
+ if N - 3 in ng and N - 2 in ng and N - 1 in ng :
18
+ print ('NO' )
19
+ exit ()
20
+ if N - 3 not in ng and N - 3 >= 0 :
21
+ N -= 3
22
+ count += 1
23
+ elif N - 2 not in ng and N - 2 >= 0 :
24
+ N -= 2
25
+ count += 1
26
+ elif N - 1 not in ng and N - 1 >= 0 :
27
+ N -= 1
28
+ count += 1
29
+
30
+ if count > 100 :
31
+ print ('NO' )
32
+ exit ()
33
+ print ('YES' )
34
+
35
+
36
+ ###ans
37
+ # N = int(input())
38
+ # ng = [int(input()) for i in range(3)]
39
+ # if N in ng:
40
+ # print("NO")
41
+ # exit()
42
+ # if N <= 3:
43
+ # print("YES")
44
+ # exit()
45
+ # dp = [float('inf')]*(N+1)
46
+ # dp[N] = 0
47
+ # for i in range(N, -1, -1):
48
+ # if i not in ng:
49
+ # for j in range(1,4):
50
+ # dp[i-j] = min(dp[i]+1, dp[i-j])
51
+ # if dp[0]<=100:
52
+ # print("YES")
53
+ # else:
54
+ # print("NO")
Original file line number Diff line number Diff line change
1
+ A , B = map (int , input ().split ())
2
+ print (B , A )
Original file line number Diff line number Diff line change
1
+ N = int (input ())
2
+ h = N // 3600
3
+ m = (N - h * 3600 )// 60
4
+ s = (N - h * 3600 - m * 60 )
5
+ print ('{:02}:{:02}:{:02}' .format (h , m , s ))
Original file line number Diff line number Diff line change
1
+ def make_divisors (n ):
2
+ divisors = []
3
+ for i in range (1 , int (n ** 0.5 )+ 1 ):
4
+ if n % i == 0 :
5
+ divisors .append (i )
6
+ if i != n // i :
7
+ divisors .append (n // i )
8
+
9
+ divisors .sort ()
10
+ return divisors
11
+
12
+ N = int (input ())
13
+ N = 2025 - N
14
+ div = make_divisors (N )
15
+ for i in range (len (div )):
16
+ if div [len (div )- 1 - i ] <= 9 and div [i ] <= 9 :
17
+ print (str (div [i ])+ ' x ' + str (div [len (div )- 1 - i ]))
Original file line number Diff line number Diff line change
1
+ print (ord (input ())- 64 )
Original file line number Diff line number Diff line change
1
+ a = int (input ())
2
+ b = int (input ())
3
+
4
+ ans = abs (b - a )
5
+ ans = min (ans , abs (min (a ,b )- 0 )+ abs (max (a ,b )- 9 )+ 1 )
6
+ print (ans )
Original file line number Diff line number Diff line change
1
+ a = int (input ())
2
+ b = int (input ())
3
+ print (0 if a % b == 0 else b - a % b )
Original file line number Diff line number Diff line change
1
+ n , x = map (int , input ().split ())
2
+ a = list (map (int , input ().split ()))
3
+ bin_str = format (x , 'b' )
4
+ #print(bin_str)
5
+ ans = 0
6
+ for j , i in enumerate (bin_str [::- 1 ]):
7
+ #print(i)
8
+ if int (i )== 1 :
9
+ ans += a [j ]
10
+ print (ans )
You can’t perform that action at this time.
0 commit comments