# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
140439 |
2019-08-03T00:40:25 Z |
cfalas |
Game (IOI13_game) |
C++14 |
|
3 ms |
376 KB |
#include<bits/stdc++.h>
using namespace std;
#include "game.h"
long long gcd(long long X, long long Y) {
long long tmp;
while (X != Y && Y != 0) {
tmp = X;
X = Y;
Y = tmp % Y;
}
return X;
}
int a[1000][1000];
int seg[10000];
void init(int R, int C) {
}
void updateseg(int pos, int val, int l=0, int r=/*TOTOOODSOSODOASD-*/1, int ind=1){
if(l==r && l==pos){
seg[ind] = val;
return;
}
if(pos<l || pos>r) return;
int m = (l+r)/2;
updateseg(pos, val, l, m, ind*2);
updateseg(pos, val, m+1, r, ind*2+1);
seg[ind] = gcd(seg[ind*2], seg[ind*2+1]);
}
void update(int P, int Q, long long K) {
a[P][Q] = K;
}
long long calculate(int P, int Q, int U, int V) {
long long ans=0;
for(int i=P;i<=U;i++)
for(int j=Q;j<=V;j++)
ans = gcd(ans, a[i][j]);
return ans;
}
Compilation message
grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
int res;
^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |