結果
| 問題 | No.1644 Eight Digits |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-13 21:51:11 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 343 bytes |
| 記録 | |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 71,748 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-19 19:42:44 |
| 合計ジャッジ時間 | 2,435 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <cstdio>
#include <algorithm>
int main() {
int a, count = 0;
int b[] = {1, 2, 3, 4, 5, 6, 7, 8};
std::scanf("%d", &a);
do {
int n = 0, d = 1;
for(int i = 0; i < 8; ++i) {
n += b[i] * d;
d *= 10;
}
if(n % a == 0) ++count;
} while(std::next_permutation(b, b + 8));
std::printf("%d\n", count);
}