제출 #592896

#제출 시각아이디문제언어결과실행 시간메모리
592896NotLinuxKamenčići (COCI21_kamencici)C++14
0 / 70
1 ms332 KiB
/* character : NotLinux stats : - Skill : 2/10 - Passion : 8/10 - Rating : ~1400/3000 - Biggest Dream : being actually good at cp - Methods : Studying - Extras : No math or coding background - Started at : October of 2021 */ #include <bits/stdc++.h> using namespace std; #define int long long #define mp make_pair #ifdef LOCAL #include "/home/notlinux/debug.h" #else #define debug(x...) void(37) #define showarr(x) void(37) #endif void solve(){ } int32_t main(){ ios_base::sync_with_stdio(0);cin.tie(nullptr); //int tt;cin>>tt;while(tt--)solve(); deque < char > q; int n,k;cin >> n >> k; string str;cin >> str; for(auto itr : str)q.push_back(itr); int cnt1 = 0; int cnt2 = 0; int turn = 0; debug(q); while(cnt1 != k and cnt2 != k and q.size()) { int last = q.size()-1; debug(q,turn); if(turn%2){//cnt2 if(q[0] == 'P'){ q.pop_front(); } else if(q[last] == 'P'){ q.pop_back(); } else { cnt2++; debug(cnt2); q.pop_front() ; } } else {//cnt1 if(q[0] == 'P'){ q.pop_front(); } else if(q[last] == 'P'){ q.pop_back(); } else { cnt1++; debug(cnt1); q.pop_front() ; } } turn++; } debug(q); debug(cnt1 , cnt2); if(cnt2 != k)cout << "NE" << endl; else cout << "DA" << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...