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

제출 #380444

#제출 시각아이디문제언어결과실행 시간메모리
380444penguinhackerVepar (COCI21_vepar)C++14
70 / 70
334 ms15640 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array const int MX = 10000001; bool p[MX]; vector<int> primes; int main() { ios::sync_with_stdio(0); cin.tie(0); memset(p, 1, sizeof(p)); for (int i = 2; i < MX; ++i) { if (!p[i]) continue; primes.push_back(i); if ((ll)i * i >= MX) continue; for (int j = i * i; j < MX; j += i) p[j] = 0; } int t; cin >> t; for (int a, b, c, d; t--;) { cin >> a >> b >> c >> d; vector<int> ct(primes.size()); auto Upd = [&](int n, int i, int inc) { int x = primes[i]; n /= x; while(n) { ct[i] += inc * n; n /= x; } }; for (int i = 0; i < primes.size(); ++i) { Upd(d, i, 1); Upd(c - 1, i, -1); Upd(b, i, -1); Upd(a - 1, i, 1); } cout << (*min_element(ct.begin(), ct.end()) >= 0 ? "DA" : "NE") << "\n"; } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:36:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |   for (int i = 0; i < primes.size(); ++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...