Submission #362722

#TimeUsernameProblemLanguageResultExecution timeMemory
362722nighthalloTreasure (different grader from official contest) (CEOI13_treasure2)C++14
Compilation error
0 ms0 KiB
#include "treasure.h" //4분할을 하는 건 맞음 -> 1개짜리로 4개 보는것보다, 4개 한번, 2개 2번으로 해결 가능 //d = (a + b + c + d) - (a + b) - (a + c) + a void findTreasure (int N) { int arr[101][101]; int mid = (int)(N/2) for(int i = 1 ; i <= N ; i++){ for(int j = 1 ; j <= N ; j++){ arr[i][j] = countTreasure(1, 1, i, j); } } for(int i = 1 ; i <= N ; i++){ for(int j = 1 ; j <= N ; j++){ if (arr[i][j] - arr[i-1][j] - arr[i][j-1] + arr[i-1][j-1]){ Report(i, j); } } } }

Compilation message (stderr)

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:11:5: error: expected ',' or ';' before 'for'
   11 |     for(int i = 1 ; i <= N ; i++){
      |     ^~~
treasure.cpp:11:21: error: 'i' was not declared in this scope
   11 |     for(int i = 1 ; i <= N ; i++){
      |                     ^
treasure.cpp:9:9: warning: unused variable 'mid' [-Wunused-variable]
    9 |     int mid = (int)(N/2)
      |         ^~~