제출 #622667

#제출 시각아이디문제언어결과실행 시간메모리
622667Dremix10전선 연결 (IOI17_wiring)C++17
13 / 100
26 ms3788 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll,ll> pl; #define F first #define S second #define all(x) (x).begin(),(x).end() #ifdef dremix #define p(x) cerr<<#x<<" = "<<x<<endl; #define p2(x,y) cerr<<#x<<" , "<<#y<<" = "<<x<<" , "<<y<<endl; #define pp(x) cerr<<#x<<" = "<<x.F<<"-"<<x.S<<endl; #define pv(x) cerr<<#x<<" = {";for(auto v : x)cerr<<v<<", ";cerr<<"}"<<endl; #define ppv(x) cerr<<#x<<" = {";for(auto v : x)cerr<<v.F<<"-"<<v.S<<", ";cerr<<"}"<<endl; #else #define p(x) {} #define p2(x,y) {} #define pp(x) {} #define pv(x) {} #define ppv(x) {} #endif const int N = 3e5+5; const int MOD = 1e9+7; const ll INF = 1e18+5; void solve(int i){ } long long min_total_length(std::vector<int> r, std::vector<int> b) { int i,j,k; int n = r.size(); int m = b.size(); j=0; ll ans = 0; for(i=0;i<n;i++){ if(j==m)break; ans += b[j] - r[i]; j++; } for(;i<n;i++){ ans += b[0] - r[i]; } for(;j<m;j++){ ans += b[j] - r[n-1]; } return ans; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:33:10: warning: unused variable 'k' [-Wunused-variable]
   33 |  int i,j,k;
      |          ^
#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...