国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問(wèn)答1問(wèn)答10問(wèn)答100問(wèn)答1000問(wèn)答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問(wèn)答文章1 問(wèn)答文章501 問(wèn)答文章1001 問(wèn)答文章1501 問(wèn)答文章2001 問(wèn)答文章2501 問(wèn)答文章3001 問(wèn)答文章3501 問(wèn)答文章4001 問(wèn)答文章4501 問(wèn)答文章5001 問(wèn)答文章5501 問(wèn)答文章6001 問(wèn)答文章6501 問(wèn)答文章7001 問(wèn)答文章7501 問(wèn)答文章8001 問(wèn)答文章8501 問(wèn)答文章9001 問(wèn)答文章9501
當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

CodeforcesRound#280(Div.2)A_html/css

來(lái)源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 15:58:58
文檔

CodeforcesRound#280(Div.2)A_html/css

CodeforcesRound#280(Div.2)A_html/css_WEB-ITnose:題目: A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He d
推薦度:
導(dǎo)讀CodeforcesRound#280(Div.2)A_html/css_WEB-ITnose:題目: A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He d

題目:

A. Vanya and Cubes

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist of 1 cube, the second level must consist of 1?+?2?=?3 cubes, the third level must have 1?+?2?+?3?=?6 cubes, and so on. Thus, the i-th level of the pyramid must have 1?+?2?+?...?+?(i?-?1)?+?i cubes.

Vanya wants to know what is the maximum height of the pyramid that he can make using the given cubes.

Input

The first line contains integer n (1?≤?n?≤?104) ? the number of cubes given to Vanya.

Output

Print the maximum possible height of the pyramid in the single line.

Sample test(s)

input

output

input

25

output

Note

Illustration to the second sample:

沒(méi)啥好說(shuō)的。模擬一下就可以了,還wa一發(fā)不應(yīng)該..


#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define MIN(a, b) ((a) < (b) ? (a) : (b))#define MAX(a, b) ((a) > (b) ? (a) : (b))#define F(i, n) for(int (i)=0;(i)<(n);++(i))#define REP(i, s, t) for(int (i)=(s);(i)<=(t);++(i))#define UREP(i, s, t) for(int (i)=(s);(i)>=(t);--(i))#define REPOK(i, s, t, o) for(int (i)=(s);(i)<=(t) && (o);++(i))#define MEM0(addr) memset((addr), 0, sizeof((addr)))#define PI 3.141592653579323846233832795#define HALF_PI 1.57079632679466192313216916398#define MAXN 100000#define MAXM 10000#define MOD 1000000007typedef long long LL;const double maxdouble = numeric_limits::max();const double eps = 1e-10;const int INF = 0x7FFFFFFF;int main(){ int n; cin >> n; int ans = 0; int base = 1; while (n >= base) { ++ans; n -= base; base += ans+1; } cout << ans; return 0;}

聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

CodeforcesRound#280(Div.2)A_html/css

CodeforcesRound#280(Div.2)A_html/css_WEB-ITnose:題目: A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He d
推薦度:
標(biāo)簽: (a 2) codeforcesround#
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 波多野结衣系列在线观看 | 国内一级野外a一级毛片 | 国产精品电影一区二区 | 中文字幕国产欧美 | 精品国产电影在线看免费观看 | 欧美在线观看视频免费 | 河边性xxxxfreexxxxx | 亚洲 欧美 日韩 综合 | 插插插叉叉叉 | 亚洲欧美另类日本 | 欧美日韩一二三区 | 国产精选在线视频 | 国产一区二区三区欧美 | 九九久久亚洲综合久久久 | 自拍偷拍 欧美日韩 | 国产亚洲欧美日韩俺去了 | 亚洲一级毛片免观看 | 国产va免费精品 | 亚洲欧美网址 | 欧美日韩国产一区二区三区不卡 | 国产特级全黄一级毛片不卡 | 成人一级毛片 | 亚洲精彩视频 | 久久91av | 一区二区免费在线观看 | 国产色综合久久无码有码 | 欧美视频免费在线观看 | 国产精品女同一区二区久久 | 国产精品成人麻豆专区 | 国产成人无精品久久久久国语 | 国产成人欧美一区二区三区的 | 国产精品色综合久久 | 精品国产一区二区三区2021 | 黄色毛片在线观看 | 91麻精品国产91久久久久 | 欧美一区二区三区日韩免费播 | 国产一级成人毛片 | 国产一区二区在线看 | 欧美日本国产 | 亚洲欧洲一二三区 | 国产精品毛片久久久久久久 |