結果
| 問題 |
No.1644 Eight Digits
|
| コンテスト | |
| ユーザー |
keisuke6
|
| 提出日時 | 2022-05-28 09:32:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 353 bytes |
| コンパイル時間 | 1,800 ms |
| コンパイル使用メモリ | 169,372 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-20 20:42:37 |
| 合計ジャッジ時間 | 2,923 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int N;
cin>>N;
vector<int> S={1,2,3,4,5,6,7,8};
int ans = 0;
do{
int now = 0;
for(int i=0;i<8;i++){
now *= 10;
now += S[i];
}
ans += (now%N == 0);
}while(next_permutation(S.begin(),S.end()));
cout<<ans<<endl;
}
keisuke6