Task: | Lähetit |
Sender: | |
Submission time: | 2015-07-18 13:59:53 +0300 |
Language: | Python2 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.07 s | 1 | details |
#2 | WRONG ANSWER | 0.08 s | 1 | details |
#3 | WRONG ANSWER | 0.11 s | 1 | details |
#4 | WRONG ANSWER | 0.08 s | 1 | details |
#5 | WRONG ANSWER | 0.11 s | 1 | details |
#6 | WRONG ANSWER | 0.10 s | 2 | details |
#7 | WRONG ANSWER | 0.09 s | 2 | details |
#8 | WRONG ANSWER | 0.09 s | 2 | details |
#9 | WRONG ANSWER | 0.09 s | 2 | details |
#10 | WRONG ANSWER | 0.07 s | 2 | details |
#11 | WRONG ANSWER | 0.10 s | 3 | details |
#12 | WRONG ANSWER | 0.09 s | 3 | details |
#13 | WRONG ANSWER | 0.09 s | 3 | details |
#14 | WRONG ANSWER | 0.10 s | 3 | details |
#15 | WRONG ANSWER | 0.10 s | 3 | details |
Code
import sys import math import itertools from collections import defaultdict n, k = map(int, sys.stdin.readline().rstrip().split()) if n == 1: print n sys.exit() if n == 2: if k > 1: print "QAQ" else: print "1 2" sys.exit() res = [-1]*n start1 = 1 start2 = int(math.ceil(n/2.0)) + 1 #if start2 - 2 < k: # print "QAQ" # sys.exit() if n % 2 == 1: insertStart1 = True else: insertStart1 = False for i in xrange(n): if insertStart1: res[i] = start1 start1 += 1 else: res[i] = start2 start2 += 1 insertStart1 = not insertStart1 mindif = min([abs(res[i] - res[i + 1]) for i in xrange(n - 1)]) if mindif >= k: print " ".join(map(str, res)) else: print "QAQ" # 1 4 2 5 3 6 # 2 5 1 4 6 3 # 1 5 2 6 3 7 4 # 1 5 2 6 3 7 4 8 # 5 1 6 2 7 3 8 4
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 2 |
correct output |
---|
240 |
user output |
---|
1 4 2 5 3 |
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 4 |
correct output |
---|
2728 |
user output |
---|
QAQ |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 6 |
correct output |
---|
1960 |
user output |
---|
QAQ |
Test 4
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 8 |
correct output |
---|
32 |
user output |
---|
QAQ |
Test 5
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 10 |
correct output |
---|
0 |
user output |
---|
QAQ |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 4 |
correct output |
---|
1809464 |
user output |
---|
6 1 7 2 8 3 9 4 10 5 |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 8 |
correct output |
---|
209594075 |
user output |
---|
QAQ |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 12 |
correct output |
---|
811277399 |
user output |
---|
QAQ |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 16 |
correct output |
---|
17275136 |
user output |
---|
QAQ |
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 20 |
correct output |
---|
0 |
user output |
---|
QAQ |
Test 11
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 40 |
correct output |
---|
126883191 |
user output |
---|
51 1 52 2 53 3 54 4 55 5 56 6 ... |
Test 12
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 80 |
correct output |
---|
785497039 |
user output |
---|
QAQ |
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 120 |
correct output |
---|
324216296 |
user output |
---|
QAQ |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 160 |
correct output |
---|
895190039 |
user output |
---|
QAQ |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 200 |
correct output |
---|
0 |
user output |
---|
QAQ |