Submission #1365984

#TimeUsernameProblemLanguageResultExecution timeMemory
1365984mon_de2738RUN Sequence (KAISTRUN26SPRING_B)C++20
0 / 100
0 ms348 KiB
// kdy40929님의 블로그 글을 보고 biko에 테케를 추가했는데, 그게 잘 반영됐는지 보기 위한 테스트용 코드입니다. 
#include<iostream>
using namespace std;
using ll=long long;
ll R,U,N;
ll F[55];
 
int main(){
    F[1]=F[2]=1;
    for(int i=3; i<55; i++) F[i]=F[i-1]+F[i-2];
    int pos=lower_bound(F,F+55,1e9)-F;
    cin >> R >> U >> N;
    ll neg=0;
    if(N-1<pos) neg=max(0LL,U-F[N-2])*(R-F[N-1]);
    cout << R*U-neg;
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...