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 <algorithm> #include <assert.h> #include <bitset> #include <chrono> #include <cstdio> #include <ctime> #include <ctype.h> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <r...
#include <algorithm> #include <assert.h> #include <bitset> #include <chrono> #include <cstdio> #include <ctime> #include <ctype.h> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <r...
[["-", 15, 16, 31, 69, 341, 342, 0, 83, 0, 22], ["-", 15, 16, 31, 69, 341, 342, 0, 83, 0, 21], ["+", 15, 16, 31, 69, 341, 342, 0, 83, 0, 21], ["+", 15, 16, 31, 69, 341, 342, 0, 83, 0, 22]]
1
504
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll h, w, m; cin >> h >> w >> m; vector<pair<ll, ll>> bombs(m); vector<ll> h_count(h), w_count(w); for (ll i = 0; i < m; i++) { ll hi, wi; cin >> hi >> wi; hi--; wi--; bombs[i] = {hi, wi}; h_count[hi]++; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll h, w, m; cin >> h >> w >> m; vector<pair<ll, ll>> bombs(m); vector<ll> h_count(h), w_count(w); for (ll i = 0; i < m; i++) { ll hi, wi; cin >> hi >> wi; hi--; wi--; bombs[i] = {hi, wi}; h_count[hi]++; ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
324
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() typedef vector<int> vi; typedef pair<int, int> ii; typedef long long ll; typedef long double ld; const int mod = 998244353; const ll inf = 3e18 + 5; int add(int a, int b) { return (a += b) < mod ? a ...
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() typedef vector<int> vi; typedef pair<int, int> ii; typedef long long ll; typedef long double ld; const int mod = 998244353; const ll inf = 3e18 + 5; int add(int a, int b) { return (a += b) < mod ? a ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 146], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 147]]
1
360
// 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> #include <ext/pb_ds/assoc_container.hpp> #inc...
// 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> #include <ext/pb_ds/assoc_container.hpp> #inc...
[["+", 0, 2, 3, 4, 0, 83, 0, 91, 17, 33]]
1
423
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<string> vs; typedef vector<vi> vvi; typ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<string> vs; typedef vector<vi> vvi; typ...
[["-", 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
676
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { FastScanner sc = new FastScanner(System.in); PrintWriter pw = new PrintWriter(System.out); int h = sc.nextInt(); int w = sc.nextInt(); int m = sc.nextInt(); HashSet<Long> bomb =...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { FastScanner sc = new FastScanner(System.in); PrintWriter pw = new PrintWriter(System.out); int h = sc.nextInt(); int w = sc.nextInt(); int m = sc.nextInt(); HashSet<Long> bomb =...
[["-", 0, 16, 31, 16, 31, 74, 51, 509, 119, 22], ["+", 0, 16, 31, 16, 31, 74, 51, 509, 119, 22], ["-", 439, 492, 3, 4, 0, 16, 12, 509, 119, 22], ["+", 439, 492, 3, 4, 0, 16, 12, 509, 119, 22]]
3
969
# -*- coding: utf-8 -*- H,W,M = map(int, input().split()) count_H = [0 for _ in range(H)] count_W = [0 for _ in range(W)] bomb = set() for _ in range(M): h,w = map(int, input().split()) bomb.add((h-1,w-1)) count_H[h-1] += 1 count_W[w-1] += 1 def argmax(L): indeices = [] maximum = 0 for i in range(len(...
# -*- coding: utf-8 -*- H,W,M = map(int, input().split()) count_H = [0 for _ in range(H)] count_W = [0 for _ in range(W)] bomb = set() for _ in range(M): h,w = map(int, input().split()) bomb.add((h-1,w-1)) count_H[h-1] += 1 count_W[w-1] += 1 def argmax(L): indices = [] maximum = -1 for i in range(len(...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 664, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 664, 28, 612]]
5
229
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define mkp make_pair #define pb push_back #define pf push_front #define popb pop_back #define popf pop_front #define ff first #define ss second #define endl "\n" #define MOD 1...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define mkp make_pair #define pb push_back #define pf push_front #define popb pop_back #define popf pop_front #define ff first #define ss second #define endl "\n" #define MOD 1...
[["-", 0, 11, 12, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 11, 12, 16, 12, 69, 341, 342, 0, 22], ["-", 12, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 12, 16, 31, 16, 12, 69, 341, 342, 0, 22]]
1
766
#include "bits/stdc++.h" const int INF = 1e9; int main() { std::ios_base::sync_with_stdio(false); std::cout.tie(nullptr); std::cin.tie(nullptr); int h, w, m; std::cin >> h >> w >> m; std::map<int, int> cntx, cnty; std::map<int, std::map<int, int>> cnt; for (int i = 0, x, y; i < m; i++) { std::c...
#include "bits/stdc++.h" const int INF = 1e9; int main() { std::ios_base::sync_with_stdio(false); std::cout.tie(nullptr); std::cin.tie(nullptr); int h, w, m; std::cin >> h >> w >> m; std::map<int, int> cntx, cnty; std::map<int, std::map<int, int>> cnt; for (int i = 0, x, y; i < m; i++) { std::c...
[["-", 0, 30, 0, 14, 8, 9, 0, 338, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 338, 12, 22]]
1
361
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int, int> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int, int> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 0, 7, 8, 9, 0, 43, 49, 50, 51, 146], ["+", 0, 7, 8, 9, 0, 43, 49, 50, 51, 147], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 146]]
1
445
#include <algorithm> #include <cstdio> #include <iostream> #include <numeric> #include <set> #include <string> #include <utility> #include <vector> using namespace std; using PV = pair<int, vector<int>>; using PII = pair<int, int>; void show(vector<int> &v) { for (auto x : v) { printf("%d ", x); } printf(...
#include <algorithm> #include <cstdio> #include <iostream> #include <numeric> #include <set> #include <string> #include <utility> #include <vector> using namespace std; using PV = pair<int, vector<int>>; using PII = pair<int, int>; void show(vector<int> &v) { for (auto x : v) { printf("%d ", x); } printf(...
[["-", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73]]
1
372
def main(): from operator import itemgetter import sys input = sys.stdin.readline H, W, M = map(int, input().split()) rows = [0] * H cols = [0] * W ps = set() for _ in range(M): r, c = (int(x) - 1 for x in input().split()) rows[r] += 1 cols[c] += 1 ps.ad...
def main(): from operator import itemgetter import sys input = sys.stdin.readline H, W, M = map(int, input().split()) rows = [0] * H cols = [0] * W ps = set() for _ in range(M): r, c = (int(x) - 1 for x in input().split()) rows[r] += 1 cols[c] += 1 ps.ad...
[["-", 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, 25], ["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
215
h,w,m=map(int,input().split()) a=dict() b=dict() points=set() for i in range (m): x,y=map(int,input().split()) points.add((x,y)) if x in a: a[x]+=1 else: a[x]=1 if y in b: b[y]+=1 else: b[y]=1 m1=max(a.values()) m2=max(b.values()) s1=set() s2=set() for i in a: ...
h,w,m=map(int,input().split()) a=dict() b=dict() points=set() for i in range (m): x,y=map(int,input().split()) points.add((x,y)) if x in a: a[x]+=1 else: a[x]=1 if y in b: b[y]+=1 else: b[y]=1 m1=max(a.values()) m2=max(b.values()) s1=set() s2=set() for i in a: ...
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
236
#include <algorithm> #include <iostream> #include <map> using namespace std; typedef pair<int, int> P; int main() { int h, w, m; cin >> h >> w >> m; int x[300005]{0}, y[100005]{0}; map<P, int> mp; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; x[a]++; y[b]++; mp[...
#include <algorithm> #include <iostream> #include <map> using namespace std; typedef pair<int, int> P; int main() { int h, w, m; cin >> h >> w >> m; int x[300005]{0}, y[300005]{0}; map<P, int> mp; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; x[a]++; y[b]++; mp[...
[["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
357
#include <bits/stdc++.h> using namespace std; int main() { int H, W, M; cin >> H >> W >> M; vector<int> h(M), w(M); // vector<vector<int>> h_vec(H, vector<int>()), w_vec(W, vector<int>()); // vector<pair<int, vector<int>>> h_vec(H, pair<int, vector<int>>()), w_vec(W, // pair<int, vector<int>>()); vector<...
#include <bits/stdc++.h> using namespace std; int main() { int H, W, M; cin >> H >> W >> M; vector<int> h(M), w(M); // vector<vector<int>> h_vec(H, vector<int>()), w_vec(W, vector<int>()); // vector<pair<int, vector<int>>> h_vec(H, pair<int, vector<int>>()), w_vec(W, // pair<int, vector<int>>()); vector<...
[["-", 51, 118, 28, 69, 341, 342, 0, 16, 31, 22], ["+", 51, 118, 28, 69, 341, 342, 0, 16, 31, 22]]
1
519
h, w, m = gets.split(" ").map(&:to_i) grid = {} h_grid = Array.new(h+1, 0) w_grid = Array.new(w+1, 0) hmax = h_grid.max h_arr = [] wmax = w_grid.max w_arr = [] m.times do hi, wi = gets.split(" ").map(&:to_i) grid[[hi, wi]] = true h_grid[hi] ||= 0 w_grid[wi] ||= 0 h_grid[hi] += 1 w_grid[wi] += 1 if h_...
h, w, m = gets.split(" ").map(&:to_i) grid = {} h_grid = Array.new(h+1, 0) w_grid = Array.new(w+1, 0) hmax = h_grid.max h_arr = [] wmax = w_grid.max w_arr = [] m.times do hi, wi = gets.split(" ").map(&:to_i) grid[[hi, wi]] = true h_grid[hi] ||= 0 w_grid[wi] ||= 0 h_grid[hi] += 1 w_grid[wi] += 1 if h_...
[["+", 0, 652, 196, 737, 8, 736, 0, 745, 0, 747], ["+", 0, 652, 196, 737, 8, 736, 0, 745, 15, 22]]
4
229
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define pb push_back #define ll long long #define si short int #define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define pill pair<ll, ll> #define f first #define s second #define pilc pair<ll, char> #define all(a) (a).begin(), (a).end(...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define pb push_back #define ll long long #define si short int #define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define pill pair<ll, ll> #define f first #define s second #define pilc pair<ll, char> #define all(a) (a).begin(), (a).end(...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22]]
1
507
#include <bits/stdc++.h> using namespace std; #define ll long long int int main(void) { // Your code here! ios_base::sync_with_stdio(false); cin.tie(NULL); ll i, mr, mc, h, w, m, x, y; cin >> h >> w >> m; ll r[h], c[w]; for (i = 0; i < h; i++) r[i] = 0; for (i = 0; i < w; i++) c[i] = 0; set<pa...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main(void) { // Your code here! ios_base::sync_with_stdio(false); cin.tie(NULL); ll i, mr, mc, h, w, m, x, y; cin >> h >> w >> m; ll r[h], c[w]; for (i = 0; i < h; i++) r[i] = 0; for (i = 0; i < w; i++) c[i] = 0; set<pa...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
315
// abc176_e #include <bits/stdc++.h> #ifdef LOCAL #include "../cxx-prettyprint/prettyprint.hpp" #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; #define REP(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define REPN(i, m, n) for (int(i) = m; (i) < (int)(n); +...
// abc176_e #include <bits/stdc++.h> #ifdef LOCAL #include "../cxx-prettyprint/prettyprint.hpp" #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; #define REP(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define REPN(i, m, n) for (int(i) = m; (i) < (int)(n); +...
[["-", 31, 69, 341, 342, 0, 69, 341, 342, 0, 22], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 22]]
1
561
# Fast IO (be careful about bytestring) # import os,io # input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline H,W,M = map(int,input().split()) targetList = [] rowCount = [0] * H columnCount = [0] * W for _ in range(M): p,q = map(int,input().split()) targetList.append((p-1,q-1)) rowCount[p-1] += 1 ...
# Fast IO (be careful about bytestring) # import os,io # input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline H,W,M = map(int,input().split()) targetList = [] rowCount = [0] * H columnCount = [0] * W for _ in range(M): p,q = map(int,input().split()) targetList.append((p-1,q-1)) rowCount[p-1] += 1 ...
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
348
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define int long long #define double long double #define mp make_pair #define pb push_back #define er erase #define cl clear #define sw swap #define br break #define ct continue #define rt return #define ...
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define int long long #define double long double #define mp make_pair #define pb push_back #define er erase #define cl clear #define sw swap #define br break #define ct continue #define rt return #define ...
[["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22]]
1
482
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define ios \ ; \ ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define ios \ ; \ ios::sync_with_stdio(false); ...
[["-", 64, 1, 0, 2, 3, 4, 0, 118, 119, 120], ["+", 64, 1, 0, 2, 3, 4, 0, 118, 119, 120]]
1
595
#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; template <class T> using ordered_set = __gnu_pbds::tree<T, __gnu_pbds::null_type...
#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; template <class T> using ordered_set = __gnu_pbds::tree<T, __gnu_pbds::null_type...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
406
#include <algorithm> #include <stdio.h> long long h, w, m, c, d, mx, my, e, f, l, r, t, k; long long x[300000]; long long y[300000]; long long z[300000]; long long u[300000]; long long v[300000]; int main() { scanf("%lld%lld%lld", &h, &w, &m); for (int i = 0; i < m; i++) { scanf("%lld%lld", &c, &d); c--; ...
#include <algorithm> #include <stdio.h> long long h, w, m, c, d, mx, my, e, f, l, r, t, k; long long x[300000]; long long y[300000]; long long z[300000]; long long u[300000]; long long v[300000]; int main() { scanf("%lld%lld%lld", &h, &w, &m); for (int i = 0; i < m; i++) { scanf("%lld%lld", &c, &d); c--; ...
[["-", 64, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 64, 1, 0, 11, 12, 69, 341, 342, 0, 22]]
1
421
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < (int)(n); i++) #define ALL(a) a.begin(), a.end() #define MOD 1000000007 using namespace std; using ll = long long; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); int H, W, M; cin >> H >> W >> M; map<pair<int, int>, bool>...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < (int)(n); i++) #define ALL(a) a.begin(), a.end() #define MOD 1000000007 using namespace std; using ll = long long; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); int H, W, M; cin >> H >> W >> M; map<pair<int, int>, bool>...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
384
#include <bits/stdc++.h> using namespace std; #define ll long long #define dd double #define endl "\n" #define pb push_back #define all(v) v.begin(), v.end() #define mp make_pair #define fi first #define se second #define vll vector<ll> #define pll pair<ll, ll> #define fo(i, n) for (int i = 0; i < n; i++) #define fo1(i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define dd double #define endl "\n" #define pb push_back #define all(v) v.begin(), v.end() #define mp make_pair #define fi first #define se second #define vll vector<ll> #define pll pair<ll, ll> #define fo(i, n) for (int i = 0; i < n; i++) #define fo1(i...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
623
h, w, m = [int(e) for e in input().split()] htotal = [0] * h wtotal = [0] * w hmax = 0 wmax = 0 s = set() hl = [] wl = [] for i in range(m): hi, wi = [int(e) for e in input().split()] hi -= 1 wi -= 1 s.add((hi, wi)) htotal[hi] += 1 wtotal[wi] += 1 if htotal[hi] > hmax: hmax = ...
h, w, m = [int(e) for e in input().split()] htotal = [0] * h wtotal = [0] * w hmax = 0 wmax = 0 s = set() hl = [] wl = [] for i in range(m): hi, wi = [int(e) for e in input().split()] hi -= 1 wi -= 1 s.add((hi, wi)) htotal[hi] += 1 wtotal[wi] += 1 if htotal[hi] > hmax: hmax = ...
[["-", 8, 196, 0, 57, 15, 666, 0, 206, 206, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 206, 22]]
5
227
import collections h, w, m = map(int, input().split()) my_s = set() h_ls = [] w_ls = [] for _ in range(m): h_e, w_e = map(int, input().split()) my_s.add((h_e, w_e)) h_ls.append(h_e) w_ls.append(w_e) h_c = collections.Counter(h_ls) w_c = collections.Counter(w_ls) h_ls = h_c.most_common() w_ls = w_c...
import collections h, w, m = map(int, input().split()) my_s = set() h_ls = [] w_ls = [] for _ in range(m): h_e, w_e = map(int, input().split()) my_s.add((h_e, w_e)) h_ls.append(h_e) w_ls.append(w_e) h_c = collections.Counter(h_ls) w_c = collections.Counter(w_ls) h_ls = h_c.most_common() w_ls = w_c...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
311
from collections import defaultdict H,W,M = map(int,input().split()) bomb = [[0,0] for _ in range(M)] bomb_d = defaultdict(int) for i in range(M): bomb[i] = list(map(int,input().split())) bomb[i][0] -= 1 bomb[i][1] -= 1 bomb_d[tuple(bomb[i])] = 1 dh = [0]*H dw = [0]*W for i in range(M): dh[bomb...
from collections import defaultdict H,W,M = map(int,input().split()) bomb = [[0,0] for _ in range(M)] bomb_d = defaultdict(int) for i in range(M): bomb[i] = list(map(int,input().split())) bomb[i][0] -= 1 bomb[i][1] -= 1 bomb_d[tuple(bomb[i])] = 1 dh = [0]*H dw = [0]*W for i in range(M): dh[bomb...
[["-", 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], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 196, 0, 7, 75, 76, 0, 95], ["+", 0, 7, 8, ...
5
267
#include <bits/stdc++.h> using namespace std; int n, m, q, sumr[330000], sumc[330000], x, y, ans; int ansr[330000], ansc[330000]; long long maxr, maxc, totr, totc; map<pair<int, int>, bool> mp; int main() { scanf("%d%d%d", &n, &m, &q); for (int i = 1; i <= q; i++) { scanf("%d%d", &x, &y); sumr[x]++; if ...
#include <bits/stdc++.h> using namespace std; int n, m, q, sumr[330000], sumc[330000], x, y, ans; int ansr[330000], ansc[330000]; long long maxr, maxc, totr, totc; map<pair<int, int>, bool> mp; int main() { scanf("%d%d%d", &n, &m, &q); for (int i = 1; i <= q; i++) { scanf("%d%d", &x, &y); sumr[x]++; if ...
[["-", 0, 34, 31, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 34, 31, 11, 12, 69, 341, 342, 0, 22]]
1
335
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define int long long // [9,223,372,036,854,775,807 to -9.....808] 19 digits #define pb push_back #define all(x) (x).begin(), (x).end() #define mp make_pair #define vi ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define int long long // [9,223,372,036,854,775,807 to -9.....808] 19 digits #define pb push_back #define all(x) (x).begin(), (x).end() #define mp make_pair #define vi ...
[["-", 51, 16, 12, 2, 3, 4, 0, 83, 0, 22], ["-", 51, 16, 12, 2, 3, 4, 0, 83, 0, 21], ["+", 51, 16, 12, 2, 3, 4, 0, 83, 0, 21], ["+", 51, 16, 12, 2, 3, 4, 0, 83, 0, 22]]
1
358
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; int h, w, m; map<int, int> r; map<int, int> c; vector<int> maxr, maxc; int maxrval, maxcval; map<ii, bool> istarget; int main() { scanf("%d%d%d", &h, &w, &m); for (int i = 0; i < m; i++) { int curh, curw; scanf("%d%d", &curh, &curw)...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; int h, w, m; map<int, int> r; map<int, int> c; vector<int> maxr, maxc; int maxrval, maxcval; map<ii, bool> istarget; int main() { scanf("%d%d%d", &h, &w, &m); for (int i = 0; i < m; i++) { int curh, curw; scanf("%d%d", &curh, &curw)...
[["+", 8, 9, 0, 338, 8, 9, 0, 57, 0, 121], ["+", 0, 338, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 338, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 338, 8, 9, 0, 57, 15, 339, 0, 25]]
1
305
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int h, w, m; cin >> h >> w >> m; set<pair<int, int>> st; vector<int> a(h + 1), b(w + 1); for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; st.insert(make_pair(u, v)); a[u]++; b[v]++; ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int h, w, m; cin >> h >> w >> m; set<pair<int, int>> st; vector<int> a(h + 1), b(w + 1); for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; st.insert(make_pair(u, v)); a[u]++; b[v]++; ...
[["-", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22]]
1
470
/*{{{*/ #include "bits/stdc++.h" using namespace std; #define MT make_tuple #define all(x) begin(x), end(x) #define putchar(x) cout << (x) static int fastio = []() { ios_base::sync_with_stdio(false); cin.tie(0); cout.precision(17); return 0; }(); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count...
/*{{{*/ #include "bits/stdc++.h" using namespace std; #define MT make_tuple #define all(x) begin(x), end(x) #define putchar(x) cout << (x) static int fastio = []() { ios_base::sync_with_stdio(false); cin.tie(0); cout.precision(17); return 0; }(); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count...
[["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 21], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]]
1
1,150
H, W, M = map(int, input().split()) from collections import defaultdict from collections import Counter h_dic = defaultdict(int)#h[i]にいくつ爆発物があるか w_dic = defaultdict(int)#w[i]にいくつ爆発物があるか bomb = defaultdict(lambda:defaultdict(int)) for i in range(M): h,w = map(int,input().split()) h_dic[h] += 1 w_dic[w] += 1 ...
H, W, M = map(int, input().split()) from collections import defaultdict from collections import Counter h_dic = defaultdict(int)#h[i]にいくつ爆発物があるか w_dic = defaultdict(int)#w[i]にいくつ爆発物があるか bomb = defaultdict(lambda:defaultdict(int)) for i in range(M): h,w = map(int,input().split()) h_dic[h] += 1 w_dic[w] += 1 ...
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
286
#include <stdio.h> int main() { int H, W, M, i, max1, max2, k1, cc, dd1, dd2; max1 = 0; max2 = 0; dd1 = 0; dd2 = 0; k1 = 0; scanf("%d %d %d", &H, &W, &M); int h[M], w[M], sw[H + W]; for (i = 0; i < 2 * M; ++i) { sw[i] = 0; } for (i = 0; i < M; ++i) { scanf("%d %d", &h[i], &w[i]); sw...
#include <stdio.h> int main() { int H, W, M, i, max1, max2, k1, cc, dd1, dd2; max1 = 0; max2 = 0; dd1 = 0; dd2 = 0; k1 = 0; scanf("%d %d %d", &H, &W, &M); int h[M], w[M], sw[H + W]; for (i = 0; i < H + W; ++i) { sw[i] = 0; } for (i = 0; i < M; ++i) { scanf("%d %d", &h[i], &w[i]); sw...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 48], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22]]
0
369
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
443
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) #de...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) #de...
[["-", 49, 50, 51, 69, 341, 342, 0, 83, 0, 22], ["-", 49, 50, 51, 69, 341, 342, 0, 83, 0, 21], ["+", 49, 50, 51, 69, 341, 342, 0, 83, 0, 21], ["+", 49, 50, 51, 69, 341, 342, 0, 83, 0, 22]]
1
379
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef unsigned int u32; typedef int i32; typedef unsigned long long int u64; typedef long long int i64; // 9e18 typedef uint16_t u16; type...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef unsigned int u32; typedef int i32; typedef unsigned long long int u64; typedef long long int i64; // 9e18 typedef uint16_t u16; type...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
489
#include <bits/stdc++.h> using namespace std; int main() { long H, W, N; cin >> H >> W >> N; vector<pair<long, long>> ta(H), yo(W); map<pair<long, long>, long> mp; for (int i = 0; i < H; i++) ta.at(i).second = i; for (int i = 0; i < W; i++) yo.at(i).second = i; long h, w; for (int i = 0; i < N; ...
#include <bits/stdc++.h> using namespace std; int main() { long H, W, N; cin >> H >> W >> N; vector<pair<long, long>> ta(H), yo(W); map<pair<long, long>, long> mp; for (int i = 0; i < H; i++) ta.at(i).second = i; for (int i = 0; i < W; i++) yo.at(i).second = i; long h, w; for (int i = 0; i < N; ...
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
414
h,w,m = map(int,input().split()) b = [] x = [0 for _ in range(w)] y = [0 for _ in range(h)] for i in range(m): bh,bw = map(int,input().split()) bh -= 1 bw -= 1 b.append((bh,bw)) x[bw] += 1 y[bh] += 1 #print(b,x,y) mxx = max(x) mxy = max(y) cmxb = 0 for by,bx in b: if y[by]+x[bx] == mxx+mxy-1: cmxb +...
h,w,m = map(int,input().split()) b = [] x = [0 for _ in range(w)] y = [0 for _ in range(h)] for i in range(m): bh,bw = map(int,input().split()) bh -= 1 bw -= 1 b.append((bh,bw)) x[bw] += 1 y[bh] += 1 #print(b,x,y) mxx = max(x) mxy = max(y) cmxb = 0 for by,bx in b: if y[by]+x[bx] == mxx+mxy: cmxb += ...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60]]
5
197
#include <bits/stdc++.h> using namespace std; typedef long long LL; template <typename T> inline void read(T &x) { int f = 1; x = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = -1; for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48); x *= f; } cons...
#include <bits/stdc++.h> using namespace std; typedef long long LL; template <typename T> inline void read(T &x) { int f = 1; x = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = -1; for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48); x *= f; } cons...
[["-", 51, 16, 12, 118, 28, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 118, 28, 69, 341, 342, 0, 22], ["-", 31, 16, 12, 23, 0, 16, 31, 16, 31, 22], ["+", 31, 16, 12, 23, 0, 16, 31, 16, 31, 22]]
1
522
h, w, m = map(int, input().split()) hw = [list(map(int, input().split())) for _ in range(m)] c = [0 for _ in range(h)] r = [0 for _ in range(w)] bakuset = {} for i, j in hw: # print(i, j) c[i-1] += 1 r[j-1] += 1 if not str(i-1) + "+" + str(j-1) in bakuset: bakuset[str(i-1) + "+" + str(j-1)] = 0...
h, w, m = map(int, input().split()) hw = [list(map(int, input().split())) for _ in range(m)] c = [0 for _ in range(h)] r = [0 for _ in range(w)] bakuset = {} for i, j in hw: # print(i, j) c[i-1] += 1 r[j-1] += 1 if not str(i-1) + "+" + str(j-1) in bakuset: bakuset[str(i-1) + "+" + str(j-1)] = 0...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22]]
5
313
#include <algorithm> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #define fast ...
#include <algorithm> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #define fast ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,710
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, i, ans = 0, tot, k1 = 0, k2 = 0, mx1 = 0, mx2 = 0; cin >> n >> m >> k; // map<pair<int,int>,int>mp; int a[n + 1] = {0}, b[m + 1] = {0}; int x[k + 1], y[k + 1]; for (i = 1; i <= k; i++) { cin >> x[i] >> y[i]; a[x[i]]++; b[y[...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, i, ans = 0, tot, k1 = 0, k2 = 0, mx1 = 0, mx2 = 0; cin >> n >> m >> k; // map<pair<int,int>,int>mp; int a[n + 1] = {0}, b[m + 1] = {0}; int x[k + 1], y[k + 1]; for (i = 1; i <= k; i++) { cin >> x[i] >> y[i]; a[x[i]]++; b[y[...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
320
import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int H = sc.nextInt(); int W = sc.nextInt(); int M = sc.nextInt(); int[] h = new int[M]; int[] w = new int[M]; HashSet<L...
import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int H = sc.nextInt(); int W = sc.nextInt(); int M = sc.nextInt(); int[] h = new int[M]; int[] w = new int[M]; HashSet<L...
[["-", 0, 530, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 530, 8, 196, 0, 7, 15, 16, 12, 22]]
3
510
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define bug(x) cout << "zdongdebug1: " << x << endl; #define bug2(x, y) co...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define bug(x) cout << "zdongdebug1: " << x << endl; #define bug2(x, y) co...
[["-", 341, 342, 0, 118, 28, 69, 341, 342, 0, 22], ["+", 341, 342, 0, 118, 28, 69, 341, 342, 0, 22]]
1
506
#include <bits/stdc++.h> using namespace std; int n, x[6005], y[2005][2005], add, ans, mx[2005], mxx; int main() { scanf("%d", &n); for (int i = 0; i < n * 3; i++) scanf("%d", x + i); for (int i = 1; i <= n; i++) { mx[i] = INT_MIN; for (int j = 1; j <= n; j++) y[i][j] = INT_MIN; } mx[x[0]...
#include <bits/stdc++.h> using namespace std; int n, x[6005], y[2005][2005], add, ans, mx[2005], mxx; int main() { scanf("%d", &n); for (int i = 0; i < n * 3; i++) scanf("%d", x + i); for (int i = 1; i <= n; i++) { mx[i] = INT_MIN; for (int j = 1; j <= n; j++) y[i][j] = INT_MIN; } mx[x[0]...
[["-", 8, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 8, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 31, 22], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 17, 72]]
1
722
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, a, b) for (int i = (a); i < (b); ++i) #define all(a) (a).begin(), (a).end() int main() { string s; cin >> s; bool p = s[0] == 'R'; bool q = s[1] == 'R'; bool r = s[2] == 'R';...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, a, b) for (int i = (a); i < (b); ++i) #define all(a) (a).begin(), (a).end() int main() { string s; cin >> s; bool p = s[0] == 'R'; bool q = s[1] == 'R'; bool r = s[2] == 'R';...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["-", 75, 76, 0, 57, 15, 339, 51, 1...
1
160
s = input() if 'SSS' in s: ans = 3 elif 'SS' in s: ans = 2 elif 'S' in s: ans = 1 else: ans = 0 print(ans)
s = input() if 'RRR' in s: ans = 3 elif 'RR' in s: ans = 2 elif 'R' in s: ans = 1 else: ans = 0 print(ans)
[["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6], ["+", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6]]
5
44
a = str(input()) if a[0] == 'R' and a[1] == 'R' and a[2] == 'R': print(3) elif a[1] == 'R' and a[2] == 'R' and a[0] != 'R': print(2) elif a[0] == 'R' and a[1] == 'R' and a[0] != 'R': print(2) elif 'R' not in a: print(0) else: print(1)
a = str(input()) if a[0] == 'R' and a[1] == 'R' and a[2] == 'R': print(3) elif a[1] == 'R' and a[2] == 'R' and a[0] != 'R': print(2) elif a[0] == 'R' and a[1] == 'R' and a[2] != 'R': print(2) elif 'R' not in a: print(0) else: print(1)
[["-", 75, 665, 15, 679, 12, 666, 0, 206, 206, 612], ["+", 75, 665, 15, 679, 12, 666, 0, 206, 206, 612]]
5
122
s=input() ren=0 max=0 for i in range(3): if s[i]=="R": ren+=1 if max<ren: max=ren print(max)
s=input() ren=0 max=0 for i in range(3): if s[i]=="R": ren+=1 else: ren=0 if max<ren: max=ren print(max)
[["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
44
S=input() count=[] s=0 for i in range(3): if S[i]=='R': if i==2 or S[i+1]=='S': s=s+1 count.append(s) s=0 else: s=s+1 print(max(count))
S=input() count=[0] s=0 for i in range(3): if S[i]=='R': if i==2 or S[i+1]=='S': s=s+1 count.append(s) s=0 else: s=s+1 print(max(count))
[["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 612]]
5
74
#include <bitset> #include <iostream> #include <map> #include <vector> using namespace std; int main() { string w; cin >> w; ; int result; if (w.at(0) == 'S' && w.at(1) == 'S' && w.at(2) == 'S') { result = 0; } else if (w.at(0) == 'R' && w.at(1) == 'R' && w.at(2) == 'R') { result = 3; } else if...
#include <bitset> #include <iostream> #include <map> #include <vector> using namespace std; int main() { string w; cin >> w; ; int result; if (w.at(0) == 'S' && w.at(1) == 'S' && w.at(2) == 'S') { result = 0; } else if (w.at(0) == 'R' && w.at(1) == 'R' && w.at(2) == 'R') { result = 3; } else if...
[["-", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125]]
1
204
s = input() if "R" not in s: print(0) elif s[1] == "S": print(1) elif s[0] == s[2] == "R": print(3) elif s[0] == "R" or s[2] == "R": print(2)
s = input() if "R" not in s: print(0) elif s[1] == "S": print(1) elif s[0] == s[2] == "R": print(3) elif s[0] == "R" or s[2] == "R": print(2) else: print(1)
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["+", 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, 612], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
73
S = input() if S.count("SSS")>=1: print(3) exit() if S.count("SS")>=1: print(2) exit() if S.count("S")==0: print(0) exit() else: print(1)
S = input() if S.count("RRR")>=1: print(3) exit() if S.count("RR")>=1: print(2) exit() if S.count("R")==0: print(0) exit() else: print(1)
[["-", 15, 666, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 15, 666, 0, 652, 3, 4, 0, 557, 0, 6]]
5
68
s=list(input()) c=[] for i in range(3): if s[i]=='R': cnt=0 while i<3: if s[i]=='R': cnt+=1 i+=1 else: break c.append(cnt) print(max(c))
s=list(input()) c=[] for i in range(3): cnt=0 if s[i]=='R': while i<3: if s[i]=='R': cnt+=1 i+=1 else: break c.append(cnt) print(max(c))
[["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 12, 612], ["-", 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
70
S = int(input()) flag = False ans = 0 for i in range(len(S)): if S[i] == 'R': ans += 1 flag = True elif S[i] == 'S' and flag: break print(ans)
S = input() flag = False ans = 0 for i in range(len(S)): if S[i] == 'R': ans += 1 flag = True elif S[i] == 'S' and flag: break print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
58
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int ans = 0; int tmpAns = 0; char[] s = sc.nextLine().toCharArray(); for (int cnt = 0; cnt < 3; cnt++) { if (s[cnt] == 'R') { tmpAns++; } if (s[cnt...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int ans = 0; int tmpAns = 0; char[] s = sc.nextLine().toCharArray(); for (int cnt = 0; cnt < 3; cnt++) { if (s[cnt] == 'R') { tmpAns++; } if (s[cnt...
[["+", 0, 57, 64, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 12, 499], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35]]
3
134
s = input() ans = 0 if s[0]=='R' and s[1]=='R' and s[2]=='R': ans = 3 if (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'): ans = 2 if ans == 0: for i in range(3): if s[i]=='R': ans = 1 print(ans)
s = input() ans = 0 if (s[0]=='R' and s[1]=='R') and s[2]=='R': ans = 3 elif (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'): ans = 2 if ans == 0: for i in range(3): if s[i]=='R': ans = 1 print(ans)
[["+", 0, 656, 0, 57, 15, 679, 31, 23, 0, 24], ["+", 0, 656, 0, 57, 15, 679, 31, 23, 0, 25], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
113
#include <iostream> using namespace std; #include <string> int main() { string str; cin >> str; int ans = 0; if (str.at(1) == 'R') { ans++; if (str.at(2) == 'R') ans++; if (str.at(0) == 'R') ans++; } else { if (str.at(0) == 'R' && str.at(2) == 'R') ans++; } cout << ans <...
#include <iostream> using namespace std; #include <string> int main() { string str; cin >> str; int ans = 0; if (str.at(1) == 'R') { ans++; if (str.at(2) == 'R') ans++; if (str.at(0) == 'R') ans++; } else { if (str.at(0) == 'R' || str.at(2) == 'R') ans++; } cout << ans <...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
112
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] S = sc.next().toCharArray(); int res = 0; int count = 0; for (int i = 0; i < 3; i++) { if (S[i] == 'R') { res++; count = res; } else { r...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] S = sc.next().toCharArray(); int res = 0; int count = 0; for (int i = 0; i < 3; i++) { if (S[i] == 'R') { res++; count = res; } else { r...
[["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22]]
3
110
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define all(x) (x).beg...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define all(x) (x).beg...
[["-", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6], ["+", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6]]
1
14,840
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> using namespace std; #define rep(i, j, n) for (int i = j; i < (n); i++) #define rep0(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) int main() { string s; cin >> s; if (s[0]...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> using namespace std; #define rep(i, j, n) for (int i = j; i < (n); i++) #define rep0(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) int main() { string s; cin >> s; if (s[0]...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
229
import re x = input() pattern = "R+" pat = re.match(pattern, x) if pat: print(len(pat.group())) else: print(0)
import re x = input() pattern = "R+" pat = re.search(pattern, x) if pat: print(len(pat.group())) else: print(0)
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
42
S = list(input()) if 'RRR' in s: i = 3 elif 'RR' in s: i = 2 elif 'R' in s: i = 1 else: i = 0 print(i)
s = input() if 'RRR' in s: i = 3 elif 'RR' in s: i = 2 elif 'R' in s: i = 1 else: i = 0 print(i)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
47
S = input() a = (S[0] == 'S') b = (S[1] == 'S') c = (S[2] == 'S') if a and b and c: print(3) elif (a and b and (c == False)) or ((a == False) and b and c): print(2) elif (a == False) and (b == False) and (c == False): print(0) else: print(1)
S = input() a = (S[0] == 'R') b = (S[1] == 'R') c = (S[2] == 'R') if a and b and c: print(3) elif (a and b and (c == False)) or ((a == False) and b and c): print(2) elif (a == False) and (b == False) and (c == False): print(0) else: print(1)
[["-", 0, 662, 12, 23, 0, 666, 0, 557, 0, 6], ["+", 0, 662, 12, 23, 0, 666, 0, 557, 0, 6]]
5
110
s = input() if s == 'R': print(3) elif s[:2] == "RR" or s[1:] == "RR": print(2) elif 'R' in s: print(1) else: print(0)
s = input() if s == 'RRR': print(3) elif s[:2] == "RR" or s[1:] == "RR": print(2) elif 'R' in s: print(1) else: print(0)
[["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6]]
5
58
S = input() max_c = 0 for i in S: if i != 'R': count = 0 else: count = count + 1 if max_c < count: max_c = count print(max_c)
S = input() count = 0 max_c = 0 for i in S: if i != 'R': count = 0 else: count = count + 1 if max_c < count: max_c = count print(max_c)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
42
s = input() if s[0] == s[1] and s[1] == s[2] and s[1] =='R': print('3') elif s[0] == s[1] or s[1] == s[2] and s[1]=='R': print('2') elif s[0] == 'R' or s[1] =='R' or s[2] == 'R': print('1') else: print('0')
s = input() if s[0] == s[1] and s[1] == s[2] and s[1] =='R': print('3') elif (s[0] == s[1] or s[1] == s[2]) and s[1]=='R': print('2') elif s[0] == 'R' or s[1] =='R' or s[2] == 'R': print('1') else: print('0')
[["+", 0, 57, 75, 665, 15, 679, 31, 23, 0, 24], ["+", 0, 57, 75, 665, 15, 679, 31, 23, 0, 25]]
5
119
// This file is a "Hello, world!" in C++ language by GCC for wandbox. #include <cstdlib> #include <iostream> using namespace std; int main() { string s; cin >> s; if (s == "RRR") { cout << 3 << endl; } if (s == "SSS") { cout << 0 << endl; } else if (s == "RRS" or "SRR") { cout << 2 << end...
// This file is a "Hello, world!" in C++ language by GCC for wandbox. #include <cstdlib> #include <iostream> using namespace std; int main() { string s; cin >> s; if (s == "RRR") { cout << 3 << endl; } else if (s == "SSS") { cout << 0 << endl; } else if (s == "RRS" or s == "SRR") { cout <...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60]]
1
91
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; int k = 0; for (int i = 0; i < 3; i++) { if (s.at(i) == 'R') { k++; } else { ans = max(ans, k); } } cout << max(ans, k) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; int k = 0; for (int i = 0; i < 3; i++) { if (s.at(i) == 'R') { k++; } else { ans = max(ans, k); k = 0; } } cout << max(ans, k) << endl; return 0; }
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
89
s = input() if s == "RRR": print(3) if s == "SSS": print(0) if s == "RRS" or s == "SRR": print(2) else: print(1)
s = input() if s == "RRR": print(3) elif s == "SSS": print(0) elif s == "RRS" or s == "SRR": print(2) else: print(1)
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
50
#include <stdio.h> int main(void) { char s[4]; scanf("%s", s); if (s[0] == 'R') { if (s[1] == 'R') { if (s[2] == 'R') { printf("3\n"); } else { printf("2\n"); } } else { printf("1\n"); } } else { if (s[1] == 'R') { if (s[2] == 'R') { prin...
#include <stdio.h> int main(void) { char s[4]; scanf("%s", s); if (s[0] == 'R') { if (s[1] == 'R') { if (s[2] == 'R') { printf("3\n"); } else { printf("2\n"); } } else { printf("1\n"); } } else { if (s[1] == 'R') { if (s[2] == 'R') { prin...
[["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 13], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 71, 13]]
0
179
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ame = 0; for (int i = 0; i < 3; i++) { if (S.at(i) == 'R') { if (i <= 1) { if (S.at(i + 1) == 'R') { if (i == 0) { if (S.at(i + 2) == 'R') { ame == 3; break; ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ame = 0; for (int i = 0; i < 3; i++) { if (S.at(i) == 'R') { if (i <= 1) { if (S.at(i + 1) == 'R') { if (i == 0) { if (S.at(i + 2) == 'R') { ame = 3; break; ...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46], ["+", 64, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
153
// g++ -std=gnu++14 a.cpp #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #in...
// g++ -std=gnu++14 a.cpp #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #in...
[["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22]]
1
575
s = input() #ある数が7の倍数なら、「一の位の数に2をかけて、残った数から引いても7の倍数 if s[0] == "S": if s[1] == "S": if s[2] == "S": print("3") else: print("2") else: print("1") elif s[1] == "S": if s[2] == "S": print("2") else: print("1") elif s[2] == "S": ...
s = input() if s[0] == "R": if s[1] == "R": if s[2] == "R": print("3") else: print("2") else: print("1") elif s[1] == "R": if s[2] == "R": print("2") else: print("1") elif s[2] == "R": print("1") else: print("0")
[["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6], ["+", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6]]
5
116
S = input() if(S == 'RRR'): print(3) elif(S=='RRS' or S=='SRR' or S=='RSR'): print(2) elif(S == 'SSS'): print(0) else: print(1)
S = input() if(S == 'RRR'): print(3) elif(S=='RRS' or S=='SRR'): print(2) elif(S == 'SSS'): print(0) else: print(1)
[["-", 0, 57, 75, 665, 15, 23, 0, 679, 17, 354], ["-", 75, 665, 15, 23, 0, 679, 12, 666, 0, 22], ["-", 75, 665, 15, 23, 0, 679, 12, 666, 667, 60], ["-", 15, 23, 0, 679, 12, 666, 0, 557, 0, 654], ["-", 15, 23, 0, 679, 12, 666, 0, 557, 0, 6], ["-", 15, 23, 0, 679, 12, 666, 0, 557, 0, 655]]
5
62
s = rawinput() res = 0 cur = 0 for i in s: if i =='S': cur = 0 else: cur += 1 res = max(cur, res) print(res)
s = input() res = 0 cur = 0 for i in s: if i =='S': cur = 0 else: cur += 1 res = max(cur, res) print(res)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
43
s = input() ans=0 R = 'R'*i for i in range(1,4): R = 'R'*i if R in s: ans = i print(ans)
s = input() ans=0 for i in range(1,4): R = 'R'*i if R in s: ans = i print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 0, 1, 0, 662, 12, 657, 31, 557, 0, 654], ["-", 0, 1, 0, 662, 12, 657, 31, 557, 0, 6], ["-", 0, 1, 0, 662, 12, 657, 31, 557, 0, 655], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
44
#include "bits/stdc++.h" using namespace std; const int MAX = 700000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD ...
#include "bits/stdc++.h" using namespace std; const int MAX = 700000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
695
def main(): s = input() cnt = 0 cnt2 = 0 for i in s: if i == "R": cnt2 += 1 else: cnt = max(cnt, cnt2) cnt2 = 0 print(cnt) main()
def main(): s = input() cnt = 0 cnt2 = 0 for i in s: if i == "R": cnt2 += 1 else: cnt = max(cnt, cnt2) cnt2 = 0 print(max(cnt, cnt2)) main()
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
51
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; bool p = S.at(0) == 'R'; bool q = S.at(1) == 'R'; bool r = S.at(2) == 'R'; if (p && q && r) cout << 3 << endl; if ((p && q) || (q && r)) cout << 2 << endl; if (p || q || r) cout << 1 << endl; else cout << ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; bool p = S.at(0) == 'R'; bool q = S.at(1) == 'R'; bool r = S.at(2) == 'R'; if (p && q && r) cout << 3 << endl; else if ((p && q) || (q && r)) cout << 2 << endl; else if (p || q || r) cout << 1 << endl; else ...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
116
S=input() if S=='RRR': print(3) elif S==('RRS' or 'SRR'): print(2) elif S=='SSS': print(0) else: print(1)
S=input() if S=='RRR': print(3) elif S=='RRS' or S=='SRR': print(2) elif S=='SSS': print(0) else: print(1)
[["-", 0, 57, 75, 665, 15, 666, 0, 23, 0, 24], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 667, 60], ["-", 0, 57, 75, 665, 15, 666, 0, 23, 0, 25]]
5
50
S = input() a = 0 for i in S: if i == 'R': a += 1 if a == 2: if S[1] == S: a == 1 print(a)
S = list(input()) a = 0 for i in S: if i == 'R': a += 1 if a == 2: if S[1] == 'S': a = 1 print(a)
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 64, 196, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 64, 196, 0, 57, 15, 666, 0, 557, 0, 655], ["-", 0, 57, 64, 196, 0, 1, 0, 666, 667, 60], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32]]
5
43
a=list(input()) if a[0]=="R": if a[1]=="S": print(1) else: if a[2]=="R": print(3) else: print(2) else: if a[1]=="R" and a[2]=="R": print(2) elif a[1]=="S" and a[1]=="S": print(0) else: print(1)
a=list(input()) if a[0]=="R": if a[1]=="S": print(1) else: if a[2]=="R": print(3) else: print(2) else: if a[1]=="R" and a[2]=="R": print(2) elif a[1]=="S" and a[2]=="S": print(0) else: print(1)
[["-", 75, 665, 15, 679, 12, 666, 0, 206, 206, 612], ["+", 75, 665, 15, 679, 12, 666, 0, 206, 206, 612]]
5
108
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int count = 0; for (int i; i < 3; i++) { if (S.at(i) == 'R') { count++; } } if (count == 2) { } else if (S.at(1) == 'S') { count = 1; } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int count = 0; for (int i = 0; i < 3; i++) { if (S.at(i) == 'R') { count++; } } if (count == 2) { if (S.at(1) == 'S') { count = 1; } } cout << count << endl; }
[["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46]]
1
90
s = input() cnt = 0 ans = [] for i in range(3): if s[i] == 'R': cnt+=1 ans.append(cnt) else: cnt = 0 print(max(ans))
s = input() cnt = 0 ans = [0] for i in range(3): if s[i] == 'R': cnt+=1 ans.append(cnt) else: cnt = 0 print(max(ans))
[["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 612]]
5
51
s =input() ans = 0 for i in range(3): p = "R"*i if p in s: ans = i print(ans)
s = input() ans = 0 for i in range(1,4): p = "R"*i if p in s: ans = i print(ans)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
35
#include <iostream> using namespace std; int main() { string wheather; cin >> wheather; char cnt = 0; char maxcnt = 0; for (int loop = 0; loop < 3; loop++) { if (wheather[loop] == 'R') { cnt++; if (maxcnt <= cnt) maxcnt = cnt; } else cnt = 0; } cout << maxcnt << endl; ...
#include <iostream> using namespace std; int main() { string wheather; cin >> wheather; int cnt = 0; int maxcnt = 0; for (int loop = 0; loop < 3; loop++) { if (wheather[loop] == 'R') { cnt++; if (maxcnt <= cnt) maxcnt = cnt; } else cnt = 0; } cout << maxcnt << endl; r...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
85
str = str(input()) print(str) if str == "RRR": print(3) elif str == "RRS" or str=="SRR": print(2) elif str == "SSS": print(0) else: print(1)
str = str(input()) if str == "RRR": print(3) elif str == "RRS" or str=="SRR": print(2) elif str == "SSS": print(0) else: print(1)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
57
#include <algorithm> #include <assert.h> #include <bitset> #include <climits> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include ...
#include <algorithm> #include <assert.h> #include <bitset> #include <climits> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include ...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
463
days = input() day1 = days[0] day2 = days[1] day3 = days[2] ans = 0 if day1 == "R": ans += 1 if day2 == "R": ans += 1 if day3 == "R": ans +=1 if day2 == "R": ans += 1 if day3 == "R": ans +=1 if day3 == "R": ans +=1 print(ans)
days = input() day1 = days[0] day2 = days[1] day3 = days[2] ans = 0 if day1 == "R": ans += 1 if day2 == "R": ans += 1 if day3 == "R": ans +=1 elif day2 == "R": ans += 1 if day3 == "R": ans +=1 elif day3 == "R": ans +=1 print(ans)
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
90
s=str(input()) if s.count("rrr")==1: print(3) elif s.count("rr")==1: print(2) elif s.count("r")>=1: print(1) else: print(0)
s=str(input()) if s.count("RRR")==1: print(3) elif s.count("RR")==1: print(2) elif s.count("R")>=1: print(1) else: print(0)
[["-", 15, 666, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 15, 666, 0, 652, 3, 4, 0, 557, 0, 6]]
5
62
s = input() if 'RRR' in s: ans = 3 elif 'RR' in s: ans = 2 elif 'R' in s: ans = 1 print(ans)
s = input() ans = 0 if 'RRR' in s: ans = 3 elif 'RR' in s: ans = 2 elif 'R' in s: ans = 1 print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
39
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int c = 0; int l = 0; for (int i = 0; i < 2; i++) { if (str[i] == 'R') l++; else { if (l > c) c = l; l = 0; } } if (l > c) c = l; cout << c << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int c = 0; int l = 0; for (int i = 0; i < 3; i++) { if (str[i] == 'R') l++; else { if (l > c) c = l; l = 0; } } if (l > c) c = l; cout << c << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
95
import re s = input() print(max(map(len, re.split('R', s))))
import re s = input() print(max(map(len, re.split('S', s))))
[["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]]
5
28
s = str(input()) ans = 0 tmp = 0 for i in range(len(s)): if(s[i] == 'R'): tmp += 1 else: ans = tmp tmp = 0 ans = max(tmp,ans) print(ans)
s = str(input()) ans = 0 tmp = 0 for i in range(len(s)): if(s[i] == 'R'): tmp += 1 else: ans = max(tmp,ans) tmp = 0 ans = max(tmp,ans) print(ans)
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
60
#include <bits/stdc++.h> using namespace std; #define rep(i, A) for (int i = 0; i < A; i++) int main() { string S; cin >> S; int count = 0; rep(i, 3) { if (S[i] == 'R') { count++; } } if (count != 2) { cout << count << endl; } else { if (S[0] == 'R') { cout << 1 << endl; }...
#include <bits/stdc++.h> using namespace std; #define rep(i, A) for (int i = 0; i < A; i++) int main() { string S; cin >> S; int count = 0; rep(i, 3) { if (S[i] == 'R') { count++; } } if (count != 2) { cout << count << endl; } else { if (S[1] == 'R') { cout << 2 << endl; }...
[["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
102
str=input() maxcnt=0 cnt=0 for i in range(len(str)): if(str[i]=="R"): cnt+=1 maxcnt=max(cnt,max) else: cnt=0 print(max)
str=input() maxcnt=0 cnt=0 for i in range(len(str)): if(str[i]=="R"): cnt+=1 maxcnt=max(cnt,maxcnt) else: cnt=0 print(maxcnt)
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
54