제출 #778061

#제출 시각아이디문제언어결과실행 시간메모리
778061Jarif_Rahman저울 (IOI15_scales)C++17
19.61 / 100
1 ms280 KiB
#include "scales.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; void init(int T){ } template<typename it, typename t> void merge_sort(it l, it r, t && comp){ int n = r-l; if(n <= 1) return; int md = n/2; merge_sort(l, l+md, comp); merge_sort(l+md, r, comp); typename remove_reference<decltype(*l)>::type* sth = new typename remove_reference<decltype(*l)>::type[n]; for(int i = 0; i < n; i++) sth[i] = *(l+i); merge(sth, sth+md, sth+md, sth+n, l, comp); delete[] sth; } void orderCoins(){ int w[6] = {1, 2, 3, 4, 5, 6}; /* determine heaviest */{ int a = getHeaviest(1, 2, 3), b = getHeaviest(4, 5, 6); int c = 1; if(c == a) c = 2; int d = getHeaviest(a, b, c); if(d != 6) swap(w[d-1], w[5]); } sort(w, w+5, [&](int a, int b){ return getLightest(a, b, w[5]) == a; }); answer(w); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:10:15: warning: unused parameter 'T' [-Wunused-parameter]
   10 | void init(int T){
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...