#7229: 為什麼NA?

#### mrsasuke (極限)

School : No School
ID : 28000
IP address : [111.253.170.243]
2015-08-04 16:42:30
d639. 企鵝村三兄弟penguin -- | From: [140.113.68.109] | Post Date : 2012-11-27 20:39

#include <stdio.h>
int main (void){
int n,i,a[6];
while (scanf ("%d",&n)==1){
a[1]=a[2]=a[3]=1;
a[4]=a[5]=a[6]=0;
for (i=4;i<=n;i+=3){
a[4]=a[3]+a[2]+a[1];
a[5]=a[4]+a[3]+a[2];
a[6]=a[5]+a[4]+a[3];
a[1]=a[4]%10007;
a[2]=a[5]%10007;
a[3]=a[6]%10007;
}
a[0]=a[3];
printf ("%d\n",a[n%3]);
}
return 0;
}

自己跑沒問題(至少第一測資點沒問題，輸入8跑出來31)

您的答案為: 1 正確答案為: 31

#7230: Re:為什麼NA?

#### tomoyaken14 (歐練)

School : No School
ID : 6922
IP address : [122.117.127.202]
2024-04-15 14:31:55
d639. 企鵝村三兄弟penguin -- | From: [140.117.70.91] | Post Date : 2012-11-28 11:20

#include
int main (void){
int n,i,a[6];
while (scanf ("%d",&n)==1){
a[1]=a[2]=a[3]=1;
a[4]=a[5]=a[6]=0;
for (i=4;i<=n;i+=3){
a[4]=a[3]+a[2]+a[1];
a[5]=a[4]+a[3]+a[2];
a[6]=a[5]+a[4]+a[3];
a[1]=a[4]%10007;
a[2]=a[5]%10007;
a[3]=a[6]%10007;
}
a[0]=a[3];
printf ("%d\n",a[n%3]);
}
return 0;
}
自己跑沒問題(至少第一測資點沒問題，輸入8跑出來31)

您的答案為: 1 正確答案為: 31

#7235: Re:為什麼NA?

#### akira0331 (小迷糊)

School : No School
ID : 26613
IP address : [203.70.194.240]
2013-07-29 09:30:29
d639. 企鵝村三兄弟penguin -- | From: [203.70.194.240] | Post Date : 2012-11-29 11:37

#include
int main (void){
int n,i,a[6];
while (scanf ("%d",&n)==1){
a[1]=a[2]=a[3]=1;
a[4]=a[5]=a[6]=0;
for (i=4;i<=n;i+=3){
a[4]=a[3]+a[2]+a[1];
a[5]=a[4]+a[3]+a[2];
a[6]=a[5]+a[4]+a[3];
a[1]=a[4]%10007;
a[2]=a[5]%10007;
a[3]=a[6]%10007;
}
a[0]=a[3];
printf ("%d\n",a[n%3]);
}
return 0;
}
自己跑沒問題(至少第一測資點沒問題，輸入8跑出來31)

您的答案為: 1 正確答案為: 31

#7236: Re:為什麼NA?

#### mrsasuke (極限)

School : No School
ID : 28000
IP address : [111.253.170.243]