Submission #944705

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9447052024-03-13 04:05:42KG07Digital Circuit (IOI22_circuit)C++17
0 / 100
417 ms18380 KiB
#include "circuit.h"
#include <bits/stdc++.h>
using namespace std;
struct segment_tree{
int n, m;
long long tree_size[200002], sum[400004], counting[400004], multiplier[100001];
bool toggle[400004];
vector<int> child[100001], A;
vector<long long> left_product[100001], right_product[100001];
void init(int N, int M, vector<int> p, vector<int> a){
n = N;
m = M;
A = a;
tree_size[0] = 1LL;
for(int i = 1; i < N+M; i++){
tree_size[i] = 1LL;
child[p[i]].push_back(i);
left_product[p[i]].push_back(0LL);
right_product[p[i]].push_back(0LL);
}
}
void calculate_size(int N){
if(N >= n)return;
tree_size[N] = (long long) child[N].size();
for(int i = 0; i < child[N].size(); i++){
calculate_size(child[N][i]);
left_product[N][i] = tree_size[child[N][i]];
right_product[N][i] = tree_size[child[N][i]];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

circuit.cpp: In member function 'void segment_tree::calculate_size(int)':
circuit.cpp:27:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for(int i = 0; i < child[N].size(); i++){
      |                        ~~^~~~~~~~~~~~~~~~~
circuit.cpp:34:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |         for(int i = 1; i < child[N].size(); i++){
      |                        ~~^~~~~~~~~~~~~~~~~
circuit.cpp: In member function 'void segment_tree::calculate_multiplier(int, long long int)':
circuit.cpp:52:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |         for(int i = 0; i < child[N].size(); i++){
      |                        ~~^~~~~~~~~~~~~~~~~
circuit.cpp:54:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |             else if(i+1==child[N].size())calculate_multiplier(child[N][i], (M*left_product[N][child[N].size()-2])%1000002022);
      |                     ~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...