QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387815 | #7758. Painter | berarchegas# | WA | 0ms | 3676kb | C++20 | 1.7kb | 2024-04-12 21:01:21 | 2024-04-12 21:01:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;
const ll INF = 1e14;
const int BSIZE = 1;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<ll> v(n);
for(ll & i :v)
cin >> i;
vector<ll> resp(n), resto(n);
auto score_back =[&](int id) -> ll {
ll sum = 0;
for(int i = id; i >=max(0,id-BSIZE+1); i--){
sum*=2;
sum+=v[i];
}
return sum;
};
auto normalize =[&](ll x){
if(x < 0)
return -1;
if(x > 0)
return 1;
if(x == 0)
return 0;
};
auto print_score =[&](int id){
ll x = resp[id]+resto[id];
if(x < 0)
cout << '-';
if(x > 0)
cout << '+';
if(x == 0)
cout << 0;
};
for(int i = 0; i < n; i++){
resp[i] = score_back(i);
if(i < BSIZE){
print_score(i);
} else {
resp[i]+=resp[i-BSIZE]>>BSIZE;
resto[i] = resto[i-BSIZE];
if(resto[i-BSIZE] != normalize(resp[i])){
resp[i]+=resto[i];
resto[i]*=-1;
}
print_score(i);
}
if(resp[i] % (1ll<<BSIZE)){
resto[i] = normalize(resp[i]);
}
// cerr << "("
}
for(int i = 0; i < n; i++)
cerr << resp[i] << ' ' << resto[i] << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3676kb
input:
7 Circle 0 0 5 * Circle -2 2 1 @ Circle 2 2 1 @ Rectangle 0 -1 0 0 ^ Rectangle -2 -2 2 -2 _ Render -5 -5 5 5 Render -1 0 1 2
output:
0000000
result:
wrong answer 1st lines differ - expected: '.....*.....', found: '0000000'