# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
931811 |
2024-02-22T11:14:33 Z |
Syrius |
Topical (NOI23_topical) |
C++14 |
|
1000 ms |
125068 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ff first
#define ss second
#define pint pair < int , int >
#define fast ios_base::sync_with_stdio(NULL); cin.tie(NULL)
const int inf = 1e9 + 9;
const int mxn = 2e5 + 2;
const int mod = 1e9 + 7;
vector < vector < int > > u , r;
int n , k;
bool cmp(vector < int > a , vector < int > b) {
for (int i = 0; i < k; i++) {
if (a[i] < b[i]) return 1;
else if (a[i] > b[i]) return 0;
}
return 0;
}
signed main() {
cin >> n >> k;
for (int i = 0; i < n; i++) {
vector < int > tv;
for (int j = 0; j < k; j++) {
int t;
cin >> t;
tv.push_back(t);
}
tv.push_back(i);
r.push_back(tv);
}
u.resize(n);
for (int i = 0; i < n; i++) {
for (int j = 0; j < k; j++) {
int t;
cin >> t;
u[i].push_back(t);
}
}
sort(r.begin() , r.end() , cmp);
vector < int > p(k , 0);
int ans = 0;
for (int i = 0; i < n; i++) {
if (!cmp(p , r[i])) {
ans++;
for (int j = 0; j < k; j++) {
p[j] += u[r[i][k]][j];
}
} else break;
}
cout << ans << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
4 ms |
780 KB |
Output is correct |
4 |
Correct |
390 ms |
39776 KB |
Output is correct |
5 |
Correct |
380 ms |
39716 KB |
Output is correct |
6 |
Correct |
381 ms |
39968 KB |
Output is correct |
7 |
Correct |
255 ms |
39716 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Incorrect |
6 ms |
616 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
600 KB |
Output is correct |
3 |
Correct |
13 ms |
1548 KB |
Output is correct |
4 |
Correct |
146 ms |
12900 KB |
Output is correct |
5 |
Correct |
134 ms |
13388 KB |
Output is correct |
6 |
Execution timed out |
1074 ms |
125068 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
4 ms |
780 KB |
Output is correct |
4 |
Correct |
390 ms |
39776 KB |
Output is correct |
5 |
Correct |
380 ms |
39716 KB |
Output is correct |
6 |
Correct |
381 ms |
39968 KB |
Output is correct |
7 |
Correct |
255 ms |
39716 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Incorrect |
6 ms |
616 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |