【Codeforces Round #428 (Div. 2) A】Arya and Bran
and Codeforces div round
2023-09-14 09:03:49 时间
傻逼题
#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ms(x,y) memset(x,y,sizeof x)
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rs(x) scanf("%s",x+1)
#define oi(x) printf("%d",x)
#define ol(x) printf("%lld",x)
#define oc putchar(' ')
#define os(x) printf(x)
#define all(x) x.begin(),x.end()
#define Open() freopen("F:\\rush.txt","r",stdin)
#define Close() ios::sync_with_stdio(0)
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);
const int N = 110;
int n,k;
int main(){
//Open();
//Close();
ri(n),ri(k);
int now = 0,cur = 0;
rep1(i,1,n){
int x;
ri(x);
cur+=x;
now += min(cur,8);
cur -= min(cur,8);
if (now >= k){
oi(i);puts("");
return 0;
}
}
puts("-1");
return 0;
}
相关文章
- Codeforces Round #326 (Div. 2) B. Pasha and Phone C. Duff and Weight Lifting
- 【Codeforces Round #223 (Div. 1) C】Sereja and Brackets
- 【Codeforces Round #635 (Div. 2) E】Kaavi and Magic Spell
- 【Codeforces Round #635 (Div. 2) C】Linova and Kingdom
- 【Codeforces 1108E1】Array and Segments (Easy version)
- 【Codeforces 342A】Xenia and Divisors
- 【Codeforces Round #465 (Div. 2) C】Fifa and Fafa
- 【Codeforces Round #457 (Div. 2) C】Jamie and Interesting Graph
- 【Codeforces Round #447 (Div. 2) B】Ralph And His Magic Field
- 【Codeforces Round #299 (Div. 2) E】Tavas and Pashmaks
- 【Codeforces Round #299 (Div. 2) D】Tavas and Malekas
- 【Codeforces Round #442 (Div. 2) B】Nikita and string
- 【22.48%】【codeforces 689D】Friends and Subsequences
- 【28.57%】【codeforces 711E】ZS and The Birthday Paradox
- 【codeforces 776B】Sherlock and his girlfriend
- 【codeforces 750A】New Year and Hurry
- 【codeforces 546E】Soldier and Traveling
- 【codeforces 755E】PolandBall and White-Red graph
- 【codeforces 510A】Fox And Snake
- 【codeforces 515D】Drazil and Tiles
- 【codeforces 515C】Drazil and Factorial
- 【Codeforces Round #429 (Div. 1) B】Leha and another game about graph
- 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory
- 【codeforces 449C】Jzzhu and Apples
- 【codeforces 812C】Sagheer and Nubian Market
- Codeforces Round #252 (Div. 2) B. Valera and Fruits(模拟)
- Codeforces Round #253 (Div. 1) B. Andrey and Problem
- C. Arthur and Table(Codeforces Round #311 (Div. 2) 贪心)
- Codeforces Round #311 (Div. 2) E - Ann and Half-Palindrome(字典树+dp)
- Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combine