알고리즘49 Codeforces Round #653 (Div. 3) ABC #include using namespace std; int T, x, y, n; int main() { cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(0); cin >> T; while (T--) { cin >> x >> y >> n; int k; if ((n / x) * x + y L; string s = ""; for (int i = 0; i > input; s += input; } int cnt = 0, res = 0; for (int i = 0; i < L; ++i) { if (s[i] == '(') cnt++; else { if (cnt == 0) res++; else cnt--; } } cout 2020. 8. 6. 이전 1 ··· 6 7 8 9 다음