結果
問題 |
No.344 ある無理数の累乗
|
ユーザー |
![]() |
提出日時 | 2017-04-22 13:06:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 397 bytes |
コンパイル時間 | 1,440 ms |
コンパイル使用メモリ | 170,332 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-21 16:05:23 |
合計ジャッジ時間 | 5,956 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 TLE * 1 -- * 14 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) int N; int g(int x) { if (x < 2) return 2; return (2 * g(x - 1) + 2 * g(x - 2)) % 1000; } //----------------------------------------------------------------------------------- int main() { cin >> N; int ans = g(N); if (N % 2 == 0) ans = (ans - 1 + 1000) % 1000; cout << ans << endl; }