intmain(){ int n, m; cin >> n >> m; int sum = 0; for(int i = 1; i <= n; i++) { int tmp = 0, x; for(int j = 1; j <= m; j++) { cin >> x; tmp = max(tmp, x); } sum += tmp; } cout << sum << endl; return0; }
intmain(){ map<int, bool> one; one[1] = 1; int x = 1, p = 1; while(x <= 1e9) { one[x+p] = 1; x += p; p++; } int n; cin >> n; while(n--) { cin >> x; cout << one[x] << endl; } return0; }
/* 1 2 4 7 11 */
F
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include<bits/stdc++.h> usingnamespace std;
intmain(){ int n, m, k; cin >> n >> m >> k; int i = 0, j = 0; while(k--) { cout << i + 1 << ' ' << j + 1 << endl; i++; i %= n; j++; j %= m; } return0; }
a = [int(x) for x ininput().split()] print(max(a[1:]))
B
1 2 3 4 5 6 7 8 9
#include<bits/stdc++.h> usingnamespace std;
intmain(){ int n; cin >> n; for(int i = 7; i >= 0; i--) cout << ((n>>i)&1); return0; }
C
1 2 3 4 5
s = input() count = 0 for i inrange(len(s)): count += ('0' <=s[i] <= '9') print(count)
D
1 2 3 4 5 6 7
arr = [int(x) for x ininput().split()][1:] arr = sorted(arr) # print(arr) ans = 0x7f7f7f7f for i inrange(1, len(arr)): ans = min(ans, arr[i] - arr[i-1]) print(ans)
E
1 2 3 4 5 6
arr = [int(x) for x ininput().split()][1:] arr.sort() arr = arr[::-1] arr.sort(key = lambda x: abs(x)) arr = arr[::-1] print(','.join([str(x) for x in arr]))
F
1 2 3 4 5 6 7
import struct f = float(input()) m = struct.pack('d', f).hex() m = str(m).upper() m = [m[i*2:i*2+2] for i inrange(0, 8)][::-1] m = '-'.join(m) print(m)