# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
808741 |
2023-08-05T10:22:33 Z |
Tunglam07 |
Vepar (COCI21_vepar) |
C++17 |
|
95 ms |
9480 KB |
#include<bits/stdc++.h>
using namespace std;
long long t, a, b, c, d, s, s1;
bool chk[10000001];
vector<long long> prim;
long long sol(long long v,long long k)
{
long long ans = 0;
while (v)
{
ans += v/k;
v /= k;
}
return ans;
}
void findprime()
{
for(int i = 2; i <= 5000000; i++)
{
if(!chk[i])
{
prim.push_back(i);
for(int j = i * 2; j <= 5000000; j += i)
{
chk[j] = 1;
}
}
}
}
int main()
{
ios::sync_with_stdio (0);
cin.tie (0);
cout.tie (0);
findprime();
cin >> t;
while(t--)
{
cin >> a >> b >> c >> d;
bool ck = 0;
for (int v : prim)
{
if (sol(b, v) - sol(a - 1, v) > sol(d, v) - sol(c - 1, v))
{
ck = 1;
break;
}
}
if(!ck)
{
cout << "DA" << endl;
}
else
{
cout << "NE" << endl;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
49 ms |
9444 KB |
Output is correct |
2 |
Correct |
58 ms |
9448 KB |
Output is correct |
3 |
Correct |
23 ms |
9472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
9480 KB |
Output is correct |
2 |
Correct |
41 ms |
9420 KB |
Output is correct |
3 |
Correct |
42 ms |
9420 KB |
Output is correct |
4 |
Correct |
48 ms |
9420 KB |
Output is correct |
5 |
Correct |
29 ms |
9452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
9448 KB |
Output is correct |
2 |
Correct |
36 ms |
9420 KB |
Output is correct |
3 |
Correct |
42 ms |
9448 KB |
Output is correct |
4 |
Correct |
41 ms |
9436 KB |
Output is correct |
5 |
Correct |
47 ms |
9448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
77 ms |
9444 KB |
Output is correct |
2 |
Correct |
43 ms |
9420 KB |
Output is correct |
3 |
Correct |
31 ms |
9376 KB |
Output is correct |
4 |
Correct |
56 ms |
9460 KB |
Output is correct |
5 |
Correct |
51 ms |
9424 KB |
Output is correct |
6 |
Correct |
45 ms |
9384 KB |
Output is correct |
7 |
Incorrect |
95 ms |
9420 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
78 ms |
9420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
78 ms |
9420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
79 ms |
9420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |