제출 #588571

#제출 시각아이디문제언어결과실행 시간메모리
588571LIF카니발 티켓 (IOI20_tickets)C++14
0 / 100
1 ms340 KiB
#include "tickets.h" #include <vector> #include<bits/stdc++.h> using namespace std; bool cmp(int x,int y) { return x<y; } long long find_maximum(int k, std::vector<std::vector<int> > x) { int xx = x[0][0]; int mm = x[0].size(); //find the m; int n = x.size(); vector< vector<int> > s; int sum =0; if(mm==1) { for(int i=0;i<n;i++) { vector<int> q; q.push_back(0); s.push_back(q); } int a[20005]; for(int i=0;i<n;i++) { a[i] = x[i][0]; } sort(a,a+n); int ans = a[n/2-1]+a[n/2]; ans /=2; for(int i=0;i<n;i++) { sum += abs(ans - a[i]); } } allocate_tickets(s); return sum; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:10:6: warning: unused variable 'xx' [-Wunused-variable]
   10 |  int xx = x[0][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...