QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#963951#1958. Grid TriangleCSQ#WA 29ms3712kbC++171.0kb2025-04-04 15:23:342025-04-04 15:23:35

Judging History

This is the latest submission verdict.

  • [2025-04-04 15:23:35]
  • Judged
  • Verdict: WA
  • Time: 29ms
  • Memory: 3712kb
  • [2025-04-04 15:23:34]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll ans = 0;
void solve(ll A,ll B,ll C,bool mode){
    for(ll a=1;a<=min(A,C);a++){
        //a,b,a+b
        //-b,a+b,a
        
        //b <= min(A,B)
        //a+b <= min(B,C);
        //b <= min(B,C) - a
        ll b = min(min(B,C)-a,A);
        if(b>0){
            ans += b - (b >= a);
        }


        //a,b,a+b
        //a+b,-a,b

        //b <= min(B,C)
        //a+b <= min(A,C)
        //b <= min(A,C)-a
        b = min(min(A,C)-a,B);
        if(b>0 && mode){
            ans += b - (b >= a);
        }
    }
   // cout<<ans<<'\n';
}
int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin.exceptions(cin.failbit);
    ll A,B,C;
    cin>>A>>B>>C;

    //cout<<"TES"<<'\n';
    //A B C
    solve(A,B,C,1);
    solve(C,A,B,0);
    ans*=8;
    cout<<ans<<'\n';
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3584kb

input:

1 1 4

output:

0

result:

ok single line: '0'

Test #2:

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

input:

1 1 5

output:

0

result:

ok single line: '0'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

1 2 6

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

1 2 7

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

2 2 8

output:

0

result:

ok single line: '0'

Test #6:

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

input:

2 3 9

output:

16

result:

ok single line: '16'

Test #7:

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

input:

2 3 10

output:

16

result:

ok single line: '16'

Test #8:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

2 3 11

output:

16

result:

ok single line: '16'

Test #9:

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

input:

3 4 12

output:

64

result:

ok single line: '64'

Test #10:

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

input:

3 4 13

output:

64

result:

ok single line: '64'

Test #11:

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

input:

3 4 14

output:

64

result:

ok single line: '64'

Test #12:

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

input:

3 5 15

output:

80

result:

ok single line: '80'

Test #13:

score: 0
Accepted
time: 29ms
memory: 3712kb

input:

10000000 10000000 10000000

output:

1199999760000000

result:

ok single line: '1199999760000000'

Test #14:

score: -100
Wrong Answer
time: 14ms
memory: 3712kb

input:

7663341 2799917 6434354

output:

175483319618832

result:

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