제출 #1261357

#제출 시각아이디문제언어결과실행 시간메모리
1261357sasdeBitaro the Brave (JOI19_ho_t1)C++20
0 / 100
1 ms324 KiB
#include<bits/stdc++.h>
using namespace std;
const int N=3e3+5,lg=30,mod=1e9+7;
int hieght,width;
bitset<N>s[N],s1[N];
char a[N][N];

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> hieght >> width;
    for(int i=1;i<=hieght;++i){
        for(int j=1;j<=width;++j){
            cin >> a[i][j];
        }
    }
    long long ans=0;
    for(int k=1;k<=hieght;++k){
        long long val=0;
        for(int l=1;l<=width;++l){
                        ans+=val;
                    if(a[k][l]=='I'){
                        bitset<N>x=s[l]&s1[l];
                        val+=x.count();
                    }
        }
        for(int l=1;l<=width;++l){
            if(a[k][l]=='O')s1[l][k]=1;
            if(a[k][l]=='J')s[l][k]=1;
        }
    }
    cout << ans;

}

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

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