結果

問題 No.2593 Reorder and Mod 120
コンテスト
ユーザー あるふぁ
提出日時 2026-09-22 21:38:05
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 411 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,766 ms
コンパイル使用メモリ 355,248 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2026-09-22 21:38:11
合計ジャッジ時間 5,623 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    string S;
    cin >> N >> S;
    vector<int> C(10, 0);
    for (char c : S) C[c-'0']++;

    int ans = 0;
    for (int n = 0; n < 1000; n++){
        auto c = C;
        bool ok = true;
        c[n%10]--, c[(n/10)%10]--, c[n/100]--;
        for (int x : c) if (x < 0) ok = false;
        if (ok) ans++;
    }

    cout << ans << endl;
}
0