답안 #146118

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
146118 2019-08-22T09:12:15 Z youssefbou62 게임 (IOI13_game) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "game.h"
using namespace std; 
using ll = long long ; 


const int N = 105 ; 
ll Mat[N][N] ; 
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;
}

void init(int R, int C) {
    /* ... */
}

void update(int P, int Q, long long K) {
    /* ... */
	Mat[P][Q]=K; 
}

long long calculate(int P, int Q, int U, int V) {
    /* ... */
    
    ll ans = 0 ; 
    for(int i = P ; <= U ; i++ ){
    	for(int j = Q;j<=V;j++ )ans = gcd2(ans,Mat[i][j]); 
    }
    return ans;
}

Compilation message

grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
  int res;
      ^~~
game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:32:21: error: expected primary-expression before '<=' token
     for(int i = P ; <= U ; i++ ){
                     ^~