1 条题解

  • 0
    @ 2026-4-2 19:07:52

    #include<bits/stdc++.h> using namespace std; int a[110]; bool baobo(int x, int y){ int c = x * 6; int d = y * 6; if (c % 10 < d % 10){ return 1; }else if (c % 10 == d % 10){ if (x > y){ return 1; }else { return 0; } }else { return 0; }

    } int main (){ int n; cin >> n; for (int i = 0;i < n;i++){ cin >> a[i]; } sort(a,a + n,baobo); for (int i = 0;i < n;i++){ cout << a[i] << " "; } return 0; }

    • 1

    信息

    ID
    117
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    (无)
    递交数
    83
    已通过
    28
    上传者