Submission #60706


ソースコード

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
#include <iostream>
#include <cassert>
using namespace std;
signed main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int N, Q;
cin >> N >> Q;
assert(1 <= N && N <= 2e5);
assert(1 <= Q && Q <= 2e5);
int a[N+1];
a[0] = 1000000000;
for(int i = 1; i <= N; ++i){
int A;
cin >> A;
assert(-1e9 <= A && A <= 1e9);
// a[i]:A_1からA_iまでの最小値
a[i] = min(a[i-1], A);
}
for(int i = 0; i < Q; ++i){
int R;
cin >> R;
assert(1 <= R && R <= N);
cout << a[R] << '\n';
}
return (0);
}

ステータス

項目 データ
問題 1356 - Minimum Value
ユーザー名 ei1903
投稿日時 2020-07-12 23:32:46
言語 C++17
状態 Accepted
得点 30
ソースコード長 656 Byte
最大実行時間 65 ms
最大メモリ使用量 23196 KB

セット

セット 得点 Cases
1 task01 10 / 10 in01*, sample01.txt
2 task02 20 / 20 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01_01.txt AC 19 ms 600 KB
1
2
in01_02.txt AC 26 ms 676 KB
1
2
in01_03.txt AC 17 ms 500 KB
1
2
in01_04.txt AC 19 ms 572 KB
1
2
in01_05.txt AC 18 ms 648 KB
1
2
in01_06.txt AC 19 ms 596 KB
1
2
in01_07.txt AC 21 ms 548 KB
1
2
in01_08.txt AC 20 ms 496 KB
1
2
in01_09.txt AC 26 ms 568 KB
1
2
in01_10.txt AC 15 ms 640 KB
1
2
in01_11.txt AC 28 ms 588 KB
1
2
in01_12.txt AC 19 ms 668 KB
1
2
in01_13.txt AC 18 ms 616 KB
1
2
in02_01.txt AC 41 ms 1592 KB
2
in02_02.txt AC 49 ms 3052 KB
2
in02_03.txt AC 41 ms 3160 KB
2
in02_04.txt AC 57 ms 5444 KB
2
in02_05.txt AC 59 ms 7684 KB
2
in02_06.txt AC 65 ms 9544 KB
2
in02_07.txt AC 56 ms 11916 KB
2
in02_08.txt AC 62 ms 14156 KB
2
in02_09.txt AC 62 ms 16396 KB
2
in02_10.txt AC 58 ms 18512 KB
2
in02_11.txt AC 57 ms 20636 KB
2
in02_12.txt AC 57 ms 22876 KB
2
in02_13.txt AC 52 ms 23196 KB
2
sample01.txt AC 28 ms 22496 KB
1
2