hdu acm2551

d[900] = 1180945252

d[899] = 451945252

#include <stdio.h>

int main(){

		int d[902]={0}, x;
		int t, i;

		for(i=1; i<902; i++)
		    d[i] = d[i-1] + i * i * i;

		scanf("%d", &t);
		while(t--){
		   scanf("%ld", &x);
		   for(i=0; i<902; i++){
					    if(d[i]<x && x<=d[i+1]){
									    printf("%d\n", i+1);
									    break;
									}
					}
		}

		return 0;
}


posted @ 2015-09-21 16:08  StevenLuke  阅读(108)  评论(0编辑  收藏  举报