QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#325256 | #5615. Two Charts Become One | jhtang2 | WA | 15ms | 97036kb | C++14 | 562b | 2024-02-11 06:42:46 | 2024-02-11 06:42:47 |
Judging History
answer
// Source: https://usaco.guide/general/io
#include <bits/stdc++.h>
using namespace std;
#define MAX 1000001
vector<set<int>> solve() {
string parse;
getline(cin, parse);
istringstream is(parse);
vector<set<int>> h(MAX);
stack<int> st;
int fir;
is >> fir;
st.push(fir);
char c;
while (is >> c) {
if (c == ')') {
st.pop();
}
if (c == '(') {
int child;
is >> child;
h[st.top()].insert(child);
st.push(child);
}
}
return h;
}
int main() {
cout << (solve() == solve() ? "YES" : "NO");
}
详细
Test #1:
score: 0
Wrong Answer
time: 15ms
memory: 97036kb
input:
11 (10) (12 (13) (17) (28)) 11 (12 (17) (28) (13)) (10)
output:
YES
result:
wrong answer 1st lines differ - expected: 'Yes', found: 'YES'