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

#TimeUsernameProblemLanguageResultExecution timeMemory
475740CaroLindaVepar (COCI21_vepar)C++14
70 / 70
325 ms43852 KiB
#include <bits/stdc++.h> #define mkt make_tuple #define all(x) x.begin(),x.end() #define sz(x) (int)(x.size()) #define ll long long #define lp(i,a,b) for(int i = a ; i < b ; i++ ) #define pii pair<int,int> #define mk make_pair #define pb push_back const int MAX= 10000000 ; const int MAX_PRIMES = 664589 ; using namespace std ; int T ; vector<int> primes ; int d[MAX+10] ; int getQtd(int x, int j) { int ans = 0 ; ll k = primes[j] ; while(k <= x) { ans += x/k ; k *= primes[j] ; } return ans ; } int main() { for(int i = 2 ; i <= MAX ; i++ ) { if(d[i] > 0 ) continue ; primes.pb(i) ; for(int j = i ; j <= MAX ; j += i ) if(d[j] == 0 ) d[j] = i ; } scanf("%d", &T ) ; for(int i = 1 ; i <= T ; i++ ) { int a , b , c , d ; scanf("%d %d %d %d", &a, &b, &c, &d ) ; bool ok = true ; for(int j = 0 ; j < sz(primes) ; j++ ) { if( getQtd(b,j)-getQtd(a-1,j) > getQtd(d,j)-getQtd(c-1,j) ) { ok = false ; break ; } } printf("%s\n" , ok ? "DA" : "NE") ; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:46:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |  scanf("%d", &T ) ;
      |  ~~~~~^~~~~~~~~~~
Main.cpp:51:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |   scanf("%d %d %d %d", &a, &b, &c, &d ) ;
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...