QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#524544 | #4564. Digital Circuit | kimmoqt | 0 | 30ms | 4316kb | C++20 | 691b | 2024-08-19 19:26:54 | 2024-08-19 19:26:54 |
Judging History
answer
#include "circuit.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MX=2e5+5,mod=1e9+2022;
ll cnt=0, p=0, cur=1;
int N,M;
vector<int> A;
void init(int N, int M, std::vector<int> P, std::vector<int> A) {
::N=N, ::M=M, ::A=A;
cnt=0,p=0;
p=1;
int n=N;
while(n>1) {
n/=2;
p*=2;
}
for(int i=0;i<p;i++) {
cur=cur*2%mod;
}
for(int i=0;i<A.size();i++) cnt+=A[i];
}
int count_ways(int L, int R) {
L-=N;
cnt-=A[L];
A[L]^=1;
cnt+=A[L];
return cur*cnt%mod;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3848kb
input:
1 2 -1 0 0 0 0 1 1 2 2 1 2 2 2 1 2 -1 -1 -2 -2
output:
2 4 2 0 2
result:
wrong answer 3rd lines differ - expected: '1', found: '2'
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
input:
1 2 -1 0 0 0 0 1 1 2 2 1 2 2 2 1 2 -1 -1 -2 -2
output:
2 4 2 0 2
result:
wrong answer 3rd lines differ - expected: '1', found: '2'
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Wrong Answer
Test #43:
score: 0
Wrong Answer
time: 30ms
memory: 4316kb
input:
32767 32768 -1 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50...
output:
963123668 457515822 963123668 468729492 974337338 468729492 963123668 468729492 963123668 468729492 974337338 468729492 963123668 457515822 951909998 446302152 951909998 457515822 963123668 457515822 951909998 457515822 963123668 468729492 974337338 468729492 963123668 457515822 951909998 446302152 ...
result:
wrong answer 3rd lines differ - expected: '431985922', found: '963123668'
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #2:
0%
Subtask #7:
score: 0
Skipped
Dependency #3:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
0%