結果

問題 No.1644 Eight Digits
コンテスト
ユーザー kkkk97368086
提出日時 2021-12-05 09:08:19
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 394 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,953 ms
コンパイル使用メモリ 249,680 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-28 22:09:29
合計ジャッジ時間 3,998 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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