QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#114685 | #5975. Drum Decorator | zwh2008 | 0 | 1ms | 3680kb | C++14 | 511b | 2023-06-22 21:20:59 | 2023-06-22 21:21:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=105,mod=1e9+7;
int n,m,Case;
ll f[3][N];
void solve() {
scanf("%d%d",&n,&m),f[0][1]=f[1][2]=1,f[2][2]=(m%6==0);
for(int i=2;i<=n;i++) {
f[0][i]=(f[1][i-1]+f[2][i-1])%mod;
if(i>2)f[1][i]=(f[0][i-2]+f[2][i-2])%mod;
if(i>2&&m%6==0)f[2][i]=(f[0][i-2]+f[1][i-2])%mod;
}
printf("Case #%d: %lld\n",++Case,(f[0][n]+f[1][n]+f[2][n])%mod);
}
int main() {
int tt;scanf("%d",&tt);
while(tt--)solve();
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3680kb
input:
20 5 4 4 4 6 4 4 3 5 3 3 3 4 6 6 6 2 4 6 5 3 5 2 6 5 6 6 3 4 5 2 3 5 5 3 4 3 6 2 5
output:
Case #1: 1 Case #2: 1 Case #3: 2 Case #4: 1 Case #5: 1 Case #6: 2 Case #7: 4 Case #8: 12 Case #9: 1 Case #10: 11 Case #11: 3 Case #12: 2 Case #13: 8 Case #14: 11 Case #15: 3 Case #16: 1 Case #17: 6 Case #18: 3 Case #19: 4 Case #20: 1
result:
wrong answer 1st lines differ - expected: 'Case #1: 3', found: 'Case #1: 1'
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 1ms
memory: 3616kb
input:
100 58 15 3 3 52 6 80 86 94 81 91 92 83 85 70 93 100 100 81 99 69 68 83 91 42 27 80 93 84 89 60 40 88 30 45 78 59 75 89 95 59 23 17 8 32 57 89 100 12 24 91 51 42 8 67 44 44 76 94 99 2 3 4 72 5 72 95 95 90 85 81 94 97 98 62 4 92 92 96 88 2 4 38 60 2 5 2 6 68 20 94 90 19 30 76 63 40 78 87 97 99 93 3 6...
output:
Case #1: 1 Case #2: 2 Case #3: 767733086 Case #4: 940399381 Case #5: 602746783 Case #6: 602746783 Case #7: 940399381 Case #8: 602746783 Case #9: 602746783 Case #10: 203091360 Case #11: 203091360 Case #12: 940399381 Case #13: 41662651 Case #14: 940399381 Case #15: 203091360 Case #16: 203091360 Case #...
result:
wrong answer 1st lines differ - expected: 'Case #1: 57418771', found: 'Case #1: 1'