제출 #1082182

#제출 시각아이디문제언어결과실행 시간메모리
1082182wood카니발 티켓 (IOI20_tickets)C++17
11 / 100
1 ms860 KiB
#include "tickets.h" #include <vector> #include <bits/stdc++.h> using namespace std; #define vi vector<int> #define ll long long #define pb push_back long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(), m = x[0].size(); vector<vi> ans; vi p; for(int i = 0; i<n; i++){ ans.pb({0}); p.pb(x[i][0]);} sort(p.begin(),p.end()); ll sum = 0; for(int i =0; i<n; i++) sum+=abs(p[n/2]-p[i]); allocate_tickets(ans); return sum; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:10:23: warning: unused variable 'm' [-Wunused-variable]
   10 |     int n = x.size(), m = x[0].size();
      |                       ^
#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...