QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#719751 | #8227. 圆 | Take_A_Single_6 | 0 | 237ms | 3900kb | C++14 | 1.2kb | 2024-11-07 08:36:21 | 2024-11-07 08:36:21 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define db double
#define maxn 1000005
#define mod 998244353
#define fir first
#define sec second
#define pr pair<int,int>
#define pb push_back
#define mk make_pair
#define inf 10000000000000000
using namespace std;
inline int read()
{
int SS=0,WW=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')WW=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
SS=(SS<<1)+(SS<<3)+(ch^48);
ch=getchar();
}
return SS*WW;
}
inline void write(int XX)
{
if(XX<0)putchar('-'),XX=-XX;
if(XX>9)write(XX/10);
putchar(XX%10+'0');
}
int T,n,ans;
db x;
multiset<db>s;
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
for(cin>>T;T;T--)
{
cin>>n,ans=0;
for(int i=1;i<=n;i++)cin>>x,ans+=(int)x,s.insert(x-(int)x);
while(s.size())
{
auto it=s.begin();
s.erase(it);
if(*it>=0.5)
{
ans++;
continue;
}
if(s.empty())break;
auto nxt=s.lower_bound(0.5-*it);
if(nxt==s.end())
{
auto t=s.begin();
s.erase(t),s.insert(*t+*it);
continue;
}
ans++,s.erase(nxt);
}
write(ans),puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 10ms
memory: 3788kb
input:
10000 5 0.3 1.3 7.5 0.9 1.3 5 3.7 2.8 4.8 3.3 6.8 5 5.9 5.5 0.9 8.8 6.0 5 6.9 1.9 8.3 0.9 8.6 5 1.1 5.2 5.1 6.1 7.1 5 5.1 5.8 6.1 0.1 5.2 5 1.3 7.1 3.1 2.9 9.6 5 7.8 9.8 6.8 0.8 7.8 5 6.3 9.8 1.1 3.4 7.1 5 0.1 1.7 1.2 2.2 3.7 5 3.7 9.5 0.2 8.7 7.2 5 0.0 3.6 2.7 5.1 9.9 5 5.8 3.0 5.0 4.0 8.3 5 1.0 9....
output:
12 22 28 27 25 22 24 34 28 9 30 22 26 26 27 26 34 19 22 29 26 24 19 34 19 21 24 23 31 23 17 26 30 21 28 7 28 36 16 23 15 37 22 24 27 23 23 30 27 26 22 30 7 34 18 29 32 33 25 26 28 27 19 26 16 29 10 30 30 25 29 13 27 11 30 17 29 28 19 20 36 27 22 27 19 28 32 18 45 36 21 28 31 27 23 18 18 39 27 15 29 ...
result:
wrong answer 6th numbers differ - expected: '23', found: '22'
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 1ms
memory: 3900kb
input:
100 12 3.8 2.2 7.7 4.3 8.1 9.3 6.2 7.6 5.8 9.3 5.3 7.2 12 9.1 5.5 6.5 8.1 4.1 4.5 9.1 0.5 3.1 3.7 6.5 2.4 12 2.4 3.4 3.4 8.7 0.7 9.2 0.9 2.0 5.0 8.6 5.0 0.0 12 6.7 5.0 4.7 8.9 8.5 2.8 9.0 6.8 6.0 6.7 9.5 0.9 12 4.2 7.2 8.5 9.1 0.2 4.2 0.2 5.6 2.3 1.7 0.2 8.4 12 9.7 6.8 4.0 1.8 7.7 2.8 2.1 3.3 0.7 4....
output:
79 66 51 78 53 55 73 59 68 67 50 57 79 53 65 61 34 77 65 51 53 60 47 74 68 76 43 60 61 66 60 87 63 56 51 63 67 42 69 42 69 71 81 69 53 72 81 57 40 66 77 65 53 57 72 62 57 59 74 52 70 61 40 79 53 55 60 64 49 72 49 49 60 50 52 73 76 66 68 28 65 65 57 64 73 66 52 86 43 57 61 59 59 51 59 61 58 51 64 60
result:
wrong answer 5th numbers differ - expected: '54', found: '53'
Subtask #3:
score: 0
Wrong Answer
Test #15:
score: 0
Wrong Answer
time: 188ms
memory: 3796kb
input:
10000 80 5.8 9.4 8.7 6.3 3.9 8.7 1.6 3.3 1.6 7.2 3.8 1.8 4.7 7.3 4.8 2.1 1.2 6.5 0.9 1.8 2.6 2.8 7.1 0.9 9.5 4.5 0.8 1.9 3.6 5.9 9.8 3.3 3.8 6.8 4.7 0.0 6.6 9.9 8.8 9.3 7.2 5.9 1.9 8.8 0.6 0.3 4.2 1.3 2.2 8.2 4.8 2.9 4.7 6.2 1.7 7.2 1.0 8.0 9.9 6.2 7.3 8.8 3.6 4.6 0.7 9.6 9.3 8.2 7.6 6.8 5.2 3.6 7.8...
output:
425 429 387 432 377 402 367 438 461 398 408 396 388 421 434 429 411 401 436 370 429 450 466 422 421 427 397 459 426 473 399 375 359 403 408 435 470 439 366 450 458 415 393 398 434 449 395 449 421 340 414 402 391 435 439 381 413 417 435 426 410 410 342 410 398 389 384 442 385 433 429 464 389 421 408 ...
result:
wrong answer 4th numbers differ - expected: '434', found: '432'
Subtask #4:
score: 0
Wrong Answer
Test #22:
score: 0
Wrong Answer
time: 237ms
memory: 3720kb
input:
10000 100 9.0 7.4 3.6 2.0 6.4 8.4 3.4 2.4 9.4 2.6 8.6 3.4 4.4 8.4 5.4 6.4 3.4 8.6 0.0 1.0 8.4 8.0 6.6 6.6 5.4 8.4 7.0 2.6 9.6 1.6 8.6 0.8 5.0 8.4 8.4 7.4 3.8 6.4 9.4 2.6 8.4 9.6 3.0 3.4 6.4 8.4 6.4 8.4 5.4 4.4 4.6 1.4 7.4 7.4 5.8 4.0 6.6 0.4 7.4 1.8 5.4 9.4 9.4 3.0 1.6 4.8 5.0 3.4 0.4 1.0 2.0 4.4 3....
output:
543 503 526 540 484 515 519 480 485 528 467 476 467 543 490 485 500 439 536 528 554 490 506 457 468 459 533 489 481 548 522 471 539 523 528 560 473 496 528 461 565 468 478 476 515 506 563 507 545 486 479 487 524 513 538 451 489 504 452 529 471 517 576 423 486 490 550 555 450 489 483 487 506 535 543 ...
result:
wrong answer 4th numbers differ - expected: '543', found: '540'
Subtask #5:
score: 0
Wrong Answer
Test #29:
score: 0
Wrong Answer
time: 232ms
memory: 3832kb
input:
10000 100 2.1 3.8 5.3 2.1 1.8 3.1 5.6 6.8 1.3 8.6 5.8 1.9 4.9 4.2 9.2 6.1 6.3 2.2 5.6 1.3 6.7 2.7 1.0 6.8 6.3 5.9 8.3 7.9 0.0 0.1 4.9 4.9 0.2 2.9 4.0 8.6 1.6 2.0 1.0 1.0 5.7 2.0 5.7 2.8 2.8 2.8 2.3 5.9 5.3 7.0 8.6 4.0 6.6 5.1 5.0 8.7 3.0 0.9 5.0 2.8 4.7 5.1 1.2 8.1 0.0 0.6 6.6 1.3 3.0 0.6 9.9 9.0 9....
output:
456 529 535 478 520 499 512 513 495 522 535 549 522 532 538 521 540 529 530 511 509 521 510 511 493 497 489 480 541 521 532 476 484 517 504 501 601 562 558 539 530 536 488 548 515 494 516 536 485 571 531 485 504 496 491 516 546 535 529 517 488 565 447 493 539 554 530 498 518 471 543 507 535 519 487 ...
result:
wrong answer 1st numbers differ - expected: '459', found: '456'