QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#55485 | #2965. RSA Mistake | AmrMohameD# | WA | 5ms | 8284kb | C++ | 1.8kb | 2022-10-14 05:22:05 | 2022-10-14 05:22:07 |
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) cout << "no credit";
else cout << "partial credit";
return 0;
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 8216kb
input:
13 23
output:
full credit
result:
ok single line: 'full credit'
Test #2:
score: 0
Accepted
time: 5ms
memory: 8284kb
input:
35 6
output:
partial credit
result:
ok single line: 'partial credit'
Test #3:
score: 0
Accepted
time: 1ms
memory: 8256kb
input:
4 5
output:
no credit
result:
ok single line: 'no credit'
Test #4:
score: 0
Accepted
time: 5ms
memory: 8284kb
input:
17 17
output:
no credit
result:
ok single line: 'no credit'
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 8280kb
input:
15 21
output:
partial credit
result:
wrong answer 1st lines differ - expected: 'no credit', found: 'partial credit'