-
Notifications
You must be signed in to change notification settings - Fork 0
Home
hachi-88 edited this page Jun 22, 2019
·
10 revisions
a * b / gcd(a, b)
long gcd(long a, long b)
{
if(a < b) {
swap(a, b);
}
long r = a % b;
while(r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
sort(c, c + m, [](city a, city b){ return a.i < b.i; });
struct data_t {
int num;
string str;
// 最後のconstを忘れると"instantiated from here"というエラーが出てコンパイルできないので注意
bool operator<( const data_t& right ) const {
return num == right.num ? str < right.str : num < right.num;
}
};
sort(a, a + N, greater<int>());
cout << setw(6) << setfill('0') << c[i].p;
unordered_map<string, int> cards;
for (auto card : cards) {
max = std::max(max, card.second);
}