Tag: problem: (A) Ostap and Grasshopper Solve in C/C++

Codeforces Round #382 (Div. 2), problem: (A) Ostap and Grasshopper Solution in C/C++

#include<stdio.h> int b,d; int main(){ int i,s,n,k,t; scanf("%d%d",&n,&k); char x; for(i=1;i<=n;i++){ scanf(" %c",&x); if(x=='G')s=i; if(x=='T')t=i; if(x=='#')b=1; } for(i=s;i<=n;i+=k){ if(b) break; d=1; } for(i=s;i>=1;i-=k){ if(b) break; d=1; } if(d) printf("YES"); else printf("NO"); } 📦 Looking for Codeforces Round 382 Div Problem Ostap? Check the best...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!