제출 #65537

#제출 시각아이디문제언어결과실행 시간메모리
65537IvanC보물 찾기 (CEOI13_treasure2)C++17
72 / 100
3 ms620 KiB
#include "treasure.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 110; static int matriz[MAXN][MAXN]; void solve(int x,int left,int right,int cnt){ if(cnt == 0) return; if(right - left + 1 == cnt){ for(int i = left;i<=right;i++){ matriz[x][i] = 1; } return; } int mid = (left+right)/2; int qt = countTreasure(x,left,x,mid); solve(x,left,mid,qt); solve(x,mid+1,right,cnt - qt); } void findTreasure(int N){ memset(matriz,0,sizeof(matriz)); int cnt = countTreasure(1, 1, N, N); int last = 0; for(int i = 1;i<=N;i++){ int novo = countTreasure(1,1,i,N); solve(i,1,N,novo - last); last = novo; } for(int i = 1;i<=N;i++){ for(int j = 1;j<=N;j++){ if(matriz[i][j]) Report(i,j); } } }

컴파일 시 표준 에러 (stderr) 메시지

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:30:9: warning: unused variable 'cnt' [-Wunused-variable]
     int cnt = countTreasure(1, 1, N, N);
         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...