Submission #921608

# Submission time Handle Problem Language Result Execution time Memory
921608 2024-02-04T08:01:49 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
7 / 100
2000 ms 33736 KB
#include <bits/stdc++.h>
#define F first 
#define S second
#define ent '\n'
#define int long long
#define pb push_back

typedef long double ld;
typedef long long ll;
using namespace std;

const int maxn = 1e6+12;
const int T = 0;
const int mod = 1e9+7;

int n,m,k,x,y,l,r;
int a[maxn],b[maxn],p[maxn],pref[maxn],fact[maxn];

void solve(){
	cin>>n;
	int cnt=0;
	for(int i=1;i<=n;i++){
		cin>>a[i]>>b[i];
		cnt+=(b[i]==1);
	}
	if(cnt==n){
		cout<<n;
		return;
	}
//	abs(x[i] - x[j]) <= abs(y[i] - y[j]);
	int ans=0;
	map<int,int>mp; 
	for(int i=1;i<=n;i++){
		if(!mp[i]){
			ans++;
			for(int j=i+1;j<=n;j++){
				if(abs(a[i] - a[j]) <= abs(b[i] - b[j]))mp[j]=1;
			}
		}
	}
	cout<<ans;
}	
//BEKSULTAN TOP
signed main(){	
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	if(T)cin>>t;
	while(t--)solve();
} 
# Verdict Execution time Memory Grader output
1 Runtime error 131 ms 33736 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4444 KB Output is correct
2 Correct 1 ms 4444 KB Output is correct
3 Correct 1 ms 4444 KB Output is correct
4 Correct 1 ms 4444 KB Output is correct
5 Correct 1 ms 4444 KB Output is correct
6 Correct 1 ms 4444 KB Output is correct
7 Correct 1 ms 4444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4444 KB Output is correct
2 Correct 1 ms 4444 KB Output is correct
3 Correct 1 ms 4444 KB Output is correct
4 Correct 1 ms 4444 KB Output is correct
5 Correct 1 ms 4444 KB Output is correct
6 Correct 1 ms 4444 KB Output is correct
7 Correct 1 ms 4444 KB Output is correct
8 Incorrect 1 ms 4440 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4444 KB Output is correct
2 Correct 1 ms 4444 KB Output is correct
3 Correct 1 ms 4444 KB Output is correct
4 Correct 1 ms 4444 KB Output is correct
5 Correct 1 ms 4444 KB Output is correct
6 Correct 1 ms 4444 KB Output is correct
7 Correct 1 ms 4444 KB Output is correct
8 Incorrect 1 ms 4440 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4444 KB Output is correct
2 Correct 1 ms 4444 KB Output is correct
3 Correct 1 ms 4444 KB Output is correct
4 Correct 1 ms 4444 KB Output is correct
5 Correct 1 ms 4444 KB Output is correct
6 Correct 1 ms 4444 KB Output is correct
7 Correct 1 ms 4444 KB Output is correct
8 Incorrect 1 ms 4440 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2051 ms 16980 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 131 ms 33736 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -