https://codeforces.com/contest/977/problem/D
void solve(){
int n;
cin >> n;
vector<pair<int, long long>> a(n);
for (auto&[x, y] : a){
cin >> y;
x = 0;
long long temp = y;
while (temp % 3 == 0){
x --;
temp /= 3;
}
}
sort(a.begin(), a.end(), [&](const pair<int, long long>& i, const pair<int ,long long>& j){
return i.first != j.first ? i.first < j.first : i.second < j.second;
});
for (int i = 0; i < n; ++i){
cout << a[i].second << " \n"[i == n - 1];
}
}
标签:Divide,temp,int,two,pair,second,multiply,first
From: https://www.cnblogs.com/yxcblogs/p/18069494