답안 #523755

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
523755 2022-02-08T06:12:55 Z mansur Gap (APIO16_gap) C++17
30 / 100
44 ms 1188 KB
#include<bits/stdc++.h>	

#include "gap.h"
 
#pragma optimize ("g",on)
#pragma GCC optimize ("inline")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("03")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,avx2,mmx,fma,avx,tune=native")

//01001101 01100001 01101011 01101000 01100001  01100111 01100001 01111001 

using namespace std;

#define all(a) a.begin(), a.end()                                                   
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define pb push_back
#define sz(a) a.size()
#define nl '\n'
#define popb pop_back()                                                                   
#define ld double
#define ull unsigned long long
#define ff first                                         
#define ss second  
#define fix fixed << setprecision
#define pii pair<int, int>                          
#define E exit (0)

const ll inf = 1e18;

ll findGap(int t, int n) {
	ll li, lj, ans = 0;
	MinMax(0ll, inf, &li, &lj);
	int cnt = 2;
	while (cnt <= n) {
		if (cnt == n) {
			ans = max(ans, lj - li);
			break;
		}
		ll i, j;
		MinMax(li + 1, lj - 1, &i, &j);
		ans = max({ans, i - li, lj - j});
		li = i, lj = j;
		cnt += 2;
	}
	return ans;
}                                                              

Compilation message

gap.cpp:5: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    5 | #pragma optimize ("g",on)
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 0 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 0 ms 200 KB Output is correct
6 Correct 0 ms 200 KB Output is correct
7 Correct 0 ms 200 KB Output is correct
8 Correct 0 ms 200 KB Output is correct
9 Correct 0 ms 200 KB Output is correct
10 Correct 0 ms 200 KB Output is correct
11 Correct 1 ms 328 KB Output is correct
12 Correct 1 ms 328 KB Output is correct
13 Correct 1 ms 328 KB Output is correct
14 Correct 1 ms 328 KB Output is correct
15 Correct 1 ms 328 KB Output is correct
16 Correct 12 ms 456 KB Output is correct
17 Correct 9 ms 456 KB Output is correct
18 Correct 10 ms 416 KB Output is correct
19 Correct 9 ms 504 KB Output is correct
20 Correct 7 ms 508 KB Output is correct
21 Correct 36 ms 1072 KB Output is correct
22 Correct 44 ms 1036 KB Output is correct
23 Correct 38 ms 968 KB Output is correct
24 Correct 37 ms 960 KB Output is correct
25 Correct 33 ms 1048 KB Output is correct
26 Correct 41 ms 960 KB Output is correct
27 Correct 39 ms 960 KB Output is correct
28 Correct 44 ms 1188 KB Output is correct
29 Correct 38 ms 1052 KB Output is correct
30 Correct 31 ms 968 KB Output is correct
31 Correct 0 ms 200 KB Output is correct
32 Correct 0 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Output is correct
2 Partially correct 0 ms 200 KB Partially correct
3 Partially correct 0 ms 200 KB Partially correct
4 Partially correct 1 ms 200 KB Partially correct
5 Partially correct 0 ms 200 KB Partially correct
6 Partially correct 0 ms 200 KB Partially correct
7 Partially correct 0 ms 200 KB Partially correct
8 Partially correct 0 ms 200 KB Partially correct
9 Partially correct 0 ms 200 KB Partially correct
10 Partially correct 0 ms 200 KB Partially correct
11 Partially correct 1 ms 200 KB Partially correct
12 Partially correct 1 ms 328 KB Partially correct
13 Partially correct 1 ms 328 KB Partially correct
14 Partially correct 1 ms 328 KB Partially correct
15 Partially correct 1 ms 328 KB Partially correct
16 Partially correct 9 ms 456 KB Partially correct
17 Partially correct 11 ms 456 KB Partially correct
18 Partially correct 12 ms 456 KB Partially correct
19 Partially correct 9 ms 456 KB Partially correct
20 Partially correct 7 ms 508 KB Partially correct
21 Incorrect 39 ms 1080 KB Expected int32, but "2500100000" found
22 Incorrect 39 ms 1088 KB Expected int32, but "2500100000" found
23 Incorrect 43 ms 1072 KB Expected int32, but "2500100000" found
24 Incorrect 36 ms 1072 KB Expected int32, but "2500100000" found
25 Incorrect 35 ms 1056 KB Expected int32, but "2500100000" found
26 Incorrect 37 ms 960 KB Expected int32, but "2500100000" found
27 Incorrect 37 ms 1180 KB Expected int32, but "2500100000" found
28 Incorrect 37 ms 1052 KB Expected int32, but "2500100000" found
29 Incorrect 39 ms 1000 KB Expected int32, but "2500100000" found
30 Incorrect 31 ms 968 KB Expected int32, but "2500100000" found
31 Partially correct 0 ms 200 KB Partially correct
32 Partially correct 0 ms 200 KB Partially correct