제출 #1261693

#제출 시각아이디문제언어결과실행 시간메모리
1261693gry3125Kamenčići (COCI21_kamencici)C++20
0 / 70
0 ms324 KiB
#include <bits/stdc++.h> #define owo ios_base::sync_with_stdio(0);cin.tie(0); #define all(v) (v).begin(),(v).end() #define pb push_back #define fi first #define se second typedef long long int ll; using namespace std; int main() { owo int n, k; cin >> n >> k; bool ok = 0; deque<char> c(n); bool t = 1; vector<int> cnt(2); for (int i = 0; i < n; i++) cin >> c[i]; while (c.size() > 1) { t = !t; if (cnt[0] == k) {cout << "NE"; ok = 1; break;} if (cnt[1] == k) {cout << "DA"; ok = 1; break;} if (c.front() == 'P') {c.pop_front(); continue;} if (c.back() == 'P') {c.pop_back(); continue;} if (c[1] == 'C') {c.pop_front(); cnt[t]++; continue;} c.pop_back(); cnt[t]++; continue; } if (!ok) cout << "NE"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...