Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
May 24th, 2018
93
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
#include <iostream>
#include <math.h>
using namespace std;
int main() {
long long s, sum;
int n;
cin >> s;
n = sqrt(2 * s);
while (n*(n + 1) / 2 > s) {
n--;
}
cout << n << '\n';
return 0;
}
Add Comment
Please,
Sign In
to add comment
Public Pastes
🤑 G2A.com Free Gift Card Guide May 2024 FIX 💰
GetText | 55 min ago | 0.38 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 57 min ago | 0.39 KB
Untitled
C# | 1 hour ago | 0.42 KB
Untitled
C# | 1 hour ago | 0.57 KB
"Servo Control" rev_04
Arduino | 1 hour ago | 2.91 KB
Control Servos rev_03
Arduino | 1 hour ago | 2.91 KB
Untitled
C# | 1 hour ago | 0.61 KB
Untitled
C# | 1 hour ago | 0.74 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!