QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#46664#1958. Grid Triangleneko_nyaa#WA 37ms3760kbC++23775b2022-08-30 17:21:392022-08-30 17:21:42

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-08-30 17:21:42]
  • 评测
  • 测评结果:WA
  • 用时:37ms
  • 内存:3760kb
  • [2022-08-30 17:21:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define int long long

int solve(int sum, int mxx) {
    if (mxx < (sum-1)/2) return 0;

    mxx = min(mxx, sum-1);
    int mn = sum-mxx;
    int mx = mxx;

    //cout << sum << ' ' << mxx << ' ' << mx << ' ' << mx-mn+1 << '\n';
    int ans = mx-mn+1;
    if (sum % 2 == 0) ans--;
    return ans;
}

int solve0(int mxsum, int mxx) {
    int ans = 0;
    for (int sum = 3; sum <= mxsum; sum++) {
        ans += solve(sum, mxx);
    }
    return ans;
}

signed main() {
    ios::sync_with_stdio(0); cin.tie(0);

    int a, b, c; cin >> a >> b >> c;
    int ans = 0;
    ans += solve0(min(a, b), c);
    ans += solve0(min(b, c), a);
    ans += solve0(min(c, a), b);
    cout << ans*8 << '\n';
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3548kb

input:

1 1 4

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3568kb

input:

1 1 5

output:

0

result:

ok single line: '0'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3680kb

input:

1 2 6

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3664kb

input:

1 2 7

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3488kb

input:

2 2 8

output:

0

result:

ok single line: '0'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3612kb

input:

2 3 9

output:

16

result:

ok single line: '16'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3756kb

input:

2 3 10

output:

16

result:

ok single line: '16'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3692kb

input:

2 3 11

output:

16

result:

ok single line: '16'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3620kb

input:

3 4 12

output:

64

result:

ok single line: '64'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

3 4 13

output:

64

result:

ok single line: '64'

Test #11:

score: 0
Accepted
time: 2ms
memory: 3580kb

input:

3 4 14

output:

64

result:

ok single line: '64'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3664kb

input:

3 5 15

output:

80

result:

ok single line: '80'

Test #13:

score: 0
Accepted
time: 37ms
memory: 3484kb

input:

10000000 10000000 10000000

output:

1199999760000000

result:

ok single line: '1199999760000000'

Test #14:

score: -100
Wrong Answer
time: 17ms
memory: 3628kb

input:

7663341 2799917 6434354

output:

125432496112208

result:

wrong answer 1st lines differ - expected: '125432496112224', found: '125432496112208'