제출 #292573

#제출 시각아이디문제언어결과실행 시간메모리
292573crossing0ver게임 (IOI13_game)C++17
0 / 100
175 ms256004 KiB
#include<bits/stdc++.h> #define ll long long #include "game.h" using namespace std; int r1,c1; ll gcd2(ll X, ll Y) { long long tmp; while (X != Y && Y != 0) { tmp = X; X = Y; Y = tmp % Y; } return X; } ll t[2*2060][2*2060]; void init(int R, int C) { r1 = R;c1 = C; /* ... */ } ll val; void upd_y(int vx,int lx,int rx,int vy,int ly,int ry,int x,int y) { if (ly == ry) { if (lx == rx) t[vx][vy] = val; else t[vx][vy] = gcd2(t[vx*2][vy],t[vx*2+1][vy]); }else { int tm = (ly + ry)/2; if (y <= tm) upd_y(vx,lx,rx,vy*2,ly,tm,x,y); else upd_y(vx,lx,rx,vy*2+1,tm,ry,x,y); t[vx][vy] = gcd2(t[vx][vy*2],t[vx][vy*2+1]); } } void upd_x(int vx,int lx,int rx,int x,int y) { if (lx != rx) { int tm = (lx + rx)/2; if (x <= tm) upd_x(vx*2,lx,tm,x,y); else upd_x(vx*2+1,tm+1,rx,x,y); } upd_y(vx,lx,rx,1,0,c1-1,x,y); } int LX,LY,RX,RY; ll get_y(int vx,int lx,int rx,int vy,int ly,int ry) { if (LY > ry || RY < ly) return 0; if (ly == ry) { if (lx == rx) return t[vx][vy]; else return gcd2(t[vx*2][vy],t[vx*2+1][vy]); }else { int tm = (ly + ry)/2; // if (y <= tm) // return 0; return gcd2(get_y(vx,lx,rx,vy*2,ly,tm),get_y(vx,lx,rx,vy*2+1,tm,ry)); //t[vx][vy] = gcd2(t[vx][vy*2],t[vx][vy*2+1]); } } ll get_x(int vx,int lx,int rx) { if (LX > rx || RX < lx) return 0; if (lx != rx) { int tm = (lx + rx)/2; return gcd2(get_x(vx*2,lx,tm),get_x(vx*2+1,tm+1,rx)); }else return get_y(vx,lx,rx,1,0,c1-1); // upd_y(vx,lx,rx,vy,ly,ry,x,y); } void update(int P, int Q, long long K) { val = K; upd_x(1,0,r1-1,P,Q); /* ... */ } long long calculate(int P, int Q, int U, int V) { LX = P; LY = Q; RX = U; RY = V; return get_x(1,0,r1-1); /* ... */ return 42; }

컴파일 시 표준 에러 (stderr) 메시지

grader.c: In function 'int main()':
grader.c:25:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   25 |     while(res != 1);
      |     ^~~~~
grader.c:26:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   26 |  res = fscanf(f, "%d", &C);
      |  ^~~
grader.c:27:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   27 |     while(res != 1);
      |     ^~~~~
grader.c:28:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   28 |  res = fscanf(f, "%d", &N);
      |  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...