Submission #471478

#TimeUsernameProblemLanguageResultExecution timeMemory
471478fuad27Bitaro the Brave (JOI19_ho_t1)C++17
100 / 100
292 ms20660 KiB
#include<bits/stdc++.h> using namespace std; #define int long long main () { int h, w; cin >> h >> w; string v[h]; for(int i = 0;i<h;i++)cin>>v[i]; int cnt[w] = {0}, ans = 0, k = 0; for(int i = h-1;i>=0;i--) { k = 0; for(int j = w-1;j>=0;j--) { if(v[i][j] == 'J')ans+=cnt[j]*k; else if(v[i][j] == 'O')k++; else cnt[j]++; } } cout<<ans<<endl; }

Compilation message (stderr)

joi2019_ho_t1.cpp:4:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 |  main () {
      |  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...