結果
問題 |
No.1644 Eight Digits
|
ユーザー |
|
提出日時 | 2021-08-14 09:56:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 694 bytes |
コンパイル時間 | 1,439 ms |
コンパイル使用メモリ | 168,212 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 21:33:50 |
合計ジャッジ時間 | 2,111 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
/** * author: ytsmash * created: 14.08.2021 09:15:35 **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) x.begin(), x.end() const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); using P = pair<int, int>; int main() { int K; cin >> K; vector<int> a(8); iota(all(a), 1); int ans = 0; do { int check = 0; rep(i, 8) { check *= 10; check += a[i]; } if (check % K == 0) { ans++; } } while (next_permutation(all(a))); cout << ans << "\n"; return 0; }