题目:https://codeforces.com/problemset/problem/474/B
题意:
题解:
使得每一个号码都可以保存下来(大力出奇迹)
#include <iostream>
using namespace std;
const int N = 1e6 + 5;
int a[N] = {};
int main()
{
int n;
cin >> n;
int cnt = 1;
for (int i = 1; i <= n; i++)
{
int x;
cin >> x;
for (int j = 0; j < x; j++)
a[cnt++] = i;
}
int m;
cin >> m;
while (m--)
{
int y;
cin >> y;
cout << a[y] << endl;
}
}