제출 #717542

#제출 시각아이디문제언어결과실행 시간메모리
717542vjudge1Bitaro the Brave (JOI19_ho_t1)C++11
0 / 100
0 ms212 KiB
#include <bits/stdc++.h> using namespace std; int findingnemo(int x,int y){ int ans=0; for(int a=1;a<=x;a++){ for(int b=1;b<=y;b++){ ans++; } } //cout << x << y << ans << endl; return ans; } int main(){ int h,w,jx,jy,counto=0,counti=0,ans; cin >> h >> w; char grid[h][w]; for(int x=0;x<h;x++){ for(int y=0;y<w;y++){ cin >> grid[x][y]; } } for(int x=0;x<h;x++){ for(int y=0;y<w;y++){ counto=0; counti=0; if(grid[x][y]=='J'){ //cout << x << y << endl; for(int j=0;j<w;j++){ if(grid[x][j]=='O'){ //cout << x << j << endl; if(y<j) counto++; } } for(int i=0;i<h;i++){ if(grid[i][y]=='I'){ //cout << i << y << endl; if(x<i) counti++; } } if((counto>=1)&&(counti>=1)) ans = ans + findingnemo(counto,counti); } } } cout << ans; }

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

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:14:10: warning: unused variable 'jx' [-Wunused-variable]
   14 |  int h,w,jx,jy,counto=0,counti=0,ans;
      |          ^~
joi2019_ho_t1.cpp:14:13: warning: unused variable 'jy' [-Wunused-variable]
   14 |  int h,w,jx,jy,counto=0,counti=0,ans;
      |             ^~
joi2019_ho_t1.cpp:44:10: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   44 |  cout << ans;
      |          ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...