Skip to content

Commit

Permalink
수들의 합
Browse files Browse the repository at this point in the history
  • Loading branch information
yewon-yw authored Apr 20, 2022
1 parent 8481a5e commit af959f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions greedy_algorithm/1789.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <iostream>
using namespace std;

int main() {
long long s, i = 1;
cin >> s;
while (1) {
s -= i;
if (s <= i) break;
i++;
}
cout << i;
}

0 comments on commit af959f3

Please sign in to comment.