| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 646933 | GudStonks | Kamenčići (COCI21_kamencici) | C++17 | 1091 ms | 300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int n, k;
string s;
bool fun(int l = 0, int r = n - 1, int a = 0, int b = 0)
{
if(a == k || b == k)
return b == k;
if(!(n - (r - l + 1) & 1))
{
return fun(l + 1, r, a + (s[l] == 'C'), b) || fun(l, r - 1, a + (s[r] == 'C'), b);
}
else
{
return !(!fun(l + 1, r, a, b + (s[l] == 'C')) || !fun(l, r - 1, a, b + (s[r] == 'C')));
}
}
int main()
{
cin>>n>>k;
cin>>s;
cout<<(fun() ? "DA" : "NE");
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
