結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2016-11-10 16:28:21 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 25 ms / 1,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 209 ms |
コンパイル使用メモリ | 21,248 KB |
実行使用メモリ | 24,960 KB |
最終ジャッジ日時 | 2024-11-25 07:13:23 |
合計ジャッジ時間 | 1,255 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
コンパイルメッセージ
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[1000001][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;}