QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#131087#2965. RSA Mistakechu_shiTL 8ms3680kbC++141.0kb2023-07-26 10:07:392023-07-26 10:07:42

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 10:07:42]
  • 评测
  • 测评结果:TL
  • 用时:8ms
  • 内存:3680kb
  • [2023-07-26 10:07:39]
  • 提交

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;
}
int check2(__int128 n)
{
	__int128 cnt=0;
	__int128 l=0;
	for(__int128 i=2;i<=n/i;i++)
	{
		if(n%i==0)
		{
			cnt=0;
			while(n%i==0)
			{
				n/=i;
				cnt++;
			}
			if(cnt>1) return 1;
			l=cnt;
		}
	}
//	printf("%lld\n",n);
//	if(n>1) return 0;
	return 0;
}
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 
	{
		__int128 nn=n*m;
		f=check2(nn);
		if(f) 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: 3500kb

input:

13 23

output:

full credit

result:

ok single line: 'full credit'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

35 6

output:

partial credit

result:

ok single line: 'partial credit'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3504kb

input:

4 5

output:

no credit

result:

ok single line: 'no credit'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

17 17

output:

no credit

result:

ok single line: 'no credit'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3552kb

input:

15 21

output:

no credit

result:

ok single line: 'no credit'

Test #6:

score: 0
Accepted
time: 8ms
memory: 3676kb

input:

545528636581 876571629707

output:

no credit

result:

ok single line: 'no credit'

Test #7:

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

input:

431348146441 3

output:

no credit

result:

ok single line: 'no credit'

Test #8:

score: 0
Accepted
time: 1ms
memory: 3500kb

input:

584803025179 200560490130

output:

partial credit

result:

ok single line: 'partial credit'

Test #9:

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

input:

725769156026 520807975733

output:

partial credit

result:

ok single line: 'partial credit'

Test #10:

score: 0
Accepted
time: 1ms
memory: 3680kb

input:

94785999423 831843785340

output:

no credit

result:

ok single line: 'no credit'

Test #11:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

962631984045 923583932904

output:

no credit

result:

ok single line: 'no credit'

Test #12:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

983892174682 596267564620

output:

no credit

result:

ok single line: 'no credit'

Test #13:

score: 0
Accepted
time: 4ms
memory: 3504kb

input:

988586693791 523281177667

output:

full credit

result:

ok single line: 'full credit'

Test #14:

score: 0
Accepted
time: 6ms
memory: 3676kb

input:

768483880537 958632922673

output:

full credit

result:

ok single line: 'full credit'

Test #15:

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

input:

695320496641 992131878511

output:

full credit

result:

ok single line: 'full credit'

Test #16:

score: 0
Accepted
time: 5ms
memory: 3520kb

input:

619864432127 575182057589

output:

full credit

result:

ok single line: 'full credit'

Test #17:

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

input:

574224928327 554785761851

output:

full credit

result:

ok single line: 'full credit'

Test #18:

score: 0
Accepted
time: 1ms
memory: 3508kb

input:

2 2

output:

no credit

result:

ok single line: 'no credit'

Test #19:

score: 0
Accepted
time: 7ms
memory: 3504kb

input:

999999999989 999999999961

output:

full credit

result:

ok single line: 'full credit'

Test #20:

score: -100
Time Limit Exceeded

input:

999999999989 999999999989

output:


result: