結果

問題 No.1644 Eight Digits
ユーザー ripityripity
提出日時 2021-12-18 15:12:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 335 bytes
コンパイル時間 1,986 ms
コンパイル使用メモリ 201,456 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 17:57:08
合計ジャッジ時間 3,417 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
4,348 KB
testcase_01 AC 15 ms
4,348 KB
testcase_02 AC 15 ms
4,352 KB
testcase_03 AC 14 ms
4,348 KB
testcase_04 AC 15 ms
4,348 KB
testcase_05 AC 16 ms
4,348 KB
testcase_06 AC 15 ms
4,352 KB
testcase_07 AC 15 ms
4,348 KB
testcase_08 AC 16 ms
4,348 KB
testcase_09 AC 15 ms
4,348 KB
testcase_10 AC 15 ms
4,348 KB
testcase_11 AC 16 ms
4,352 KB
testcase_12 AC 16 ms
4,348 KB
testcase_13 AC 15 ms
4,348 KB
testcase_14 AC 15 ms
4,352 KB
testcase_15 AC 15 ms
4,352 KB
testcase_16 AC 14 ms
4,348 KB
testcase_17 AC 15 ms
4,348 KB
testcase_18 AC 16 ms
4,352 KB
testcase_19 AC 15 ms
4,348 KB
testcase_20 AC 15 ms
4,348 KB
testcase_21 AC 15 ms
4,352 KB
testcase_22 AC 15 ms
4,348 KB
testcase_23 AC 15 ms
4,352 KB
testcase_24 AC 16 ms
4,348 KB
testcase_25 AC 15 ms
4,348 KB
testcase_26 AC 15 ms
4,348 KB
testcase_27 AC 15 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(void){
    vector<int> p = {1,2,3,4,5,6,7,8};
    int K;
    int ans = 0;
    cin >> K;
    do {
        int N = 0;
        for( int i = 0; i < 8; i++ ) N += pow(10,i)*p[i];
        if( N%K == 0 ) ans++;
    }while(next_permutation(p.begin(),p.end()));
    cout << ans << endl;
}
0