結果

問題 No.1644 Eight Digits
ユーザー kohei2019
提出日時 2022-11-04 12:50:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 8 ms / 1,000 ms
コード長 445 bytes
コンパイル時間 2,143 ms
コンパイル使用メモリ 199,356 KB
最終ジャッジ日時 2025-02-08 17:08:38
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;


int main() {
    vector<string> v;
    string out;
    int cnt,num;
    cin >> num;
    cnt = 0;
    v = {"1","2","3","4","5","6","7","8"};
    do{
        out = "";
        for(int i=0;i<8;i++){
            out += v[i];
        }
        if((stoi(out)%num)==0){
            cnt += 1;
        }
        }while (next_permutation(v.begin(),v.end()));
    cout << cnt << endl;
}
0