|
|
|
|
讨论 Discussion |
|
|
题解 |
#include<iostream>
using namespace std;
int main(){
freopen("p1240.in","r",stdin);
freopen("p1240.out","w",stdout);
int a,b=1;
bool c=1;
cin>>a;
while(a==0){
if(a==2){
b*=2;
break;
}
if(a==3){
b*=3;
break;
}
if(a%2==0){
b*=2;
a=a-2;
}
if(a%2==1){
c=0;
}
}
if(c){
cout<<b;
}else{
cout<<a-1;
}
fclose(stdin);
fclose(stdout);
return 0;
}
( ) |
|
|
|
|
|
|
|
|
|
Flag |
|
题号 |
P1240 |
|
其它 |
通过 |
30人 |
提交 |
182次 |
通过率 |
16% |
难度 |
2 |
|
|
|
|
|
|