Submission #884855

#TimeUsernameProblemLanguageResultExecution timeMemory
884855IsamKamenčići (COCI21_kamencici)C++17
0 / 70
0 ms348 KiB
#include<bits/stdc++.h> #ifdef DEBUG #include "debug.h" #else #define debug(...) void(37) #endif using namespace std; signed main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int N, K; string s; cin >> N >> K >> s; s = ' ' + s; int l = 1, r = N, gottena(0), gottenb(0); bool que = true; while(l <= r && max(gottena, gottenb) < K){ if(s[l] == 'C'){ if(que) gottena += s[r] == 'C'; else gottenb += s[r] == 'C'; --r; }else{ if(que) gottena += s[l] == 'C'; else gottenb += s[l] == 'C'; ++l; } que ^= 1; } cout << (gottena == K ? "NE" : "DA") << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...