답안 #47270

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
47270 2018-04-30T05:36:23 Z yogahmad Gap (APIO16_gap) C++14
0 / 100
47 ms 39248 KB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;


long long findGap(int T, int N)
{
	vector<long long>ve;
	long long* kiri,*kanan;
	MinMax(0,1e18,kiri,kanan);
	long long gap=(*kanan-*kiri)/N;
	long long jaw=0;
	for(long long awal=*kiri;awal<=*kanan;awal+=gap+1){
		long long *lo,*hi;
		MinMax(awal,awal+gap,lo,hi);
		if(*lo==-1 && *hi==-1)
			continue;
		ve.push_back(*lo);
		ve.push_back(*hi);
	}
	sort(ve.begin(),ve.end());
	for(int i=1;i<ve.size();i++){
		jaw=max(jaw,ve[i]-ve[i-1]);
	}
	return jaw;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:22:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<ve.size();i++){
              ~^~~~~~~~~~
gap.cpp:10:8: warning: 'kiri' is used uninitialized in this function [-Wuninitialized]
  MinMax(0,1e18,kiri,kanan);
  ~~~~~~^~~~~~~~~~~~~~~~~~~
gap.cpp:10:8: warning: 'kanan' is used uninitialized in this function [-Wuninitialized]
gap.cpp:15:9: warning: 'lo' may be used uninitialized in this function [-Wmaybe-uninitialized]
   MinMax(awal,awal+gap,lo,hi);
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~
gap.cpp:15:9: warning: 'hi' may be used uninitialized in this function [-Wmaybe-uninitialized]
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 248 KB Execution failed because the return code was nonzero
2 Runtime error 2 ms 360 KB Execution failed because the return code was nonzero
3 Runtime error 2 ms 440 KB Execution failed because the return code was nonzero
4 Runtime error 2 ms 460 KB Execution failed because the return code was nonzero
5 Runtime error 2 ms 644 KB Execution failed because the return code was nonzero
6 Runtime error 2 ms 644 KB Execution failed because the return code was nonzero
7 Runtime error 2 ms 644 KB Execution failed because the return code was nonzero
8 Runtime error 2 ms 644 KB Execution failed because the return code was nonzero
9 Runtime error 2 ms 644 KB Execution failed because the return code was nonzero
10 Runtime error 2 ms 692 KB Execution failed because the return code was nonzero
11 Runtime error 2 ms 692 KB Execution failed because the return code was nonzero
12 Runtime error 3 ms 724 KB Execution failed because the return code was nonzero
13 Runtime error 3 ms 788 KB Execution failed because the return code was nonzero
14 Runtime error 3 ms 788 KB Execution failed because the return code was nonzero
15 Runtime error 3 ms 848 KB Execution failed because the return code was nonzero
16 Runtime error 10 ms 1592 KB Execution failed because the return code was nonzero
17 Runtime error 9 ms 1964 KB Execution failed because the return code was nonzero
18 Runtime error 15 ms 2488 KB Execution failed because the return code was nonzero
19 Runtime error 15 ms 2952 KB Execution failed because the return code was nonzero
20 Runtime error 5 ms 3048 KB Execution failed because the return code was nonzero
21 Runtime error 30 ms 5528 KB Execution failed because the return code was nonzero
22 Runtime error 29 ms 7352 KB Execution failed because the return code was nonzero
23 Runtime error 30 ms 9156 KB Execution failed because the return code was nonzero
24 Runtime error 35 ms 11044 KB Execution failed because the return code was nonzero
25 Runtime error 24 ms 12300 KB Execution failed because the return code was nonzero
26 Runtime error 29 ms 14100 KB Execution failed because the return code was nonzero
27 Runtime error 29 ms 15944 KB Execution failed because the return code was nonzero
28 Runtime error 29 ms 17804 KB Execution failed because the return code was nonzero
29 Runtime error 38 ms 19792 KB Execution failed because the return code was nonzero
30 Runtime error 16 ms 20340 KB Execution failed because the return code was nonzero
31 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
32 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
2 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
3 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
4 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
5 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
6 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
7 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
8 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
9 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
10 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
11 Runtime error 3 ms 20340 KB Execution failed because the return code was nonzero
12 Runtime error 3 ms 20340 KB Execution failed because the return code was nonzero
13 Runtime error 3 ms 20340 KB Execution failed because the return code was nonzero
14 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
15 Runtime error 2 ms 20340 KB Execution failed because the return code was nonzero
16 Runtime error 9 ms 20452 KB Execution failed because the return code was nonzero
17 Runtime error 13 ms 20916 KB Execution failed because the return code was nonzero
18 Runtime error 9 ms 21352 KB Execution failed because the return code was nonzero
19 Runtime error 10 ms 21780 KB Execution failed because the return code was nonzero
20 Runtime error 5 ms 21952 KB Execution failed because the return code was nonzero
21 Runtime error 29 ms 24384 KB Execution failed because the return code was nonzero
22 Runtime error 30 ms 26356 KB Execution failed because the return code was nonzero
23 Runtime error 31 ms 28088 KB Execution failed because the return code was nonzero
24 Runtime error 30 ms 29880 KB Execution failed because the return code was nonzero
25 Runtime error 22 ms 31136 KB Execution failed because the return code was nonzero
26 Runtime error 30 ms 32992 KB Execution failed because the return code was nonzero
27 Runtime error 29 ms 34828 KB Execution failed because the return code was nonzero
28 Runtime error 47 ms 36724 KB Execution failed because the return code was nonzero
29 Runtime error 30 ms 38596 KB Execution failed because the return code was nonzero
30 Runtime error 15 ms 39248 KB Execution failed because the return code was nonzero
31 Runtime error 2 ms 39248 KB Execution failed because the return code was nonzero
32 Runtime error 2 ms 39248 KB Execution failed because the return code was nonzero