結果
問題 |
No.1644 Eight Digits
|
ユーザー |
|
提出日時 | 2021-08-13 21:27:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 787 ms |
コンパイル使用メモリ | 93,228 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-03 17:09:38 |
合計ジャッジ時間 | 1,868 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <cmath> #include <stdio.h> #include <queue> #include <deque> #include <cstdio> #include <set> #include <map> #include <bitset> #include <stack> #include <cctype> using namespace std; int main() { int k, ans = 0; cin >> k; int a[8] = { 1,2,3,4,5,6,7,8 }; do { int num = 0; for (int i = 0; i < 8; i++) { num *= 10; num += a[i]; } if (num % k == 0) { ans++; } } while (next_permutation(a, a + 8)); cout << ans << endl; }