Submission #913502

# Submission time Handle Problem Language Result Execution time Memory
913502 2024-01-20T08:10:03 Z ashkan_ahmadi_koni Bitaro the Brave (JOI19_ho_t1) C++17
20 / 100
1000 ms 2696 KB
/*               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

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 time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 3 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 3 ms 2652 KB Output is correct
8 Correct 3 ms 2652 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 4 ms 2696 KB Output is correct
11 Correct 3 ms 2652 KB Output is correct
12 Correct 1 ms 2652 KB Output is correct
13 Correct 4 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 3 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 3 ms 2652 KB Output is correct
8 Correct 3 ms 2652 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 4 ms 2696 KB Output is correct
11 Correct 3 ms 2652 KB Output is correct
12 Correct 1 ms 2652 KB Output is correct
13 Correct 4 ms 2652 KB Output is correct
14 Correct 334 ms 2672 KB Output is correct
15 Correct 3 ms 2652 KB Output is correct
16 Correct 116 ms 2672 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 559 ms 2672 KB Output is correct
19 Correct 70 ms 2668 KB Output is correct
20 Execution timed out 1098 ms 2652 KB Time limit exceeded
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 3 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 3 ms 2652 KB Output is correct
8 Correct 3 ms 2652 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 4 ms 2696 KB Output is correct
11 Correct 3 ms 2652 KB Output is correct
12 Correct 1 ms 2652 KB Output is correct
13 Correct 4 ms 2652 KB Output is correct
14 Correct 334 ms 2672 KB Output is correct
15 Correct 3 ms 2652 KB Output is correct
16 Correct 116 ms 2672 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 559 ms 2672 KB Output is correct
19 Correct 70 ms 2668 KB Output is correct
20 Execution timed out 1098 ms 2652 KB Time limit exceeded
21 Halted 0 ms 0 KB -