Submission #924114

# Submission time Handle Problem Language Result Execution time Memory
924114 2024-02-08T13:20:10 Z pcc Lightning Rod (NOI18_lightningrod) C++14
80 / 100
2000 ms 247800 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>


const int mxn = 1e7+10;
pii arr[mxn];
int N;

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>N;
	for(int i = 0;i<N;i++){
		cin>>arr[i].fs>>arr[i].sc;
		arr[i] = make_pair(arr[i].fs-arr[i].sc,arr[i].fs+arr[i].sc);
	}
	sort(arr,arr+N,[](pii &a,pii &b){return a.fs == b.fs?a.sc>b.sc:a.fs<b.fs;});
	int ans = 0,big = INT_MIN;
	for(int i = 0;i<N;i++){
		//cout<<arr[i].fs<<','<<arr[i].sc<<' ';
		ans += (big<arr[i].sc);
		big = max(big,arr[i].sc);
	}
	cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1346 ms 189080 KB Output is correct
2 Correct 1356 ms 188856 KB Output is correct
3 Correct 1265 ms 184016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 600 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 600 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 600 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 41 ms 6224 KB Output is correct
15 Correct 37 ms 6020 KB Output is correct
16 Correct 29 ms 5240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1392 ms 174672 KB Output is correct
2 Correct 1319 ms 174248 KB Output is correct
3 Correct 1306 ms 170340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1346 ms 189080 KB Output is correct
2 Correct 1356 ms 188856 KB Output is correct
3 Correct 1265 ms 184016 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 600 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 41 ms 6224 KB Output is correct
18 Correct 37 ms 6020 KB Output is correct
19 Correct 29 ms 5240 KB Output is correct
20 Correct 1392 ms 174672 KB Output is correct
21 Correct 1319 ms 174248 KB Output is correct
22 Correct 1306 ms 170340 KB Output is correct
23 Execution timed out 2019 ms 247800 KB Time limit exceeded
24 Halted 0 ms 0 KB -