Submission #291470

# Submission time Handle Problem Language Result Execution time Memory
291470 2020-09-05T11:01:15 Z cig32 Game (IOI13_game) C++14
Compilation error
0 ms 0 KB
#include "game.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int grid[1000][1000];
void init(int R,int C){
    for(int i=0;i<R;i++){
        for(int j=0;j<C;j++){
            grid[i][j]=0;
        }
    }
}
void update(int P,int Q,long long K){
    grid[P][Q]=K;
}
long long calculate(int P,int Q,int U,int V){
    ll GCD=grid[P][Q];
    for(int i=P;i<=U;i++){
        for(int j=Q;j<=V;j++){
            if(grid[i][j]!=0) GCD=gcd(GCD,grid[i][j]);
        }
    }
    return GCD;
}

Compilation message

grader.c: In function 'int main()':
grader.c:25:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   25 |     while(res != 1);
      |     ^~~~~
grader.c:26:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   26 |  res = fscanf(f, "%d", &C);
      |  ^~~
grader.c:27:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   27 |     while(res != 1);
      |     ^~~~~
grader.c:28:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   28 |  res = fscanf(f, "%d", &N);
      |  ^~~
game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:20:35: error: 'gcd' was not declared in this scope
   20 |             if(grid[i][j]!=0) GCD=gcd(GCD,grid[i][j]);
      |                                   ^~~