# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
814413 | 2023-08-08T07:22:31 Z | 박상훈(#10120) | Arranging Tickets (JOI17_arranging_tickets) | C++17 | 215 ms | 296 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[200200], b[200200], c[200200], S[200200]; void add(int l, int r){ for (int i=l;i<=r;i++) S[i]++; } int main(){ int n, m; scanf("%d %d", &n, &m); for (int i=1;i<=m;i++){ scanf("%d %d %d", a+i, b+i, c+i); if (a[i] > b[i]) swap(a[i], b[i]); } int ans = 1e9 + 100; for (int z=0;z<(1<<m);z++){ fill(S+1, S+n+1, 0); for (int i=0;i<m;i++){ if (z&(1<<i)) add(a[i], b[i]-1); else{ add(1, a[i]-1); add(b[i], n); } } ans = min(ans, *max_element(S+1, S+n+1)); } printf("%d\n", ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 212 ms | 296 KB | Output is correct |
2 | Incorrect | 215 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 212 ms | 296 KB | Output is correct |
2 | Incorrect | 215 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 212 ms | 296 KB | Output is correct |
2 | Incorrect | 215 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 212 ms | 296 KB | Output is correct |
2 | Incorrect | 215 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 212 ms | 296 KB | Output is correct |
2 | Incorrect | 215 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |