Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
316906 gyszlongyiyang25 三排地砖 T3 C++ 通过 5 MS 708 KB 579 2026-04-17 16:53:55

Tests(10/10):


#include<bits/stdc++.h> using namespace std; const int s = 1000000007; int main() { int n; cin >> n; if (n % 2 != 0) { cout << 0 << endl; return 0; } if (n == 0) { cout << 1 << endl; return 0; } int a = 1; int b = 3; if (n == 2) { cout << b << endl; return 0; } int cnt= 0; for (int i = 4; i <= n; i += 2) { cnt = (4LL * b - a) % s; if (cnt < 0) cnt += s; a = b; b = cnt; } cout << cnt << endl; return 0; }


测评信息: