結果

問題 No.677 10^Nの約数
ユーザー kyo1kyo1
提出日時 2020-07-26 15:18:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 999 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 204,020 KB
実行使用メモリ 4,568 KB
最終ジャッジ日時 2023-09-11 01:51:27
合計ジャッジ時間 3,071 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,500 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

template <typename T>
int pow(int x, T n, int mod = std::numeric_limits<int>::max()) {
  int res = 1;
  while (n > 0) {
    if (n & 1) res = static_cast<int64_t>(res) * static_cast<int64_t>(x) % mod;
    x = static_cast<int64_t>(x) * static_cast<int64_t>(x) % mod;
    n >>= 1;
  }
  return res;
}

template <typename T>
int64_t pow(int64_t x, T n, int64_t mod = std::numeric_limits<int64_t>::max()) {
  int64_t res = 1;
  while (n > 0) {
    if (n & 1) res = static_cast<__int128>(res) * static_cast<__int128>(x) % mod;
    x = static_cast<__int128>(x) * static_cast<__int128>(x) % mod;
    n >>= 1;
  }
  return res;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int64_t> res;
  for (int i = 0; i < N + 1; i++) {
    for (int j = 0; j < N + 1; j++) {
      res.emplace_back(pow(2, i) * pow(5, j));
    }
  }
  sort(res.begin(), res.end());
  for (auto r : res) {
    cout << r << '\n';
  }
  return 0;
}
0