Submission #1263785

#TimeUsernameProblemLanguageResultExecution timeMemory
1263785aren_danceGame (IOI13_game)C++20
0 / 100
1 ms328 KiB
#include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <map> #include "game.h" #define ll long long using namespace std; vector<pair<pair<int, int>,ll>> g; ll gcd(ll x,ll y) { if (x > y) { swap(x, y); } if (x == 0) { return y; } if (y % x == 0) { return x; } return gcd(y%x,x); } void init(int R, int C) { } void update(int P, int Q, long long K) { for (auto i : g) { if (i.first.first == P && i.first.second == Q) { return; } } g.push_back({ {P,Q},K }); } long long calculate(int P, int Q, int U, int V) { ll answ = 0; ll x = log2(V - Q + 1); for (auto i : g) { if (i.first.first >= P && i.first.first <= U && i.first.second >= Q && i.first.second <= V) { answ = gcd(answ, i.second); } } return answ; }
#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...