제출 #581585

#제출 시각아이디문제언어결과실행 시간메모리
581585chirathnirodhaKamenčići (COCI21_kamencici)C++17
0 / 70
0 ms212 KiB
//Coded by Chirath Nirodha #include<bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; using namespace std; #define F first #define S second #define PB push_back #define MP make_pair #define P push #define I insert typedef long long ll; typedef long double ld; typedef unsigned long long ull; //typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set; const ll mod=1e9+7; inline void io(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } void solve(){ io(); int n,k;cin>>n>>k; string s;cin>>s; int a=0,b=n-1; int x=0,y=0; bool aut=true; while(a<=b){ int tt=0; if(s[a]=='P')a++; else if(s[b]=='P')b--; else{ if(aut)x++; else y++; if(b-a<3)a++; else{ if(a+1=='C')a++; else b++; } } if(x==k){cout<<"NE"<<endl;return;} if(y==k){cout<<"DA"<<endl;return;} if(aut)aut=false; else aut=true; } } int main(){ io(); solve(); //int t;cin>>t;for(int i=0;i<t;i++)solve(); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'void solve()':
Main.cpp:30:7: warning: unused variable 'tt' [-Wunused-variable]
   30 |   int tt=0;
      |       ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...