結果
| 問題 |
No.303 割れません
|
| ユーザー |
|
| 提出日時 | 2016-12-09 22:00:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 986 bytes |
| コンパイル時間 | 671 ms |
| コンパイル使用メモリ | 87,512 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-28 20:01:16 |
| 合計ジャッジ時間 | 1,981 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 12 |
ソースコード
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;
ll fib(int v) {
ll x = 0;
ll y = 1;
REP(i, 0, v) {
ll z = x + y;
x = y;
y = z;
}
return x;
}
int main(void){
int l;
cin >> l;
if (l == 2) {
cout << 3 << endl << "INF" << endl;
return 0;
}
cout << l << endl;
if (l % 2 == 1) {
cout << fib(l) << endl;
} else {
cout << fib(l) - fib(l / 2) * fib(l / 2) << endl;
}
}