File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
CP/Codeforces Round #457 (Div. 2) Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 4
4
if k < len (a ):
5
5
print 'No'
6
6
quit ()
7
+ #print(a)
7
8
s = a [- 1 ]
8
9
c = 0
9
10
while len (a ) + c < k :
10
11
if a and s == a [- 1 ]:
11
12
c += 1
12
13
a .pop ()
14
+ #print(a)
13
15
c = c * 2
14
16
s -= 1
15
17
t = len (a ) + c - k
16
18
a .reverse ()
17
19
b = 0
20
+ #print(t,a,c,s)
18
21
if t :
19
22
while t :
20
23
c -= 2
21
24
t -= 1
22
25
b += 1
26
+ #print("loop1")
23
27
if not a :
24
28
c -= 1
25
29
a .append (s )
30
+ #print("loop2")
31
+ #print(c)
26
32
while c > 1 :
27
33
c -= 2
28
34
b += 1
29
35
a .extend ([a .pop () - 1 ] * 2 )
36
+ #print("loop3")
30
37
a = [s + 1 ] * b + [s ] * c + a
31
38
print 'Yes'
32
39
for x in a :
Original file line number Diff line number Diff line change
1
+ n , m = map (int , raw_input ().split ())
2
+ t = k = 100000007
3
+ print 2 , (k if n != 2 else 2 )
4
+ print 1 , n , 2
5
+ k -= 2
6
+ for i in range (2 , n ):
7
+ print 1 , i , k / (n - 2 ) + (k % (n - 2 ) if i == 2 else 0 )
8
+ u , v = 2 , 2
9
+ for i in range (n - 1 , m ):
10
+ v += 1
11
+ if v > n :
12
+ u += 1
13
+ v = u + 1
14
+ print u , v , t
You can’t perform that action at this time.
0 commit comments