# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1159833 | justin271828 | Specijacija (COCI20_specijacija) | C++17 | 135 ms | 100740 KiB |
#include <bits/stdc++.h>
using namespace std;
#define l2 long long
l2 p[543210][20];
l2 d[543210];
int main() {
l2 n, que, t;
cin >> n >> que >> t;
l2 com = ((n+1)*(n+2))/2;
l2 a[n];
set<l2> as;
for (l2 i = 0; i < n; i++) {
cin >> a[i];
as.insert(a[i]);}
memset(p, -1, sizeof(p));
d[1] = 0;
queue<l2> q;
q.push(1);
q.push(1);
l2 counter = 1;
while (!q.empty()) {
if (counter >= com) break;
p[++counter][0] = q.front();
d[counter] = d[q.front()]+1;
q.pop();
q.push(counter);
if (as.find(counter) != as.end()) q.push(counter);}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |