제출 #738369

#제출 시각아이디문제언어결과실행 시간메모리
738369Elvin_Fritl전선 연결 (IOI17_wiring)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; #include "wiring.h" long long min_total_length(vector<int> r, vector<int> b){ set<pair<int,int>>s; vector<int>chek((int)b.size()*2 +1,0); for(int i=0;i<(int)r.size();i++){ b[r[i]]=1; s.insert({r[i],1}); } int j=0,n=(int)b.size()+(int)r.size(); long long res=0; for(int i=0;i<(int)b.size();i++){ res+=abs(b[i] - s.begin()->first); if(s.size()>1) s.erase(s.begin()); } return res; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:12:9: warning: unused variable 'j' [-Wunused-variable]
   12 |     int j=0,n=(int)b.size()+(int)r.size();
      |         ^
wiring.cpp:12:13: warning: unused variable 'n' [-Wunused-variable]
   12 |     int j=0,n=(int)b.size()+(int)r.size();
      |             ^
#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...