제출 #420461

#제출 시각아이디문제언어결과실행 시간메모리
420461Belgutei카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms296 KiB
#include "tickets.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define mk make_pair ll sum[1505],ans=1e18; long long find_maximum(int k, std::vector<std::vector<int> > x) { int n = x.size(); int m = x[0].size(); std::vector<std::vector<int> > answer; if(m==1){ // subtask 1 for(int i=0; i<n; i++){ sum[i]+=x[i][0]; if(i!=0) sum[i]+=sum[i-1]; } for(int i=0; i<n; i++){ // x[i][0] ll cnt=x[i][0]*(i+1)-sum[i]; cnt+=sum[n-1]-sum[i]-(n-i-1)*x[i][0]; ans=min(ans,cnt); } answer.resize(n); for(int i=0; i<n; i++){ answer[i].resize(m); } for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ answer[i][j]=0; } } allocate_tickets(answer); return ans; } allocate_tickets(answer); return 1; }
#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...