제출 #962996

#제출 시각아이디문제언어결과실행 시간메모리
962996n3rm1n게임 (IOI13_game)C++17
0 / 100
1 ms348 KiB
#include<bits/stdc++.h> #include "game.h" using namespace std; int r, c; void init(int R, int C) { r = R; c = C; } map < pair < long long, long long >, long long > mp; long long gcd2(long long X, long long Y) { int ans = mp[make_pair(X, Y)]; if(ans)return ans; long long tmp; long long oldx = X, oldy = Y; while (X != Y && Y != 0) { tmp = X; X = Y; Y = tmp % Y; } mp[make_pair(oldx, oldy)] = X; return X; } struct point { int x, y; long long val; point(){}; point(int _x, int _y, long long _val) { x = _x; y = _y; val = _val; } }; vector < point > g; void update(int P, int Q, long long K) { P ++; Q ++; g.push_back(point(P, Q, K)); } long long calculate(int P, int Q, int U, int V) { P ++; Q ++; U ++; V ++; long long ans = 0; for (int i = 0; i < g.size(); ++ i) { if(g[i].x >= P && g[i].x <= U && g[i].y >= Q && g[i].y <= V) ans = gcd2(ans, g[i].val); } return ans; }

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

game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:56:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<point>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |     for (int i = 0; i < g.size(); ++ i)
      |                     ~~^~~~~~~~~~
#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...