QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#407517 | #6823. Coffee Overdose | james1BadCreeper | WA | 1ms | 3572kb | C++17 | 588b | 2024-05-08 21:37:37 | 2024-05-08 21:37:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
int n, c;
i64 solve1(void) {
i64 x = min(n / c, (c + 1) / 2);
return 1ll * n * (n + 1) / 2 + 1ll * c * (c - 1) / 2 * x - 1ll * x * (x - 1) / 2 * c;
}
i64 solve2(void) {
i64 x = n / (c + 1) + 1;
return 1ll * x * n * c - 1ll * x * (x - 1) / 2 * c * (c + 1);
}
void solve(void) {
cin >> n >> c;
int ans = max(solve1(), solve2());
cout << ans << "\n";
}
int main(void) {
ios::sync_with_stdio(0);
int T; cin >> T;
while (T--) solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3572kb
input:
4 1 2 2 1 10 4 172800 172800
output:
2 3 63 -204931072
result:
wrong answer 4th words differ - expected: '29859840000', found: '-204931072'