I had trouble with standard input in AtCorder, so make a note.
a, b = list( map( int, input().split() ) )
In a word Split the input string at the time of space using split → Use map to make all values int type → List values
list() List strings ** Example ** list('python') →['p', 'y', 't', 'h', 'o', 'n']
map(function, iterable, ...) Receives functions and iterable objects as arguments. Iterator that passes each element of the iterable object to the function and has the return value after executing the function as the element for each passed element. ** Reference site ** How to use map What is an iterator map returns an iterator
input() You can always get a string ** Reference site ** Get keyboard input with Python input function
.split() Applying split () by default splits not only newline characters but also spaces. ** Reference site ** Split strings in Python (delimiters, newlines, regular expressions, number of characters)
Recommended Posts