Submission #146118

# Submission time Handle Problem Language Result Execution time Memory
146118 2019-08-22T09:12:15 Z youssefbou62 Game (IOI13_game) C++14
Compilation error
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++ ){
                     ^~