結果

問題 No.1644 Eight Digits
ユーザー mmn15277198
提出日時 2021-08-22 12:59:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 487 bytes
コンパイル時間 888 ms
コンパイル使用メモリ 94,068 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-06 09:14:11
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  //cout << fixed << setprecision(15);
  
  int k;
  cin >> k;
  string s = "12345678";
  int ans = 0;
  do {
    int s2 = stoi(s);
    if (s2 % k == 0) ans++;

  } while (next_permutation(s.begin() , s.end()));
  cout << ans << endl;
  return 0;
}
0