답안 #29886

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
29886 2017-07-21T10:07:49 Z ozaslan 게임 (IOI13_game) C++14
0 / 100
0 ms 1844 KB
#include <bits/stdc++.h>
#include <stdio.h>
#include "game.h"
#define max_N 10000

long long gcd2(long long X, long long Y) {
	//printf("X\n");
    long long tmp;
    while (X != Y && Y != 0) {
        tmp = X;
        X = Y;
        Y = tmp % Y;
    }
    return X;
}

long long mat[max_N][max_N];
int sa, su;

void init(int R, int C) {
	sa = R;
	su = 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) {
    /* ... */
    long long ekok;// = mat[P][Q];

    for(int i = P; i <= U; i++) {
    	for(int j = Q; j <= V; j++)
    		ekok = gcd2(ekok, mat[i][j]);
    }

    return ekok;
}

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:38:12: warning: 'ekok' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return ekok;
            ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1844 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1844 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1844 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1844 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1844 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -