10
418429661 507737753
65169664 688434084
413093800 274858870
631767266 42769340
898214935 257992265
<100 bytes omitted>
用户输出
3130225209
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#21539 | #1002. B. 说服合伙人 | Wrong Answer | 0 | 2174 ms | 7072 K | C++ 11 (NOI) / 2.5 K | 十三月 | 2020-02-08 12:01:45 |
#include <iostream>
#include <string>
#include <cmath>
#include <fstream>
#include <cstdlib>
using namespace std;
struct pai {
long long ana;
long long bna;
char naderen;
};
long long min1(pai ar[], char a, int b);
long long min2(pai ar[], char a, int b);
int main() {
long a;
cin >> a;
pai* paizongliang = new pai[a];
long long i = 0, k = 0;
while (i < a) {
cin >> paizongliang[i].ana >> paizongliang[i].bna;
i++;
}
for (i = 0; i < a; i++) paizongliang[i].naderen = 'c';
for (i = 0; i < a; i++) {
for (long long j = i; j < a; j++) {
pai zhongjian;
if (paizongliang[i].ana < paizongliang[j].ana) {
zhongjian = paizongliang[i];
paizongliang[i] = paizongliang[j];
paizongliang[j] = zhongjian;
}
if ((paizongliang[i].ana == paizongliang[j].ana) && (paizongliang[i].bna < paizongliang[j].bna)) {
zhongjian = paizongliang[i];
paizongliang[i] = paizongliang[j];
paizongliang[j] = zhongjian;
}
}
}
i = 0;
while (i < a) {
if (i < a) {
paizongliang[i].naderen = 'a';
if (paizongliang[i].bna > min1(paizongliang, 'b', a)) {
paizongliang[i].naderen = 'b';
paizongliang[min2(paizongliang, 'b', a)].naderen = 'a';
}
i++;
}
if (i < a) {
paizongliang[i].naderen = 'b';
i++;
}
}
for (i = 0; i < a; i++) {
if (paizongliang[i].naderen == 'b')
k = k + paizongliang[i].ana;
}
cout << k;
return 0;
}
long long min1(pai ar[], char a, int b) {
long long i = 0;
long long j = 0;
long long* k = new long long[b];
*k = { 0 };
for (i; i < b; i++) {
if (ar[i].naderen == a) {
k[j] = i;
j++;
}
}
i = j = 0;
for (j; j < b; j++) {
if (ar[k[j]].bna < ar[k[i]].bna)
i = j;
}
return ar[k[i]].bna;
}
long long min2(pai ar[], char a, int b) {
long long i = 0;
long long j = 0;
long long* k = new long long[b];
*k = { 0 };
for (i; i < b; i++) {
if (ar[i].naderen == a) {
k[j] = i;
j++;
}
}
i = j = 0;
for (j; j < b; j++) {
if (ar[k[j]].bna < ar[k[i]].bna)
i = j;
}
return k[i];
}
10
418429661 507737753
65169664 688434084
413093800 274858870
631767266 42769340
898214935 257992265
<100 bytes omitted>
用户输出
3130225209
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
10
261419711 381790741
395301464 109727004
59930794 897303752
3088137 384452998
958125214 871307598
<99 bytes omitted>
用户输出
1828788897
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
10
272820626 605064353
42452002 527776118
972100004 103698531
970919694 473147884
766382361 47804712
<99 bytes omitted>
用户输出
3688248138
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
10
665205051 427204195
710845907 763741672
770108551 603167371
630316362 77165788
55843477 686664883
<99 bytes omitted>
用户输出
1576220713
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
10
370117930 10356508
206440207 24034552
458210301 632865559
491222122 687287181
687518376 655230963
<100 bytes omitted>
用户输出
1749286009
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
10
139976 593656460
723986671 363424724
1380273 28180744
408184158 741160744
281059907 629774070
642
<95 bytes omitted>
用户输出
1829402922
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
661330356 52985058
911549339 118926429
807317539 459347150
992990256 125679776
996241486 822802
<19613 bytes omitted>
用户输出
237373639573
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
565256379 461020479
586329353 20119014
704616001 387799623
671532884 883210479
19037978 7054035
<19589 bytes omitted>
用户输出
230293085451
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
459961701 778863108
184807385 131922901
981443367 130232010
858676237 295402608
970097732 64695
<19597 bytes omitted>
用户输出
432488890994
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
814981411 458887084
170493152 194098923
473222527 856427999
862026089 664018822
78094868 152144
<19613 bytes omitted>
用户输出
239919429322
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
998911939 14469580
801910454 835524235
924052809 151599226
906225034 728418914
509755094 338138
<19592 bytes omitted>
用户输出
308381037785
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
483991898 501892083
777360399 190443766
528271572 849071211
834112216 565841714
592931589 50914
<19616 bytes omitted>
用户输出
321521840818
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
662901492 757792097
22571113 205360684
341580811 497412615
141460200 418808285
281598247 518331
<19623 bytes omitted>
用户输出
230134610425
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
3021544 383844645
150777033 75965531
173194118 287932285
931104466 964593235
69625941 905448292
<19569 bytes omitted>
用户输出
373645707267
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
445016789 239644846
872436348 575307044
330232101 137239592
216342997 88891199
18780554 8558978
<19613 bytes omitted>
用户输出
459779209059
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
163988884 92515928
93417639 739319950
725416124 379155836
206222379 920981728
513989916 3549671
<19599 bytes omitted>
用户输出
218705606678
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
358875965 620163043
971597723 976962388
174534894 733898703
477415518 452255158
594800521 28882
<19621 bytes omitted>
用户输出
233853186973
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
881418187 750110566
315493938 282606189
699540817 761508637
293832807 238994173
43805780 899199
<19585 bytes omitted>
用户输出
223649036025
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
100000
54371547 36495877
591025884 46108328
160800309 868200825
637021838 76173428
413626379 9811729
<1968958 bytes omitted>