Submission #672398

# Submission time Handle Problem Language Result Execution time Memory
672398 2022-12-16T01:27:09 Z horiseun Zagrade (COI20_zagrade) C++11
Compilation error
0 ms 0 KB
#include "cia.h"
#include <iostream>
#include <stack>
#include <cstring>
using namespace std;

stack<int> unpaired;
char s[100005];
int count;

string solve(int n, int q) {
    unpaired.push(0);
    for (int i = 1; i < n; i++) {
        if (unpaired.empty()) {
            unpaired.push(i);
            continue;
        }
        if (query(unpaired.top(), i)) {
            s[unpaired.top()] = '(';
            s[i] = ')';
            unpaired.pop();
        } else {
            unpaired.push(i);
        }
    }

    for (int i = 0; i < n; i++) {
        if (!(s[i] == ')' || s[i] == '(')) count++;
    }
    count /= 2;

    string ans = "";
    for (int i = 0; i < n; i++) {
        if (s[i] == ')' || s[i] == '(') {
            ans += s[i];
        } else {
            if (count) {
                ans += ')';
                count--;
            } else {
                ans += '(';
            }
        }
    }

    return ans;

}

Compilation message

zagrade.cpp:1:10: fatal error: cia.h: No such file or directory
    1 | #include "cia.h"
      |          ^~~~~~~
compilation terminated.