Submit solution
Points:
100.00 (partial)
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem type
Allowed languages
Python, Scratch
In case the statement didn't load correctly, you can download the statement here: Statement
Comments
if M % 2 == 0: tong = (M // 2) * (N + 1) else: tong = (M // 2) * (N + 1) + (M + 1) // 2
code : n=int(input()) m=int(input()) total=(n+1)*(m>>1)
m&1==m%2
if(m&1): total+=(m>>1)+1 print(total)
cứu mình với, mình làm trên scratch ra kết quả nhanh lắm mà lại bị nói là quá thời gian
40 diem
n=int(input()) m=int(input()) l=[1, n, 2, (n - 1), 3, (n - 2)] t=0 if n%2==0 and 1<=m<=n<=10**9: for i in range(1, m+1): t+=l[i-1] print(t)
Code ne
N = int(input("Nhap so N:")) M = int(input("Nhap so M:")) if M%2==0: a = m/2 T = a(N+1) else: a = (M-1)/2 T = (a(N+1))+((M+1)/2) print(T)
https://scratch.mit.edu/projects/1030960813/editor/ tự xem đi
https://drive.google.com/file/d/1QbJzRf0UWVpYhw4n6pBD5TsiCI50nNxQ/view tham khảo nha
N=int(input()) M=int(input()) if M==1:print(1) elif M%2==1:print((M//2+2)(M//2+1)//2+(2N-M//2+1)(M//2)//2) else:print((1+M//2)(M//2)//2+(2N-M//2+1)(M//2)//2)
a=int(input()) b=int(input()) tong=0 for i in range(a+1,b): if (i%2==0) and (i%3!=0): tong=tong+i print(tong) Test cuối vì sao quá thời gian
nên dùng sum() đó
cho mình xin test 5 với ạ
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
Làm thế nào vậy mn ?