제출 #1252023

#제출 시각아이디문제언어결과실행 시간메모리
1252023fahmid_rngFinding Routers (IOI20_routers)C++20
컴파일 에러
0 ms0 KiB
#incldue<bits/stdc++.h> #include "routers.h" using namespace std; std::vector<int> find_routers(int l, int n, int q) { vector<int> p(n); p[0]=0; int last=use_detector(1),l=1; for(int i=2;i<=n;){ int curr=use_detector(i); if(curr==last+1){ p[l]=2*(i-1)-p[l-1]; l++; i=p[l]+1; } else{i++;} last=curr; } return p; }

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

routers.cpp:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits/stdc++.h>
      |  ^~~~~~~
      |  include
routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:7:30: error: declaration of 'int l' shadows a parameter
    7 |     int last=use_detector(1),l=1;
      |                              ^
routers.cpp:4:35: note: 'int l' previously declared here
    4 | std::vector<int> find_routers(int l, int n, int q) {
      |                               ~~~~^