# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1008155 |
2024-06-26T08:02:04 Z |
kebine |
Lasers (NOI19_lasers) |
C++17 |
|
20 ms |
16316 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
const int MAXN = 1e6 + 5;
vector < int > freq ( MAXN, 0);
int n, q;
signed main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> q;
while ( q-- ){
int k; cin >> k;
int yes = n;
int a[k + 5];
for ( int i = 1; i <= k; i++){
cin >> a[i];
}
sort ( a + 1, a + 1 + k, greater < int >());
for ( int i = 1; i <= k; i++){
for ( int j = max ( yes - a[i] + 1, 1ll ); j <= a[i]; j++){
freq[j]++;
///cout << j << " ";
}
yes -= a[i];
}
}
int ans = 0;
int l = 1, r = n;
while ( l < r ){
if ( freq[l] ) freq[r] = 1;
l++; r--;
}
for ( int i = 1; i <= n; i++) if ( freq[i] ) ans++;
cout << ans << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
8 ms |
16316 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
8 ms |
16316 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
9308 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8280 KB |
Output is correct |
2 |
Incorrect |
2 ms |
8284 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
9308 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
8 ms |
16316 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |