QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#54909 | #2965. RSA Mistake | DafuQ_o# | AC ✓ | 18ms | 3724kb | C++ | 3.2kb | 2022-10-11 16:21:49 | 2022-10-11 16:21:51 |
Judging History
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define gtr(T) vector<T>,greater<T>
#define ACPC ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds;
template<class T> using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
void err(istream_iterator<string> it) {cerr << endl;}
template<typename T, typename... Args>void err(istream_iterator<string> it, T a, Args... args) {cerr << *it << " = " << a << endl;err(++it, args...);}
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
template<typename T>
istream & operator >> (istream &in, vector<T> &a){
for(auto &i: a)
in >> i;
return in;
}
template<typename T>
ostream & operator << (ostream &out, const vector<T> &a){
for(auto &i: a)
out << i << ' ';
return out;
}
const int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
const int dy[] = {1 , -1, 0, 0, 1, -1, -1, 1};
const int N = 300 + 5;
const int M = 1e3 + 5;
const int INF = 1e9;
const int MOD = 1e9 + 7;
//vector<int> adj[N];
//int s[N], p[N];
//void addEdge(int u, int v){
// adj[u].emplace_back(v);
// adj[v].emplace_back(u);
//}
//int dp[N][N][3];
//int dfs(int u, int par, int i, int k, bool lst){
// error(u,par,i,k,lst);
// if(i >= sz(adj[u]))return 0;
// int &ret = dp[u][k][lst];
// if(~ret)
// return ret;
// int v = adj[u][i];
// if(v == par){
// return ret = dfs(u, par, i + 1,k, lst);
// }
//
// if(!lst){
// if(s[u] <= k){
// for(auto &g: adj[u]){
// if(g == par)continue;
// ret = max(ret, p[u] + dfs(g, u, 0, k - s[g], 1));
// }
// }
// if(s[v] <= k )
// ret = max(ret, p[v] + dfs(u, par, i + 1, k - s[v], lst) + dfs(v, u, i + 1, k - s[v], 1));
// ret = max(ret, dfs(u,par, i + 1, k , lst));
// }else{
// for(auto &v: adj[u]){
// if(v == par)continue;
// ret = max(ret, dfs(v,u,0,k,1));
// }
//
// }
// return ret;
//}
void doShit(){
ll x , y;
cin >> x >> y;
map<ll, int> mp;
for(ll i = 2; i * i <= x; ++i){
while(x % i == 0){
x /= i;
mp[i]++;
}
}
if(x > 1)mp[x]++;
for(ll i = 2; i * i <= y; ++i){
while(y % i == 0){
y /= i;
mp[i]++;
}
}
if(y > 1)mp[y]++;
int c = 0;
for(auto &i: mp)c += i.second;
if(c == 2 and mp.size() == 2){
cout << "full credit\n";
}else {
for(auto &i: mp){
if(i.second >= 2){
cout << "no credit\n";
return ;
}
}
cout << "partial credit\n";
}
/*
7 10
1 7
2 4
5 18
2 3
3 12
9 20
2 8
1 2
1 3
2 4
2 5
3 6
3 7
5 10
2 1
2 2
2 4
2 8
2 16
1 2
2 3
3 4
4 5
* */
}
signed main(){
ACPC
int q = 1;
// cin >> q;
while(q--)
doShit();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3704kb
input:
13 23
output:
full credit
result:
ok single line: 'full credit'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
35 6
output:
partial credit
result:
ok single line: 'partial credit'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3704kb
input:
4 5
output:
no credit
result:
ok single line: 'no credit'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
17 17
output:
no credit
result:
ok single line: 'no credit'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
15 21
output:
no credit
result:
ok single line: 'no credit'
Test #6:
score: 0
Accepted
time: 13ms
memory: 3724kb
input:
545528636581 876571629707
output:
no credit
result:
ok single line: 'no credit'
Test #7:
score: 0
Accepted
time: 7ms
memory: 3612kb
input:
431348146441 3
output:
no credit
result:
ok single line: 'no credit'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
584803025179 200560490130
output:
partial credit
result:
ok single line: 'partial credit'
Test #9:
score: 0
Accepted
time: 3ms
memory: 3500kb
input:
725769156026 520807975733
output:
partial credit
result:
ok single line: 'partial credit'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
94785999423 831843785340
output:
no credit
result:
ok single line: 'no credit'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
962631984045 923583932904
output:
no credit
result:
ok single line: 'no credit'
Test #12:
score: 0
Accepted
time: 6ms
memory: 3556kb
input:
983892174682 596267564620
output:
no credit
result:
ok single line: 'no credit'
Test #13:
score: 0
Accepted
time: 12ms
memory: 3616kb
input:
988586693791 523281177667
output:
full credit
result:
ok single line: 'full credit'
Test #14:
score: 0
Accepted
time: 16ms
memory: 3556kb
input:
768483880537 958632922673
output:
full credit
result:
ok single line: 'full credit'
Test #15:
score: 0
Accepted
time: 13ms
memory: 3560kb
input:
695320496641 992131878511
output:
full credit
result:
ok single line: 'full credit'
Test #16:
score: 0
Accepted
time: 14ms
memory: 3648kb
input:
619864432127 575182057589
output:
full credit
result:
ok single line: 'full credit'
Test #17:
score: 0
Accepted
time: 14ms
memory: 3544kb
input:
574224928327 554785761851
output:
full credit
result:
ok single line: 'full credit'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
2 2
output:
no credit
result:
ok single line: 'no credit'
Test #19:
score: 0
Accepted
time: 18ms
memory: 3536kb
input:
999999999989 999999999961
output:
full credit
result:
ok single line: 'full credit'
Test #20:
score: 0
Accepted
time: 18ms
memory: 3640kb
input:
999999999989 999999999989
output:
no credit
result:
ok single line: 'no credit'
Test #21:
score: 0
Accepted
time: 11ms
memory: 3536kb
input:
2 999999999989
output:
full credit
result:
ok single line: 'full credit'
Test #22:
score: 0
Accepted
time: 10ms
memory: 3496kb
input:
999999999989 2
output:
full credit
result:
ok single line: 'full credit'
Test #23:
score: 0
Accepted
time: 16ms
memory: 3552kb
input:
799337241719 790574179457
output:
no credit
result:
ok single line: 'no credit'
Test #24:
score: 0
Accepted
time: 18ms
memory: 3708kb
input:
999962000357 999944000663
output:
no credit
result:
ok single line: 'no credit'
Test #25:
score: 0
Accepted
time: 2ms
memory: 3612kb
input:
2 4
output:
no credit
result:
ok single line: 'no credit'
Test #26:
score: 0
Accepted
time: 2ms
memory: 3616kb
input:
4 2
output:
no credit
result:
ok single line: 'no credit'
Test #27:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
21 15
output:
no credit
result:
ok single line: 'no credit'
Test #28:
score: 0
Accepted
time: 2ms
memory: 3536kb
input:
5 4
output:
no credit
result:
ok single line: 'no credit'
Test #29:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
125 7
output:
no credit
result:
ok single line: 'no credit'
Test #30:
score: 0
Accepted
time: 6ms
memory: 3552kb
input:
999999999969 999999999929
output:
partial credit
result:
ok single line: 'partial credit'
Test #31:
score: 0
Accepted
time: 5ms
memory: 3708kb
input:
428571428541 999999999929
output:
no credit
result:
ok single line: 'no credit'
Test #32:
score: 0
Accepted
time: 11ms
memory: 3616kb
input:
949999999373 714080161721
output:
partial credit
result:
ok single line: 'partial credit'
Test #33:
score: 0
Accepted
time: 10ms
memory: 3544kb
input:
757523014201 616759792799
output:
partial credit
result:
ok single line: 'partial credit'
Test #34:
score: 0
Accepted
time: 16ms
memory: 3556kb
input:
945410323183 793541296879
output:
partial credit
result:
ok single line: 'partial credit'
Test #35:
score: 0
Accepted
time: 9ms
memory: 3720kb
input:
668134918943 250092815711
output:
partial credit
result:
ok single line: 'partial credit'
Test #36:
score: 0
Accepted
time: 9ms
memory: 3608kb
input:
593159028797 378923570503
output:
partial credit
result:
ok single line: 'partial credit'
Test #37:
score: 0
Accepted
time: 15ms
memory: 3544kb
input:
673663445657 685555556761
output:
partial credit
result:
ok single line: 'partial credit'
Test #38:
score: 0
Accepted
time: 8ms
memory: 3496kb
input:
615590502287 730111591619
output:
partial credit
result:
ok single line: 'partial credit'
Test #39:
score: 0
Accepted
time: 12ms
memory: 3628kb
input:
737474530367 339061475591
output:
partial credit
result:
ok single line: 'partial credit'
Test #40:
score: 0
Accepted
time: 11ms
memory: 3560kb
input:
547304948893 825051092141
output:
partial credit
result:
ok single line: 'partial credit'
Test #41:
score: 0
Accepted
time: 9ms
memory: 3620kb
input:
888259990703 349508614421
output:
partial credit
result:
ok single line: 'partial credit'
Test #42:
score: 0
Accepted
time: 14ms
memory: 3636kb
input:
394206923881 679230181703
output:
no credit
result:
ok single line: 'no credit'
Test #43:
score: 0
Accepted
time: 9ms
memory: 3640kb
input:
199036422587 813176211779
output:
no credit
result:
ok single line: 'no credit'
Test #44:
score: 0
Accepted
time: 4ms
memory: 3620kb
input:
385196736923 358517468791
output:
no credit
result:
ok single line: 'no credit'
Test #45:
score: 0
Accepted
time: 11ms
memory: 3628kb
input:
540003052801 543341442493
output:
no credit
result:
ok single line: 'no credit'
Test #46:
score: 0
Accepted
time: 8ms
memory: 3628kb
input:
529883073493 557936045561
output:
no credit
result:
ok single line: 'no credit'
Test #47:
score: 0
Accepted
time: 7ms
memory: 3496kb
input:
519207113731 326410289771
output:
no credit
result:
ok single line: 'no credit'
Test #48:
score: 0
Accepted
time: 14ms
memory: 3544kb
input:
530779897367 729543471779
output:
no credit
result:
ok single line: 'no credit'
Test #49:
score: 0
Accepted
time: 2ms
memory: 3500kb
input:
623202833611 876138576449
output:
no credit
result:
ok single line: 'no credit'
Test #50:
score: 0
Accepted
time: 15ms
memory: 3704kb
input:
741753647069 741753647069
output:
no credit
result:
ok single line: 'no credit'
Test #51:
score: 0
Accepted
time: 7ms
memory: 3636kb
input:
548039 445335943361
output:
no credit
result:
ok single line: 'no credit'
Test #52:
score: 0
Accepted
time: 13ms
memory: 3672kb
input:
644483448731 611801529223
output:
no credit
result:
ok single line: 'no credit'
Test #53:
score: 0
Accepted
time: 2ms
memory: 3640kb
input:
498556835561 412089307169
output:
no credit
result:
ok single line: 'no credit'
Test #54:
score: 0
Accepted
time: 11ms
memory: 3720kb
input:
602312422583 602312422583
output:
no credit
result:
ok single line: 'no credit'
Test #55:
score: 0
Accepted
time: 7ms
memory: 3648kb
input:
517277 424820460851
output:
no credit
result:
ok single line: 'no credit'