B. Worms time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms such…
http://codeforces.com/problemset/problem/474/B B. Worms time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Ma…
It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms such that i-th pile contains ai worms. He labeled all these worms with consecutive integers: worms in first pile are label…
474B Worms time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms su…
题意:给定 n 堆数,然后有 m 个话询问,问你在哪一堆里. 析:这个题是一个二分题,但是有一个函数,可以代替写二分,lower_bound. 代码如下: #include<bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 1e5 + 5; int a[maxn]; int main(){ int n, m; cin >> n; for(int i = 1; i <= n; +…