QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#73995 | #3170. Lunchtime Name Recall | UCSC_Ravioli# | WA | 5887ms | 3484kb | C++20 | 1.2kb | 2023-01-30 07:34:26 | 2023-01-30 07:34:27 |
Judging History
answer
// qdd on Jan 29, 2023
#ifdef qdd
#include <ringo>
#else
#include <bits/stdc++.h>
#define dbg(...)
#define dbgr(x, y)
#endif
using namespace std;
using ll = long long;
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
for (T& x : v) is >> x;
return is;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
bool f = 0;
for (const T& x : v) (f ? os << ' ' : os) << x, f = 1;
return os;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int a[10][30];
void sol() {
int n, m, x;
cin >> n >> m;
for (int i = 0; i < m; i++) {
cin >> x;
for (int j = 0; j < x; j++) a[i][j] = (1 << i);
}
int ans = 0, t = 1900000;
while (t--) {
for (int i = 0; i < m; i++) {
shuffle(a[i], a[i] + n, rng);
}
map<int, int> mp;
for (int j = 0; j < n; j++) {
int sum = 0;
for (int i = 0; i < m; i++) {
sum += a[i][j];
}
mp[sum]++;
}
int now = 0;
for (auto& [x, y] : mp) {
if (y == 1) now++;
}
ans = max(ans, now);
}
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
sol();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 360ms
memory: 3388kb
input:
4 2 2 2
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 1767ms
memory: 3480kb
input:
16 3 6 8 8
output:
5
result:
ok single line: '5'
Test #3:
score: 0
Accepted
time: 412ms
memory: 3456kb
input:
5 2 2 2
output:
3
result:
ok single line: '3'
Test #4:
score: 0
Accepted
time: 1785ms
memory: 3412kb
input:
16 3 8 8 8
output:
6
result:
ok single line: '6'
Test #5:
score: 0
Accepted
time: 3595ms
memory: 3472kb
input:
20 7 1 1 1 1 6 8 8
output:
11
result:
ok single line: '11'
Test #6:
score: 0
Accepted
time: 756ms
memory: 3476kb
input:
7 3 3 2 1
output:
4
result:
ok single line: '4'
Test #7:
score: 0
Accepted
time: 1128ms
memory: 3396kb
input:
9 4 1 1 3 3
output:
5
result:
ok single line: '5'
Test #8:
score: 0
Accepted
time: 1166ms
memory: 3412kb
input:
10 3 4 4 3
output:
6
result:
ok single line: '6'
Test #9:
score: 0
Accepted
time: 1210ms
memory: 3392kb
input:
10 3 4 4 5
output:
6
result:
ok single line: '6'
Test #10:
score: 0
Accepted
time: 1212ms
memory: 3392kb
input:
10 3 4 4 4
output:
7
result:
ok single line: '7'
Test #11:
score: 0
Accepted
time: 1429ms
memory: 3404kb
input:
12 3 6 6 6
output:
6
result:
ok single line: '6'
Test #12:
score: 0
Accepted
time: 1538ms
memory: 3376kb
input:
10 5 2 2 2 2 2
output:
7
result:
ok single line: '7'
Test #13:
score: 0
Accepted
time: 1789ms
memory: 3396kb
input:
10 6 2 2 2 2 2 2
output:
10
result:
ok single line: '10'
Test #14:
score: 0
Accepted
time: 689ms
memory: 3476kb
input:
10 2 3 3
output:
2
result:
ok single line: '2'
Test #15:
score: 0
Accepted
time: 1776ms
memory: 3484kb
input:
10 6 8 5 2 8 8 1
output:
10
result:
ok single line: '10'
Test #16:
score: 0
Accepted
time: 913ms
memory: 3476kb
input:
7 4 5 5 1 2
output:
5
result:
ok single line: '5'
Test #17:
score: 0
Accepted
time: 154ms
memory: 3408kb
input:
2 1 1
output:
2
result:
ok single line: '2'
Test #18:
score: 0
Accepted
time: 181ms
memory: 3392kb
input:
3 1 1
output:
1
result:
ok single line: '1'
Test #19:
score: 0
Accepted
time: 970ms
memory: 3472kb
input:
30 1 15
output:
0
result:
ok single line: '0'
Test #20:
score: 0
Accepted
time: 423ms
memory: 3408kb
input:
3 5 1 1 1 1 1
output:
3
result:
ok single line: '3'
Test #21:
score: 0
Accepted
time: 794ms
memory: 3284kb
input:
5 6 2 2 2 2 2 2
output:
5
result:
ok single line: '5'
Test #22:
score: -100
Wrong Answer
time: 5887ms
memory: 3428kb
input:
30 5 15 15 15 15 13
output:
26
result:
wrong answer 1st lines differ - expected: '28', found: '26'