QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#617427 | #1958. Grid Triangle | untitledtwo# | WA | 0ms | 3940kb | C++17 | 531b | 2024-10-06 15:30:53 | 2024-10-06 15:30:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
inline int Calc(int n, int m)
{
n = min(n, m);
int ans = n * (2 * m - n - 1) / 2;
ans -= min(n, m / 2);
return ans;
}
inline int Work(int A, int B, int C)
{
return Calc(A, min(B, C)) + Calc(B, min(A, C));
}
signed main()
{
int A, B, C;
scanf("%lld %lld %lld", &A, &B, &C);
int ans = Work(A, B, C) + Work(A, C, B) + Work(B, A, C) + Work(B, C, A) + Work(C, A, B) + Work(C, B, A);
printf("%lld\n", ans * 2);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3940kb
input:
1 1 4
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
1 1 5
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
1 2 6
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
1 2 7
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
2 2 8
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
2 3 9
output:
16
result:
ok single line: '16'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
2 3 10
output:
16
result:
ok single line: '16'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
2 3 11
output:
16
result:
ok single line: '16'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
3 4 12
output:
64
result:
ok single line: '64'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
3 4 13
output:
64
result:
ok single line: '64'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
3 4 14
output:
64
result:
ok single line: '64'
Test #12:
score: -100
Wrong Answer
time: 0ms
memory: 3792kb
input:
3 5 15
output:
88
result:
wrong answer 1st lines differ - expected: '80', found: '88'