Task: | trener |
Sender: | Kuha |
Submission time: | 2016-07-27 16:17:29 +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.05 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | RUNTIME ERROR | 0.17 s | details |
#6 | RUNTIME ERROR | 0.14 s | details |
#7 | RUNTIME ERROR | 0.14 s | details |
#8 | RUNTIME ERROR | 0.17 s | details |
#9 | WRONG ANSWER | 0.06 s | details |
#10 | WRONG ANSWER | 0.06 s | details |
#11 | RUNTIME ERROR | 0.15 s | details |
#12 | RUNTIME ERROR | 0.14 s | details |
#13 | RUNTIME ERROR | 0.15 s | details |
#14 | WRONG ANSWER | 0.05 s | details |
#15 | RUNTIME ERROR | 0.13 s | details |
Code
#include <bits/stdc++.h> #define ll int//long long #define INF 999999999 #define N (1<<17) #define M 1000000007 #define C 4123 using namespace std; ll ans = 0; ll v[50][50]; ll m[50][50][C]; ll m2[50][50][C]; 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 % C) + C) % C; } 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]; 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); 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 = sum(x1, x, y1, y); 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: RUNTIME ERROR
input |
---|
50
wkrtpgfjmzlnqigogi knqkkelytfjgmyxgyzcfd xdkjrptlcuzwqgvrtzdbybh vscbjbji ... |
correct output |
---|
efv |
user output |
---|
(empty) |
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) |