Last active
December 12, 2019 08:41
-
-
Save c-yan/b942d71ea5ea88357c5f43b90114ade1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = [0] * N | |
↓ | |
A = np.zeros(N, dtype = np.int64) | |
A = [1] * N | |
↓ | |
A = np.ones(N, dtype = np.int64) | |
A = [float('inf')] * N | |
↓ | |
A = np.empty(N, dtype = np.int64) | |
A[:] = np.iinfo(np.int64).max | |
A = [1, 2, 3, 4] | |
↓ | |
A = np.array([1, 2, 3, 4]) | |
A = list(map(int, input().split())) | |
↓ | |
A = np.fromstring(input(), dtype = np.int64, sep = ' ') | |
A = list(range(N)) | |
↓ | |
A = np.arange(N) | |
B = [a - 1 for a in A] | |
↓ | |
B = A - 1 | |
for i in range(len(A)): | |
A[i] %= 2 | |
↓ | |
A %= 2 | |
C = [A[i] ^ B[i] for i in range(len(A))] | |
↓ | |
C = A ^ B | |
B = [a for a in A if a != 0] | |
↓ | |
B = np.nonzero(A)[0] | |
len([a for a in A if a < 0]) | |
↓ | |
np.count_nonzero(A < 0) または np.sum(A < 0) | |
all(a > 0 for a in A) | |
↓ | |
all(A > 0) または np.all(A > 0) または (A > 0).all() (any も同様) | |
for i in range(j, k + 1): | |
a[i] = 1 | |
または A[j:k] = [1] * (k - j) | |
↓ | |
A[j:k] = 1 | |
sum(A) | |
↓ | |
sum(A) または np.sum(A) または A.sum() (max, min, mean 等も同様) | |
for i in range(len(A) - 1): | |
A[i + 1] += A | |
↓ | |
A = np.cumsum(A) または A = A.cumsum() | |
A.sort() | |
↓ | |
A = np.sort(A) または A.sort() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment