제출 #976614

#제출 시각아이디문제언어결과실행 시간메모리
976614rakhim_ovaCyberland (APIO23_cyberland)C++17
0 / 100
18 ms2136 KiB
#include "cyberland.h" #include <bits/stdc++.h> using namespace std; using ll = long long; double solve(int N, int M, int K, int H, std::vector<int> x, std::vector<int> y, std::vector<int> c, std::vector<int> arr) { int n=N, m=M, k=K, h=H; if(n>3){ return -1; } if(m==0) return -1; if(m==2 && ((x[0]!=0 && x[1]!=0 && y[0]!=0 && y[1]!=0) || (x[0]!=h && x[1]!=h && y[0]!=h && y[1]!=h))) return -1; if(n==2 || m==1){ return c[0]; } if(x[0]==0 && y[0]==h){ return c[0]; } if(x[1]==0 && y[1]==h){ return c[1]; } if(x[0]==h && y[0]==0){ return c[0]; } if(x[1]==h && y[1]==0){ return c[1]; } if(x[0]>y[0]) swap(x[0], y[0]); if(x[1]>y[1]) swap(x[1], y[1]); if(x[0]==0){ if(x[1]==y[0] && y[1]==h){ if(arr[y[0]]==0){ return c[1]; } else if(arr[y[0]]==1){ return c[0]+c[1]; } else{ double res=(double)c[0]/2+c[1]; return res; } } else{ if(arr[y[1]]==0){ return c[1]; } else if(arr[y[1]]==1){ return c[0]+c[1]; } else{ double res=(double)c[0]/2+c[1]; return res; } } } else{ if(x[0]==y[1] && y[0]==h){ if(arr[y[1]]==0){ return c[0]; } else if(arr[y[1]]==1){ return c[0]+c[1]; } else{ double res=(double)c[1]/2+c[0]; return res; } } else{ if(arr[y[0]]==0){ return c[0]; } else if(arr[y[0]]==1){ return c[0]+c[1]; } else{ double res=(double)c[1]/2+c[0]; return res; } } } return -1; }

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

cyberland.cpp: In function 'double solve(int, int, int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
cyberland.cpp:10:19: warning: unused variable 'k' [-Wunused-variable]
   10 |     int n=N, m=M, k=K, h=H;
      |                   ^
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...