Skip to content

Instantly share code, notes, and snippets.

@romyilano
Last active May 19, 2019 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romyilano/0d3c7831e992b640fcbb544cb2ab9d61 to your computer and use it in GitHub Desktop.
Save romyilano/0d3c7831e992b640fcbb544cb2ab9d61 to your computer and use it in GitHub Desktop.
tips for accepting input into atcoder

swift

cielavenir

let inputInt = Int(readline()!)!

let arrayInt = readlin()!.characters.split { $0== " " }.map { Int(String($0))! }

ex. https://atcoder.jp/contests/dp/tasks/dp_h

from fmhr

python

h, w = (int(i) for i in input().split())

Python3

2 4 5 7

would be

a, b, c, d = (int(i) for i in input().split())

turn it into an array

a = [int(i) for i in input().split()]
# a = [2, 4, 5, 6]

# or with a list
a = list(int(i) for input().split())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment