×

 0 Here is my code: Solution The expected output is also produced and the limits of the variables is also satisfied. The output format is also correct. Is it that we don't have to print leading zeros? Please help me with the code. Thanks a lot! asked 12 Oct '17, 23:27 66●6 accept rate: 7%

 0 If last character of string is 1 then chef wins Here is an easy soln for it You can look at the editorial for full detail https://discuss.codechef.com/questions/71404/ttenis-editorial #include using namespace std; int main() { int t; cin>>t; while (t--) { string s; cin >> s; cout << (s[s.length()-1] == '1' ? "WIN\n" : "LOSE\n"); } }  answered 13 Oct '17, 01:28 1★spp____ 1.1k●2●10 accept rate: 8% 13.6k●1●10●36
 0 Dear, please read input constraints explicitly. The length of string (i.e. number of matches) can be upto 100. So your if-else conditions- if(chef==10&&opp==10) flag=true; else if(chef==11&&opp<11&&!flag) System.out.println("WIN"); else if(opp==11&&chef<11&&!flag) System.out.println("LOSE");  Will all malfunction. I think your code would print nothing for cases when S~100, although I didnt check that. answered 13 Oct '17, 10:05 13.6k●1●10●36 accept rate: 19%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×1,125
×461
×1

question asked: 12 Oct '17, 23:27

question was seen: 187 times

last updated: 13 Oct '17, 10:05