(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 #382248

#TimeUsernameProblemLanguageResultExecution timeMemory
382248VimmerVepar (COCI21_vepar)C++14
70 / 70
683 ms14584 KiB
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //#pragma GCC optimize("-O3") //#pragma GCC optimize("unroll-loops") //#pragma GCC optimize("Ofast") #define N 200501 #define NN 10000010 #define PB push_back #define M ll(1e9 + 7) #define all(x) x.begin(), x.end() #define sz(x) int(x.size()) #define _ << " " << #define pri(x) cout << x << endl #define endl '\n' #define F first #define S second //using namespace __gnu_pbds; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef short int si; typedef long double ld; //typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; bool mk[NN]; vector <int> pr; int skok(int l, int r, ll x) { vector <int> vr; vr.clear(); vr.PB(x); while (1ll * vr.back() * x <= 1ll * r) vr.PB(vr.back() * x); int val[sz(vr)], ans = 0; for (int i = sz(vr) - 1; i >= 0; i--) { int kol = (r / vr[i]); kol -= ((l - 1) / vr[i]); for (int j = i + 1; j < sz(vr); j++) kol -= val[j]; val[i] = kol; ans += kol * (i + 1); } return ans; } int main() { ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("1.in", "r", stdin); for (int i = 2; i < NN; i++) { if (mk[i]) continue; pr.PB(i); for (ll j = 1ll * i * i; j < NN; j += i) mk[j] = 1; } int q; cin >> q; for (; q > 0; q--) { int a, b, c, d; cin >> a >> b >> c >> d; bool gd = 1; for (auto it : pr) { int l = skok(a, b, it); int r = skok(c, d, it); if (l > r) { gd = 0; break; } } if (gd) { pri("DA"); } else { pri("NE"); } } }
#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...