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

×

How do I take CodeChef input?

I just started on this site and am completely confused. How do you take the test case input? Could someone give a simple example?

asked 13 Oct '18, 18:51

reader8765's gravatar image

0★reader8765
01
accept rate: 0%


Write a loop in any language you prefer.

Consider this problem

Following code is in python:

t = int(input())
while t:
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    t -= 1
link

answered 13 Oct '18, 19:05

a_d_i's gravatar image

2★a_d_i
1746
accept rate: 23%

This doesn't help with the input. I use Javascript and am trying to figure out whether arguments are passed to a function or taken some other way.

(13 Oct '18, 19:09) reader87650★
(13 Oct '18, 19:12) reader87650★

Found my answer in this question: https://discuss.codechef.com/questions/72647/life-the-universe-and-everything-nodejs-solution. I will test it and come back witth the result.

link

answered 13 Oct '18, 20:25

reader8765's gravatar image

0★reader8765
01
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:

×361
×169

question asked: 13 Oct '18, 18:51

question was seen: 121 times

last updated: 13 Oct '18, 20:25