Submission #411785

# Submission time Handle Problem Language Result Execution time Memory
411785 2021-05-26T00:17:59 Z kimbj0709 Bitaro the Brave (JOI19_ho_t1) C++14
0 / 100
1 ms 332 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f first
#define s second
#define maxn 3050
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);cout.tie(0);
  int n,m;
  cin >> n >> m;
  vector<int> cnt1(maxn,0);
  vector<int> cnt2(maxn,0);
  char input;
  vector<pair<int,int> > pos;
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cin >> input;
      if(input=='I'){
        cnt2[j]++;
      }
      else if(input=='J'){
        pos.push_back({i,j});
      }
      else if(input=='O'){
        cnt1[i]++;
      }
    }
  }
  int ans = 0;
  for(int i=0;i<pos.size();i++){
    ans += cnt1[pos[i].f]*cnt2[pos[i].s];
  }
  cout << ans;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int32_t main()':
joi2019_ho_t1.cpp:31:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |   for(int i=0;i<pos.size();i++){
      |               ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 1 ms 304 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 1 ms 304 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 1 ms 304 KB Output isn't correct
5 Halted 0 ms 0 KB -