#include <bits/stdc++.h>
#ifndef ARTHUR_LOCAL
#include "game.h"
#endif
using namespace std;
using ll=long long;
const int p2=262144;
ll st[10][p2+p2];
ll grid[100][100];
int r,c;
void init(int r_r, int c_r)
{
r=r_r;
c=c_r;
for(int i=0; i<100; i++)
{
for(int j=0; j<100; j++)
{
grid[i][j]=0;
}
}
for(int i=0; i<10; i++)
{
for(int j=0; j<p2+p2; j++)
{
st[i][j]=0;
}
}
}
void update(int p, int q, ll k)
{
q += p2;
st[p][q]=k;
q/=2;
while(q>0)
{
st[p][q] = __gcd(st[p][q+q],st[p][q+q+1]);
q/=2;
}
}
ll query(int p, int l, int r)
{
l+=p2;
r+=p2;
ll ans=0;
while(l<=r)
{
if(l%2 == 1) ans=__gcd(ans,st[p][l++]);
if(r%2 == 0) ans=__gcd(ans,st[p][r--]);
l/=2;
r/=2;
}
return ans;
}
ll calculate(int p, int q, int u, int v)
{
ll cur_gcd = 0;
for(int i=p; i<=u; i++)
{
cur_gcd = __gcd(cur_gcd,query(i,q,v));
}
#ifdef ARTHUR_LOCAL
cout << cur_gcd << endl;
#endif
return cur_gcd;
}
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;
^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
41464 KB |
Output is correct |
2 |
Runtime error |
95 ms |
83704 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
41476 KB |
Output is correct |
2 |
Correct |
35 ms |
41464 KB |
Output is correct |
3 |
Correct |
38 ms |
41468 KB |
Output is correct |
4 |
Correct |
945 ms |
49816 KB |
Output is correct |
5 |
Correct |
608 ms |
49660 KB |
Output is correct |
6 |
Correct |
839 ms |
47184 KB |
Output is correct |
7 |
Correct |
912 ms |
47012 KB |
Output is correct |
8 |
Correct |
677 ms |
47244 KB |
Output is correct |
9 |
Correct |
878 ms |
46972 KB |
Output is correct |
10 |
Correct |
731 ms |
46624 KB |
Output is correct |
11 |
Correct |
35 ms |
41460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
41464 KB |
Output is correct |
2 |
Runtime error |
89 ms |
83584 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
41464 KB |
Output is correct |
2 |
Runtime error |
89 ms |
83652 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
41464 KB |
Output is correct |
2 |
Runtime error |
91 ms |
83600 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |