QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#418517#8723. 乘二OstracismWA 309ms64096kbC++14582b2024-05-23 14:19:322024-05-23 14:19:34

Judging History

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

  • [2024-05-23 14:19:34]
  • 评测
  • 测评结果:WA
  • 用时:309ms
  • 内存:64096kb
  • [2024-05-23 14:19:32]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n, k, x;
const int MOD = 1e9 + 7;
typedef unsigned long long ull;
map<ull, int> llimp;
ull ans;

int main() {
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> x;
		llimp[x]++;
	}
	for (auto t : llimp) {
		int tmp = min(k, t.second), idx = t.first;
		llimp[idx] -= tmp;
		k -= tmp;
		llimp[(2 * idx) % MOD] += tmp;
	}
//	for (auto t : llimp) {
//		cout << t.first << " " << t.second << endl;
//	}
	for (auto t : llimp) {
		ans = (ans + t.first % MOD * t.second) % MOD;
	}
	cout << ans;
	return 0;
}

详细

Test #1:

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

input:

3 3
7 2 1

output:

15

result:

ok 1 number(s): "15"

Test #2:

score: 0
Accepted
time: 299ms
memory: 63904kb

input:

200000 1605067
366760624 67854 93901 693975 27016 1046 10808 6533158 54778 500941023 77236442 32173 10431454 2 9726 1553148 89282 411182309 494073 131299543 249904771 7906930 353 9909 3632698 29156 1917186 303 737 1189004 22 1983 263 711 4106258 2070 36704 12524642 5192 123 2061 22887 66 380 1 10153...

output:

707034173

result:

ok 1 number(s): "707034173"

Test #3:

score: 0
Accepted
time: 296ms
memory: 64096kb

input:

200000 108039
13 851590697 3104 109395313 37 928 2329004 13853269 1 15 226 4785 488 2930 83250294 12228 145352832 120690 14511669 181 10740 26395301 4 1172 451394571 24571 11076 90419 5929 579583498 903729755 142027966 300157 25 20 22148 30321289 71577040 37091 1951 445549 21 96460 3491 624 764 1 48...

output:

752908968

result:

ok 1 number(s): "752908968"

Test #4:

score: 0
Accepted
time: 293ms
memory: 63884kb

input:

200000 2903290
201855332 123438 83762 1638319 17 122361 121973 17172 44 51 1 5 367822770 251 1908405 5 240290 185972 303017248 22227 193978 133159 92105 504 227 4796 1173 143 6 67736 252033016 257 876 845 16 39 9408 18 204865935 18263757 564396 213 126820 23050809 235107 1025 2169 7495 1264417 1 158...

output:

832633511

result:

ok 1 number(s): "832633511"

Test #5:

score: 0
Accepted
time: 295ms
memory: 64092kb

input:

200000 2896585
6 452 3906 198 2255433 1 801262 36414 814625805 15306728 1 323 9147 38 209 27 65213 52955210 1058270 212337 33487357 748 1192540 5474 45771272 953357 49527 59 76 12 58289305 2981 51095 235 109 14245387 460771 804 77441813 518 13278099 1032654 2 97035 13 1290 488716758 926 771025363 13...

output:

675173351

result:

ok 1 number(s): "675173351"

Test #6:

score: 0
Accepted
time: 295ms
memory: 63696kb

input:

200000 2903371
3753 232038 1596 27188889 29806557 4507 101382910 29719929 5846 126677 26420576 129855 3056030 2888725 4010747 4 12420 20002 24 237 253986 15720 2 1408 210143934 115978 457371 130799 370 6526734 11 12314003 12801660 157231514 115822 256104005 741129 3 1177403 33905648 17 125368170 232...

output:

682045332

result:

ok 1 number(s): "682045332"

Test #7:

score: 0
Accepted
time: 289ms
memory: 63640kb

input:

200000 1379432
217058486 3 323 10 162481 57177214 1678053 1 102 344174298 43456176 29791 26831 1163 2052378 38165 257 543 3078 20 155606738 371718950 2206343 91109757 52819894 226780639 1449 324614092 1 5156380 25135511 2 703379984 284865307 18 54995975 9 264 16066939 1 344513 386945818 23384664 138...

output:

724985989

result:

ok 1 number(s): "724985989"

Test #8:

score: 0
Accepted
time: 302ms
memory: 63808kb

input:

200000 1766925
435446 1 933 69620787 614953807 7697 553 166794 37 852 1838 282 131157201 91 5012 83045 53 471328 3 915357 7 1 791554250 6 237448 3688 15020 30076 2088 7 133877 5448 488942367 472 113 128774175 74422376 294698 453085 116 149183429 72768 138 66470849 129266201 4 716757134 77 2405 19168...

output:

517037208

result:

ok 1 number(s): "517037208"

Test #9:

score: -100
Wrong Answer
time: 309ms
memory: 63964kb

input:

200000 688425072
2541 13648574 164117 7494942 2212249 200 1722 466007 43596 25893922 283753 637416551 81907530 15 1006457 1409 11096782 1 16 2240287 55407492 2377695 944 120 776859 890171856 6138 109 915 31958 95467702 922635 120 189 3 339 549450930 151077 10 3814 890391326 6509774 26584150 4560323 ...

output:

264181971

result:

wrong answer 1st numbers differ - expected: '161069543', found: '264181971'