Submission #913502

#TimeUsernameProblemLanguageResultExecution timeMemory
913502ashkan_ahmadi_koniBitaro the Brave (JOI19_ho_t1)C++17
20 / 100
1098 ms2696 KiB
/*               In The Name Of God               */
#include                              <bits/stdc++.h>
using                                  namespace std;
#define int                                 long long
#define sw                            sync_with_stdio
#pragma GCC       optimize("Ofast, unroll-loops, O3")
#define fast       ios::sw(0),cin.tie(0),cout.tie(0);
const int   N = 3e3 + 3, M = 1e9 + 7, inf = 1e18 + 8; 

int h, w, ans;
char a[N][N];

signed main() {
    fast; cin >> h >> w;
    
     for (int i = 1; i <= h; ++i)
    	for (int j = 1; j <= w; ++j) 
    		cin >> a[i][j];
    
    for (int i = 1; i <= h; ++i)
    	for (int j = 1; j <= w; ++j) 
    		if (a[i][j] == 'J') 
    			for (int k = i + 1; k <= h; ++k)
    				if (a[k][j] == 'I') 
    					for (int l = j + 1; l <= w; ++l)
    						if (a[i][l] == 'O') ans++;
    		
    					
    cout << ans << '\n';
    
}

/* 

    .---.    .    .--.         
    |        |    |   ) o      
    |--- .--.|--. |--:  .  ---.
    |    `--.|  | |   ) |   .' 
    '---'`--''  `-'--'-' `-'--- 

*/

Compilation message (stderr)

joi2019_ho_t1.cpp:6:53: warning: bad option '-f unroll-loops' to pragma 'optimize' [-Wpragmas]
    6 | #pragma GCC       optimize("Ofast, unroll-loops, O3")
      |                                                     ^
joi2019_ho_t1.cpp:6:53: warning: bad option '-f O3' to pragma 'optimize' [-Wpragmas]
joi2019_ho_t1.cpp:13:13: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
   13 | signed main() {
      |             ^
joi2019_ho_t1.cpp:13:13: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...