제출 #1078859

#제출 시각아이디문제언어결과실행 시간메모리
1078859Muhammad_Aneeq카니발 티켓 (IOI20_tickets)C++17
11 / 100
1 ms604 KiB
#include <vector> #include <set> #include <algorithm> using namespace std; void allocate_tickets( vector<vector<int>> _x); long long find_maximum(int k, vector<vector<int>> d) { int n=d.size(),m=d[0].size(); if (m==1) { vector<vector<int>>ans=d; vector<int>f; for (int i=0;i<n;i++) { ans[i][0]=0; f.push_back(d[i][0]); } allocate_tickets(ans); sort(begin(f),end(f)); long long z=0; for (int i=0;i<n;i++) z+=abs(f[i]-f[n/2]); return z; } if (k==1) { pair<int,int>a[n]; for (int i=0;i<n;i++) a[i].first=d[i][0],a[i].second=d[i].back(); long long ans=0; } return 0; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:30:13: warning: unused variable 'ans' [-Wunused-variable]
   30 |   long long ans=0;
      |             ^~~
#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...