제출 #1343928

#제출 시각아이디문제언어결과실행 시간메모리
1343928coderg300711Bitaro the Brave (JOI19_ho_t1)C++20
100 / 100
60 ms10084 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) 메시지

joi2019_ho_t1.cpp: In function 'void setIO(std::string)':
joi2019_ho_t1.cpp:13:54: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 | void setIO(string name = ""){if(name.size()){ freopen((name + ".in").c_str(), "r", stdin);freopen((name + ".out").c_str(), "w", stdout);}}
      |                                               ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:13:98: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 | void setIO(string name = ""){if(name.size()){ freopen((name + ".in").c_str(), "r", stdin);freopen((name + ".out").c_str(), "w", stdout);}}
      |                                                                                           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...