<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        CodeforcesRound#280(Div.2)A_html/css

        來源:懂視網(wǎng) 責編:小采 時間: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
        推薦度:
        導讀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:

        沒啥好說的。模擬一下就可以了,還wa一發(fā)不應該..


        #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)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。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
        推薦度:
        標簽: (a 2) codeforcesround#
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 最近的2019免费中文字幕| 巨波霸乳在线永久免费视频| 精品国产人成亚洲区| 亚洲免费观看在线视频| 亚洲片国产一区一级在线观看| 亚洲国产成人无码AV在线| 四虎亚洲国产成人久久精品| 免费av一区二区三区| 亚洲精品色播一区二区| 亚洲精品成人网站在线观看| 久久午夜免费视频| 国产三级在线免费观看| 亚洲男女一区二区三区| 亚洲国产精品嫩草影院久久 | 亚洲av无码一区二区三区天堂| 国产亚洲精品无码拍拍拍色欲| 久视频精品免费观看99| h视频在线观看免费| 亚洲精品福利你懂| 亚洲成AV人片在线观看ww| 日本人的色道www免费一区| 久久精品成人免费看| 黄色一级毛片免费| 亚洲国产精品综合一区在线| 国产日韩成人亚洲丁香婷婷| 国产成人免费高清激情视频| 西西人体免费视频| 黄色一级毛片免费| 久久综合亚洲色hezyo| 亚洲国产精品张柏芝在线观看| 毛茸茸bbw亚洲人| 日本高清免费中文字幕不卡| 69xx免费观看视频| 免费91麻豆精品国产自产在线观看 | 亚洲麻豆精品国偷自产在线91| 免费看成人AA片无码视频羞羞网| 国产精品黄页免费高清在线观看| 亚洲日本一线产区和二线 | 亚洲日韩精品国产一区二区三区| 亚洲毛片在线免费观看| 国产日韩亚洲大尺度高清|