Codeforces 492A Vanya and Cubes(水)

题目链接:Codeforces 492A Vanya and Cubes

#include 
#include 
#include 

using namespace std;

int main () {
	int n, s = 0;
	scanf("%d", &n);
	for (int i = 1; i; i++) {
		s += i;
		if (n < s) {
			printf("%d\n", i - 1);
			break;
		} else
			n -= s;
	}
	return 0;
}


你可能感兴趣的:(CF,GRADE:D,非常简单的签到题)