제출 #256281

#제출 시각아이디문제언어결과실행 시간메모리
256281SortingGame (IOI13_game)C++17
10 / 100
13098 ms8208 KiB
#include "game.h"
#include <bits/stdc++.h>

using namespace std;

const int k_Inf = 1e9;

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;
}

map<pair<int, int>, long long> mp;

void init(int _r, int _c) {
}

void update(int p, int q, long long k) {
    mp[{p, q}] = k;
}

long long calculate(int p, int q, int u, int v) {
    long long ans = 0;
    for(auto t: mp){
        int x = t.first.first;
        int y = t.first.second;
        long long num = t.second;

        if(p <= x && x <= u && q <= y && y <= v)
            ans = gcd2(ans, num);
    }
    return ans;
}

컴파일 시 표준 에러 (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 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...