結果
| 問題 |
No.1644 Eight Digits
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-05 20:31:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 1,000 ms |
| コード長 | 384 bytes |
| コンパイル時間 | 1,567 ms |
| コンパイル使用メモリ | 168,376 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 07:34:26 |
| 合計ジャッジ時間 | 2,640 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define all(A) (A).begin(),(A).end()
#define MOD 1000000007
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main(void){
int k; cin >> k;
string s = "12345678";
ll ans = 0;
do {
int a = stoi(s);
if(a%k == 0) ans++;
} while(next_permutation(all(s)));
cout << ans;
}