sort関数の使用
496 ワード
比較関数comを定義し、降順に変更します.
#include
#include
std using namespace;
bool compare(int a,int b){
return a S;
sort(S.begin(),s.end(),compare);
#include
#include
std using namespace;
bool compare(int a,int b){
return a S;
sort(S.begin(),s.end(),compare);