답안 #363591

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
363591 2021-02-06T16:33:28 Z keta_tsimakuridze Lightning Rod (NOI18_lightningrod) C++14
66 / 100
2000 ms 53612 KB
#include<bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int N=1e7+5,mod=1e9+7;
int t,x[N],y[N],n;
stack<int> s; 
 main(){
	t=1;
//	cin >> t;
	while(t--){
		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>x[i]>>y[i];
			while(s.size() && x[s.top()]-y[s.top()]>=x[i]-y[i]) s.pop();
			if(!s.size() || x[s.top()]+y[s.top()]<x[i]+y[i]) s.push(i);
		}
		cout<<s.size();
	}
}

Compilation message

lightningrod.cpp:8:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 |  main(){
      |       ^
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2072 ms 53612 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 2 ms 364 KB Output is correct
12 Correct 3 ms 364 KB Output is correct
13 Correct 2 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 2 ms 364 KB Output is correct
12 Correct 3 ms 364 KB Output is correct
13 Correct 2 ms 364 KB Output is correct
14 Correct 160 ms 5484 KB Output is correct
15 Correct 152 ms 5356 KB Output is correct
16 Correct 135 ms 4844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2074 ms 50284 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2072 ms 53612 KB Time limit exceeded
2 Halted 0 ms 0 KB -