QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54943#2965. RSA MistakeSa3tElSefr#TL 18ms3712kbC++1.1kb2022-10-11 18:17:332022-10-11 18:17:36

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-11 18:17:36]
  • 评测
  • 测评结果:TL
  • 用时:18ms
  • 内存:3712kb
  • [2022-10-11 18:17:33]
  • 提交

answer

#include <bits/stdc++.h>

#define ll long long
#define ld  double
using namespace std;

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(int i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if(n > 0) ret[n]++;
    return ret;
}



int 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;
}





詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3648kb

input:

13 23

output:

full credit

result:

ok single line: 'full credit'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3648kb

input:

35 6

output:

partial credit

result:

ok single line: 'partial credit'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3640kb

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: 2ms
memory: 3632kb

input:

15 21

output:

no credit

result:

ok single line: 'no credit'

Test #6:

score: 0
Accepted
time: 18ms
memory: 3712kb

input:

545528636581 876571629707

output:

no credit

result:

ok single line: 'no credit'

Test #7:

score: 0
Accepted
time: 12ms
memory: 3544kb

input:

431348146441 3

output:

no credit

result:

ok single line: 'no credit'

Test #8:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

584803025179 200560490130

output:

partial credit

result:

ok single line: 'partial credit'

Test #9:

score: -100
Time Limit Exceeded

input:

725769156026 520807975733

output:


result: