QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#817377#2652. IcebergsSGColinAC ✓3ms3944kbC++20771b2024-12-16 22:00:502024-12-16 22:00:56

Judging History

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

  • [2024-12-16 22:00:56]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3944kb
  • [2024-12-16 22:00:50]
  • 提交

answer

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

inline int rd() {
    int x = 0;
    char c = getchar();
    for (; !isdigit(c); c = getchar());
    for (; isdigit(c); c = getchar()) x= x * 10 + (c ^ 48);
    return x;
}

ll ans = 0;

struct vec {
    ll x, y;
    inline ll operator * (vec &b) {
        return x * b.y - y * b.x;
    }
}c[100];

inline void work() {
    int n = rd();
    ll nw = 0;
    for (int i = 1; i <= n; ++i) {
        c[i].x = rd(); c[i].y = rd();
    }
    for (int i = 1; i <= n; ++i) {
        int j = i + 1 > n ? 1 : i + 1;
        nw += c[i] * c[j];
    }
    ans += abs(nw);
}

int main() {
    int t = rd();
    while (t--) work();
    printf("%lld\n", ans / 2);
    return 0;
}

詳細信息

Test #1:

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

input:

1
4
0 0
1 0
1 1
0 1

output:

1

result:

ok single line: '1'

Test #2:

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

input:

2
5
98 35
79 90
21 90
2 36
50 0
3
0 0
20 0
0 20

output:

6100

result:

ok single line: '6100'

Test #3:

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

input:

100
4
495001 7735
742502 7735
495001 3867
247500 3867
4
495001 15471
742502 15471
495001 11603
247500 11603
4
247500 19848
495001 16356
742502 23207
495001 17242
4
495001 34811
742502 34811
495001 30943
247500 30943
4
495001 46415
742502 46415
495001 38679
247500 38679
4
495001 54151
742502 50663
49...

output:

120867113350

result:

ok single line: '120867113350'

Test #4:

score: 0
Accepted
time: 3ms
memory: 3876kb

input:

1000
50
630 30937
88 61876
483 92814
570 123753
483 154691
1299 185630
718 247506
1213 278444
107 309383
169 340321
483 371260
168 402198
726 433137
858 495013
483 525951
549 556890
483 587828
98 618767
79 649705
1008 680644
304 742520
483 773458
607 804397
662 866273
127 897211
967 928150
256 89721...

output:

428408462250

result:

ok single line: '428408462250'

Test #5:

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

input:

1000
50
30937 162
61876 265
92814 372
123753 431
154691 516
185630 365
247506 442
278444 467
309383 618
340321 375
371260 345
402198 185
433137 414
495013 437
525951 597
556890 476
587828 418
618767 310
645386 288
672006 353
742520 364
773458 385
804397 637
866273 734
897211 586
928150 644
897211 12...

output:

429998996492

result:

ok single line: '429998996492'

Test #6:

score: 0
Accepted
time: 3ms
memory: 3812kb

input:

1000
50
147 30937
309 61876
541 92814
577 123753
638 154691
518 185630
338 247506
398 286057
667 324609
1094 347934
973 371260
675 402198
333 433137
399 495013
428 505060
488 515107
483 525154
483 535202
600 618485
600 638861
600 742520
333 773458
419 804397
330 866273
383 897211
272 928150
767 8972...

output:

428945417677

result:

ok single line: '428945417677'

Test #7:

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

input:

1000
40
0 0
25010 0
25010 25010
2000 25010
2000 2000
23010 2000
23010 23010
4000 23010
4000 4000
21010 4000
21010 21010
6000 21010
6000 6000
19010 6000
19010 19010
8000 19010
8000 8000
17010 8000
17010 17010
10000 17010
10001 17009
17009 17009
17009 8001
8001 8001
8001 19009
19009 19009
19009 6001
6...

output:

275209000

result:

ok single line: '275209000'

Test #8:

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

input:

100
4
7735 495001
7735 742502
3867 495001
860 247500
4
15471 495001
15471 742502
11603 495001
8596 247500
4
20482 247500
19339 495001
23207 742502
23207 495001
4
30943 247500
30943 495001
34811 742502
34811 495001
4
46415 495001
46415 742502
38679 495001
38679 247500
4
54151 495001
54151 742502
5028...

output:

118551246493

result:

ok single line: '118551246493'

Test #9:

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

input:

100
4
181463 3867
495001 5576
795191 7222
495001 9800
4
181463 11603
495001 14701
795191 14445
495001 19602
4
181463 19339
495001 24503
795191 21668
495001 29404
4
495001 44106
795191 32503
495001 39206
181463 30943
4
181463 38679
495001 49007
795191 43337
495001 58809
4
181463 50283
495001 63710
79...

output:

147860270352

result:

ok single line: '147860270352'

Test #10:

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

input:

100
4
3867 247500
3003 495001
3430 742502
6008 495001
4
12018 495001
6861 742502
9013 495001
11603 247500
4
16639 495001
8903 742502
14328 495001
19339 247500
4
30943 247500
21259 495001
12313 742502
23353 495001
4
35293 247500
25446 495001
16418 742502
29632 495001
4
36076 495001
19155 742502
32854...

output:

119770931421

result:

ok single line: '119770931421'

Test #11:

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

input:

200
10
123750 4532
247501 3810
371252 1897
495003 374
618754 1933
742505 3868
618754 3868
495003 749
371252 3795
247501 7621
10
123750 13600
247501 8633
371252 5693
495003 1124
618754 5802
742505 7737
618754 7737
495003 1500
371252 7591
247501 9646
10
123750 20549
247501 9773
371252 10373
495003 187...

output:

246426232557

result:

ok single line: '246426232557'

Test #12:

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

input:

200
10
602 123750
492 247501
26 371252
3183 495003
2905 618754
6468 742505
5811 618754
6368 495003
53 371252
986 247501
10
1974 247501
107 371252
12738 495003
11624 618754
12938 742505
10775 618754
9553 495003
97 371252
1480 247501
1730 123750
10
3016 123750
2468 247501
134 371252
15922 495003
14530...

output:

240553752603

result:

ok single line: '240553752603'

Test #13:

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

input:

200
10
247501 4297
371252 2717
495003 1799
618754 1573
742505 1434
618754 785
495003 899
371252 1358
247501 1520
123750 694
10
123750 7736
247501 6446
371252 4076
495003 2699
618754 2359
742505 2868
618754 3147
495003 3600
371252 5436
247501 8596
10
123750 12894
247501 11285
371252 7335
495003 4455
...

output:

245251093061

result:

ok single line: '245251093061'

Test #14:

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

input:

200
10
1933 123750
3223 247501
3135 371252
2503 495003
1845 618754
2578 742505
3691 618754
5007 495003
6272 371252
6449 247501
10
5802 123750
9095 247501
8831 371252
6933 495003
5537 618754
5158 742505
7384 618754
10016 495003
12547 371252
12899 247501
10
9671 123750
14539 247501
14099 371252
12201 ...

output:

244961020717

result:

ok single line: '244961020717'

Test #15:

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

input:

1000
50
30937 511
61876 289
92814 483
123753 483
154691 761
185630 906
247506 126
251056 750
370373 792
431806 1359
493240 342
493683 48
494127 483
495013 483
525951 176
556890 483
587828 1229
618767 86
649705 1728
680644 764
742520 52
773458 549
804397 483
866273 483
897211 644
928150 241
897211 12...

output:

429781636784

result:

ok single line: '429781636784'