QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#54944 | #2965. RSA Mistake | Sa3tElSefr# | WA | 18ms | 3648kb | C++ | 1.1kb | 2022-10-11 18:18:36 | 2022-10-11 18:18:38 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define ld double
using namespace std;
#define int ll
const int N = 2e5 + 5, mod = 998244353;
bool isPrime(ll n) {
for(ll i = 2; i * i <= n; i++) {
if(n % i == 0) {
return 0;
}
}
return 1;
}
map<ll, int> get(ll n) {
map<ll, int> ret;
for(ll i = 2; i * i <= n; i++) {
while(n % i == 0) {
ret[i]++;
n /= i;
}
}
if(n > 0) ret[n]++;
return ret;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll a, b;
cin >> a >> b;
vector<string> s = {"full credit", "partial credit", "no credit"};
if(isPrime(a) && isPrime(b)) {
if(a == b) cout << s[2];
else cout << s[0];
return 0;
}
auto res = get(a);
auto t = get(b);
for(auto i: t) res[i.first] += i.second;
bool found = 0;
for(auto i: res) {
if(i.second % 2 == 0) {
found = 1;
}
}
if(found) cout << s[2];
else cout << s[1];
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3564kb
input:
13 23
output:
full credit
result:
ok single line: 'full credit'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3544kb
input:
35 6
output:
partial credit
result:
ok single line: 'partial credit'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
4 5
output:
no credit
result:
ok single line: 'no credit'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
17 17
output:
no credit
result:
ok single line: 'no credit'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
15 21
output:
no credit
result:
ok single line: 'no credit'
Test #6:
score: 0
Accepted
time: 18ms
memory: 3556kb
input:
545528636581 876571629707
output:
no credit
result:
ok single line: 'no credit'
Test #7:
score: 0
Accepted
time: 13ms
memory: 3648kb
input:
431348146441 3
output:
no credit
result:
ok single line: 'no credit'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3620kb
input:
584803025179 200560490130
output:
partial credit
result:
ok single line: 'partial credit'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
725769156026 520807975733
output:
partial credit
result:
ok single line: 'partial credit'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
94785999423 831843785340
output:
no credit
result:
ok single line: 'no credit'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
962631984045 923583932904
output:
no credit
result:
ok single line: 'no credit'
Test #12:
score: -100
Wrong Answer
time: 3ms
memory: 3560kb
input:
983892174682 596267564620
output:
partial credit
result:
wrong answer 1st lines differ - expected: 'no credit', found: 'partial credit'