結果
問題 | No.2593 Reorder and Mod 120 |
ユーザー |
![]() |
提出日時 | 2023-12-24 20:06:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 999 bytes |
コンパイル時間 | 3,762 ms |
コンパイル使用メモリ | 254,972 KB |
最終ジャッジ日時 | 2025-02-18 14:17:05 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 21 WA * 5 |
ソースコード
#include <bits/stdc++.h>using namespace std;using namespace chrono;#if __has_include(<atcoder/all>)#include <atcoder/all>using namespace atcoder;#endifint main(){int64_t n;string s;cin >> n >> s;vector<int64_t> cnt(10, 0);for (auto &&c : s){cnt[c - '0']++;}set<int64_t> st;for (int64_t a = 0; a < 10; a++){for (int64_t b = 0; b < 10; b++){for (int64_t c = 0; c < 10; c++){cnt[a]--;cnt[b]--;cnt[c]--;if (cnt[a] < 0 || cnt[b] < 0 || cnt[c] < 0){cnt[a]++;cnt[b]++;cnt[c]++;continue;}st.insert((100 * a + 10 * b + c) % 40);cnt[a]++;cnt[b]++;cnt[c]++;}}}cout << st.size() << endl;return 0;}