結果
問題 | No.1644 Eight Digits |
ユーザー |
|
提出日時 | 2021-08-13 21:34:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 1,798 ms |
コンパイル使用メモリ | 168,516 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-03 17:33:00 |
合計ジャッジ時間 | 2,080 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
//#include <atcoder/all>#include <bits/stdc++.h>#include <cmath>using namespace std;//using namespace atcoder;using ll = long long;#define all(A) A.begin(),A.end()using vll = vector<ll>;#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)using Graph = vector<vector<ll>>;int main() {string S="12345678";ll K;cin>>K;ll an=0;do{ll P=0;rep(i,8){P+=(S[i]-'0');P*=10;}P/=10;an+=(P%K==0);}while(next_permutation(all(S)));cout<<an<<endl;}