結果

問題 No.1644 Eight Digits
ユーザー You_saku
提出日時 2021-09-17 00:22:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 1,000 ms
コード長 500 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 81,752 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 17:18:11
合計ジャッジ時間 1,754 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include <ios>
#include <iomanip> 
#include<algorithm>

using namespace std;

int main(){
    int ans = 0;
    string base = "12345678";
    int k;
    cin >> k;
    do{
        string tmp = "";
        for(auto &x: base){
            tmp += x;
        }
        int num = atoi(tmp.c_str());
        if(num%k == 0) ans++;

    }while(next_permutation(base.begin(), base.end()));
    cout << ans << endl;
    return 0;
}
0