#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 rows, c;
int seg[10000];
int a[11][10000];
void init(int R, int C) {
rows = R, c = C;
}
void updateseg(int pos, int val, int l=0, int r=c-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]);
}
int query(int rl, int rr, int l=0, int r=c-1, int ind=1){
}
void update(int P, int Q, long long K) {
a[P][Q] = K;
/*int anspos = 0;
for(int i=0;i<rrows;i++){
anspos = gcd(anspos, a[i][Q]);
}
updateseg(Q, anspos);*/
}
long long calculate(int P, int Q, int U, int V) {
//cout<<"-----------------------\n";
//cout<<P<<" "<<Q<<" "<<U<<" "<<V<<endl;
long long ans=0;
for(int i=P;i<=U;i++){
for(int j=Q;j<=V;j++){
//cout<<a[i][j]<<" ";
ans = gcd(ans, a[i][j]);
}
//cout<<endl;
}
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;
^~~
game.cpp: In function 'int query(int, int, int, int, int)':
game.cpp:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
400 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |