結果
| 問題 | No.2749 随伴関手入門 |
| ユーザー |
|
| 提出日時 | 2024-05-10 21:41:45 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 623µs | |
| コード長 | 540 bytes |
| 記録 | |
| コンパイル時間 | 6,438 ms |
| コンパイル使用メモリ | 462,396 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-25 08:08:04 |
| 合計ジャッジ時間 | 6,650 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
void solve() {
boost::multiprecision::cpp_int n, a = 0, b = 1, c = 0;
cin >> n;
for (ll k = 1;; k++) {
if (b % n == 0) {
cout << k << '\n';
return;
}
c = a + b;
a = b;
b = c;
}
}
int main() {
std::cin.tie(nullptr);
std::ios_base::sync_with_stdio(false);
int T = 1;
for (int t = 0; t < T; t++) {
solve();
}
return 0;
}