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

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 cut = 0; for (int i = 4; i <= n; i += 2) { cut = (4LL * b - a) % s; if (cut < 0) cut += s; a = b; b = cut; } cout << cut << endl; return 0; }


测评信息: