QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#55461#2965. RSA MistakeSayedHassan#WA 2ms3708kbC++1.0kb2022-10-13 20:53:132022-10-13 20:53:14

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-13 20:53:14]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3708kb
  • [2022-10-13 20:53:13]
  • 提交

answer

#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fi first
#define sc second
vector<ll> solve(int x)
{
    vector<ll> v;
    for(ll i=2;i*i<=x;i++)
    {
        while(x%i==0)
        {
            v.push_back(i);
            x/=i;
        }
    }
    if(x!=1)v.push_back(x);
    return v;
}
map<ll,int> f;
int main()
{
	ll n,m;
	cin>>n>>m;
	vector<ll> v1=solve(n),v2=solve(m);
	if(v1.size()==1&&v2.size()==1&&n!=m)
    {
        cout<<"full credit";
    }
    else
    {
        for(auto x:v1)
        {
            if(f[x])
            {
                cout<<"no credit";
                return 0;
            }
            f[x]++;
        }
        for(auto x:v2)
        {
            if(f[x])
            {
                cout<<"no credit";
                return 0;
            }
            f[x]++;
        }
        cout<<"partial credit";
    }
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3608kb

input:

13 23

output:

full credit

result:

ok single line: 'full credit'

Test #2:

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

input:

35 6

output:

partial credit

result:

ok single line: 'partial credit'

Test #3:

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

input:

4 5

output:

no credit

result:

ok single line: 'no credit'

Test #4:

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

input:

17 17

output:

no credit

result:

ok single line: 'no credit'

Test #5:

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

input:

15 21

output:

no credit

result:

ok single line: 'no credit'

Test #6:

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

input:

545528636581 876571629707

output:

no credit

result:

ok single line: 'no credit'

Test #7:

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

input:

431348146441 3

output:

no credit

result:

ok single line: 'no credit'

Test #8:

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

input:

584803025179 200560490130

output:

partial credit

result:

ok single line: 'partial credit'

Test #9:

score: -100
Wrong Answer
time: 2ms
memory: 3628kb

input:

725769156026 520807975733

output:

no credit

result:

wrong answer 1st lines differ - expected: 'partial credit', found: 'no credit'