buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 10; struct node { int x, y; } a[N]; int cx[N], cy[N], idx, idy; vector<int> xx, yy; map<long long, int> mp; int main() { int n, m, k; cin >> n >> m >> k; for (int i = 0; i < k; i++) { scanf("%d %d", &a[i].x, &a[i].y); cx[a[i].x]++, cy[a[i...
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 10; struct node { int x, y; } a[N]; int cx[N], cy[N], idx, idy; vector<int> xx, yy; map<long long, int> mp; int main() { int n, m, k; cin >> n >> m >> k; for (int i = 0; i < k; i++) { scanf("%d %d", &a[i].x, &a[i].y); cx[a[i].x]++, cy[a[i...
[["-", 0, 57, 64, 1, 0, 11, 12, 118, 119, 120], ["+", 0, 57, 64, 1, 0, 11, 12, 118, 119, 120]]
1
388
H,W,M = map(int,input().split()) Hmax_temp = [0]*(H+1) Wmax_temp = [0]*(W+1) Hmax = 0 Wmax = 0 Bomb = dict() for i in range(M): H_M,W_M = map(int,input().split()) Hmax_temp[H_M] += 1 Wmax_temp[W_M] += 1 Bomb[(H_M,W_M)] = 1 Hmax = max(Hmax_temp) Wmax = max(Wmax_temp) #H方向の走査 y_max = [] for i in range(H+1): if Hm...
H,W,M = map(int,input().split()) Hmax_temp = [0]*(H+1) Wmax_temp = [0]*(W+1) Hmax = 0 Wmax = 0 Bomb = dict() for i in range(M): H_M,W_M = map(int,input().split()) Hmax_temp[H_M] += 1 Wmax_temp[W_M] += 1 Bomb[(H_M,W_M)] = 1 Hmax = max(Hmax_temp) Wmax = max(Wmax_temp) #H方向の走査 y_max = [] for i in range(H+1): if ...
[["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 699]]
5
220
#include <bits/stdc++.h> using namespace std; long long n, m, k, a[300010], b[300010], x[300010], y[300010], ans, c, d, f, aa, bb; int main() { cin >> n >> m >> k; for (int i = 0; i < k; i++) { cin >> x[i] >> y[i]; a[x[i]]++; b[y[i]]++; } for (int i = 1; i <= n; i++) c = max(c, a[i]); for...
#include <bits/stdc++.h> using namespace std; long long n, m, k, a[300010], b[300010], x[300010], y[300010], ans, c, d, f, aa, bb; int main() { cin >> n >> m >> k; for (int i = 0; i < k; i++) { cin >> x[i] >> y[i]; a[x[i]]++; b[y[i]]++; } for (int i = 1; i <= n; i++) c = max(c, a[i]); for...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
285
// C++ //#pragma comment(linker, "/STACK:102400000,102400000") // G++ //#define OPENSTACK #define ONLINE_JUDGE #include <algorithm> #include <cctype> #include <cstring> #include <ctime> #include <iostream> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef ...
// C++ //#pragma comment(linker, "/STACK:102400000,102400000") // G++ //#define OPENSTACK #define ONLINE_JUDGE #include <algorithm> #include <cctype> #include <cstring> #include <ctime> #include <iostream> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef ...
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 12, 22]]
1
491
#include <bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; int m; cin >> m; int mxr = 0, mxc = 0; vector<int> row(h), col(w); vector<pair<int, int>> v(m); for (int i = 0; i < m; i++) { int x, y; cin >> x >> y; --x, --y; mxr = max(mxr, ++row[x]); mxc = max(mxc...
#include <bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; int m; cin >> m; int mxr = 0, mxc = 0; vector<int> row(h), col(w); vector<pair<int, int>> v; for (int i = 0; i < m; i++) { int x, y; cin >> x >> y; --x, --y; mxr = max(mxr, ++row[x]); mxc = max(mxc, +...
[["-", 8, 9, 0, 43, 49, 53, 54, 55, 0, 24], ["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 8, 9, 0, 43, 49, 53, 54, 55, 0, 25]]
1
234
import collections h,w,m = map(int,input().split()) X = [] Y = [] for _ in range(m): x,y = map(int,input().split()) X.append(x) Y.append(y) #まず一番大いX座標を調べる most_common_x = collections.Counter(X).most_common() most_common_x_index = most_common_x[0][0] #x座標 most_common_x_count = most_common_x[0][1] #その線に存在する爆...
import collections h,w,m = map(int,input().split()) X = [] Y = [] for _ in range(m): x,y = map(int,input().split()) X.append(x) Y.append(y) #まず一番大いX座標を調べる most_common_x = collections.Counter(X).most_common() most_common_x_index = most_common_x[0][0] #x座標 most_common_x_count = most_common_x[0][1] #その線に存在する爆...
[["-", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22]]
5
274
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = (0); (i) < (int)(n); ++(i)) using ll = long long; using P = pair<int, int>; using namespace std; #define INF ((1 << 30) - 1) #define LLINF (1LL << 60) #define EPS (1e-10) int main() { int h, w, n; cin >> h >> w >> n; vector<int> hs(h, ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = (0); (i) < (int)(n); ++(i)) using ll = long long; using P = pair<int, int>; using namespace std; #define INF ((1 << 30) - 1) #define LLINF (1LL << 60) #define EPS (1e-10) int main() { int h, w, n; cin >> h >> w >> n; vector<int> hs(h, ...
[["-", 0, 1, 0, 11, 31, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 31, 2, 3, 4, 0, 22]]
1
289
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ld long double template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; ...
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ld long double template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; ...
[["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]]
1
638
h,w,m = ( int(x) for x in input().split() ) h_array = [ 0 for i in range(h) ] w_array = [ 0 for i in range(w) ] ps = set() for i in range(m): hi,wi = ( int(x)-1 for x in input().split() ) h_array[hi] += 1 w_array[wi] += 1 ps.add( (hi,wi) ) h_great = max(h_array) w_great = max(w_array) h_greats = list()...
h,w,m = ( int(x) for x in input().split() ) h_array = [ 0 for i in range(h) ] w_array = [ 0 for i in range(w) ] ps = set() for i in range(m): hi,wi = ( int(x)-1 for x in input().split() ) h_array[hi] += 1 w_array[wi] += 1 ps.add( (hi,wi) ) h_great = max(h_array) w_great = max(w_array) h_greats = list()...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
205
import sys import random H,W,M=map(int,input().split()) hlist=[0]*H wlist=[0]*W hwset=set() for _ in range(M): h,w=map(int,input().split()) hlist[h-1]+=1 wlist[w-1]+=1 hwset.add((h-1,w-1)) hmax=max(hlist) wmax=max(wlist) hlist2=[] for i in range(H): if hlist[i]==hmax: hlist2.append(i) hlist2.sort(rev...
import sys import random H,W,M=map(int,input().split()) hlist=[0]*H wlist=[0]*W hwset=set() for _ in range(M): h,w=map(int,input().split()) hlist[h-1]+=1 wlist[w-1]+=1 hwset.add((h-1,w-1)) hmax=max(hlist) wmax=max(wlist) hlist2=[] for i in range(H): if hlist[i]==hmax: hlist2.append(i) hlist2.sort(rev...
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
306
import sys sys.setrecursionlimit(10**7) readline = sys.stdin.buffer.readline def readstr():return readline().rstrip().decode() def readstrs():return list(readline().decode().split()) def readint():return int(readline()) def readints():return list(map(int,readline().split())) def printrows(x):print('\n'.join(map(str,x)...
import sys sys.setrecursionlimit(10**7) readline = sys.stdin.buffer.readline def readstr():return readline().rstrip().decode() def readstrs():return list(readline().decode().split()) def readint():return int(readline()) def readints():return list(map(int,readline().split())) def printrows(x):print('\n'.join(map(str,x)...
[["-", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
380
import bisect H, W, M = map(int,input().split()) hw = [list(map(int,input().split())) for _ in range(M)] hw.sort() rows, columns = [0]*H, [0]*W for h, w in hw: rows[h-1] += 1 columns[w-1] += 1 max_r, max_c = max(rows), max(columns) argmax_r, argmax_c = [], [] for i in range(H): if max_r == rows[i]: ...
import bisect H, W, M = map(int,input().split()) hw = [list(map(int,input().split())) for _ in range(M)] hw.sort() rows, columns = [0]*H, [0]*W for h, w in hw: rows[h-1] += 1 columns[w-1] += 1 max_r, max_c = max(rows), max(columns) argmax_r, argmax_c = [], [] for i in range(H): if max_r == rows[i]: ...
[["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 57, 15, 679, 17, 354]]
5
216
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int h, w, m; cin >> h >> w >> m; vector<pair<int, int>> bomb(m); rep(i, m) { cin >> bomb[i].first >> bomb[i].second; --bomb[i].first; --bomb[i].sec...
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int h, w, m; cin >> h >> w >> m; vector<pair<int, int>> bomb(m); rep(i, m) { cin >> bomb[i].first >> bomb[i].second; --bomb[i].first; --bomb[i].sec...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 75, 76, 0, 1, 0, 16, 12, 16, 17, 33], ["+", 75, 76, 0, 1, 0, 16, 12, 16, 12, 13]]
1
331
#include "bits/stdc++.h" #define rep(i, j) for (int i = 0; i < j; i++) #define srep(i, j, k) for (int i = j; i < k; i++) using namespace std; using ll = long long; using P = pair<int, int>; using ull = unsigned long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } ...
#include "bits/stdc++.h" #define rep(i, j) for (int i = 0; i < j; i++) #define srep(i, j, k) for (int i = j; i < k; i++) using namespace std; using ll = long long; using P = pair<int, int>; using ull = unsigned long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } ...
[["-", 8, 9, 0, 1, 0, 27, 28, 69, 28, 22], ["+", 8, 9, 0, 1, 0, 27, 28, 69, 28, 22]]
1
1,094
def main(): H,W,M = map(int,input().split()) s = [] h_cnt = [0 for i in range(H)] w_cnt = [0 for i in range(W)] for i in range(M): h,w = map(int,input().split()) s.append([h-1,w-1]) h_cnt[h-1] += 1 w_cnt[w-1] += 1 h_m,w_m = max(h_cnt), max(w_cnt) h_mp,w_mp = [...
def main(): H,W,M = map(int,input().split()) s = [] h_cnt = [0 for i in range(H)] w_cnt = [0 for i in range(W)] for i in range(M): h,w = map(int,input().split()) s.append([h-1,w-1]) h_cnt[h-1] += 1 w_cnt[w-1] += 1 h_m,w_m = max(h_cnt), max(w_cnt) h_mp,w_mp = [...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22]]
5
253
import sys from collections import Counter H,W,m = map(int,input().split()) h_ls = [0] * H w_ls = [0] * W bombers = [[0,0] for _ in range(m)] for i in range(m): h,w = map(int,input().split()) h_ls[h-1] += 1 w_ls[w-1] += 1 bombers[i] = [h-1,w-1] h_max = max(h_ls) h_counter = Counter(h_ls) # Couter使ってみる ...
import sys from collections import Counter H,W,m = map(int,input().split()) h_ls = [0] * H w_ls = [0] * W bombers = [(0,0) for _ in range(m)] for i in range(m): h,w = map(int,input().split()) h_ls[h-1] += 1 w_ls[w-1] += 1 bombers[i] = (h-1,w-1) h_max = max(h_ls) h_counter = Counter(h_ls) # Couter使ってみる ...
[["-", 0, 1, 0, 662, 12, 658, 8, 634, 0, 70], ["+", 0, 1, 0, 662, 12, 658, 8, 660, 0, 24], ["-", 0, 1, 0, 662, 12, 658, 8, 634, 0, 73], ["+", 0, 1, 0, 662, 12, 658, 8, 660, 0, 25], ["-", 8, 196, 0, 1, 0, 662, 12, 634, 0, 70], ["+", 8, 196, 0, 1, 0, 662, 12, 660, 0, 24], ["-", 8, 196, 0, 1, 0, 662, 12, 634, 0, 73], ["+"...
5
254
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x).size() #define F first #define S second #define forn(i, n) for (int i = 0; i < (int)n; i++) #define pb push_back #define fastIO ios::sync_with_stdio(0), cin.tie(0) #defin...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x).size() #define F first #define S second #define forn(i, n) for (int i = 0; i < (int)n; i++) #define pb push_back #define fastIO ios::sync_with_stdio(0), cin.tie(0) #defin...
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
441
H, W, M = map(int, input().split()) hc = [0] * H wc = [0] * W d = {} for _ in range(M): h, w = map(lambda x: int(x) - 1,input().split()) hc[h] += 1 wc[w] += 1 d[(h, w)] = 1 maxh = max(hc) maxw = max(wc) result = max(maxh + maxw - 1, 0) wi = [i for i in range(W) if wc[i] == maxw] for h in [i for i in ...
H, W, M = map(int, input().split()) hc = [0] * H wc = [0] * W d = {} for _ in range(M): h, w = map(lambda x: int(x) - 1,input().split()) hc[h] += 1 wc[w] += 1 d[(h, w)] = 1 maxh = max(hc) maxw = max(wc) result = max(maxh + maxw - 1, 0) wi = [i for i in range(W) if wc[i] == maxw] for h in [i for i in ...
[["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 699]]
5
178
import sys input = sys.stdin.readline def main(): h, w, m = map(int, input().split()) bomb_row = [0] * h bomb_col = [0] * w # 座標だけはsetで格納 bomb_pos = set() # 爆弾情報を行と列ごとで格納 for _ in range(m): r, c = [int(i) - 1 for i in input().split()] bomb_row[r] += 1 bomb_col[c] += ...
import sys input = sys.stdin.readline def main(): h, w, m = map(int, input().split()) bomb_row = [0] * h bomb_col = [0] * w # 座標だけはsetで格納 bomb_pos = set() # 爆弾情報を行と列ごとで格納 for _ in range(m): r, c = [int(i) - 1 for i in input().split()] bomb_row[r] += 1 bomb_col[c] += ...
[["-", 0, 662, 12, 658, 0, 678, 0, 666, 0, 22], ["+", 0, 662, 12, 658, 0, 678, 0, 666, 0, 22]]
5
192
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define rep(i, a, b) for (ll i = a; i < b; i++) #define IOS \ ios::sync_with_stdio(0); ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define rep(i, a, b) for (ll i = a; i < b; i++) #define IOS \ ios::sync_with_stdio(0); ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79]]
1
546
h,w,m = map(int,input().split()) tate = [0]*(h+1) yoko = [0]*(w+1) basyo = [] for i in range(m): hh,ww = map(int,input().split()) basyo.append((hh-1,ww-1)) tate[hh-1] += 1 yoko[ww-1] += 1 tt,yy = 0,0 x = max(tate) for i in tate: if i == x: tt += 1 y = max(yoko) for i i...
h,w,m = map(int,input().split()) tate = [0]*(h+1) yoko = [0]*(w+1) basyo = [] for i in range(m): hh,ww = map(int,input().split()) basyo.append((hh-1,ww-1)) tate[hh-1] += 1 yoko[ww-1] += 1 tt,yy = 0,0 x = max(tate) for i in tate: if i == x: tt += 1 y = max(yoko) for i i...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
196
import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int h = in.nextInt(); int w = in.nextInt(); int m = in.nextInt(); HashSet<Long> bombs = new HashSet<Long>(); int[...
import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int h = in.nextInt(); int w = in.nextInt(); int m = in.nextInt(); HashSet<Long> bombs = new HashSet<Long>(); int[...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22]]
3
428
def solve(): H,W,M = map(int,input().split()) h_counter = [0] * H w_counter = [0] * W opponents = [] for _ in range(M): h, w = map(lambda x:int(x)-1, input().split()) h_counter[h] += 1 w_counter[w] += 1 opponents.append((h,w)) h_max = max(h_counter) w_ma...
def solve(): H,W,M = map(int,input().split()) h_counter = [0] * H w_counter = [0] * W opponents = [] for _ in range(M): h, w = map(lambda x:int(x)-1, input().split()) h_counter[h] += 1 w_counter[w] += 1 opponents.append((h,w)) h_max = max(h_counter) w_ma...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22]]
5
231
from itertools import product def zero_origin(s: str) -> int: return int(s) - 1 H, W, M = map(int, input().split()) h_obj = [0 for _ in range(H)] w_obj = [0 for _ in range(W)] obj = set() for _ in range(M): h, w = map(zero_origin, input().split()) h_obj[h] += 1 w_obj[w] += 1 obj.add((h, w)) max_h = max(h_ob...
from itertools import product def zero_origin(s: str) -> int: return int(s) - 1 H, W, M = map(int, input().split()) h_obj = [0 for _ in range(H)] w_obj = [0 for _ in range(W)] obj = set() for _ in range(M): h, w = map(zero_origin, input().split()) h_obj[h] += 1 w_obj[w] += 1 obj.add((h, w)) max_h = max(h_ob...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
202
#include <algorithm> #include <iostream> #include <map> using namespace std; map<pair<int, int>, int> mp; int r[1000009], c[1000009]; pair<int, int> r1[1000009], c1[1000009]; bool cmp(pair<int, int> x, pair<int, int> y) { return x.second > y.second; } int main() { int n, m, s; cin >> n >> m >> s; for (int i = 1;...
#include <algorithm> #include <iostream> #include <map> using namespace std; map<pair<int, int>, int> mp; int r[1000009], c[1000009]; pair<int, int> r1[1000009], c1[1000009]; bool cmp(pair<int, int> x, pair<int, int> y) { return x.second > y.second; } int main() { int n, m, s; cin >> n >> m >> s; for (int i = 1;...
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
369
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #define mm(a, x) memset(a, x, sizeof(a)) #define sync \ std::ios::sync_with_stdio(false); \ std::cin...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #define mm(a, x) memset(a, x, sizeof(a)) #define sync \ std::ios::sync_with_stdio(false); \ std::cin...
[["-", 0, 11, 31, 118, 28, 69, 341, 342, 0, 22], ["+", 0, 11, 31, 118, 28, 69, 341, 342, 0, 22]]
1
343
import java.awt.*; import java.io.*; import java.net.StandardSocketOptions; import java.util.*; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main(); } public Main() { new TestE().doIt(); } class TestE { void doIt() { int H = sc.nextInt(); ...
import java.awt.*; import java.io.*; import java.net.StandardSocketOptions; import java.util.*; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main(); } public Main() { new TestE().doIt(); } class TestE { void doIt() { int H = sc.nextInt(); ...
[["-", 49, 200, 51, 16, 31, 16, 31, 492, 500, 22], ["+", 49, 200, 51, 16, 31, 16, 31, 492, 500, 22], ["-", 51, 16, 31, 16, 31, 492, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 492, 3, 4, 0, 22]]
3
504
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { int h, w, n; cin >> h >> w >> n; vector<int> hs(h), ws(w); set<P> s; rep(i, n) { int r, c; cin >> r >> c; r--; c--; hs[r]++; hs[c]...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { int h, w, n; cin >> h >> w >> n; vector<int> hs(h), ws(w); set<P> s; rep(i, n) { int r, c; cin >> r >> c; r--; c--; hs[r]++; ws[c]...
[["-", 8, 9, 0, 1, 0, 27, 28, 69, 28, 22], ["+", 8, 9, 0, 1, 0, 27, 28, 69, 28, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22]]
1
275
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define ALL(v) v.begin(), v.end() using namespace std; using P = pair<int, int>; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define ALL(v) v.begin(), v.end() using namespace std; using P = pair<int, int>; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; ...
[["-", 64, 1, 0, 2, 3, 4, 0, 118, 119, 120], ["+", 64, 1, 0, 2, 3, 4, 0, 118, 119, 120]]
1
387
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, s, n) for (int i = (s); i < (n); i++) #define all(v) v.begin(), v.end() #define outve(v) \ for (auto i : v) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, s, n) for (int i = (s); i < (n); i++) #define all(v) v.begin(), v.end() #define outve(v) \ for (auto i : v) ...
[["-", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120]]
1
719
#include <bits/stdc++.h> using namespace std; #define int long long map<int, int> row, col; vector<int> a, b; map<pair<int, int>, int> mp; signed main() { int n, m, k; cin >> n >> m >> k; int maxn_row = -1, maxn_col = -1; for (int i = 0; i < k; i++) { int x, y; cin >> x >> y; row[x]++, col[y]++; ...
#include <bits/stdc++.h> using namespace std; #define int long long map<int, int> row, col; vector<int> a, b; map<pair<int, int>, int> mp; signed main() { int n, m, k; cin >> n >> m >> k; int maxn_row = -1, maxn_col = -1; for (int i = 0; i < k; i++) { int x, y; cin >> x >> y; row[x]++, col[y]++; ...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
372
R, C, T = map(int, input().split()) RC = [] for _ in range(T): RC.append(list(map(int, input().split()))) TR = [0] * (R + 1) TC = [0] * (C + 1) for r, c in RC: TR[r] += 1 TC[c] += 1 mxr = max(TR) mxc = max(TC) ct = TR.count(mxr) * TC.count(mxc) - len([0 for r, c in RC if TR[r] == mxr and TC[c] == mxc]) prin...
R, C, T = map(int, input().split()) RC = [] for _ in range(T): RC.append(list(map(int, input().split()))) TR = [0] * (R + 1) TC = [0] * (C + 1) for r, c in RC: TR[r] += 1 TC[c] += 1 mxr = max(TR) mxc = max(TC) ct = TR.count(mxr) * TC.count(mxc) - len([0 for r, c in RC if TR[r] == mxr and TC[c] == mxc]) prin...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21]]
5
161
H, W, M = map(int,input().split()) ARR = [] for i in range(M): ARR.append(list(map(int,input().split()))) def calculate(h, w, m, arr): points = set() rowSum = [0 for i in range(h)] columnSum = [0 for i in range(w)] for ar in arr: points.add((ar[0]-1, ar[1]-1)) rowSum[ar[0]-1] +...
H, W, M = map(int,input().split()) ARR = [] for i in range(M): ARR.append(list(map(int,input().split()))) def calculate(h, w, m, arr): points = set() rowSum = [0 for i in range(h)] columnSum = [0 for i in range(w)] for ar in arr: points.add((ar[0]-1, ar[1]-1)) rowSum[ar[0]-1] +...
[["-", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94], ["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
273
// 2020-08-22 21:32:54 #include <bits/stdc++.h> #ifdef LOCAL #include "lib/debug.hpp" #else #define debug(...) 1 #endif #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define rep(i, n) REP(i, 0, (n)) #define repc(i, n) REPC(i, 0, (n)) #define REP(i, n, m) for (int i = (int)(n); i < (int)...
// 2020-08-22 21:32:54 #include <bits/stdc++.h> #ifdef LOCAL #include "lib/debug.hpp" #else #define debug(...) 1 #endif #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define rep(i, n) REP(i, 0, (n)) #define repc(i, n) REPC(i, 0, (n)) #define REP(i, n, m) for (int i = (int)(n); i < (int)...
[["-", 0, 338, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 0, 338, 8, 9, 0, 57, 64, 9, 0, 46]]
1
560
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define INF 1e12 #define PB push_back #define PF push_front #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vpi vector<pii> #define vll vector<ll> #define vp...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define INF 1e12 #define PB push_back #define PF push_front #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vpi vector<pii> #define vll vector<ll> #define vp...
[["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]]
1
607
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <vector> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, double> pdd; typedef ...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <vector> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, double> pdd; typedef ...
[["-", 8, 338, 8, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 338, 8, 57, 64, 9, 0, 126, 0, 127], ["+", 8, 338, 8, 57, 64, 9, 0, 126, 128, 129], ["+", 0, 30, 0, 14, 8, 9, 0, 97, 128, 129], ["+", 0, 30, 0, 14, 8, 9, 0, 97, 0, 102]]
1
479
#include <bits/stdc++.h> #define loop(s, e, i) for (int i = s; i < e; ++i) #define print(s) cout << s << endl; using namespace std; using ll = long long; using lld = long long; /* 浮動小数点の入力 cout << fixed << setprecision(9) << endl; */ ll gcd(ll a, ll b) { if (a < b) { return gcd(b, a); } while (b != 0) { ...
#include <bits/stdc++.h> #define loop(s, e, i) for (int i = s; i < e; ++i) #define print(s) cout << s << endl; using namespace std; using ll = long long; using lld = long long; /* 浮動小数点の入力 cout << fixed << setprecision(9) << endl; */ ll gcd(ll a, ll b) { if (a < b) { return gcd(b, a); } while (b != 0) { ...
[["-", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
373
#include <memory.h> #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <uti...
#include <memory.h> #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <uti...
[["-", 3, 4, 0, 118, 28, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 118, 28, 69, 341, 342, 0, 22]]
1
469
import java.io.*; import java.util.*; class Main { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(System.out); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int h = Int...
import java.io.*; import java.util.*; class Main { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(System.out); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int h = Int...
[["-", 0, 11, 12, 492, 3, 4, 0, 504, 71, 22], ["+", 0, 11, 12, 492, 3, 4, 0, 504, 71, 22]]
3
478
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; #define ALL(v) v.begin(), v.end() #define vmax(v) *max_element(ALL(v)) #define vmin(v) *min_element(ALL(v)) #define chmax(x, a) x = max(x, a...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; #define ALL(v) v.begin(), v.end() #define vmax(v) *max_element(ALL(v)) #define vmin(v) *min_element(ALL(v)) #define chmax(x, a) x = max(x, a...
[["-", 0, 57, 64, 1, 0, 2, 63, 118, 28, 22], ["+", 0, 57, 64, 1, 0, 2, 63, 118, 28, 22]]
1
363
from collections import defaultdict n,m,k=map(int,input().split()) points=set() row=defaultdict(int) col=defaultdict(int) for i in range(k): a,b=map(int,input().split()) points.add((a,b)) row[a]+=1 col[b]+=1 m1=max(row.values()) m2=max(col.values()) l1=[] l2=[] for i in row: if row[i]==m1: l...
from collections import defaultdict n,m,k=map(int,input().split()) points=set() row=defaultdict(int) col=defaultdict(int) for i in range(k): a,b=map(int,input().split()) points.add((a,b)) row[a]+=1 col[b]+=1 m1=max(row.values()) m2=max(col.values()) l1=[] l2=[] for i in row: if row[i]==m1: l...
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
198
#include <bits/stdc++.h> using namespace std; #define REP(i, p, n) for (ll i = p; i < ll(n); ++i) #define rep(i, n) REP(i, 0, n) using ll = long long; using pll = pair<ll, ll>; int main() { ll H, W, M; cin >> H >> W >> M; map<ll, ll> NX; map<ll, ll> NY; set<pll> P; ll xn = 0, yn = 0; rep(i, M) { ...
#include <bits/stdc++.h> using namespace std; #define REP(i, p, n) for (ll i = p; i < ll(n); ++i) #define rep(i, n) REP(i, 0, n) using ll = long long; using pll = pair<ll, ll>; int main() { ll H, W, M; cin >> H >> W >> M; map<ll, ll> NX; map<ll, ll> NY; set<pll> P; ll xn = 0, yn = 0; rep(i, M) { ...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33]]
1
364
H,W,M = map(int,input().split()) h = [] w = [] for i in range(M): tmp1,tmp2 = map(int,input().split()) h.append(tmp1) w.append(tmp2) dic1 = {} dic2 = {} for i in h: if i not in dic1: dic1[i] = 1 else: dic1[i] +=1 val1 = max(dic1,key=dic1.get) ans = 0 ans +=dic1[val1] for j in ran...
H,W,M = map(int,input().split()) h = [] w = [] for i in range(M): tmp1,tmp2 = map(int,input().split()) h.append(tmp1) w.append(tmp2) dic1 = {} dic2 = {} for i in h: if i not in dic1: dic1[i] = 1 else: dic1[i] +=1 val1 = max(dic1,key=dic1.get) ans = 0 ans +=dic1[val1] for j in ran...
[["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 64, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 64, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 0, 1, 0, 662, 31, 206, 206, 206, 51, 22], ["+", 0, 1, 0, 662, 31, 206, 206, 206, 51, 22], ["-", 0, 1, 0, 677, 31, 206, 206,...
5
311
// E #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define all(v) v.begin(), v.end() using namespace std; typedef long long LL; int frekx[300001], freky[300001], Segtree1[8000001], Segtree2[8000001]; vector<int> v[300001], v2[300001]; void build(int p, int L, in...
// E #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define all(v) v.begin(), v.end() using namespace std; typedef long long LL; int frekx[300001], freky[300001], Segtree1[8000001], Segtree2[8000001]; vector<int> v[300001], v2[300001]; void build(int p, int L, in...
[["-", 0, 7, 8, 9, 0, 338, 12, 69, 28, 22], ["+", 0, 7, 8, 9, 0, 338, 12, 69, 28, 22]]
1
745
import sys input = sys.stdin.readline H, W, M = map(int, input().split()) Hsum = [0] * H Wsum = [0] * W hw = set() for m in range(M): h, w = map(lambda x: int(x) - 1, input().split()) Hsum[h] += 1 Wsum[w] += 1 hw.add((h, w)) mh = max(Hsum) mw = max(Wsum) hidx = [i for i, _ in enumerate(Hsum) if _ == mh] widx...
import sys input = sys.stdin.readline H, W, M = map(int, input().split()) Hsum = [0] * H Wsum = [0] * W hw = set() for m in range(M): h, w = map(lambda x: int(x) - 1, input().split()) Hsum[h] += 1 Wsum[w] += 1 hw.add((h, w)) mh = max(Hsum) mw = max(Wsum) hidx = [i for i, _ in enumerate(Hsum) if _ == mh] widx...
[["+", 8, 196, 0, 7, 8, 196, 0, 57, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 22]]
5
215
#include <bits/stdc++.h> #define ntest 0 using namespace std; long long h, w, m, x, y, res, mxX, mxY; const long long k = 1e6; set<long long> st; long long r[300005], c[300005]; long long getH(long long x, long long y) { return x * k + y; } void solve() { cin >> h >> w >> m; for (int i = 1; i <= m; ++i) { cin...
#include <bits/stdc++.h> #define ntest 0 using namespace std; long long h, w, m, x, y, res, mxX, mxY; const long long k = 1e6; set<long long> st; long long r[300005], c[300005]; long long getH(long long x, long long y) { return x * k + y; } void solve() { cin >> h >> w >> m; for (int i = 1; i <= m; ++i) { cin...
[["-", 28, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 28, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
367
from collections import Counter from collections import defaultdict from collections import deque from heapq import heapify from heapq import heappop from heapq import heappush h,w,m=[int(x) for x in input().split()] #defaultdictにすることにより後に使うmax関数のコストを削減 hcnt=defaultdict(int) wcnt=defaultdict(int) bomb=set() #O(H) fo...
from collections import Counter from collections import defaultdict from collections import deque from heapq import heapify from heapq import heappop from heapq import heappush h,w,m=[int(x) for x in input().split()] #defaultdictにすることにより後に使うmax関数のコストを削減 hcnt=defaultdict(int) wcnt=defaultdict(int) #存在チェックのアクセスがリストで持た...
[["-", 0, 1, 0, 652, 3, 4, 0, 634, 0, 70], ["+", 0, 1, 0, 652, 3, 4, 0, 660, 0, 24], ["-", 0, 1, 0, 652, 3, 4, 0, 634, 0, 73], ["+", 0, 1, 0, 652, 3, 4, 0, 660, 0, 25], ["-", 0, 57, 15, 681, 28, 666, 0, 634, 0, 70], ["+", 0, 57, 15, 681, 28, 666, 0, 660, 0, 24], ["-", 0, 57, 15, 681, 28, 666, 0, 634, 0, 73], ["+", 0, 5...
5
214
import random import time start=time.time() h,w,m=map(int,input().split()) hh=[[0,i]for i in range(h)] ww=[[0,i]for i in range(w)] hw=set() for _ in range(m): a,b=map(int,input().split()) a-=1 b-=1 hh[a][0]+=1 ww[b][0]+=1 hw.add((a,b)) ww.sort(reverse=1) s=ww[0][0] w=[] for x,j in ww: if x==s:w.append(j) ...
import random import time start=time.time() h,w,m=map(int,input().split()) hh=[[0,i]for i in range(h)] ww=[[0,i]for i in range(w)] hw=set() for _ in range(m): a,b=map(int,input().split()) a-=1 b-=1 hh[a][0]+=1 ww[b][0]+=1 hw.add((a,b)) ww.sort(reverse=1) s=ww[0][0] w=[] for x,j in ww: if x==s:w.append(j) ...
[["-", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["-", 64, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 64, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["-", 15, 666, 0, 657, 12, 652, 3, 4, 0, 612], ["+", 15, 666, 0, 657, 12, 652, 3, 4, 0, 612]]
5
313
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct A { int cnt, idx; A() { cnt = 0; } } x[300001], y[300001]; bool cmp(A a, A b) { return a.cnt > b.cnt; } int main() { ios::sync_with_stdio(false); cin.tie(0); int h, w, m; cin >> h >> w >> m; int p, q; unordered_set<ll> us; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct A { int cnt, idx; A() { cnt = 0; } } x[300001], y[300001]; bool cmp(A a, A b) { return a.cnt > b.cnt; } int main() { ios::sync_with_stdio(false); cin.tie(0); int h, w, m; cin >> h >> w >> m; int p, q; unordered_set<ll> us; ...
[["+", 0, 14, 8, 9, 0, 7, 10, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 7, 10, 11, 31, 22], ["+", 8, 9, 0, 7, 8, 7, 10, 11, 17, 32], ["+", 8, 9, 0, 7, 8, 7, 10, 11, 12, 13]]
1
376
H, W, M = map(int, input().split()) HL, WL = [0]*H, [0]*W B = [] for _ in range(M): h, w = map(lambda x:int(x)-1, input().split()) B.append((h, w)) HL[h] += 1 WL[w] += 1 HM, WM = max(HL), max(WL) K = HL.count(HM) * WM.count(WL) cnt = 0 for h, w in B: if HL[h] == HM and WL[w] == WM: cnt += 1 if K > cn...
H, W, M = map(int, input().split()) HL, WL = [0]*H, [0]*W B = [] for _ in range(M): h, w = map(lambda x:int(x)-1, input().split()) B.append((h, w)) HL[h] += 1 WL[w] += 1 HM, WM = max(HL), max(WL) K = HL.count(HM) * WL.count(WM) cnt = 0 for h, w in B: if HL[h] == HM and WL[w] == WM: cnt += 1 if K > cn...
[["-", 0, 662, 12, 657, 12, 652, 63, 319, 500, 22], ["+", 0, 662, 12, 657, 12, 652, 63, 319, 500, 22], ["-", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22]]
5
168
H, W, M = map(int, input().split()) row = [0]*H # 行 column = [0]*W # 列 target = set() for _ in range(M): # h行, w列に爆破対象がある h, w = map(lambda x: int(x)-1, input().split()) row[h] += 1 column[w] += 1 target.add((h, w)) max_row_value = max(row) max_column_value = max(column) max_row_idx = [] max_col...
H, W, M = map(int, input().split()) row = [0]*H # 行 column = [0]*W # 列 target = set() for _ in range(M): # h行, w列に爆破対象がある h, w = map(lambda x: int(x)-1, input().split()) row[h] += 1 column[w] += 1 target.add((h, w)) max_row_value = max(row) max_column_value = max(column) max_row_idx = [] max_col...
[["-", 0, 656, 0, 7, 8, 196, 0, 7, 12, 22], ["+", 0, 656, 0, 7, 8, 196, 0, 7, 12, 22]]
5
195
# coding: utf-8 # Your code here! H,W,M = input().rstrip().split(' ') H = int(H) W = int(W) M = int(M) hcount = [0 for _ in range(H)] wcount = [0 for _ in range(W)] #L = [[0 for i in range(W)]for j in range(H)] L = {} for i in range(M): ij = input().rstrip().split(' ') i = int(ij[0])-1 j = int(ij[1])-1...
# coding: utf-8 # Your code here! H,W,M = input().rstrip().split(' ') H = int(H) W = int(W) M = int(M) hcount = [0 for _ in range(H)] wcount = [0 for _ in range(W)] #L = [[0 for i in range(W)]for j in range(H)] L = {} for i in range(M): ij = input().rstrip().split(' ') i = int(ij[0])-1 j = int(ij[1])-1...
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
221
h,w,m=map(int, input().split()) hh=[] ww=[] b=set() for _ in range(m): hi,wi=map(int, input().split()) hh.append(hi) ww.append(wi) b.add((hi,wi)) from collections import Counter hc=Counter(hh) wc=Counter(ww) hmx=0;hnow=-1 wmx=0;wnow=-1 hs=[];ws=[] for hi in hc: if hc[hi]>hmx: hmx=hc[hi] ...
h,w,m=map(int, input().split()) hh=[] ww=[] b=set() for _ in range(m): hi,wi=map(int, input().split()) hh.append(hi) ww.append(wi) b.add((hi,wi)) from collections import Counter hc=Counter(hh) wc=Counter(ww) hmx=0;hnow=-1 wmx=0;wnow=-1 hs=[];ws=[] for hi in hc: if hc[hi]>hmx: hmx=hc[hi] ...
[["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 60]]
5
280
import math from functools import reduce from collections import deque import sys sys.setrecursionlimit(10**7) from bisect import bisect_left def input(): return sys.stdin.readline().strip() # スペース区切りの入力を読み込んで数値リストにして返します。 def get_nums_l(): return [ int(s) for s in input().split(" ")] # 改行またはスペース区切りの入力をすべて読み込...
import math from functools import reduce from collections import deque import sys sys.setrecursionlimit(10**7) from bisect import bisect_left def input(): return sys.stdin.readline().strip() # スペース区切りの入力を読み込んで数値リストにして返します。 def get_nums_l(): return [ int(s) for s in input().split(" ")] # 改行またはスペース区切りの入力をすべて読み込...
[["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355]]
5
392
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) const ll MAX = 1001001; const ll MOD = 1000000007; int main() { ll h, w, m; cin >> h >> w >> m; vector<ll> a(m), b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) const ll MAX = 1001001; const ll MOD = 1000000007; int main() { ll h, w, m; cin >> h >> w >> m; vector<ll> a(m), b...
[["+", 64, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
440
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 300000 #define max(a, b) ((a > b) ? (a) : (b)) int cmp1(const void *p, const void *q) //昇順 { return *(int *)p - *(int *)q; } typedef long long int int64; int tate[SIZE] = {0}; int yoko[SIZE] = {0}; int tatemax[SIZE] = {0}; i...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 300000 #define max(a, b) ((a > b) ? (a) : (b)) int cmp1(const void *p, const void *q) //昇順 { return *(int *)p - *(int *)q; } typedef long long int int64; int tate[SIZE] = {0}; int yoko[SIZE] = {0}; int tatemax[SIZE] = {0}; i...
[["-", 12, 23, 0, 74, 51, 74, 39, 77, 39, 78], ["+", 12, 23, 0, 74, 51, 74, 39, 77, 39, 78], ["-", 51, 74, 51, 66, 28, 2, 3, 4, 0, 22], ["+", 51, 74, 51, 66, 28, 2, 3, 4, 0, 22]]
0
550
H,W,M = map(int,input().split()) hcount = [0 for i in range(H+1)] wcount = [0 for i in range(W+1)] hw = [list(map(int,input().split())) for i in range(M)] for i in range(M): h,w = hw[i] hcount[h]+=1 wcount[w]+=1 ansh = max(hcount) answ = max(wcount)#おいてない前提 counth=0 countw=0 for i in range(H+1): if h...
H,W,M = map(int,input().split()) hcount = [0 for i in range(H+1)] wcount = [0 for i in range(W+1)] hw = [list(map(int,input().split())) for i in range(M)] for i in range(M): h,w = hw[i] hcount[h]+=1 wcount[w]+=1 ansh = max(hcount) answ = max(wcount)#おいてない前提 counth=0 countw=0 for i in range(H+1): if h...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
218
#include <bits/stdc++.h> using namespace std; int main() { int H, W, M, h, w; cin >> H >> W >> M; set<pair<int, int>> st; vector<int64_t> R(H, 0), C(W, 0), hs(M), ws(M); for (int i = 0; i < M; i++) { cin >> h >> w; h--, w--; R.at(h)++; C.at(w)++; hs.at(i) = h; ws.at(i) = w; st.ins...
#include <bits/stdc++.h> using namespace std; int main() { int H, W, M, h, w; cin >> H >> W >> M; set<pair<int, int>> st; vector<int64_t> R(H, 0), C(W, 0), hs(M), ws(M); for (int i = 0; i < M; i++) { cin >> h >> w; h--, w--; R.at(h)++; C.at(w)++; hs.at(i) = h; ws.at(i) = w; st.ins...
[["-", 28, 2, 3, 4, 0, 83, 0, 69, 28, 22], ["+", 28, 2, 3, 4, 0, 83, 0, 69, 28, 22]]
1
418
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) {...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) {...
[["-", 3, 4, 0, 118, 28, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 118, 28, 69, 341, 342, 0, 22]]
1
588
#include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T> using v2 = vector<vector<T>>; template <typename T> inline v2<T> fill(int r, int c, const T &t) { return v2<T>(r, vector<T>(c, t)); } #define F first #define S second void solve() { int h, w, m; cin >> h >> w >> m; vector...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T> using v2 = vector<vector<T>>; template <typename T> inline v2<T> fill(int r, int c, const T &t) { return v2<T>(r, vector<T>(c, t)); } #define F first #define S second void solve() { int h, w, m; cin >> h >> w >> m; vector...
[["-", 12, 2, 3, 4, 0, 16, 12, 118, 119, 120], ["+", 12, 2, 3, 4, 0, 16, 12, 118, 119, 120]]
1
495
from operator import itemgetter H, W, M = map(int, input().split()) h_count = [[i, 0] for i in range(H)] w_count = [[i, 0] for i in range(W)] exist = dict() for _ in range(M): h, w = map(lambda x: int(x)-1, input().split()) h_count[h][1] += 1 w_count[w][1] += 1 exist[(h, w)] = True h_count.sort(key=it...
from operator import itemgetter H, W, M = map(int, input().split()) h_count = [[i, 0] for i in range(H)] w_count = [[i, 0] for i in range(W)] exist = dict() for _ in range(M): h, w = map(lambda x: int(x)-1, input().split()) h_count[h][1] += 1 w_count[w][1] += 1 exist[(h, w)] = True h_count.sort(key=it...
[["+", 8, 196, 0, 57, 15, 679, 12, 681, 0, 372]]
5
256
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #def...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #def...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22]]
1
409
// Problem : E - Bomber // Contest : AtCoder - AtCoder Beginner Contest 176 // URL : https://atcoder.jp/contests/abc176/tasks/abc176_e // Memory Limit : 1024 MB // Time Limit : 3000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define ff first #define...
// Problem : E - Bomber // Contest : AtCoder - AtCoder Beginner Contest 176 // URL : https://atcoder.jp/contests/abc176/tasks/abc176_e // Memory Limit : 1024 MB // Time Limit : 3000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define ff first #define...
[["-", 51, 66, 28, 2, 3, 4, 0, 16, 12, 22], ["+", 51, 66, 28, 2, 3, 4, 0, 16, 12, 22]]
1
380
H, W, M = map(int, input().split()) targets = [] n_target_h = [0] * H n_target_w = [0] * W for i in range(M): h, w = map(int, input().split()) targets.append((h, w)) n_target_h[h - 1] += 1 n_target_w[w - 1] += 1 h_max = max(n_target_h) w_max = max(n_target_w) bomb_h = [i + 1 for i, h in enumerate(n_...
H, W, M = map(int, input().split()) targets = [] n_target_h = [0] * H n_target_w = [0] * W for i in range(M): h, w = map(int, input().split()) targets.append((h, w)) n_target_h[h - 1] += 1 n_target_w[w - 1] += 1 h_max = max(n_target_h) w_max = max(n_target_w) bomb_h = [i + 1 for i, h in enumerate(n_...
[["-", 15, 679, 12, 23, 0, 666, 0, 206, 51, 22], ["+", 15, 679, 12, 23, 0, 666, 0, 206, 51, 22], ["-", 0, 666, 0, 206, 206, 657, 31, 206, 206, 612], ["+", 0, 666, 0, 206, 206, 657, 31, 206, 206, 612], ["-", 0, 57, 15, 679, 12, 23, 0, 666, 0, 22], ["+", 0, 57, 15, 679, 12, 23, 0, 666, 0, 22]]
5
209
// given n integers and an integer m such that n>m then there exits a pair //(a-b) such that (a-b)%m==0 #include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll M = 1000000007; void solve() { int r, c, m; cin >> r >> c >> m; int ans1 = 0, ans2 = 0, id1, id2; map<int, int> p, q; map<pa...
// given n integers and an integer m such that n>m then there exits a pair //(a-b) such that (a-b)%m==0 #include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll M = 1000000007; void solve() { int r, c, m; cin >> r >> c >> m; int ans1 = 0, ans2 = 0, id1, id2; map<int, int> p, q; map<pa...
[["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38]]
1
309
// Problem : E - Bomber // Contest : AtCoder - AtCoder Beginner Contest 176 // URL : https://atcoder.jp/contests/abc176/tasks/abc176_e // Memory Limit : 1024 MB // Time Limit : 3000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma")...
// Problem : E - Bomber // Contest : AtCoder - AtCoder Beginner Contest 176 // URL : https://atcoder.jp/contests/abc176/tasks/abc176_e // Memory Limit : 1024 MB // Time Limit : 3000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma")...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]]
1
635
import sys readline=sys.stdin.readline H,W,M = map(int,readline().split()) hcol = [[0,i] for i in range(H)] wcol = [[0,i] for i in range(W)] P = set() for i in range(M): h,w = map(int,readline().split()) h -= 1 w -= 1 hcol[h][0] += 1 wcol[w][0] += 1 P.add((h,w)) hcol = sorted(hcol, key = lambda x:x[0]...
import sys readline=sys.stdin.readline H,W,M = map(int,readline().split()) hcol = [[0,i] for i in range(H)] wcol = [[0,i] for i in range(W)] P = set() for i in range(M): h,w = map(int,readline().split()) h -= 1 w -= 1 hcol[h][0] += 1 wcol[w][0] += 1 P.add((h,w)) hcol = sorted(hcol, key = lambda x:x[0]...
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
307
import sys import collections sys.setrecursionlimit(10**6) input = sys.stdin.readline #read = sys.stdin.buffer.read def main(): H, W, M = map(int, input().split()) bombs = [] for _ in range(M): h, w = map(int, input().split()) bombs.append((h, w)) bombs_set = set(bombs) g = list(zi...
import sys import collections sys.setrecursionlimit(10**6) input = sys.stdin.readline #read = sys.stdin.buffer.read def main(): H, W, M = map(int, input().split()) bombs = [] for _ in range(M): h, w = map(int, input().split()) bombs.append((h, w)) bombs_set = set(bombs) g = list(zi...
[["-", 8, 196, 0, 1, 0, 662, 12, 206, 206, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 206, 612], ["-", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
288
#include <bits/stdc++.h> using namespace std; int main() { int h, w, m; cin >> h >> w >> m; map<pair<int, int>, int> baku; map<int, int> bh; map<int, int> bw; map<int, int> bhmax; map<int, int> bwmax; map<int, int> bh_flag; map<int, int> bw_flag; int tmp1, tmp2; for (int i = 0; i < m; i++) { c...
#include <bits/stdc++.h> using namespace std; int main() { int h, w, m; cin >> h >> w >> m; map<pair<int, int>, int> baku; map<int, int> bh; map<int, int> bw; map<int, int> bhmax; map<int, int> bwmax; map<int, int> bh_flag; map<int, int> bw_flag; int tmp1, tmp2; for (int i = 0; i < m; i++) { c...
[["-", 28, 2, 3, 4, 0, 83, 0, 118, 119, 120], ["+", 28, 2, 3, 4, 0, 83, 0, 118, 119, 120]]
1
472
// AtCoder template #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { cin.tie(0); ios::sync_with_stdio(false); map<pair<int, int>, int> mp; int h, w, m; cin >> h >> w >> m; vector<pair<int, int>> row(h), col(w); rep(i, h) row[...
// AtCoder template #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { cin.tie(0); ios::sync_with_stdio(false); map<pair<int, int>, int> mp; int h, w, m; cin >> h >> w >> m; vector<pair<int, int>> row(h), col(w); rep(i, h) row[...
[["-", 341, 342, 0, 2, 3, 4, 0, 118, 119, 120], ["+", 341, 342, 0, 2, 3, 4, 0, 118, 119, 120], ["+", 0, 7, 15, 16, 12, 16, 12, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 16, 12, 16, 12, 13]]
1
398
#include <bits/stdc++.h> using namespace std; using ll = long long; // print(fixed << setprecision(10)); #define rep(i, n) for (ll i = 0; i < (n); i++) #define repk(i, n, k) for (ll i = k; i < (n); i++) #define all(n) n.begin(), n.end() #define print(n) cout << n << endl double PI = acos(-1.0); int INF = 1e9; ll LINF ...
#include <bits/stdc++.h> using namespace std; using ll = long long; // print(fixed << setprecision(10)); #define rep(i, n) for (ll i = 0; i < (n); i++) #define repk(i, n, k) for (ll i = k; i < (n); i++) #define all(n) n.begin(), n.end() #define print(n) cout << n << endl double PI = acos(-1.0); int INF = 1e9; ll LINF ...
[["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
342
import java.util.*; public class Main { private static final int INF = 1_000_000_000; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); int W = sc.nextInt(); int M = sc.nextInt(); int[] rowCnt = new int[H]; int[] colCnt = new int[W]; ...
import java.util.*; public class Main { private static final int INF = 1_000_000_000; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); int W = sc.nextInt(); int M = sc.nextInt(); int[] rowCnt = new int[H]; int[] colCnt = new int[W]; ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22]]
3
386
#include <algorithm> #include <bitset> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <utility> #include <vector> using namespace std; #define N (1000000000 + 7) //#define N 99824...
#include <algorithm> #include <bitset> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <utility> #include <vector> using namespace std; #define N (1000000000 + 7) //#define N 99824...
[["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
422
import sys;input=sys.stdin.readline H, W, M = map(int, input().split()) dx = [0]*H dy = [0]*W HH = set() for _ in range(M): x, y = map(int, input().split()) dx[x-1] += 1 dy[y-1] += 1 HH.add((x-1, y-1)) mx=max(dx) my=max(dy) mxs = set() mys = set() for i in range(H): if dx[i] == mx: mxs.add(i...
import sys;input=sys.stdin.readline H, W, M = map(int, input().split()) dx = [0]*H dy = [0]*W HH = set() for _ in range(M): x, y = map(int, input().split()) dx[x-1] += 1 dy[y-1] += 1 HH.add((x-1, y-1)) mx=max(dx) my=max(dy) mxs = set() mys = set() for i in range(H): if dx[i] == mx: mxs.add(i...
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24]]
5
213
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll h, w, m2; cin >> h >> w >> m2; vector<vector<ll>> m; vector<vector<ll>> hh(h, vector<ll>(2, 0)); vector<vector<ll>> ww(w, vector<ll>(2, 0)); vector<l...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll h, w, m2; cin >> h >> w >> m2; vector<vector<ll>> m; vector<vector<ll>> hh(h, vector<ll>(2, 0)); vector<vector<ll>> ww(w, vector<ll>(2, 0)); vector<l...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 51, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["-", 51, 16, 12, 16, 12, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 16, 12, 69, 341, 342, 0, 22]]
1
546
// Always check for base cases // Check for overflows and out of index // Do something instead of sitting idle #include <bits/stdc++.h> #define ll long long #define f first #define s second #define pb push_back #define mod 1000000007 #define mod1 1000000009 #define hell 998244353 #define inf 1000000000000000000LL #defi...
// Always check for base cases // Check for overflows and out of index // Do something instead of sitting idle #include <bits/stdc++.h> #define ll long long #define f first #define s second #define pb push_back #define mod 1000000007 #define mod1 1000000009 #define hell 998244353 #define inf 1000000000000000000LL #defi...
[["-", 0, 338, 8, 1, 0, 2, 63, 118, 28, 22], ["+", 0, 338, 8, 1, 0, 2, 63, 118, 28, 22]]
1
594
#include <bits/stdc++.h> #define INF 2e9 #define MOD 1000000007 #define MOD9 998244353 #define intMAX 51000; #define PI 3.14159265359 using namespace std; typedef long long llong; typedef long double ldouble; using Graph = vector<vector<int>>; int main() { typedef pair<int, int> pair; int H, W, M; cin >> H >> W...
#include <bits/stdc++.h> #define INF 2e9 #define MOD 1000000007 #define MOD9 998244353 #define intMAX 51000; #define PI 3.14159265359 using namespace std; typedef long long llong; typedef long double ldouble; using Graph = vector<vector<int>>; int main() { typedef pair<int, int> pair; int H, W, M; cin >> H >> W...
[["+", 0, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
409
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0LL; X < (N); X++) #define ALL(V) (V).begin(), (V).end() #define endl "\n" using namespace std; typedef long long ll; const double PI = 3.1415926535897932384626; const ll MODN = 1000000007; const ll MODN2 = 998244353; const double EPS = 1e-10; int main() { i...
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0LL; X < (N); X++) #define ALL(V) (V).begin(), (V).end() #define endl "\n" using namespace std; typedef long long ll; const double PI = 3.1415926535897932384626; const ll MODN = 1000000007; const ll MODN2 = 998244353; const double EPS = 1e-10; int main() { i...
[["-", 51, 16, 31, 118, 28, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 118, 28, 69, 341, 342, 0, 22], ["-", 3, 4, 0, 118, 28, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 118, 28, 69, 341, 342, 0, 22]]
1
384
H, W, M = map(int, input().split()) B = [list(map(int, input().split())) for _ in range(M)] bombs_row = [0] * H bombs_col = [0] * W for b in B: bombs_row[b[0] - 1] += 1 bombs_col[b[1] - 1] += 1 row_max = max(bombs_row) col_max = max(bombs_col) row_max_count = bombs_row.count(row_max) col_max_count = bombs_...
H, W, M = map(int, input().split()) B = [list(map(int, input().split())) for _ in range(M)] bombs_row = [0] * H bombs_col = [0] * W for b in B: bombs_row[b[0] - 1] += 1 bombs_col[b[1] - 1] += 1 row_max = max(bombs_row) col_max = max(bombs_col) row_max_count = bombs_row.count(row_max) col_max_count = bombs_...
[["+", 15, 679, 31, 666, 0, 206, 206, 657, 17, 33], ["+", 15, 679, 31, 666, 0, 206, 206, 657, 12, 612], ["+", 15, 679, 12, 666, 0, 206, 206, 657, 17, 33], ["+", 15, 679, 12, 666, 0, 206, 206, 657, 12, 612]]
5
167
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" using namespac...
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" using namespac...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
440
#include <bits/stdc++.h> #define rep(i, l, r) for (int i = (l); i <= (r); i++) #define per(i, r, l) for (int i = (r); i >= (l); i--) #define mem(a, b) memset(a, b, sizeof a) #define mp make_pair using namespace std; const int N = 3e5 + 5, MI = 1e6; int read() { static streambuf *in = cin.rdbuf(); #define gc ...
#include <bits/stdc++.h> #define rep(i, l, r) for (int i = (l); i <= (r); i++) #define per(i, r, l) for (int i = (r); i >= (l); i--) #define mem(a, b) memset(a, b, sizeof a) #define mp make_pair using namespace std; const int N = 3e5 + 5, MI = 1e6; int read() { static streambuf *in = cin.rdbuf(); #define gc ...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
574
import sys HK,WK,M = map(int, input().split()) W = [0] * (WK + 1) H = [0] * (HK + 1) HW = {} # 3*10^5 for i in range(M): h, w = map(int, input().split()) H[h] += 1 W[w] += 1 HW[(h,w)] = 1 answer = 0 HMAX = max(H) WMAX = max(W) HEMAX = H.count(HMAX) WEMAX = W.count(WMAX) if HEMAX * WEMAX > M: pr...
import sys HK,WK,M = map(int, input().split()) W = [0] * (WK + 1) H = [0] * (HK + 1) HW = {} # 3*10^5 for i in range(M): h, w = map(int, input().split()) H[h] += 1 W[w] += 1 HW[(h,w)] = 1 answer = 0 HMAX = max(H) WMAX = max(W) HEMAX = H.count(HMAX) WEMAX = W.count(WMAX) if HEMAX * WEMAX > M: pr...
[["+", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372]]
5
220
h,w,m=map(int,input().split()) table=[] H=[0]*h W=[0]*w li_h=[] li_w=[] for i in range(m): h1,w1=list(map(int,input().split())) table.append((h1-1,w1-1)) H[h1-1]+=1 W[w1-1]+=1 h_flag=0 w_flag=0 Hm=max(H) Wm=max(W) Hh=[i for i, x in enumerate(H) if x == HM] Ww=[i for i, x in enumerate(W) if x == Wm] ...
h,w,m=map(int,input().split()) table=[] H=[0]*h W=[0]*w li_h=[] li_w=[] for i in range(m): h1,w1=list(map(int,input().split())) table.append((h1-1,w1-1)) H[h1-1]+=1 W[w1-1]+=1 h_flag=0 w_flag=0 Hm=max(H) Wm=max(W) Hh=[i for i, x in enumerate(H) if x == Hm] Ww=[i for i, x in enumerate(W) if x == Wm] ...
[["-", 0, 662, 12, 658, 0, 678, 0, 666, 0, 22], ["+", 0, 662, 12, 658, 0, 678, 0, 666, 0, 22], ["-", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22],...
5
214
H, W, M = map(int, input().split()) hlist = [0] * H wlist = [0] * W hw = set() for i in range(M): h, w = map(int, input().split()) hlist[h - 1] += 1 wlist[w - 1] += 1 hw.add((h - 1, w - 1)) hmax = max(hlist) wmax = max(wlist) hmaxlist = [i for i, v in enumerate(hlist) if v == hmax] wmaxlist = [i for i,...
H, W, M = map(int, input().split()) hlist = [0] * H wlist = [0] * W hw = set() for i in range(M): h, w = map(int, input().split()) hlist[h - 1] += 1 wlist[w - 1] += 1 hw.add((h - 1, w - 1)) hmax = max(hlist) wmax = max(wlist) hmaxlist = [i for i, v in enumerate(hlist) if v == hmax] wmaxlist = [i for i,...
[["-", 8, 196, 0, 57, 15, 681, 28, 666, 0, 22], ["-", 8, 196, 0, 57, 15, 681, 28, 666, 667, 267], ["+", 8, 196, 0, 57, 15, 681, 28, 666, 667, 267], ["+", 8, 196, 0, 57, 15, 681, 28, 666, 0, 22]]
5
185
import java.io.*; import java.util.*; class Main { Scanner in; InputStream is; PrintWriter out; String INPUT = ""; //----------------------------------------------------------------------------------------------------// int INF = Integer.MAX_VALUE; int mod = (int)(1e9) + 7; void solve() throws IOExcep...
import java.io.*; import java.util.*; class Main { Scanner in; InputStream is; PrintWriter out; String INPUT = ""; //----------------------------------------------------------------------------------------------------// int INF = Integer.MAX_VALUE; int mod = (int)(1e9) + 7; void solve() throws IOExcep...
[["-", 0, 57, 75, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 75, 196, 0, 7, 15, 16, 12, 22]]
3
1,267
/* *****fireice**** */ #include <bits/stdc++.h> #define ll long long int #define ld long double #define vi vector<int> #define vc vector<char> #define vl vector<ll> #define vii vector<pair<int, int>> #define vll vector<pair<ll, ll>> #define pii pair<int, int> #define pb push_back #define eb emplace_back #define el '\...
/* *****fireice**** */ #include <bits/stdc++.h> #define ll long long int #define ld long double #define vi vector<int> #define vc vector<char> #define vl vector<ll> #define vii vector<pair<int, int>> #define vll vector<pair<ll, ll>> #define pii pair<int, int> #define pb push_back #define eb emplace_back #define el '\...
[["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]]
1
1,153
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << endl; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << endl; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
497
/* -------------------- | LOSER | | ~NOOBOSS~ | -------------------- */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define inl(x) scanf("%lld", &x) #define in(x) scanf("%d", ...
/* -------------------- | LOSER | | ~NOOBOSS~ | -------------------- */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define inl(x) scanf("%lld", &x) #define in(x) scanf("%d", ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
1,294
#include <bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; template <class T, class U> using P = pair<T, U>; template <class T> using Heap = priority_queue<T>; template <class T> using heaP = priority_queue<T, vector<T>...
#include <bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; template <class T, class U> using P = pair<T, U>; template <class T> using Heap = priority_queue<T>; template <class T> using heaP = priority_queue<T, vector<T>...
[["-", 8, 1, 0, 11, 12, 16, 31, 69, 28, 22], ["+", 8, 1, 0, 11, 12, 16, 31, 69, 28, 22], ["-", 0, 7, 8, 1, 0, 11, 12, 16, 17, 98], ["-", 8, 1, 0, 11, 12, 16, 12, 69, 28, 22], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 67], ["+", 8, 1, 0, 11, 12, 16, 12, 69, 28, 22]]
1
529
import sys from itertools import product H, W, M = map(int, input().split()) hsum = [0 for i in range(H)] wsum = [0 for i in range(W)] s = set() for i in range(M): h, w = map(int, input().split()) h, w = h-1, w-1 s.add((h, w)) hsum[h] += 1 wsum[w] += 1 hmax = max(hsum) wmax = max(wsum) hmax_index ...
import sys from itertools import product H, W, M = map(int, input().split()) hsum = [0 for i in range(H)] wsum = [0 for i in range(W)] s = set() for i in range(M): h, w = map(int, input().split()) h, w = h-1, w-1 s.add((h, w)) hsum[h] += 1 wsum[w] += 1 hmax = max(hsum) wmax = max(wsum) hmax_index ...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]]
5
213
H, W, M = map(int, input().split()) h = [0] * H w = [0] * W boms = set() for _ in range(M): x, y = map(int, input().split()) h[x - 1] += 1 w[y - 1] += 1 boms.add((x, y)) h_max = max(h) w_max = max(w) h_idx = [x + 1 for x, y in enumerate(h) if y == h_max] w_idx = [x + 1 for x, y in enumerate(w) if y ...
H, W, M = map(int, input().split()) h = [0] * H w = [0] * W boms = set() for _ in range(M): x, y = map(int, input().split()) h[x - 1] += 1 w[y - 1] += 1 boms.add((x, y)) h_max = max(h) w_max = max(w) h_idx = [x + 1 for x, y in enumerate(h) if y == h_max] w_idx = [x + 1 for x, y in enumerate(w) if y ...
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22]]
5
175
h,w,m=map(int,input().split()) g=[] e1=[0]*h e2=[0]*w for c in range(m): a,b=map(int,input().split()) g.append([a-1,b-1]) e1[a-1]+=1 e2[b-1]+=1 p1=max(e1) p2=max(e2) x=[1 if e1[c]==p1 else 0 for c in range(h)] y=[1 if e2[c]==p2 else 0 for c in range(w)] r=sum(x)*sum(y) for i in g: if x[i[0]]==1 and ...
h,w,m=map(int,input().split()) g=[] e1=[0]*h e2=[0]*w for c in range(m): a,b=map(int,input().split()) g.append([a-1,b-1]) e1[a-1]+=1 e2[b-1]+=1 p1=max(e1) p2=max(e2) x=[1 if e1[c]==p1 else 0 for c in range(h)] y=[1 if e2[c]==p2 else 0 for c in range(w)] r=sum(x)*sum(y) for i in g: if x[i[0]]==1 and ...
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", ...
5
205
// // main.cpp // CP-C++ // // Created by ALOK KUMAR THAKUR on 05/05/20. // Copyright © 2020 ALOK KUMAR THAKUR. All rights reserved. // #include <bits/stdc++.h> using namespace std; #define ll long long #define tc() \ ll T; ...
// // main.cpp // CP-C++ // // Created by ALOK KUMAR THAKUR on 05/05/20. // Copyright © 2020 ALOK KUMAR THAKUR. All rights reserved. // #include <bits/stdc++.h> using namespace std; #define ll long long #define tc() \ ll T; ...
[["-", 51, 16, 12, 69, 341, 342, 0, 83, 0, 22], ["-", 51, 16, 12, 69, 341, 342, 0, 83, 0, 21], ["+", 51, 16, 12, 69, 341, 342, 0, 83, 0, 21], ["+", 51, 16, 12, 69, 341, 342, 0, 83, 0, 22]]
1
419
import time from bisect import bisect_left t = time.time() H,W,m = map(int,input().split()) h = [0]*(H+1) w = [0]*(W+1) c = [[-1] for i in range(H+1)] for i in range(m): a,b = map(int,input().split()) h[a] += 1 w[b] += 1 c[a].append(b) mh = max(h) mw = max(w) hkouho = [] wkouho = [] for i in range(H+1):...
import time from bisect import bisect_left t = time.time() H,W,m = map(int,input().split()) h = [0]*(H+1) w = [0]*(W+1) c = [[-1,10**6] for i in range(H+1)] for i in range(m): a,b = map(int,input().split()) h[a] += 1 w[b] += 1 c[a].append(b) mh = max(h) mw = max(w) hkouho = [] wkouho = [] for i in range...
[["+", 0, 1, 0, 662, 12, 658, 8, 634, 0, 21], ["+", 0, 662, 12, 658, 8, 634, 0, 657, 31, 612], ["+", 0, 662, 12, 658, 8, 634, 0, 657, 17, 578], ["+", 0, 662, 12, 658, 8, 634, 0, 657, 12, 612]]
5
273
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define ll long long #define ld long double #define MOD 1000000007 #define nl cout << bl #define rt ll Q[100005] = {0} #define mp make_pair #define test() \...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define ll long long #define ld long double #define MOD 1000000007 #define nl cout << bl #define rt ll Q[100005] = {0} #define mp make_pair #define test() \...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
706
/* * Created By: 'Present_Sir' * Created On: Saturday 22 August 2020 08:07:43 PM IST */ #include <bits/stdc++.h> #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define all(v) v.begin()...
/* * Created By: 'Present_Sir' * Created On: Saturday 22 August 2020 08:07:43 PM IST */ #include <bits/stdc++.h> #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define all(v) v.begin()...
[["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35]]
1
391
h,w,m = map(int, input().split()) hw = [list(map(int, input().split())) for i in range(m)] bomb = set() h_list = [0] * (h+1) w_list = [0] * (w+1) for H,W in hw: h_list[H] += 1 w_list[W] += 1 bomb.add((H,W)) max_h = max(h_list) max_w = max(w_list) maxh_list = [] maxw_list = [] for k,v in enumerate(h_list): if v ...
h,w,m = map(int, input().split()) hw = [list(map(int, input().split())) for i in range(m)] bomb = set() h_list = [0] * (h+1) w_list = [0] * (w+1) for H,W in hw: h_list[H] += 1 w_list[W] += 1 bomb.add((H,W)) max_h = max(h_list) max_w = max(w_list) maxh_list = [] maxw_list = [] for k,v in enumerate(h_list): if v ...
[["-", 15, 666, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 15, 666, 0, 657, 12, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 72]]
5
219
#include <bits/stdc++.h> using namespace std; #define int ll #define ll long long #define I32_MAX 2147483647 #define I64_MAX 9223372036854775807LL #define I64_MAX2 1223372036854775807LL #define INF I64_MAX2 // #define MOD 1000000007 #define MOD 998244353 #define MEM_SIZE 101010 #define DEBUG_OUT true #define ALL(x) (...
#include <bits/stdc++.h> using namespace std; #define int ll #define ll long long #define I32_MAX 2147483647 #define I64_MAX 9223372036854775807LL #define I64_MAX2 1223372036854775807LL #define INF I64_MAX2 // #define MOD 1000000007 #define MOD 998244353 #define MEM_SIZE 101010 #define DEBUG_OUT true #define ALL(x) (...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33]]
1
1,230
from collections import defaultdict row=defaultdict(int) col=defaultdict(int) H,W,M=map(int,input().split()) #matrix=[[1 for i in range(W)] for j in range(H)] matrix=defaultdict(bool) for i in range(M): h,w=map(int,input().split()) row[h-1]+=1 col[w-1]+=1 matrix[(h-1,w-1)]=True #print(row) #print(col) #...
from collections import defaultdict row=defaultdict(int) col=defaultdict(int) H,W,M=map(int,input().split()) #matrix=[[1 for i in range(W)] for j in range(H)] matrix=defaultdict(bool) for i in range(M): h,w=map(int,input().split()) row[h-1]+=1 col[w-1]+=1 matrix[(h-1,w-1)]=True #print(row) #print(col) #...
[["-", 8, 196, 0, 57, 15, 206, 206, 660, 0, 22], ["-", 8, 196, 0, 57, 15, 206, 206, 660, 0, 21], ["+", 8, 196, 0, 57, 15, 206, 206, 660, 0, 21], ["+", 8, 196, 0, 57, 15, 206, 206, 660, 0, 22]]
5
311
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func scanInt() int { num, _ := strconv.Atoi(scanString()) return num } func scanString() string { sc.Scan() return sc.Text() } func scanInts(n int) []int { sl := make([]int, n) for i := range sl { sl[i] = scanInt()...
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func scanInt() int { num, _ := strconv.Atoi(scanString()) return num } func scanString() string { sc.Scan() return sc.Text() } func scanInts(n int) []int { sl := make([]int, n) for i := range sl { sl[i] = scanInt()...
[["-", 8, 196, 0, 57, 75, 57, 15, 16, 12, 22], ["+", 8, 196, 0, 57, 75, 57, 15, 16, 12, 22]]
7
459