結果

問題 No.1644 Eight Digits
ユーザー Nzt3
提出日時 2021-08-13 21:48:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 282 bytes
コンパイル時間 1,664 ms
コンパイル使用メモリ 169,576 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-03 18:23:01
合計ジャッジ時間 2,616 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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