QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#361782 | #8508. DiviDuelo | ucup-team2443# | WA | 13ms | 69340kb | C++20 | 1.1kb | 2024-03-23 13:14:54 | 2024-03-23 13:14:55 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1919810;
ll n,m,k;
int a[N],b[N];
int cnt[N];
ll ans;
string s[N];
int dp[N][3];//选了前i个 现在有j个连续辅音
map<char,int> mp;
stack<int> st1,st2;
int tf[N];
int gao(string s){
int sum=0;
for(int i=0;i<s.size();i++){
int t=s[i]-'0';
sum=sum*10+t;
}
return sum;
}
bool isprime(ll x){
if(x==2) return true;
for(ll i=2;i<=x/i;i++){
if(x%i==0) return false;
}
return true;
}
void __(){
cin>>n;
if(n==1){
puts("N");
return;
}
if(n==2||n==3||n==4){
puts("Y");
return;
}
if(n&1){
puts("N");
return;
}
if((n&1)&&n>10){
while(1){
}
}
int res=0;
for(ll i=n,cnt=0;i>n/2&&cnt<=10;i--,cnt++){
if(isprime(i)){
res++;
}
}
if(res>=2) puts("N");
else puts("Y");
}
int main()
{
int _=1;
// cin>>_;
while(_--){
__();
}
}
//NYYYNYNNNYN
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 10ms
memory: 67292kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: 0
Accepted
time: 7ms
memory: 67080kb
input:
9
output:
N
result:
ok "N"
Test #3:
score: 0
Accepted
time: 13ms
memory: 67000kb
input:
1
output:
N
result:
ok "N"
Test #4:
score: 0
Accepted
time: 13ms
memory: 67044kb
input:
549755813888
output:
Y
result:
ok "Y"
Test #5:
score: -100
Wrong Answer
time: 11ms
memory: 69340kb
input:
274877906944
output:
Y
result:
wrong answer 1st words differ - expected: 'N', found: 'Y'