제출 #1014535

#제출 시각아이디문제언어결과실행 시간메모리
1014535huutuan게임 (IOI13_game)C++14
37 / 100
13087 ms9236 KiB
#include "game.h" long long gcd2(long long X, long long Y) { long long tmp; while (X != Y && Y != 0) { tmp = X; X = Y; Y = tmp % Y; } return X; } #include <bits/stdc++.h> using namespace std; vector<array<long long, 3>> v; void init(int R, int C) { } void update(int P, int Q, long long K) { for (auto &i:v) if (i[0]==P && i[1]==Q){ i[2]=K; return; } v.push_back({{P, Q, K}}); } long long calculate(int P, int Q, int U, int V) { long long ans=0; for (auto &i:v) if (P<=i[0] && i[0]<=U && Q<=i[1] && i[1]<=V) ans=gcd2(ans, i[2]); return ans; }
#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...