結果
| 問題 | No.3457 Fibo-shrink |
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2026-02-28 14:03:44 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,516 bytes |
| 記録 | |
| コンパイル時間 | 9,477 ms |
| コンパイル使用メモリ | 580,220 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-02-28 14:03:56 |
| 合計ジャッジ時間 | 11,161 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 4 WA * 8 |
ソースコード
#ifndef ONLINE_JUDGE
#include "header.hpp"
#else
#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_int.hpp>
using cpp_int=boost::multiprecision::cpp_int;
#include <boost/multiprecision/cpp_dec_float.hpp>
template<unsigned size>using cpp_float=boost::multiprecision::number<boost::multiprecision::cpp_dec_float<size>>;
template<unsigned size>using cpp_double=boost::multiprecision::number<boost::multiprecision::cpp_dec_float<size,long long>>;
#endif
using namespace std;
using ll=long long;
inline void yn(bool x){if(x){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}
#define double_out(x) fixed << setprecision(x)
template<class T> inline void erase_duplicate(vector<T>& A){sort(A.begin(),A.end());A.erase(unique(A.begin(),A.end()),A.end());}
inline ll powll(ll x,ll n){ll r=1;while(n>0){if(n&1){r*=x;};x*=x;n>>=1;};return r;}
using namespace std;
using ll=long long;
using mint=atcoder::static_modint<10007>;
int main(){
ll K,S,N;
cin>>K>>S>>N;
vector<mint> A;
A.push_back(mint(S));
for(ll i=1;i<N;i++){
ll a=1;
ll b=1;
mint T=0;
for(ll j=0;j<=K;j++){
if((ll)A.size()-1-j<0){
break;
}
T+=A[A.size()-1-j]/a;
// cerr<<i<<" "<<A[A.size()-1-j].val()<<" / "<<a<<endl;
ll c=a+b;
a=b;
b=c;
}
A.push_back(T);
}
// for(mint i:A){
// cerr<<i.val()<<" ";
// }cerr<<endl;
cout<<A.back().val()<<endl;
}
harurun