Submission #56706


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
int fact(int n){
int m;
if (n == 0)
return 1;
m = fact(n - 1);
return n * m;
}
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll a;
cin>>a;
long long flag=0,low=0,high=1000000000+1,mid;
while(high-low>1){
mid=(high+low)/2;
if((mid+1)*mid/2==a){
flag=1;
break;
}
if((mid+1)*mid/2<a){
low=mid;
}
else{
high=mid;
}
}
if(flag==1){
cout<<mid<<'\n';
}
else{
cout<<"Not found..."<<'\n';
}
return(0);
}

ステータス

項目 データ
問題 1212 - ヒト
ユーザー名 ei1918
投稿日時 2019-11-18 18:34:04
言語 C++
状態 Accepted
得点 10
ソースコード長 1324 Byte
最大実行時間 27 ms
最大メモリ使用量 776 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Special01.txt AC 25 ms 600 KB
1
Special02.txt AC 18 ms 428 KB
1
Special03.txt AC 18 ms 384 KB
1
Special04.txt AC 19 ms 468 KB
1
Special05.txt AC 21 ms 424 KB
1
in01.txt AC 20 ms 508 KB
1
in02.txt AC 19 ms 588 KB
1
in03.txt AC 20 ms 548 KB
1
in04.txt AC 18 ms 504 KB
1
in05.txt AC 20 ms 588 KB
1
in06.txt AC 23 ms 668 KB
1
in07.txt AC 21 ms 624 KB
1
in08.txt AC 17 ms 584 KB
1
in09.txt AC 23 ms 544 KB
1
in10.txt AC 22 ms 496 KB
1
in11.txt AC 19 ms 708 KB
1
in12.txt AC 24 ms 540 KB
1
in13.txt AC 21 ms 492 KB
1
in14.txt AC 15 ms 572 KB
1
in15.txt AC 15 ms 524 KB
1
in16.txt AC 19 ms 608 KB
1
in17.txt AC 24 ms 564 KB
1
in18.txt AC 18 ms 520 KB
1
in19.txt AC 17 ms 732 KB
1
in20.txt AC 27 ms 688 KB
1
in21.txt AC 21 ms 776 KB
1
sample01.txt AC 19 ms 728 KB
1
sample02.txt AC 21 ms 684 KB
1
sample03.txt AC 21 ms 640 KB
1