Files
python/TangDou/JiShuanKe/2023-03-06/T3667.cpp

24 lines
520 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#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;
}