結果
| 問題 |
No.2593 Reorder and Mod 120
|
| コンテスト | |
| ユーザー |
chro_96
|
| 提出日時 | 2023-12-21 23:25:56 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 680 bytes |
| コンパイル時間 | 505 ms |
| コンパイル使用メモリ | 30,848 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-27 11:10:23 |
| 合計ジャッジ時間 | 1,283 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 21 WA * 5 |
ソースコード
#include <stdio.h>
int main () {
int n = 0;
char s[200001] = "";
int res = 0;
int ans = 0;
int cnt[10] = {};
int flg[40] = {};
res = scanf("%d", &n);
res = scanf("%s", s);
for (int i = 0; i < n; i++) {
cnt[(int)(s[i]-'0')]++;
}
for (int i = 0; i < 1000; i++) {
int tmpcnt[10] = {};
int tmp = i;
int is_ok = 1;
tmpcnt[i%10]++;
tmpcnt[(i/10)%10]++;
tmpcnt[i/100]++;
for (int j = 0; j < 10; j++) {
if (tmpcnt[j] > cnt[j]) {
is_ok = 0;
}
}
if (is_ok > 0) {
flg[i%40] = 1;
}
}
for (int i = 0; i < 40; i++) {
ans += flg[i];
}
printf("%d\n", ans);
return 0;
}
chro_96