結果
| 問題 | No.677 10^Nの約数 |
| コンテスト | |
| ユーザー |
kyo1
|
| 提出日時 | 2020-07-26 15:18:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 999 bytes |
| 記録 | |
| コンパイル時間 | 2,131 ms |
| コンパイル使用メモリ | 198,720 KB |
| 最終ジャッジ日時 | 2025-01-12 05:59:36 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 9 |
ソースコード
#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;
}
kyo1