結果

問題 No.1644 Eight Digits
ユーザー MAHAYANA
提出日時 2021-09-11 10:12:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 394 bytes
コンパイル時間 3,404 ms
コンパイル使用メモリ 229,188 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-22 17:03:28
合計ジャッジ時間 4,555 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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