'commit'
This commit is contained in:
24
TangDou/JiShuanKe/2023-03-06/T3667.cpp
Normal file
24
TangDou/JiShuanKe/2023-03-06/T3667.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
const int N = 1e5 + 10;
|
||||
typedef long long LL;
|
||||
LL a[N], b[N], s[N];
|
||||
LL n, m;
|
||||
LL cnt;
|
||||
int main() {
|
||||
freopen("city.in", "r", stdin);
|
||||
freopen("city.out", "w", stdout);
|
||||
cin >> n >> m;
|
||||
for (int i = 1; i <= n; i++) cin >> a[i];
|
||||
for (int i = 1; i <= n; i++) cin >> b[i];
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cnt += a[i];
|
||||
if (cnt >= m) {
|
||||
cout << b[i] << endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user