QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#458381#8669. 正方形计数linrui#0 1ms3784kbC++141.4kb2024-06-29 16:56:432024-06-29 16:56:44

Judging History

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

  • [2024-06-29 16:56:44]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3784kb
  • [2024-06-29 16:56:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using u64=unsigned long long;
//using lll=__int128_t;
using lf=long double;
using Pr=pair<int,int>;
#define F(i,l,r) for(ll i=l;i<=ll(r);++i)
#define G(i,r,l) for(ll i=r;i>=ll(l);--i)
#define ct const
#define il inline
#define pb push_back
#define fi first
#define se second
#define mkr make_pair
template<class T>
il void tomn(T&x,T ct&y){y<x?x=y,0:0;}
template<class T>
il void tomx(T&x,T ct&y){x<y?x=y,0:0;}
#define dbg(...) fprintf(stderr,__VA_ARGS__)
#define CUT dbg("===================\n")
ct lf EPS=1e-10L;
il int dcmp(lf x){return fabs(x)<=EPS?0:(x<0?-1:1);}
ct ll INF=4e18L;
//ct int INF=1.02e9;
//il void rd(int&x){scanf("%d",&x);}
//il void rd(ll&x){scanf("%lld",&x);}

ct ll P=1000000007;
void add2(ll&x,ll y){x+=y,x-=((-(x>=P))&P);}
void sub2(ll&x,ll y){x-=y,x+=((-(x<0))&P);}
ll add(ll x,ll y){return add2(x,y),x;}
ll sub(ll x,ll y){return sub2(x,y),x;}

struct Vec{ll x,y;};
Vec operator-(Vec x,Vec y){return Vec{x.x-y.x,x.y-y.y};}
ll cross(Vec x,Vec y){return x.x*y.y-x.y*y.x;}

ct int N=10;
int n;
Vec p[N];
int main(){
#ifdef LOCAL
	freopen("B.in","r",stdin);
//	freopen(".out","w",stdout);
#endif
	scanf("%d",&n);
	F(i,1,n)scanf("%lld%lld",&p[i].x,&p[i].y);
	ll a=p[2].y-p[1].y,b=p[4].x-p[1].x,ans=0;
	F(i,1,min(a,b))ans+=(a-i+1)*(b-i+1)*i;
	printf("%lld\n",ans);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 0ms
memory: 3784kb

input:

4
131 603
131 1828
1919 1828
1919 603

output:

361182910200

result:

ok 1 number(s): "361182910200"

Test #2:

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

input:

4
239 211
239 962
261 962
261 211

output:

1498772

result:

ok 1 number(s): "1498772"

Test #3:

score: 10
Accepted
time: 0ms
memory: 3784kb

input:

4
0 0
0 2000
2000 2000
2000 0

output:

1336001667000

result:

ok 1 number(s): "1336001667000"

Test #4:

score: 10
Accepted
time: 1ms
memory: 3748kb

input:

4
36 771
36 786
672 786
672 771

output:

427720

result:

ok 1 number(s): "427720"

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 3680kb

input:

4
0 100
100 200
200 100
100 0

output:

8670850

result:

wrong answer 1st numbers differ - expected: '34001650', found: '8670850'

Subtask #2:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 1ms
memory: 3676kb

input:

3
131 603
131 1828
1919 603

output:

0

result:

wrong answer 1st numbers differ - expected: '63739309181', found: '0'

Subtask #3:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 0ms
memory: 3748kb

input:

8
0 13
4 15
15 15
15 6
13 1
12 0
5 0
0 6

output:

58

result:

wrong answer 1st numbers differ - expected: '4047', found: '58'

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%