QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#54908 | #2965. RSA Mistake | DafuQ_o# | WA | 10ms | 3708kb | C++ | 3.2kb | 2022-10-11 16:19:49 | 2022-10-11 16:19:50 |
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 == 0){
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: 2ms
memory: 3608kb
input:
13 23
output:
full credit
result:
ok single line: 'full credit'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
35 6
output:
partial credit
result:
ok single line: 'partial credit'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
4 5
output:
no credit
result:
ok single line: 'no credit'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
17 17
output:
no credit
result:
ok single line: 'no credit'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3608kb
input:
15 21
output:
no credit
result:
ok single line: 'no credit'
Test #6:
score: 0
Accepted
time: 10ms
memory: 3612kb
input:
545528636581 876571629707
output:
no credit
result:
ok single line: 'no credit'
Test #7:
score: 0
Accepted
time: 7ms
memory: 3556kb
input:
431348146441 3
output:
no credit
result:
ok single line: 'no credit'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3616kb
input:
584803025179 200560490130
output:
partial credit
result:
ok single line: 'partial credit'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3496kb
input:
725769156026 520807975733
output:
partial credit
result:
ok single line: 'partial credit'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
94785999423 831843785340
output:
no credit
result:
ok single line: 'no credit'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
962631984045 923583932904
output:
no credit
result:
ok single line: 'no credit'
Test #12:
score: -100
Wrong Answer
time: 6ms
memory: 3708kb
input:
983892174682 596267564620
output:
partial credit
result:
wrong answer 1st lines differ - expected: 'no credit', found: 'partial credit'