結果
| 問題 |
No.1644 Eight Digits
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2024-04-18 02:54:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 1,000 ms |
| コード長 | 372 bytes |
| コンパイル時間 | 751 ms |
| コンパイル使用メモリ | 71,740 KB |
| 最終ジャッジ日時 | 2025-02-21 02:58:19 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string S = "12345678";
int K; cin >> K;
int ans = 0;
do{
int x = stoi(S);
if(x % K == 0) ans += 1;
} while(next_permutation(S.begin(),S.end()));
cout << ans << endl;
return 0;
}
Nachia