QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#131080 | #2965. RSA Mistake | chu_shi | TL | 8ms | 3636kb | C++14 | 811b | 2023-07-26 09:48:33 | 2023-07-26 09:48:37 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define int long long
#define ios ios::sync_with_stdio(0)
__int128 n,m;
typedef pair<int,int> pll;
const int N=2e6+10,inf=0x3f3f3f3f;
//int n,m;
int a[N];
bool check(int n)
{
if(n==1) return 0;
for(int i=2;i<=n/i;i++)
{
if(n%i==0) return 0;
}
return 1;
}
void solve()
{
scanf("%lld%lld",&n,&m);
int f=check(n);
int d=check(m);
if(f&&d&&n!=m) cout<<"full credit"<<endl;
else
{
int ff=0;
for(int i=2;i*i<=n*m;i++)
if((n*m)%(i*i)==0){
ff=1;
break;
}
if(ff) cout<<"no credit"<<endl;
else cout<<"partial credit"<<endl;
}
}
signed main()
{
// ios;
// cin.tie(0);
// cout.tie(0);
int T=1;
// cin>>T;
while(T--)
{
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
13 23
output:
full credit
result:
ok single line: 'full credit'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
35 6
output:
partial credit
result:
ok single line: 'partial credit'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
4 5
output:
no credit
result:
ok single line: 'no credit'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
17 17
output:
no credit
result:
ok single line: 'no credit'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
15 21
output:
no credit
result:
ok single line: 'no credit'
Test #6:
score: 0
Accepted
time: 8ms
memory: 3568kb
input:
545528636581 876571629707
output:
no credit
result:
ok single line: 'no credit'
Test #7:
score: 0
Accepted
time: 5ms
memory: 3564kb
input:
431348146441 3
output:
no credit
result:
ok single line: 'no credit'
Test #8:
score: -100
Time Limit Exceeded
input:
584803025179 200560490130