Submission #131265

# Submission time Handle Problem Language Result Execution time Memory
131265 2019-07-16T21:51:09 Z FedericoS Lightning Rod (NOI18_lightningrod) C++14
0 / 100
2000 ms 83448 KB
#include <iostream>
#include <algorithm>
using namespace std;

int N;
int X[10000007];
int Y[10000007];
bool B[10000007];
int ans,a;

bool comp(int a, int b){
	return Y[a]>Y[b];
}

int main(){
	scanf("%d", &N);
	for(int i=0;i<N;i++)
		scanf("%d %d", &X[i], &Y[i]);

	return 0;

	a=-2e9-5;	
	for(int i=0;i<N;i++){
		if(a<X[i]+Y[i])
			a=X[i]+Y[i];
		else
			B[i]=true;
	}

	a=-2e9-5;
	for(int i=N-1;i>=0;i--){
		if(a<-X[i]+Y[i])
			a=-X[i]+Y[i];
		else
			B[i]=true;
	}

	for(int i=0;i<N;i++)
		ans+=!B[i];

	printf("%d\n", ans);


}

Compilation message

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
  ~~~~~^~~~~~~~~~
lightningrod.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &X[i], &Y[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 2064 ms 83448 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1969 ms 80280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2064 ms 83448 KB Time limit exceeded
2 Halted 0 ms 0 KB -