-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProblemL.cpp
42 lines (40 loc) · 926 Bytes
/
ProblemL.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<bits/stdc++.h>
using namespace std;
int main() {
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
int n;
cin >> n ;
int A[n];
for(int i = 0 ;i < n ; i ++) {
cin >> A[i];
}
string s;
cin >> s;
bool flag = false;
for(int i = 0 ;i < s.size() ; i ++) {
if(flag) {
cout << 0 << endl;
}else {
long long int sum_2 =0;
if(s[i] == '0') {
for(auto &el : A ) {
if(el % 2 == 0) {
el /= 2;
}
}
}else {
// ler
}
for(auto el : A)
{
sum_2 +=el;
}
if(sum_2 == 0) {
flag = true;
}
cout << sum_2 << endl;
}
}
// 10^5 /2 /2 /2 log(N)
}