(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #381899

#TimeUsernameProblemLanguageResultExecution timeMemory
381899topovikVepar (COCI21_vepar)C++14
70 / 70
199 ms43912 KiB
#include <bits/stdc++.h> #include <chrono> #define f first #define s second #define pb push_back using namespace std; typedef long long ll; typedef long double ld; const int N = 1e7 + 10; int l[N]; vector <int> pr; ll Time() { return chrono::system_clock().now().time_since_epoch().count(); } mt19937 rnd(Time()); int sum(int x, int y) { if (x < y) return 0; else return (x / y) + sum(x / y, y); } int main() { for (register int i = 2; i < N; i++) { if (l[i] == 0) { l[i] = i; pr.pb(i); } for (register int j = 0; pr[j] <= l[i] && pr[j] * i < N; j++) l[pr[j] * i] = pr[j]; } int t; cin >> t; while (t--) { int l, r, l1, r1; cin >> l >> r >> l1 >> r1; bool g = 1; for (int i = 0; i < pr.size(); i++) g = g && (sum(r1, pr[i]) - sum(l1 - 1, pr[i])) >= (sum(r, pr[i]) - sum(l - 1, pr[i])); cout << (g ? "DA" : "NE") << endl; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:48:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |         for (int i = 0; i < pr.size(); i++) g = g && (sum(r1, pr[i]) - sum(l1 - 1, pr[i])) >= (sum(r, pr[i]) - sum(l - 1, pr[i]));
      |                         ~~^~~~~~~~~~~
#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...