Submission #1282502

#TimeUsernameProblemLanguageResultExecution timeMemory
1282502lyra_g13Lightning Rod (NOI18_lightningrod)C++20
44 / 100
289 ms78244 KiB
#include <bits/stdc++.h> using ll = long long; using namespace std; inline int readInt() { int x = 0; char ch = getchar(); while (ch < '0' || ch > '9') ch = getchar_unlocked(); while (ch >= '0' && ch <= '9'){ x = (x << 3) + (x << 1) + ch - '0'; ch = getchar_unlocked(); } return x; } int x[10000000], y[10000000]; int main(){ int n = readInt(); for(int i = 0; i < n; i++) { x[i] = readInt(); y[i] = readInt(); } if(n<= 2000 and n>=2){ ll c = 0; for(int i = 0 ; i < n ; i++){ ll found = false; ll j = 0; while ( j < n and found == false){ if(i == j ){ j = j; } else if(std::abs(x[j] - x[i]) <= y[j] - y[i]){ found = true; } j++; } if(found != true){ c++; } } std::cout << c; } else{ std::cout << n; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...