QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#298775 | #7768. Grievous Lady | Larunatrecy | 0 | 1452ms | 4044kb | C++14 | 1.1kb | 2024-01-06 14:39:38 | 2024-01-06 14:39:40 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N =3030;
typedef long long LL;
#define BIG __int128
int n;
LL Ra,Rb;
LL a[N],b[N];
mt19937 rnd(time(0));
int Make(int l,int r)
{
return rnd()%(r-l+1)+l;
}
void print(BIG x)
{
if(x>9)print(x/10);
putchar('0'+x%10);
}
BIG A=0,B=0,C=0;
int state[N];
const int LIM = 40000;
const int K = 1;
int p[N];
void solve()
{
for(int i=1;i<=n;i++)scanf("%lld %lld",&a[i],&b[i]);
A=0;B=0;C=0;
for(int ip=1;ip<=30;ip++)
{
A=0;B=0;
for(int i=1;i<=n;i++)p[i]=i;
for(int i=1;i<=n;i++)swap(p[i],p[Make(1,n)]);
for(int i=1;i<=n;i++)swap(p[i],p[Make(1,n)]);
int mid=(n/2);
for(int i=1;i<=n;i++)
{
int x=p[i];
if(i<=mid)state[x]=0,A+=a[x];
else state[x]=1,B+=b[x];
}
for(int o=1;o<=LIM;o++)
{
int x=Make(1,n);
LL nA=A,nB=B;
if(state[x]==0)nA-=a[x],nB+=b[x];
else nA+=a[x],nB-=b[x];
if(nA*nB>C||Make(1,100)==1)
{
C=nA*nB;A=nA;B=nB;
state[x]^=1;
}
}
}
print(C);
putchar('\n');
}
int main()
{
int T;
scanf("%d %d %lld %lld",&T,&n,&Ra,&Rb);
while(T--)
{
solve();
}
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1310ms
memory: 3644kb
input:
50 10 10000 10000 8450 6001 2804 803 8972 6155 8161 1938 4806 6582 2927 9312 9157 1289 6486 3737 8239 257 7292 9051 6079 2510 1408 5174 6821 772 8947 3187 100 5067 6986 9882 2067 1776 2734 6298 8909 4770 1083 1077 4929 4165 4788 5873 5490 6802 6829 6136 8919 4869 9488 4505 1052 8990 57 1445 7680 822...
output:
1356022774 902566854 1140061305 967802717 879903720 890841120 1080286757 1250989070 1362698900 1346930560 1137531330 775920120 934759445 981422955 1136968923 839143260 1277454816 522098415 1244442420 1173533392 899456910 665601553 1193825850 968599704 831871767 1263368813 1302451776 811132751 103283...
result:
wrong answer 10th lines differ - expected: '1413511168', found: '1346930560'
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 1330ms
memory: 3708kb
input:
50 30 10000 10000 4853 6897 1727 7443 2329 2876 5355 3477 2872 4090 2719 1756 989 681 7909 4601 8835 4634 9358 3999 8141 3749 8476 9479 2527 8659 7238 5965 3058 2946 8 2928 8116 7269 3840 2790 422 930 2018 8310 1708 7842 3701 3484 2944 9028 4308 9528 4704 6890 7982 8335 1596 9290 7031 745 6121 7262 ...
output:
9075997372 9741088812 10477290528 9718030620 9141835285 11432058683 10870358352 7778666504 9641567016 11623923320 10375129797 9179627443 9286255875 9491961765 10977950304 9468844866 10751350080 9006501847 10296624454 11768814156 9089300885 11323095200 12048216180 9370896150 9916697697 9600793237 977...
result:
wrong answer 4th lines differ - expected: '10327786031', found: '9718030620'
Subtask #3:
score: 0
Wrong Answer
Test #33:
score: 0
Wrong Answer
time: 1344ms
memory: 3668kb
input:
50 100 10000 10000 3817 9367 533 166 3422 6775 1637 2003 4512 2346 7101 356 2772 4037 6684 180 8703 7518 4497 9606 9197 9761 7217 8544 332 7886 9189 4475 2622 7432 729 8677 3451 5287 8879 6942 4972 487 1370 3918 1009 5847 6307 2158 2380 9771 6296 9946 6644 2651 5624 5590 3171 1058 1608 8006 6185 687...
output:
99383125432 104811638659 112444468290 93848638709 117069498189 107731650616 102622981304 111108172500 122379069060 118785947808 104473835537 108747278118 112553665042 105352000256 107751544074 110512329768 110857194136 101022351512 103918702650 104526780000 120417049494 105478041302 122292004236 115...
result:
wrong answer 3rd lines differ - expected: '112729256865', found: '112444468290'
Subtask #4:
score: 0
Wrong Answer
Test #37:
score: 0
Wrong Answer
time: 1337ms
memory: 4020kb
input:
50 100 100000 1000000000 64674 582989836 17174 628184989 7993 598433899 93758 468751386 36632 620786833 54253 85788398 24335 220088249 41708 370324059 57541 192813008 20125 886362267 3571 180283386 31249 729879131 48870 314235662 40658 954471739 36545 20574741 87835 599485007 44057 459200718 16186 4...
output:
121814717077785270 123180788743136835 104234464147768458 118827552206912880 114553299522496016 109029035257319927 107905938339188778 108780548352085057 113623696625488025 108410774381543004 99271607302919308 105616345657765579 116326704862592262 115298913133393600 109272251056246936 1116664428288502...
result:
wrong answer 1st lines differ - expected: '122583343290315160', found: '121814717077785270'
Subtask #5:
score: 0
Wrong Answer
Test #49:
score: 0
Wrong Answer
time: 1352ms
memory: 3724kb
input:
50 300 100000 1000000000000 21621 667704611522 95538 504360767965 20121 374291791983 58259 527043478787 9507 542834074255 46613 834605157827 59064 675317470117 92489 500884084061 92529 451667545421 21745 407068201316 3514 222491362996 44418 198133054017 8437 358148875035 28745 928794182062 90101 554...
output:
6459513588193346066 7877644951460219708 3963483206526121981 7855889616928475392 8649058519180308380 1508978253460201396 8190625316062630872 8431040845064409792 9182791630850268921 6790335027087482912 3773330049731418458 7464915623374894280 6812580043611716566 9101800337769381348 6012202275381531218 ...
result:
wrong answer 1st lines differ - expected: '1024354444153173318804', found: '6459513588193346066'
Subtask #6:
score: 0
Wrong Answer
Test #51:
score: 0
Wrong Answer
time: 1346ms
memory: 3796kb
input:
50 300 1000000000 1000000000 622938742 803340090 411563373 506291511 661934617 381755435 876890605 94166677 279496763 869423201 508007585 131998848 592251587 47733172 703056185 932460203 228695499 72609615 129679067 589829468 272070690 179647026 185157790 460526572 351519179 920281520 843895312 1023...
output:
8992389330223360740 9141830817251681839 8853345274192601032 9018772121866329973 8551491602302742944 9118570363101188110 1685024273521919908 1604154392536522666 5595918835547581236 . 8812864457304832674 7214516949220199752 8986277963859038637 8888472180668892288 8768957078375265589 901427134170151711...
result:
wrong answer 1st lines differ - expected: '10145178504143463639155', found: '8992389330223360740'
Subtask #7:
score: 0
Wrong Answer
Test #61:
score: 0
Wrong Answer
time: 1358ms
memory: 3800kb
input:
50 800 100000 1000000000000 98918 860842806148 33478 598362503847 18531 201301091495 53208 640503897011 43307 430663243504 74638 460997604730 14440 749299232168 15540 46909570195 54856 833537407449 70810 868074038174 17982 623720662739 34195 105105463226 76704 538435018409 23449 43950632205 21959 38...
output:
7513564040015116250 5637311197555297074 7692072381851234116 8401433909069516780 4946139316917067427 9165668219314082825 7638005229056771787 9010050304935501024 7797695210530738157 7533148438889280089 8478856447806844957 9219552988354754980 8560294680004108288 7987618337080151930 8104507328303919800 ...
result:
wrong answer 1st lines differ - expected: '7370339999554792336414', found: '7513564040015116250'
Subtask #8:
score: 0
Wrong Answer
Test #73:
score: 0
Wrong Answer
time: 1387ms
memory: 3820kb
input:
50 1500 100000 1000000000000 18757 387292221744 29053 379348011407 47483 314966420174 80638 546097965718 84807 917566638908 59364 705165061774 25136 779704406223 23865 837453418495 38499 811293770591 84972 313037387571 23632 69910257865 36366 901965627066 33323 800225614191 75382 895280109542 95500 ...
output:
8943825060287296513 7550830568880756608 9166536625645531239 6478300017172615622 9185187784587471138 8924463711596004177 8433414346026581991 5413673859068121204 8711247280496364863 7111022944970539400 8911369525454022909 8372104575827929240 5046278327181940732 5895269546276842661 9157555809516668720 ...
result:
wrong answer 1st lines differ - expected: '25099931872189852821766', found: '8943825060287296513'
Subtask #9:
score: 0
Wrong Answer
Test #85:
score: 0
Wrong Answer
time: 1433ms
memory: 4044kb
input:
50 2500 10000 1000000000 1989 715660116 726 205696491 906 80983641 1280 135698142 9814 930386766 3162 86759005 1412 262080798 8338 590216389 8436 932386996 9530 971462836 3099 385836418 6344 24362894 4400 361413630 9974 582107128 1025 746910753 2258 921930336 3036 21556198 5903 237088626 9254 502009...
output:
6945482789928543780 6879665842092806745 6870830490275035302 6967997747032593414 7050948892462220928 6694642927460924352 7059500904500998954 6895214671474241910 6993632748251664526 6870738482099907703 6891867750796657072 6951232882073667248 6847399577456411688 6952636160961249172 6713421374878656880 ...
result:
wrong answer 1st lines differ - expected: '7005218822778586245', found: '6945482789928543780'
Subtask #10:
score: 0
Wrong Answer
Test #93:
score: 0
Wrong Answer
time: 1452ms
memory: 3696kb
input:
50 3000 10000 1000000000 2737 308421419 1673 866261939 7204 148757554 1832 755475073 6111 239582749 5110 227503898 7381 928418391 4831 719415538 4618 750355710 1602 775678323 490 537881445 163 880774777 8544 75938451 2585 496945876 3375 309585347 1089 926499529 7965 908906210 1001 39148177 9619 6401...
output:
0 . ( * ( ) . 9221814181511983518 * 0 * 0 . , 0 ( - * ( * . 0 0 , . * 9223362912475900320 + * 9221772499258244843 / / , ) * . 9221565257927581118 * ( , ( ( . / * ) * , * /
result:
wrong answer 1st lines differ - expected: '10107755825402443110', found: '0'