Submission #64432


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<long long> data(n);
for(int i=0;i<n;i++){
cin>>data[i];
}
int m;
cin>>m;
vector<long long> t(m);
for(int i=0;i<m;i++){
cin>>t[i];
}
for(int i=0;i<m;i++){
cout<<upper_bound(data.begin(),data.end(),t[i])-data.begin()<<endl;
}
return(0);
}

ステータス

項目 データ
問題 0738 - プログラミング入門:二分探索
ユーザー名 ei2011
投稿日時 2020-10-22 18:20:24
言語 C++17
状態 Accepted
得点 10
ソースコード長 373 Byte
最大実行時間 392 ms
最大メモリ使用量 11996 KB

セット

セット 得点 Cases
1 Linear Search 2 / 2 Input0[1-5]
2 Binary Search 8 / 8 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 28 ms 600 KB
1
2
Input02 AC 21 ms 696 KB
1
2
Input03 AC 20 ms 664 KB
1
2
Input04 AC 19 ms 632 KB
1
2
Input05 AC 22 ms 600 KB
1
2
Input06 AC 389 ms 9904 KB
2
Input07 AC 392 ms 10488 KB
2
Input08 AC 367 ms 11076 KB
2
Input09 AC 353 ms 11796 KB
2
Input10 AC 346 ms 11996 KB
2