# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
872977 |
2023-11-14T08:19:12 Z |
aeg |
Vepar (COCI21_vepar) |
C++14 |
|
1500 ms |
852 KB |
#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 time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
348 KB |
Output is correct |
3 |
Correct |
4 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
344 KB |
Output is correct |
3 |
Correct |
5 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1552 ms |
736 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1518 ms |
852 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1548 ms |
764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1563 ms |
596 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |