제출 #1045705

#제출 시각아이디문제언어결과실행 시간메모리
1045705LittleOrange전선 연결 (IOI17_wiring)C++17
0 / 100
0 ms348 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; using ll = long long; long long min_total_length(std::vector<int> r, std::vector<int> b) { ll n = r.size(),m = b.size(); ll c = min(c,m); ll ret = 0; for(ll i = 0;i<c;i++){ ret += b[i]-r[i+n-c]; } if (n>m){ for(ll i = 0;i<n-m;i++){ ret += b[0] - r[i]; } } if(m>n){ for(ll i = n;i<m;i++){ ret += b[i] - r.back(); } } return ret; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:7:5: warning: 'c' is used uninitialized in this function [-Wuninitialized]
    7 |  ll c = min(c,m);
      |     ^
#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...