- P196's solution
-
题解P196
- @ 2025-11-9 12:24:50
按题意直接模拟即可。
AC code:
#include <bits/stdc++.h>
using namespace std;
int main() {
freopen("league.in", "r", stdin);
freopen("league.out", "w", stdout);
int T;
cin >> T;
while (T--) {
long long n;
cin >> n;
if (n == 1) {
cout << 0 << endl;
continue;
}
long long matches;
if (n > 15) {
matches = n * (n - 1) / 2;
} else {
matches = n * (n - 1);
}
long long days = (matches - 1) * 4 + 1;
cout << days << endl;
}
return 0;
}