Submission #140097

#TimeUsernameProblemLanguageResultExecution timeMemory
140097SirCenessScales (IOI15_scales)C++14
45.45 / 100
3 ms504 KiB
#include "scales.h" #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define inside sl<=l&&r<=sr #define outside r<sl||sr<l #define orta ((l+r)>>1) #define INF 1000000009 #define mod 1000000007 #define ppair(x); cerr << "(" << x.first << ", " << x.second << ")\n"; #define bas(x) #x << ": " << x << " " #define prarr(x, n); cerr << #x << ": "; for(int qsd = 0; qsd < n; qsd++) cerr << x[qsd] << " "; cerr << "\n"; #define prarrv(x); cerr << #x << ": "; for(int qsd = 0; qsd < (int)x.size(); qsd++) cerr << x[qsd] << " "; cerr << "\n"; using namespace std; typedef long long ll; void init(int T) { /* ... */ } void sil(vector<int>& arr, int val){ for (int i = 0; i < arr.size()-1; i++){ if (arr[i] == val){ swap(arr[i], arr[arr.size()-1]); break; } } arr.pop_back(); } void orderCoins() { /* ... */ int W[] = {1, 2, 3, 4, 5, 6}; vector<int> nums; for (int i = 0; i < 6; i++) nums.pb(i+1); for (int i = 0; i < 3; i++){ int l = getLightest(nums[0], nums[1], nums[2]); if (nums.size() > 4) l = getLightest(l, nums[3], nums[4]); else if (nums.size() > 3){ int fake = nums[0]; if (fake == l) fake = nums[1]; l = getLightest(l, fake, nums[3]); } if (nums.size() > 5) { int fake = nums[0]; if (fake == l) fake = nums[1]; l = getLightest(l, fake, nums[5]); } sil(nums, l); W[i] = l; } W[3] = getLightest(nums[0], nums[1], nums[2]); W[4] = getMedian(nums[0], nums[1], nums[2]); sil(nums, W[3]); sil(nums, W[4]); W[5] = nums[0]; answer(W); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:18:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void sil(std::vector<int>&, int)':
scales.cpp:23:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < arr.size()-1; i++){
                  ~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...