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

제출 #872977

#제출 시각아이디문제언어결과실행 시간메모리
872977aegVepar (COCI21_vepar)C++14
30 / 70
1563 ms852 KiB
#include <unordered_map> #include <iostream> using namespace std; #define F first #define S second unordered_map<int, int> ab, cd; inline void factorize(int i, bool b) { for(int j=2; j<=i; j++) { while(i%j==0) { if(b) ab[j]++; else cd[j]++; i/=j; } } } inline void solve() { int a,b,c,d; cin >> a >> b >> c >> d; for(int i=a; i<=b; i++) factorize(i, true); for(int i=c; i<=d; i++) factorize(i, false); for(auto x:ab) { if(cd[x.F]<x.S) { cout << "NE\n"; ab.clear(); cd.clear(); return; } } ab.clear(); cd.clear(); cout << "DA\n"; } int main() { cin.tie(NULL)->sync_with_stdio(false); int t; cin >> t; while(t--) solve(); }
#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...