General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
220216079 Contestant:
qbning
1862D - 21 C++20 (GCC 11-64) Wrong answer on test 9 62 ms 0 KB 2023-08-24 18:19:32 2023-08-24 18:19:35
→ Source
// Problem: D. Ice Cream Balls
// Contest: Codeforces - Codeforces Round 894 (Div. 3)
// URL: https://codeforces.com/contest/1862/problem/D
// Memory Limit: 256 MB
// Time Limit: 1000 ms
#include<iostream>
#include<cmath>
using namespace std;
typedef long long ll;
ll a;
void solve()
{
	cin>>a;
	ll ans=(1+sqrt(1+8*a))/2;
	__int128 cx=(ans*(ans-1)/2);
	a-=(ans*(ans-1)/2);
	ans+=a;
	cout<<ans<<'\n';
}

int main()
{
	int t;
	cin>>t;
	while(t--)solve();
	return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details