# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
70305 |
2018-08-22T14:56:30 Z |
MladenP |
Secret (JOI14_secret) |
C++17 |
|
705 ms |
8568 KB |
#include "secret.h"
#define m (l+r)/2
#define I int
#define G return
#define S Secret
I n,i,a[1010],d[1010][1010];void Z(I l,I r){if(l>=r)G;for(i=m+1;i <= r;i++)d[m][i]=S(d[m][i-1],a[i]);for(i=m-2;i>=l;i--)d[i][m-1]=S(a[i],d[i+1][m-1]);Z(l,m-1);Z(m+1,r);}I X(I l,I r,I L,I R){if(m<L)G X(m+1,r,L,R);if(L==m)G d[m][R];if(m<R)G S(d[L][m-1],d[m][R]);G X(l,m-1,L,R);}void Init(I N, I *A){for(i=0,n=N-1;i<N;i++)a[i]=A[i],d[i][i]=a[i];Z(0,n);}I Query(I L,I R){G X(0,n,L,R);}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
187 ms |
4448 KB |
Wrong Answer: Query(264, 271) - expected : 675707686, actual : 542584865. |
2 |
Incorrect |
171 ms |
4472 KB |
Wrong Answer: Query(210, 211) - expected : 558550312, actual : 0. |
3 |
Incorrect |
181 ms |
4496 KB |
Wrong Answer: Query(130, 131) - expected : 127065177, actual : 0. |
4 |
Incorrect |
705 ms |
8284 KB |
Wrong Answer: Query(571, 624) - expected : 309502044, actual : 18432199. |
5 |
Incorrect |
647 ms |
8452 KB |
Wrong Answer: Query(584, 592) - expected : 111053842, actual : 0. |
6 |
Incorrect |
659 ms |
8480 KB |
Wrong Answer: Query(738, 741) - expected : 983692994, actual : 942318537. |
7 |
Correct |
623 ms |
8480 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |
8 |
Correct |
649 ms |
8480 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |
9 |
Correct |
656 ms |
8480 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |
10 |
Correct |
668 ms |
8568 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |