QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#131080#2965. RSA Mistakechu_shiTL 8ms3636kbC++14811b2023-07-26 09:48:332023-07-26 09:48:37

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-26 09:48:37]
  • 评测
  • 测评结果:TL
  • 用时:8ms
  • 内存:3636kb
  • [2023-07-26 09:48:33]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

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

output:


result: