Submission #301471

#TimeUsernameProblemLanguageResultExecution timeMemory
301471qpwoeirutCarnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms768 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<vector<int>> vvi; ll N, M; ll sub1(int K, const vvi& x) { vvi ans(N, vector<int>(M, -1)); vector<int> nums(N); for (int i=0; i<N; ++i) { nums[i] = x[i][0]; ans[i][0] = 0; } sort(nums.begin(), nums.end()); int med = (nums.size()) / 2; ll sum = 0; for (int i=0; i<N; ++i) { sum += abs(nums[i] - nums[med]); } allocate_tickets(ans); return sum; } ll sub2(int K, const vvi& x) { vvi ans(N, vector<int>(M, -1)); } ll sub3(int K, const vvi& x) { vvi ans(N, vector<int>(M, -1)); for (int i=0; i<N; ++i) { } } long long find_maximum(int K, std::vector<std::vector<int>> x) { N = x.size(); M = x[0].size(); if (M == 1) { return sub1(K, x); } //if (K == 0) { // return sub2(K, x); //} set<int> vals; for (int i=0; i<N; ++i) { for (int j=0; j<M; ++j) { vals.insert(x[i][j]); } } //if (vals.size() == 2 && vals.count(0) && vals.count(1)) { // return sub3(K, x); //} return 0; }

Compilation message (stderr)

tickets.cpp: In function 'll sub2(int, const vvi&)':
tickets.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
   31 | }
      | ^
tickets.cpp: In function 'll sub3(int, const vvi&)':
tickets.cpp:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
   38 | }
      | ^
#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...