0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【競プロ】競技プログラミング標準入力用チートシート

Posted at

まえがき

ただの自分用のメモなので適当に見てください。

本題

通常文字: aiueo

main.py
A = input()

通常数字: 3

main.py
A = int(input())

複数の独立数字: A=2, B=4, C=3

main.py
A, B, C = map(int, input().split())

複数の群数字: 2 4 6 3 6 8 5 7

main.py
A = list(map, input().split())

複数行の単一数字(N行):

3
4
1
3
6
...
main.py
A = [int(input()) for _ in range(N)]

複数行の複数文字(N行 M文字) -> M個のリストへと分割:

3 1
4 5
6 4
1 6
...
main.py
AB = [map(int, input().split()) for _ in range(N)]
A, B = map(list, zip(*AB))
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?