Try   HackMD

zj c875 裝置藝術

#include <bits/stdc++.h> using namespace std; int main(){ int a, b, c; cin>>a>>b>>c; int lim = c/b; int h[a]; priority_queue< pair<int, int> > cans; // {height, place} for(int i=0; i<a; i++){ int can; cin>>can; h[i] = can; cans.push( {-can, i} ); // input negative height so the shorter ones will be favored } sort(cans.begin(), cans.end()); for(int i=0; i<a; i++){ } }