Task: | slasticar |
Sender: | zxc |
Submission time: | 2016-07-27 16:20:18 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | details |
#2 | WRONG ANSWER | 0.05 s | details |
#3 | WRONG ANSWER | 0.05 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | WRONG ANSWER | 0.05 s | details |
#6 | WRONG ANSWER | 0.15 s | details |
#7 | WRONG ANSWER | 0.16 s | details |
#8 | WRONG ANSWER | 0.15 s | details |
#9 | WRONG ANSWER | 0.16 s | details |
#10 | WRONG ANSWER | 0.16 s | details |
#11 | WRONG ANSWER | 0.17 s | details |
#12 | WRONG ANSWER | 0.16 s | details |
#13 | WRONG ANSWER | 0.14 s | details |
#14 | WRONG ANSWER | 0.16 s | details |
#15 | WRONG ANSWER | 0.17 s | details |
#16 | WRONG ANSWER | 0.16 s | details |
#17 | WRONG ANSWER | 0.15 s | details |
#18 | WRONG ANSWER | 0.15 s | details |
Compiler report
input/code.cpp: In function 'bool cmp(int, int)': input/code.cpp:15:9: warning: unused variable 'q' [-Wunused-variable] int q = hi; ^
Code
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ha[101010]; ll ex[101010]; int t[101010]; int n; ll getHash(int a, int b) { return ha[b+1] - ex[b-a+1]*ha[a]; } bool cmp(int a, int b) { int lo = 0; int hi = min(n-a-1, n-b-1); int q = hi; int best = -1; while(lo <= hi) { int mid = (lo+hi)/2; if(getHash(a, mid) == getHash(b, mid)) { best = mid; lo = mid+1; } else { hi = mid-1; } } if(best == hi) return 0; return t[a+best+1] < t[b+best+1]; } int sa[101010]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ex[0] = 1; for(int i = 1; i < 101010; ++i) { ex[i] = ex[i-1]*i; } ios_base::sync_with_stdio(0); cin>>n; for(int i = 0; i < n; ++i) { char q; cin>>q; t[i] = q; ha[i+1] = ha[i]*107 + t[i]; } for(int i = 0; i < n; ++i) { sa[i] = i; } sort(sa, sa+n, cmp); int m; cin>>m; for(int i = 0; i < m; ++i) { string s; cin>>s; } }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
7
1090901 4 87650 0901 ... |
correct output |
---|
7
10 3 4 |
user output |
---|
(empty) |
Test 2
Verdict: WRONG ANSWER
input |
---|
10
5821052680 4 210526 2105 ... |
correct output |
---|
8
6 3 9 |
user output |
---|
(empty) |
Test 3
Verdict: WRONG ANSWER
input |
---|
3
001 1 11 |
correct output |
---|
4 |
user output |
---|
(empty) |
Test 4
Verdict: WRONG ANSWER
input |
---|
1000
765663201315813856165248633340... |
correct output |
---|
837
802 756 520 611 ... |
user output |
---|
(empty) |
Test 5
Verdict: WRONG ANSWER
input |
---|
1000
407400373060682341208822230817... |
correct output |
---|
833
1026 774 855 850 ... |
user output |
---|
(empty) |
Test 6
Verdict: WRONG ANSWER
input |
---|
100000
013000232021021133321211023303... |
correct output |
---|
133418
133429 133363 133433 132893 ... |
user output |
---|
(empty) |
Test 7
Verdict: WRONG ANSWER
input |
---|
95625
020133223223332232212222000200... |
correct output |
---|
95625
95625 119412 119573 95625 ... |
user output |
---|
(empty) |
Test 8
Verdict: WRONG ANSWER
input |
---|
95625
213030223200121020313233121002... |
correct output |
---|
95625
95625 95625 119439 119527 ... |
user output |
---|
(empty) |
Test 9
Verdict: WRONG ANSWER
input |
---|
100000
000000000000000000000000000000... |
correct output |
---|
399997
1699880 799979 1499909 2099810 ... |
user output |
---|
(empty) |
Test 10
Verdict: WRONG ANSWER
input |
---|
100000
100001000110002100031000410005... |
correct output |
---|
12579
29265 117017 58854 45109 ... |
user output |
---|
(empty) |
Test 11
Verdict: WRONG ANSWER
input |
---|
100000
000000000000000000000000000000... |
correct output |
---|
100000
999964 2399747 1999829 799979 ... |
user output |
---|
(empty) |
Test 12
Verdict: WRONG ANSWER
input |
---|
100000
700007000170002700037000470005... |
correct output |
---|
55793
14829 33421 25742 27073 ... |
user output |
---|
(empty) |
Test 13
Verdict: WRONG ANSWER
input |
---|
100000
000000000000000000000000000000... |
correct output |
---|
536065
2408088 2467498 505724 1480556 ... |
user output |
---|
(empty) |
Test 14
Verdict: WRONG ANSWER
input |
---|
100000
110010000011111110101001001001... |
correct output |
---|
173282
2539 134066 60515 150056 ... |
user output |
---|
(empty) |
Test 15
Verdict: WRONG ANSWER
input |
---|
100000
000000000000000000000000000000... |
correct output |
---|
1630830
1986210 2065604 1394768 1479918 ... |
user output |
---|
(empty) |
Test 16
Verdict: WRONG ANSWER
input |
---|
100000
000000000000000000000000000000... |
correct output |
---|
1699880
1199945 1899847 1299934 699985 ... |
user output |
---|
(empty) |
Test 17
Verdict: WRONG ANSWER
input |
---|
100000
000001000010000000000000000000... |
correct output |
---|
296
296 1079 153 46303 ... |
user output |
---|
(empty) |
Test 18
Verdict: WRONG ANSWER
input |
---|
100000
100101110001121001012120210110... |
correct output |
---|
150479
116882 153076 180545 182057 ... |
user output |
---|
(empty) |