답안 #489783

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
489783 2021-11-24T15:46:47 Z marcoskal Gap (APIO16_gap) C++14
0 / 100
2000 ms 524292 KB
#include "gap.h"
#include <bits/stdc++.h>

long long findGap(int T, int N)
{
  	long long first, last, first1, last1;
  	MinMax(0, 1000000000000000001ll, &first, &last);
  	long long step=(last-first)/(N-1);
  	std::vector<long long> v;
  	v.push_back(first);
  	long long ans=step, cntr=0;
  	for(int i=first;i<=last+1;i+=step)
    {
        //cout<<i+1<<" "<<i+step<<" "<<endl;
    	MinMax(i+1, i+step, &first1, &last1);
      	if(first1!=-1){
      		v.push_back(first1);
          	cntr++;
      	}
      	if(last1!=-1&&last1!=first1){
      		v.push_back(last1);
          	cntr++;
      	}
          	ans=std::max(ans, v[cntr]-v[cntr-1]);
    }
    //for(int i=0;i<v.size();i++)
        //cout<<v[i]<<" ";
    //cout<<endl;
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 707 ms 524292 KB Execution killed with signal 9
2 Runtime error 1305 ms 524292 KB Execution killed with signal 9
3 Runtime error 1258 ms 524292 KB Execution killed with signal 9
4 Runtime error 902 ms 524292 KB Execution killed with signal 9
5 Incorrect 0 ms 200 KB Output isn't correct
6 Runtime error 1677 ms 524292 KB Execution killed with signal 9
7 Runtime error 1613 ms 524292 KB Execution killed with signal 9
8 Runtime error 1016 ms 524292 KB Execution killed with signal 9
9 Execution timed out 3075 ms 200 KB Time limit exceeded
10 Incorrect 0 ms 200 KB Output isn't correct
11 Execution timed out 2997 ms 524292 KB Time limit exceeded
12 Runtime error 1574 ms 524292 KB Execution killed with signal 9
13 Runtime error 1576 ms 524292 KB Execution killed with signal 9
14 Execution timed out 2971 ms 524292 KB Time limit exceeded
15 Execution timed out 3065 ms 131876 KB Time limit exceeded
16 Execution timed out 2196 ms 524292 KB Time limit exceeded
17 Execution timed out 3071 ms 456 KB Time limit exceeded
18 Execution timed out 3078 ms 263288 KB Time limit exceeded
19 Execution timed out 3086 ms 263280 KB Time limit exceeded
20 Incorrect 6 ms 456 KB Output isn't correct
21 Execution timed out 3065 ms 263828 KB Time limit exceeded
22 Execution timed out 3066 ms 1052 KB Time limit exceeded
23 Execution timed out 3081 ms 263832 KB Time limit exceeded
24 Execution timed out 3073 ms 1056 KB Time limit exceeded
25 Execution timed out 3082 ms 66876 KB Time limit exceeded
26 Execution timed out 3067 ms 960 KB Time limit exceeded
27 Execution timed out 3069 ms 948 KB Time limit exceeded
28 Execution timed out 3081 ms 263828 KB Time limit exceeded
29 Execution timed out 3065 ms 960 KB Time limit exceeded
30 Incorrect 28 ms 1440 KB Output isn't correct
31 Runtime error 1329 ms 524292 KB Execution killed with signal 9
32 Execution timed out 3106 ms 263088 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Runtime error 885 ms 524292 KB Execution killed with signal 9
2 Execution timed out 3091 ms 200 KB Time limit exceeded
3 Execution timed out 3087 ms 200 KB Time limit exceeded
4 Runtime error 1259 ms 524292 KB Execution killed with signal 9
5 Correct 0 ms 200 KB Output is correct
6 Runtime error 1633 ms 524292 KB Execution killed with signal 9
7 Runtime error 1081 ms 524292 KB Execution killed with signal 9
8 Execution timed out 3080 ms 200 KB Time limit exceeded
9 Runtime error 1652 ms 524292 KB Execution killed with signal 9
10 Incorrect 0 ms 200 KB Output isn't correct
11 Execution timed out 3081 ms 200 KB Time limit exceeded
12 Execution timed out 2912 ms 524292 KB Time limit exceeded
13 Execution timed out 2918 ms 524292 KB Time limit exceeded
14 Runtime error 1657 ms 524292 KB Execution killed with signal 9
15 Execution timed out 3084 ms 131756 KB Time limit exceeded
16 Execution timed out 3075 ms 456 KB Time limit exceeded
17 Execution timed out 3067 ms 456 KB Time limit exceeded
18 Execution timed out 3062 ms 456 KB Time limit exceeded
19 Execution timed out 3067 ms 456 KB Time limit exceeded
20 Incorrect 7 ms 456 KB Output isn't correct
21 Execution timed out 2708 ms 524292 KB Time limit exceeded
22 Execution timed out 3036 ms 1060 KB Time limit exceeded
23 Execution timed out 3042 ms 1048 KB Time limit exceeded
24 Execution timed out 2804 ms 524292 KB Time limit exceeded
25 Execution timed out 3053 ms 66848 KB Time limit exceeded
26 Execution timed out 3056 ms 263848 KB Time limit exceeded
27 Execution timed out 3061 ms 263888 KB Time limit exceeded
28 Execution timed out 3063 ms 263792 KB Time limit exceeded
29 Execution timed out 3014 ms 968 KB Time limit exceeded
30 Incorrect 29 ms 1472 KB Output isn't correct
31 Runtime error 1308 ms 524292 KB Execution killed with signal 9
32 Execution timed out 3096 ms 263188 KB Time limit exceeded