Task: | trener |
Sender: | Kuha |
Submission time: | 2016-07-27 16:35:12 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.06 s | details |
#2 | WRONG ANSWER | 0.05 s | details |
#3 | WRONG ANSWER | 0.06 s | details |
#4 | WRONG ANSWER | 0.07 s | details |
#5 | WRONG ANSWER | 0.16 s | details |
#6 | RUNTIME ERROR | 0.15 s | details |
#7 | RUNTIME ERROR | 0.15 s | details |
#8 | RUNTIME ERROR | 0.26 s | details |
#9 | WRONG ANSWER | 0.06 s | details |
#10 | WRONG ANSWER | 0.06 s | details |
#11 | RUNTIME ERROR | 0.14 s | details |
#12 | RUNTIME ERROR | 0.15 s | details |
#13 | RUNTIME ERROR | 0.13 s | details |
#14 | WRONG ANSWER | 0.06 s | details |
#15 | RUNTIME ERROR | 0.14 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:53:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < foo.size(); i++) e[foo[i]] = i; ^
Code
#include <bits/stdc++.h> #define ll int//long long #define INF 999999999 #define N (1<<17) #define M 1000000007 #define C 6323 using namespace std; ll ans = 0; ll v[52][52]; ll m[52][52][C]; ll m2[52][52][C]; unordered_map<ll, int> e; vector<ll> foo; const inline ll sum (const ll x1, const ll x2, const ll y1, const ll y2) { ll s = v[y2][x2]; if (x1) s -= v[y2][x1-1]; if (y1) s -= v[y1-1][x2]; if (x1 && y1) s += v[y1-1][x1-1]; return (s + 1) * s; } int main () { cin.sync_with_stdio(0); cin.tie(0); int n; cin>>n; for (int y = 0; y < n; y++) { for (int x = 0; x <n; x++) { cin>>v[y][x]; //v[y][x] = 1; if (x) v[y][x] += v[y][x - 1]; } } for(int y = 1; y < n; y++) { for (int x = 0; x < n; x++) { v[y][x] += v[y - 1][x]; } } for (ll y = 0; y < n; y++) { for (ll x = 0; x <n; x++) { for (ll y1 = 0; y1 <= y; y1++) { for (ll x1 = 0; x1 <= x; x1++) { ll s = sum(x1, x, y1, y); if (!e[s]) e[s] = 1, foo.push_back(s); } } } } sort(foo.begin(), foo.end()); for (int i = 0; i < foo.size(); i++) e[foo[i]] = i; for (ll y = 0; y < n; y++) { for (ll x = 0; x <n; x++) { for (ll y1 = 0; y1 <= y; y1++) { for (ll x1 = 0; x1 <= x; x1++) { ll s = e[sum(x1, x, y1, y)] % C; m[y1][x1][s]++; m2[y + 1][x1][s]++; } } } } for (ll y = 0; y < n; y++) { for (ll x = 0; x <n; x++) { for (ll y1 = 0; y1 <= y; y1++) { for (ll x1 = 0; x1 <= x; x1++) { ll s = e[sum(x1, x, y1, y)] % C; ans += m[y + 1][x + 1][s]; ans += m2[y1][x + 1][s]; } } } } cout<<ans<<endl; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
18
babic keksic boric bukic ... |
correct output |
---|
bk |
user output |
---|
1877922 |
Test 2
Verdict: WRONG ANSWER
input |
---|
6
michael jordan lebron james ... |
correct output |
---|
PREDAJA |
user output |
---|
2450 |
Test 3
Verdict: WRONG ANSWER
input |
---|
10
wmyrsaney raqdxrb cnwkmtcokgskaxosctzyks wlusaisfibbkwwzdqhezuj ... |
correct output |
---|
w |
user output |
---|
54450 |
Test 4
Verdict: WRONG ANSWER
input |
---|
20
jgztazpytubijfsmjz bokvgratzzdibku qineboilzoqdqivc bfctyltibtkbxq ... |
correct output |
---|
b |
user output |
---|
3537800 |
Test 5
Verdict: WRONG ANSWER
input |
---|
50
wkrtpgfjmzlnqigogi knqkkelytfjgmyxgyzcfd xdkjrptlcuzwqgvrtzdbybh vscbjbji ... |
correct output |
---|
efv |
user output |
---|
867361250 |
Test 6
Verdict: RUNTIME ERROR
input |
---|
100
cmksprocpmkl deyorcxeehlalonan tdoqxhvygiwbbklj rvamqpuprhynwduswppa ... |
correct output |
---|
dfqrt |
user output |
---|
(empty) |
Test 7
Verdict: RUNTIME ERROR
input |
---|
130
assootmfjtgcagtxh elqyysidg otuxclnjhvxdadm qmczmsgavvcboahqilzcuzm ... |
correct output |
---|
abcdefghijklmnopqrstuvwxyz |
user output |
---|
(empty) |
Test 8
Verdict: RUNTIME ERROR
input |
---|
60
ljuolrxkieqkobvikuyvt rhbrswllwycioayqjdertvb xmzcubmbbed uwgjslybqarciupgixt ... |
correct output |
---|
eflmnr |
user output |
---|
(empty) |
Test 9
Verdict: WRONG ANSWER
input |
---|
5
pnmdjqteyiapkhvebbqtwnnh pirfyzgoqjsdsio pkcltfhwxemgyubef pxcjeh ... |
correct output |
---|
p |
user output |
---|
800 |
Test 10
Verdict: WRONG ANSWER
input |
---|
20
fnuxegvwdqnkmkclmwlxeh kmurkl rlhxoacqadnzle foxonevsx ... |
correct output |
---|
PREDAJA |
user output |
---|
3537800 |
Test 11
Verdict: RUNTIME ERROR
input |
---|
81
pidkcuqljmxi mcpwm zyyjrvkkkwkabwppvpm aoighmgashjtvl ... |
correct output |
---|
cegiptuwx |
user output |
---|
(empty) |
Test 12
Verdict: RUNTIME ERROR
input |
---|
100
evyottlutpqus openmtwnmme yvtgrk shhpzhlgmpnnvswcpmjqiwe ... |
correct output |
---|
PREDAJA |
user output |
---|
(empty) |
Test 13
Verdict: RUNTIME ERROR
input |
---|
99
yuqgzaqmnwrghzntlv mcjkwfrkzchiauues uclswdwkhtvkcsvklyhyiw tggmfkr ... |
correct output |
---|
abeklmnqtvz |
user output |
---|
(empty) |
Test 14
Verdict: WRONG ANSWER
input |
---|
4
kzyulnmhnmkowhtgrqksru xkgzlbwihowzdaodfg nvxkdrltxviwyhkf npvivwibxwrludfouga |
correct output |
---|
PREDAJA |
user output |
---|
200 |
Test 15
Verdict: RUNTIME ERROR
input |
---|
78
qdidvlkgpxjxmuqq kgbugcncxazixwtxtww abwtlqxkrusaocu esjmgrutkzebklqt ... |
correct output |
---|
ajlstxz |
user output |
---|
(empty) |