10196 - Check The Check

All about problems in Volume 101. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 10196 - Check The Check

Post by lighted »

Increase array limit

Code: Select all

int cheque[300] = {0};
Always print a newline after last line.

Code: Select all

   for(i = 0; i < game; i++)
   {
      if(cheque[i] == 0)    printf("Game #%i: no king is in check.", i + 1);
      if(cheque[i] == 1)    printf("Game #%i: white king is in check.", i + 1);
      if(cheque[i] == 2)   printf("Game #%i: black king is in check.", i + 1);
      printf("\n");
   }
brianfry713 wrote:Input:

Code: Select all

PbprNPqR
BNRKbQ.n
p.qBpbrp
.N..R.NR
QRqn.R.b
Pp.bQRrq
rnnRrrBk
BRbbbNrQ

........
........
........
........
........
........
........
........
AC output:

Code: Select all

Game #1: both kings are in check.
According to problem description its invalid input/output
There will be no invalid characters (i.e. pieces) and there won't be a configuration where both kings are in check.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10196 - Check The Check

Post by brianfry713 »

I deleted that invalid input.
Check input and AC output for thousands of problems on uDebug!
falc0n
New poster
Posts: 2
Joined: Mon Sep 08, 2014 12:57 am

Re: 10196 - Check The Check

Post by falc0n »

lighted wrote:Increase array limit

Code: Select all

int cheque[300] = {0};
Always print a newline after last line.

Code: Select all

   for(i = 0; i < game; i++)
   {
      if(cheque[i] == 0)    printf("Game #%i: no king is in check.", i + 1);
      if(cheque[i] == 1)    printf("Game #%i: white king is in check.", i + 1);
      if(cheque[i] == 2)   printf("Game #%i: black king is in check.", i + 1);
      printf("\n");
   }
brianfry713 wrote:Input:

Code: Select all

PbprNPqR
BNRKbQ.n
p.qBpbrp
.N..R.NR
QRqn.R.b
Pp.bQRrq
rnnRrrBk
BRbbbNrQ

........
........
........
........
........
........
........
........
AC output:

Code: Select all

Game #1: both kings are in check.
According to problem description its invalid input/output
There will be no invalid characters (i.e. pieces) and there won't be a configuration where both kings are in check.
Thank you so much !

I've never thinked that there were going to have more than 200 tests. omg
Post Reply

Return to “Volume 101 (10100-10199)”