結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2016-11-10 16:27:23 |
言語 | C90 (gcc 12.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 466 bytes |
コンパイル時間 | 129 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 07:11:43 |
合計ジャッジ時間 | 1,507 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 RE * 3 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%lld", &n); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void) { long long int n, a[100001][3] = {0}; long long int i; scanf("%lld", &n); a[1][0] = 1; for(i = 2;i <= n;i++){ a[i][0] = a[i - 1][2] % 1000000007; a[i][1] = a[i - 1][0] % 1000000007; a[i][2] = (a[i - 1][0] + a[i - 1][1]) % 1000000007; } //for(i = 1;i <= n;i++){ // printf("%lld:%lld\n", i, (a[i][0] + a[i][1] + a[i][2]) % 1000000007); //} printf("%lld\n", (a[n][0] + a[n][1] + a[n][2]) % 1000000007); return 0; }