結果

問題 No.1644 Eight Digits
ユーザー kkkk97368086
提出日時 2021-12-05 09:08:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 394 bytes
コンパイル時間 3,226 ms
コンパイル使用メモリ 229,732 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-07 07:03:55
合計ジャッジ時間 4,037 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i,n) for(int i=0; i<n; ++i)

int main(){
    int K;
    cin >> K;

    string S = "12345678";

    int ans = 0;

    do{
        int x = stoi(S);
        if(x % K == 0) ans++;
    }while(next_permutation(S.begin(), S.end()));

    cout << ans << endl;

    return 0;
}
0