← Back to List

15667번: 2018 연세대학교 프로그래밍 경진대회 ↗

Solutions

C++14
156 B | 156 chars
#include <iostream>
using namespace std;
int N;
int main()
{
	cin>>N;
	for(int x=1; x<=110; x++)
	{
		if(x*(x+1)==N-1)
		{
			cout<<x;
			return 0;
		}
	}
}