Submission #771609

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7716092023-07-03 07:20:03ttamx자동 인형 (IOI18_doll)C++14
47 / 100
89 ms11040 KiB
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
void create_circuit(int m,vector<int> a) {
int n = a.size();
vector<int> c(m+1);
vector<int> lg(n+1);
for(int i=2;i<=n;i++)lg[i]=lg[i/2]+1;
vector<int> x,y;
auto add=[&](int u,int v){
x.emplace_back(u);
y.emplace_back(v);
return -x.size();
};
a.push_back(0);
int sz=n;
int lv=lg[sz-1]+1;
vector<int> res;
int cnt=1<<(lv-1);
int tar=-(x.size()+(1<<lv)-1);
int st=(1<<lv)-sz+1;
vector<int> pos(1<<lv);
for(int j=0;j<1<<lv;j++){
for(int k=0;k<lv;k++)if((j>>k)&1)pos[j]+=1<<(lv-k-1);
pos[j]++;
}
for(int k=0;k<cnt;k++){
int u=pos[k*2],v=pos[k*2+1];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:35:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |   for(int i=0;i<res.size();i+=2)tmp.emplace_back(add(res[i],res[i+1]));
      |               ~^~~~~~~~~~~
#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...