제출 #225482

#제출 시각아이디문제언어결과실행 시간메모리
225482NightlightBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
272 ms81016 KiB
#include <bits/stdc++.h> using namespace std; int H, W; bitset<3005> grid[3005]; int Osum[3005][3005], Isum[3005][3005]; char tp; long long ans; int main() { // freopen("inp", "r", stdin); scanf("%d %d", &H, &W); for(int i = 1; i <= H; i++) { getchar(); for(int j = 1; j <= W; j++) { tp = getchar(); if(tp == 'J') grid[i][j] = 1; else if(tp == 'O') Osum[i][j] = 1; else Isum[i][j] = 1; Osum[i][j] += Osum[i][j - 1]; Isum[i][j] += Isum[i - 1][j]; } } for(int i = 1; i <= H; i++) { for(int j = 1; j <= W; j++) { if(grid[i][j]) { ans += (Osum[i][W] - Osum[i][j]) * (Isum[H][j] - Isum[i][j]); } } } printf("%lld\n", ans); }

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

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &H, &W);
   ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...