题解 | #纳米兔子#
纳米兔子
https://ac.nowcoder.com/acm/contest/17561/C
//标程 注意一下读入就好了(数据还是大,刚才测了两下cin过还是有点费劲,这份是能过的) #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, m; int a[10][6] = {0}; a[1][1] = 1; a[2][1] = 1, a[2][2] = 1; a[3][1] = 1, a[3][2] = 2, a[3][3] = 1; a[4][1] = 1, a[4][2] = 3, a[4][3] = 3, a[4][4] = 1; a[5][1] = 1, a[5][2] = 4, a[5][3] = 6, a[5][4] = 4; a[6][1] = 5, a[6][2] = 10, a[6][3] = 10; a[7][1] = 15, a[7][2] = 20, a[8][1] = 35; while(cin >> n >> m) { long long ans = 0; for(int i = 0; i < 5; i++) { ans += a[m][i]; } cout << ans * n<< '\n'; } return 0; }