제출 #100052

#제출 시각아이디문제언어결과실행 시간메모리
100052kitoha보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include "treasure.h" #include<vector> using namespace std; typedef pair<int,int> pi; vector<pi> ans; void solve(int r1,int c1,int r2,int c2){ int cnt=countTreasure(r1,c1,r2,c2); if(cnt==0) return ; int sum=((r2-r1)+1)*((c2-c1)+1); printf("%d %d %d %d\n",r1,c1,r2,c2); if(cnt<sum){ int mid1=(r1+r2)/2-1; int mid2=(c1+c2)/2-1; solve(r1,c1,r1,c1+mid2); solve(r1,c1+mid2+1,r1,c2); solve(r1+mid1+1,c1,r2,c1); solve(r1+mid1+1,c1+mid2+1,r2,c2); } else{ for(int i=r1;i<=r2;i++){ for(int j=c1;j<=c2;j++){ ans.push_back({i,j}); } } } return ; } void findTreasure (int N) { solve(1,1,N,N); for(auto next:ans){ Report(next.first,next.second); } }

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

treasure.cpp: In function 'void solve(int, int, int, int)':
treasure.cpp:14:2: error: 'printf' was not declared in this scope
  printf("%d %d %d %d\n",r1,c1,r2,c2);
  ^~~~~~
treasure.cpp:14:2: note: suggested alternative: 'int'
  printf("%d %d %d %d\n",r1,c1,r2,c2);
  ^~~~~~
  int