제출 #542817

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5428172022-03-28 06:36:21Sho10자동 인형 (IOI18_doll)C++17
0 / 100
164 ms262144 KiB
#include "doll.h"
#include <iostream>
#include <vector>
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
int const nmax = 400000;
int leftp[nmax+1];
int rightp[nmax+1];
int cng[nmax+1];
int switches=0,added=0;
int creategraph(int nodes,int realnodes){
if(realnodes==0){
return -1;
}
if(nodes==1){
return (added++);
}
int centr=-(++switches);
leftp[-centr]=creategraph(nodes/2,realnodes-MIN(nodes/2,realnodes));
rightp[-centr]=creategraph(nodes/2,MIN(nodes/2,realnodes));
return centr;
}
std::vector<int>dest;
int real[nmax+1];
int dfs(int node){
if(node>=0){
return node;
}else {
cng[-node]=(!cng[-node]);
if(cng[-node]==1){
dfs(leftp[-node]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:41:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 | for(int i=0;i<A.size();i++)
      |             ~^~~~~~~~~
doll.cpp:47:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 | while(nodes<dest.size()){
      |       ~~~~~^~~~~~~~~~~~
doll.cpp:51:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   51 | for(int i=0;i<dest.size();i++)
      |             ~^~~~~~~~~~~~
doll.cpp: In function 'int dfs(int)':
doll.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
#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...