# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
235360 |
2020-05-28T06:54:34 Z |
crossing0ver |
Game (IOI13_game) |
C++17 |
|
5 ms |
384 KB |
#include<bits/stdc++.h>
#define ll long long
#include "game.h"
using namespace std;
long long gcd2(long long X, long long Y) {
long long tmp;
while (X != Y && Y != 0) {
tmp = X;
X = Y;
Y = tmp % Y;
}
return X;
}
ll t[2000][4*10001] , R, C;
void upd (int s,int v,int tl,int tr,int pos,ll val) {
if (tl == tr) {
t[s][v] = val;
return;
}
int tm = (tl + tr)/2;
if (pos <= tm) upd(s,v*2,tl,tm,pos,val);
else upd(s,v*2|1,tm+1,tr,pos,val);
t[s][v] = gcd2(t[s][v*2],t[s][v*2|1]);
}
ll get (int s,int v,int tl,int tr,int l,int r) {
if (l > tr || r < tl) return 0;
if (l <= tl && r >= tr) {
return t[s][v];
}
int tm = (tl + tr)/2;
return gcd2 ( get (s,v*2,tl,tm,l,r), get (s,v*2|1,tm+1,tr,l,r));
}
void update(int P, int Q, long long K) {
upd (P,1,1,10000,Q,K);
}
long long calculate(int P, int Q, int U, int V) {
/* ... */
ll s = 0;
for (int i = P; i <= U; i++) {
s = gcd2(s,get (i,1,1,10000,Q,V));
}
return s;
}
void init(int R1, int C1) {R = R1; C = C1;}
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 |
4 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |