結果
問題 | No.2749 随伴関手入門 |
ユーザー |
|
提出日時 | 2024-05-10 21:31:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 4,106 ms |
コンパイル使用メモリ | 253,036 KB |
最終ジャッジ日時 | 2025-02-21 12:18:42 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) using mint = atcoder::modint1000000007; int main(){ int n; cin>>n; if(n==1){ cout<<"1\n"; return 0; } vector<ll> fb(2); fb.at(0)=1,fb.at(1)=1; int j=2; while(1){ fb.push_back((fb.at(j-2)+fb.at(j-1))%n); if(fb.at(j)==0){ cout<<j+1<<endl; return 0; } j++; } }