QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#418511#8723. 乘二OstracismWA 1ms3720kbC++14576b2024-05-23 14:18:422024-05-23 14:18:47

Judging History

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

  • [2024-05-23 14:18:47]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3720kb
  • [2024-05-23 14:18:42]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3720kb

input:

3 3
7 2 1

output:

1 0
2 0
4 2
7 1
8 0
14 0
16 0
28 0
32 0
56 0
64 0
112 0
128 0
224 0
256 0
448 0
512 0
896 0
1024 0
1792 0
2048 0
3584 0
4096 0
7168 0
8192 0
14336 0
16384 0
28672 0
32768 0
57344 0
65536 0
114688 0
131072 0
229376 0
262144 0
458752 0
524288 0
917504 0
1048576 0
1835008 0
2097152 0
3670016 0
4194304 ...

result:

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