QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#149165 | #4564. Digital Circuit | juanda_o_182 | Compile Error | / | / | C++23 | 613b | 2023-08-24 04:36:09 | 2023-08-24 04:36:11 |
Judging History
answer
#include "circuit.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int n,m,on;
vector<int>p;
vector<int>a;
void init(int N, int M, vector<int> P, vector<int> A) {
N=n;
M=m;
for(int i=0;i<int(P.size());i++){
p.pb(P[i]);
}
for(int i=0;i<int(A.size());i++){
a.pb(A[i]);
if(A[i]==1){
on+=1;
}
}
}
int count_ways(int L, int R) {
L-=1;
R-=1;
if (a[L]==0){
a[L]=1;
on+=1;
}else{
a[L]=0;
on-=1
}
if (a[R]==0){
a[R]=1;
on+=1;
}else{
a[R]=0;
on-=1
}
return on;
}
Details
answer.code: In function ‘int count_ways(int, int)’: answer.code:35:10: error: expected ‘;’ before ‘}’ token 35 | on-=1 | ^ | ; 36 | } | ~ answer.code:42:10: error: expected ‘;’ before ‘}’ token 42 | on-=1 | ^ | ; 43 | } | ~