QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#370465#5038. Cityzzuqy#WA 0ms3656kbC++11550b2024-03-29 08:34:212024-03-29 08:34:22

Judging History

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

  • [2024-03-29 08:34:22]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3656kb
  • [2024-03-29 08:34:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
long long read()
{
    long long x;scanf("%lld",&x);return x;
}
long long ans;
int n,m;
int main()
{
    n=read();m=read();
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=n;j++)
        {
            int X1=0;
            int X2=2*i-X1;
            if(X2>n)
                X2=n,X1=2*i-X2;
            int Y1=0;
            int Y2=2*j-Y1;

            if(Y2>m)
                Y2=m,Y1=2*j-Y1;
            ans+=(Y2-Y1+1)*(X2-X1+1)/2*2;
        }

    }
    cout<<ans;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

input:

1 1

output:

0

result:

ok 1 number(s): "0"

Test #2:

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

input:

2 3

output:

14

result:

ok 1 number(s): "14"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3656kb

input:

252 139

output:

-909151740

result:

wrong answer 1st numbers differ - expected: '156806790', found: '-909151740'