結果
問題 | No.2749 随伴関手入門 |
ユーザー | pia019 |
提出日時 | 2024-05-10 21:37:50 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 2,952 ms |
コンパイル使用メモリ | 243,620 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-20 04:40:24 |
合計ジャッジ時間 | 3,796 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:23:13: warning: 'm' may be used uninitialized [-Wmaybe-uninitialized] 23 | cout << m << endl; | ^ main.cpp:14:9: note: 'm' was declared here 14 | int m; | ^
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1<<30; const long long INFLL = 1LL<<60; const int MOD = 998244353; int n; int main() { cin >> n; int x = 0, y = 1; int m; for (int i=1; i < 1000; i++){ if (y % n == 0){ m = i; break; } y = (y + x) % n; x = (y - x) % n; } cout << m << endl; return 0; }