You are not logged in. Please login at www.codechef.com to post your questions!

×

Attached code seems to be working fine but not accepted for A game of shadows-ROBOGAME!!

include<iostream>

include<string>

using namespace std; int main() { int n,i,j,c,a1,a2; cin>>n; string s; for(i=0;i<n;i++) {="" c="0;" cin="">>s; j=0; while( s[j]=='.') j++; while( s[j]!='\0') {a1=s[j]; j++; while( s[j]=='.') {j++; c++;} a2=s[j]; if(c<a2+a1-96) {cout<<"unsafe\n"; break;} } if(s[j]=='\0') cout<<"safe\n"; } return 0; }

asked 16 Dec '18, 19:22

djthecoder's gravatar image

0★djthecoder
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×249
×1

question asked: 16 Dec '18, 19:22

question was seen: 35 times

last updated: 16 Dec '18, 19:22