結果
| 問題 |
No.303 割れません
|
| コンテスト | |
| ユーザー |
maine_honzuki
|
| 提出日時 | 2021-05-14 18:16:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 599 bytes |
| コンパイル時間 | 7,725 ms |
| コンパイル使用メモリ | 396,368 KB |
| 最終ジャッジ日時 | 2025-01-21 11:01:29 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 2 TLE * 11 |
ソースコード
//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;
}
maine_honzuki