QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#55486 | #2965. RSA Mistake | AmrMohameD# | AC ✓ | 35ms | 8436kb | C++ | 1.8kb | 2022-10-14 05:24:08 | 2022-10-14 05:24:11 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define EPS 1e-9
#define PI acos(-1.0)
#define ll long long
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define pb push_back
#define ft first
#define sc second
#define pi pair<ll,ll>
#define vi vector<ll>
#define sz(s) s.size()
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll N = 2e5+5, M = 250, MOD = (1LL<<32), INF = 1e18;
int dx[] = {-1, 1, 0, 0}, Dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};;
int dy[] = {0, 0, 1, -1}, Dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
ll n, m, t, a[N], p[N], sz[N];
vi g[N];
void init(){
for(int i = 1; i <= n ;++i)
p[i] = i,sz[i] = 1;
}
int findset(int s)
{
if(s == p[s]) return s;
return p[s] = findset(p[s]);
}
void join(int a,int b)
{
a = findset(a);
b = findset(b);
if(sz[a] < sz[b]) swap(a,b);
if(a != b)
{
p[b] = a;
sz[a] += sz[b];
}
}
int main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);//freopen("lines.in", "r", stdin);
cin >> n >> m;
int tmm = 1,tmm2 = 1, no = 0;
if(n == m) return cout << "no credit",0;
for(ll i = 2; i * i <= n ;++i)
{
if(n%i == 0) tmm = 0;
if(n%(i*i) == 0) no = 1;
}
for(ll i = 2; i * i <= m ;++i)
{
if(m%i == 0) tmm2 = 0;
if(m%(i*i) == 0) no = 1;
}
if(tmm && tmm2 && !no) cout << "full credit";
else if(no || __gcd(n,m) > 1) cout << "no credit";
else cout << "partial credit";
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 4ms
memory: 8388kb
input:
13 23
output:
full credit
result:
ok single line: 'full credit'
Test #2:
score: 0
Accepted
time: 3ms
memory: 8332kb
input:
35 6
output:
partial credit
result:
ok single line: 'partial credit'
Test #3:
score: 0
Accepted
time: 4ms
memory: 8324kb
input:
4 5
output:
no credit
result:
ok single line: 'no credit'
Test #4:
score: 0
Accepted
time: 2ms
memory: 8276kb
input:
17 17
output:
no credit
result:
ok single line: 'no credit'
Test #5:
score: 0
Accepted
time: 1ms
memory: 8224kb
input:
15 21
output:
no credit
result:
ok single line: 'no credit'
Test #6:
score: 0
Accepted
time: 27ms
memory: 8212kb
input:
545528636581 876571629707
output:
no credit
result:
ok single line: 'no credit'
Test #7:
score: 0
Accepted
time: 14ms
memory: 8296kb
input:
431348146441 3
output:
no credit
result:
ok single line: 'no credit'
Test #8:
score: 0
Accepted
time: 23ms
memory: 8436kb
input:
584803025179 200560490130
output:
partial credit
result:
ok single line: 'partial credit'
Test #9:
score: 0
Accepted
time: 24ms
memory: 8300kb
input:
725769156026 520807975733
output:
partial credit
result:
ok single line: 'partial credit'
Test #10:
score: 0
Accepted
time: 23ms
memory: 8328kb
input:
94785999423 831843785340
output:
no credit
result:
ok single line: 'no credit'
Test #11:
score: 0
Accepted
time: 30ms
memory: 8360kb
input:
962631984045 923583932904
output:
no credit
result:
ok single line: 'no credit'
Test #12:
score: 0
Accepted
time: 27ms
memory: 8288kb
input:
983892174682 596267564620
output:
no credit
result:
ok single line: 'no credit'
Test #13:
score: 0
Accepted
time: 28ms
memory: 8268kb
input:
988586693791 523281177667
output:
full credit
result:
ok single line: 'full credit'
Test #14:
score: 0
Accepted
time: 29ms
memory: 8384kb
input:
768483880537 958632922673
output:
full credit
result:
ok single line: 'full credit'
Test #15:
score: 0
Accepted
time: 29ms
memory: 8388kb
input:
695320496641 992131878511
output:
full credit
result:
ok single line: 'full credit'
Test #16:
score: 0
Accepted
time: 24ms
memory: 8268kb
input:
619864432127 575182057589
output:
full credit
result:
ok single line: 'full credit'
Test #17:
score: 0
Accepted
time: 25ms
memory: 8288kb
input:
574224928327 554785761851
output:
full credit
result:
ok single line: 'full credit'
Test #18:
score: 0
Accepted
time: 5ms
memory: 8256kb
input:
2 2
output:
no credit
result:
ok single line: 'no credit'
Test #19:
score: 0
Accepted
time: 33ms
memory: 8224kb
input:
999999999989 999999999961
output:
full credit
result:
ok single line: 'full credit'
Test #20:
score: 0
Accepted
time: 5ms
memory: 8332kb
input:
999999999989 999999999989
output:
no credit
result:
ok single line: 'no credit'
Test #21:
score: 0
Accepted
time: 16ms
memory: 8344kb
input:
2 999999999989
output:
full credit
result:
ok single line: 'full credit'
Test #22:
score: 0
Accepted
time: 20ms
memory: 8436kb
input:
999999999989 2
output:
full credit
result:
ok single line: 'full credit'
Test #23:
score: 0
Accepted
time: 27ms
memory: 8344kb
input:
799337241719 790574179457
output:
no credit
result:
ok single line: 'no credit'
Test #24:
score: 0
Accepted
time: 35ms
memory: 8280kb
input:
999962000357 999944000663
output:
no credit
result:
ok single line: 'no credit'
Test #25:
score: 0
Accepted
time: 2ms
memory: 8224kb
input:
2 4
output:
no credit
result:
ok single line: 'no credit'
Test #26:
score: 0
Accepted
time: 5ms
memory: 8388kb
input:
4 2
output:
no credit
result:
ok single line: 'no credit'
Test #27:
score: 0
Accepted
time: 2ms
memory: 8348kb
input:
21 15
output:
no credit
result:
ok single line: 'no credit'
Test #28:
score: 0
Accepted
time: 2ms
memory: 8212kb
input:
5 4
output:
no credit
result:
ok single line: 'no credit'
Test #29:
score: 0
Accepted
time: 2ms
memory: 8436kb
input:
125 7
output:
no credit
result:
ok single line: 'no credit'
Test #30:
score: 0
Accepted
time: 32ms
memory: 8328kb
input:
999999999969 999999999929
output:
partial credit
result:
ok single line: 'partial credit'
Test #31:
score: 0
Accepted
time: 26ms
memory: 8284kb
input:
428571428541 999999999929
output:
no credit
result:
ok single line: 'no credit'
Test #32:
score: 0
Accepted
time: 33ms
memory: 8284kb
input:
949999999373 714080161721
output:
partial credit
result:
ok single line: 'partial credit'
Test #33:
score: 0
Accepted
time: 27ms
memory: 8300kb
input:
757523014201 616759792799
output:
partial credit
result:
ok single line: 'partial credit'
Test #34:
score: 0
Accepted
time: 33ms
memory: 8296kb
input:
945410323183 793541296879
output:
partial credit
result:
ok single line: 'partial credit'
Test #35:
score: 0
Accepted
time: 25ms
memory: 8268kb
input:
668134918943 250092815711
output:
partial credit
result:
ok single line: 'partial credit'
Test #36:
score: 0
Accepted
time: 23ms
memory: 8216kb
input:
593159028797 378923570503
output:
partial credit
result:
ok single line: 'partial credit'
Test #37:
score: 0
Accepted
time: 30ms
memory: 8272kb
input:
673663445657 685555556761
output:
partial credit
result:
ok single line: 'partial credit'
Test #38:
score: 0
Accepted
time: 26ms
memory: 8384kb
input:
615590502287 730111591619
output:
partial credit
result:
ok single line: 'partial credit'
Test #39:
score: 0
Accepted
time: 26ms
memory: 8368kb
input:
737474530367 339061475591
output:
partial credit
result:
ok single line: 'partial credit'
Test #40:
score: 0
Accepted
time: 30ms
memory: 8388kb
input:
547304948893 825051092141
output:
partial credit
result:
ok single line: 'partial credit'
Test #41:
score: 0
Accepted
time: 29ms
memory: 8324kb
input:
888259990703 349508614421
output:
partial credit
result:
ok single line: 'partial credit'
Test #42:
score: 0
Accepted
time: 27ms
memory: 8364kb
input:
394206923881 679230181703
output:
no credit
result:
ok single line: 'no credit'
Test #43:
score: 0
Accepted
time: 26ms
memory: 8212kb
input:
199036422587 813176211779
output:
no credit
result:
ok single line: 'no credit'
Test #44:
score: 0
Accepted
time: 18ms
memory: 8284kb
input:
385196736923 358517468791
output:
no credit
result:
ok single line: 'no credit'
Test #45:
score: 0
Accepted
time: 28ms
memory: 8348kb
input:
540003052801 543341442493
output:
no credit
result:
ok single line: 'no credit'
Test #46:
score: 0
Accepted
time: 24ms
memory: 8296kb
input:
529883073493 557936045561
output:
no credit
result:
ok single line: 'no credit'
Test #47:
score: 0
Accepted
time: 25ms
memory: 8212kb
input:
519207113731 326410289771
output:
no credit
result:
ok single line: 'no credit'
Test #48:
score: 0
Accepted
time: 25ms
memory: 8360kb
input:
530779897367 729543471779
output:
no credit
result:
ok single line: 'no credit'
Test #49:
score: 0
Accepted
time: 28ms
memory: 8436kb
input:
623202833611 876138576449
output:
no credit
result:
ok single line: 'no credit'
Test #50:
score: 0
Accepted
time: 2ms
memory: 8216kb
input:
741753647069 741753647069
output:
no credit
result:
ok single line: 'no credit'
Test #51:
score: 0
Accepted
time: 15ms
memory: 8328kb
input:
548039 445335943361
output:
no credit
result:
ok single line: 'no credit'
Test #52:
score: 0
Accepted
time: 29ms
memory: 8156kb
input:
644483448731 611801529223
output:
no credit
result:
ok single line: 'no credit'
Test #53:
score: 0
Accepted
time: 21ms
memory: 8224kb
input:
498556835561 412089307169
output:
no credit
result:
ok single line: 'no credit'
Test #54:
score: 0
Accepted
time: 2ms
memory: 8220kb
input:
602312422583 602312422583
output:
no credit
result:
ok single line: 'no credit'
Test #55:
score: 0
Accepted
time: 11ms
memory: 8436kb
input:
517277 424820460851
output:
no credit
result:
ok single line: 'no credit'