제출 #1119907

#제출 시각아이디문제언어결과실행 시간메모리
1119907dsyz카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; using ll = long long; #define MAXN (1000005) long long find_maximum(int k, vector<vector<int>> x) { ll N = x.size(); ll M = x[0].size(); vector<ll> all; for(ll i = 0;i < N;i++){ for(ll j = 0;j < N;j++){ all.push_back(x[i][j]); } } sort(all.begin(),all.end()); pair<ll,ll> best = {-1,-1}; for(auto b : all){ ll sum = 0; for(ll i = 0;i < N;i++){ sum += abs(b - x[i][0]); } best = max(best,{sum,b}); } vector<vector<int> > ans; for(ll i = 0;i < N;i++){ vector<int> row; row.push_back(0); ans.push_back(row); } allocate_tickets(ans); return best.first; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:9:5: warning: unused variable 'M' [-Wunused-variable]
    9 |  ll 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...