結果
| 問題 |
No.2749 随伴関手入門
|
| コンテスト | |
| ユーザー |
hiromi_ayase
|
| 提出日時 | 2024-05-10 21:27:22 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 745 bytes |
| コンパイル時間 | 5,039 ms |
| コンパイル使用メモリ | 308,216 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-20 04:18:20 |
| 合計ジャッジ時間 | 6,549 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 RE * 5 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define FAST_IO \
ios::sync_with_stdio(false); \
cin.tie(0);
const i64 INF = 1001001001001001001;
using Modint = atcoder::static_modint<998244353>;
int main() {
FAST_IO
auto ans = 0LL;
int N;
cin >> N;
if (N == 1) {
cout << 1 << endl;
return 0;
}
i64 x = -1;
vector<i64> f(N + 1);
f[1] = 1;
f[2] = 1;
for (int i = 3; i <= 10000; i ++) {
f[i] = f[i - 1] + f[i - 2];
f[i] %= N;
if (f[i] == 0) {
if (x < 0) {
x = i;
} else {
x = gcd(x, i);
}
}
}
cout << x << endl;
}
hiromi_ayase