結果

問題 No.303 割れません
ユーザー maine_honzukimaine_honzuki
提出日時 2021-05-14 18:16:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 599 bytes
コンパイル時間 9,330 ms
コンパイル使用メモリ 427,012 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-07-25 03:35:00
合計ジャッジ時間 23,307 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

//https://ncode.syosetu.com/n4830bu/303/
#include <bits/stdc++.h>
using namespace std;

#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;

cpp_int maine(int L) {
    if (L == 0)
        return 0;
    cpp_int maine = 1, book = 1;
    for (int _ = 0; _ < L - 2; _++) {
        book += maine;
        swap(book, maine);
    }
    return maine;
}

int main() {
    int L;
    cin >> L;
    if (L == 2)
        cout << "INF" << endl
             << 0 << endl;
    else
        cout << L << endl
             << maine(L) - !(L & 1) * maine(L / 2) * maine(L / 2) << endl;
}
0