mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1277.cpp
This commit is contained in:
parent
b58f68e6bc
commit
de2635164d
28
QUSTOJ/1277.cpp
Normal file
28
QUSTOJ/1277.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <cstdio>
|
||||
int main()
|
||||
{
|
||||
long long inc;
|
||||
scanf("%I64d",&inc);
|
||||
int step=0;
|
||||
while(inc>4)
|
||||
{
|
||||
long long a=inc/3+1;
|
||||
long long b=inc-2*a;
|
||||
inc=a<b?b:a;
|
||||
step++;
|
||||
}
|
||||
if(inc==2)
|
||||
{
|
||||
step++;
|
||||
}
|
||||
else if(inc==3)
|
||||
{
|
||||
step++;
|
||||
}
|
||||
else if(inc==4)
|
||||
{
|
||||
step+=2;
|
||||
}
|
||||
printf("%d\n",step);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user