結果

問題 No.1644 Eight Digits
ユーザー atjh16atjh16
提出日時 2021-09-09 22:28:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 1,665 ms
コンパイル使用メモリ 166,512 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-30 03:53:11
合計ジャッジ時間 3,788 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int k, m = 0;
vector<int> v = { 1, 2, 3, 4, 5, 6, 7, 8 };

int main()
{
	cin >> k;

	do {
		int t = 0;

		for (vector<int>::iterator itr = v.begin(); itr != v.end(); itr++) {
			t += *itr;
			t *= 10;
		}

		if (t % k == 0)
			m++;

	} while (next_permutation(v.begin(), v.end()));

	cout << m << endl;
}
0