Submission #836048

# Submission time Handle Problem Language Result Execution time Memory
836048 2023-08-24T06:30:27 Z Trumling Digital Circuit (IOI22_circuit) C++17
0 / 100
13 ms 1736 KB
#include "circuit.h"
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define pb push_back
#define INF 9999999999999999

vector<ll>pre;
ll n;
void init(int N, int M, std::vector<int> P, std::vector<int> A) 
{
n=M;

pre.assign(M,0);

for(int i=0;i<M;i++)
pre[i]==((i==0)?0:pre[i-1])+A[i];

}

int count_ways(int L, int R) 
{
  ll curr=pre[n-1]-pre[R] + ((L==0)?0:pre[L-1]);
  curr+=(R-L+1)-(pre[R]-((L==0)?0:pre[L-1]));

  return curr;
}

Compilation message

circuit.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>)':
circuit.cpp:21:7: warning: value computed is not used [-Wunused-value]
   21 | pre[i]==((i==0)?0:pre[i-1])+A[i];
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 2nd lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 2nd lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 2nd lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 1736 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 1736 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 2nd lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 2nd lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 2nd lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -