Submission #638454

# Submission time Handle Problem Language Result Execution time Memory
638454 2022-09-06T06:51:53 Z aris12345678 Digital Circuit (IOI22_circuit) C++17
0 / 100
2566 ms 1484 KB
#include "circuit.h"
#include <bits/stdc++.h>
using namespace std;

int N, M;
vector<int> P, A;

void init(int n, int m, vector<int> p, vector<int> a) {
    N = n, M = m;
    for(int i = 0; i < N+M; i++)
        P.push_back(p[i]);
    for(int i = 0; i < M; i++)
        A.push_back(a[i]);
}

int count_ways(int l, int r) {
    l--, r--;
    for(int i = l; i < r; i++) {
        if(A[i] == 1)
            A[i] = 0;
        else
            A[i] = 1;
    }
    int cnt = 0;
    for(int i = 0; i < M; i++) {
        if(A[i] == 1)
            cnt++;
    }
    return cnt;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2566 ms 1484 KB 1st lines differ - on the 1st token, expected: '431985922', found: '16401'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2566 ms 1484 KB 1st lines differ - on the 1st token, expected: '431985922', found: '16401'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -