제출 #876617

#제출 시각아이디문제언어결과실행 시간메모리
876617hasan2006Bitaro the Brave (JOI19_ho_t1)C++17
100 / 100
133 ms79988 KiB
#include <bits/stdc++.h>

using namespace std;

#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define se second
#define fi first
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"


const int N = 3e3 + 9 , mod = 1e9 + 7;
ll   a[N][N] = {}, b[N] , c[N][3] , d[N];

void solve()
{
    ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
    cin>>n>>m;
    d['J'] = 0;
    d['O'] = 1;
    d['I'] = 2;
    for(i = 1; i <= n; i++){
        for(j = 1; j <= m; j++){
            char ch;
            cin>>ch;
            a[i][j] = d[ch];
            c[i][1] += (a[i][j] == 1);
            c[j][2] += (a[i][j] == 2);
        }
    }
    for(i = 1; i <= n; i++){
        for(j = 1; j <= m; j++){
            c[j][2] -= (a[i][j] == 2);
            c[i][1] -= (a[i][j] == 1);
            if(a[i][j] == 0)
                s += c[i][1] * c[j][2];
        }
    }
    cout<<s<<"\n";
}

int main(){
    TL;

  /*
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
int t = 1;
//cin>>t;
while(t--)
     {
     solve();
     }
}
// Author : حسن

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

joi2019_ho_t1.cpp: In function 'void solve()':
joi2019_ho_t1.cpp:35:25: warning: array subscript has type 'char' [-Wchar-subscripts]
   35 |             a[i][j] = d[ch];
      |                         ^~
joi2019_ho_t1.cpp:26:8: warning: unused variable 'q' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |        ^
joi2019_ho_t1.cpp:26:26: warning: unused variable 'z' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                          ^
joi2019_ho_t1.cpp:26:37: warning: unused variable 'f' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                     ^
joi2019_ho_t1.cpp:26:40: warning: unused variable 'l' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                        ^
joi2019_ho_t1.cpp:26:44: warning: unused variable 'r' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                            ^
joi2019_ho_t1.cpp:26:48: warning: unused variable 'k' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                ^
joi2019_ho_t1.cpp:26:52: warning: unused variable 'x' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                    ^
joi2019_ho_t1.cpp:26:56: warning: unused variable 'y' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                        ^
joi2019_ho_t1.cpp:26:60: warning: unused variable 'mn' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                            ^~
joi2019_ho_t1.cpp:26:73: warning: unused variable 'mx' [-Wunused-variable]
   26 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                                         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...