| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1343928 | coderg300711 | Bitaro the Brave (JOI19_ho_t1) | C++20 | 60 ms | 10084 KiB |
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pii pair<int,int>
#define yes cout<<"Yes\n"
#define no cout<<"No\n"
#define pb push_back
#define sz(x) (int)(x).size()
#define rsz resize
#define ass assign
void setIO(string name = ""){if(name.size()){ freopen((name + ".in").c_str(), "r", stdin);freopen((name + ".out").c_str(), "w", stdout);}}
#define F(i,l,r) for(int i=(l);i<(r);++i)
typedef long long ll;
//template<typename T> using pqg = priority_queue<T, vector<T>, greater<T>>;
#define each(a,x) for(auto a:x)
#define FOR(i,a) for(int i=0;i<(a);i++)
#define ROF(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define eb emplace_back
#define ft front()
#define V vector
const int maxn=100005;
const int mod=1e9+7;
const int mox=10000005;
const int inf=1e9;
void solve(){
int h,w;
cin>>h>>w;
V<string> g(h);
FOR(i,h)cin>>g[i];
ll res=0;
V<int> cntI(w,0);
ROF(i,0,h){
int cntO=0;
ROF(j,0,w){
if(g[i][j]=='O')cntO++;
else if(g[i][j]=='I')cntI[j]++;
else if(g[i][j]=='J')res+=1LL*cntO*cntI[j];
}
}
cout<<res<<'\n';
}
signed main(){
ios_base::sync_with_stdio(0);cin.tie(nullptr);
// #ifndef ONLINE_JUDGE
// freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
//#endif
// setIO("");
int tt=1;
//cin>>tt;
while(tt--)solve();
return 0;
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
