이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "game.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
long long fpb(long long X, long long Y) {
if(Y==0)
return X;
else
return fpb(Y,X%Y);
}
ll n,m,st[11][8040404],hz,i;
void un(ll aa,ll bb,ll cc,ll dd,ll ee,ll ff)
{
if(ff>10)
while(1);
if(aa==bb)
st[ff][ee]=dd;
else
{
ll ce=(aa+bb)/2;
if(cc<=ce)
un(aa,ce,cc,dd,ee*2,ff);
else
un(ce+1,bb,cc,dd,ee*2+1,ff);
st[ff][ee]=fpb(st[ff][ee*2],st[ff][ee*2+1]);
}
}
ll hn(ll aa,ll bb,ll cc,ll dd,ll ee,ll ff)
{
if(ff>10)
while(1);
if(dd<aa||bb<cc)
return 0;
else
if(cc<=aa&&bb<=dd)
return st[ff][ee];
else
{
ll ce=(aa+bb)/2;
return fpb(hn(aa,ce,cc,dd,ee*2,ff),hn(ce+1,bb,cc,dd,ee*2+1,ff));
}
}
void init(int R, int C) {
n=R;
m=C;
}
void update(int P, int Q, long long K) {
un(0,m-1,Q,K,1,P);
}
long long calculate(int P, int Q, int U, int V) {
hz=0;
for(i=P;i<=U;i++)
hz=fpb(hz,hn(0,m-1,Q,V,1,i));
return hz;
}
컴파일 시 표준 에러 (stderr) 메시지
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |