(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.

제출 #808598

#제출 시각아이디문제언어결과실행 시간메모리
808598tlnk07Vepar (COCI21_vepar)C++17
70 / 70
204 ms18704 KiB
#include<bits/stdc++.h> using namespace std; #define int long long long long t, a, b, c, d, s, s1; bool chk[10000001]; vector<int> prime; int calc(int u,int v) { int k = 0; while (u) { k += u/v; u /= v; } return k; } signed main() { ios::sync_with_stdio (false); cin.tie (0); cout.tie (0); for(int i = 2; i <= 10000000; ++i) { if(!chk[i]) { prime.push_back(i); for(int j = i * 2; j <= 10000000; j += i) chk[j] = 1; } } cin >> t; while(t--) { cin >> a >> b >> c >> d; bool check = 0; for (int u : prime) { if (calc(b, u) - calc(a - 1, u) > calc(d, u) - calc(c - 1, u)) { check = true; break; } } if(!check) cout << "DA\n"; else cout << "NE\n"; } }
#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...