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

×

ACTNBM – Editorial

2
2

PROBLEM LINK:

Practice
Contest

Author: Arkapravo Ghosh
Tester: Aparup Ghosh
Editorialist: Aparup Ghosh

DIFFICULTY:

CAKEWALK

PREREQUISITES:

Basic programming, conditionals

PROBLEM:

Given two integers S and H you need to output “Shinchan” if S > H or “Himawari” otherwise.

QUICK EXPLANATION:

According to the given conditions, Shinchan can only win when S is greater than H. In any other case, Himawari is the winner.

EXPLANATION:

We can simply check if S is greater than H or not. If S > H, then we output “Shinchan”(without quotes) else (i.e. when S <= H), we output “Himawari”(without quotes).
The time complexity is O(T).

AUTHOR'S AND EDITORIALIST'S SOLUTIONS:

Author's solution can be found here.
Editorialist’s solution can be found here.

asked 07 Aug '18, 00:56

aparup_ghosh's gravatar image

1★aparup_ghosh
514
accept rate: 0%

edited 09 Aug '18, 15:39

admin's gravatar image

0★admin ♦♦
19.8k350498541


include<stdio.h>

void main() { int s,h; printf("\n Enter the two no= "); scanf("%d%d",&s,&h); printf("\n S=%d",s,"\n H=%d",h); if(s>h) { printf("\n Sinchan"); } else { printf("\n Himawari"); } }

link

answered 16 Aug '18, 00:34

rutujasose123's gravatar image

0★rutujasose123
1
accept rate: 0%

for _ in range(int(input())):
    S, H = [int(x) for x in input().split()]
    print(["Himawari","Shinchan"][S>H]) 
link

answered 17 Aug '18, 18:29

teratau's gravatar image

2★teratau
11
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:

×832
×81
×81
×18
×10
×10

question asked: 07 Aug '18, 00:56

question was seen: 247 times

last updated: 16 Aug '18, 00:34