結果
| 問題 |
No.1644 Eight Digits
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-13 21:51:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 343 bytes |
| コンパイル時間 | 520 ms |
| コンパイル使用メモリ | 57,584 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-03 18:28:17 |
| 合計ジャッジ時間 | 1,625 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}