mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1410.cpp
This commit is contained in:
parent
76cdbf71bd
commit
b00528607b
37
QUSTOJ/1410.cpp
Normal file
37
QUSTOJ/1410.cpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int m,n;
|
||||||
|
scanf("%d",&n);
|
||||||
|
int ans=1;
|
||||||
|
m=2;
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
int p=m*m*m;
|
||||||
|
if(ans+p<=n)
|
||||||
|
{
|
||||||
|
ans+=p;
|
||||||
|
m++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("%d\n",m-1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************
|
||||||
|
Problem: 1410
|
||||||
|
User: 1508080112
|
||||||
|
Language: C++
|
||||||
|
Result: 正确
|
||||||
|
Time:4 ms
|
||||||
|
Memory:800 kb
|
||||||
|
****************************************************************/
|
Loading…
Reference in New Issue
Block a user