akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<(int)n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fill(a,v) memset(a,v,sizeof(a))
#define d1(a) cout << a << "\n"
#define d2(a,b) cout << a << " " << b << "\n"
#define d3(a,b,c) cout << a << " " << b << " " << c << "\n"
#define d4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << "\n"
#define fast ios:: sync_with_stdio(false),cin.tie(nullptr);

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

int32_t main(){
   fast;
   ld r;
   cin >> r;
   ld ans = 2*3.14159*r;
   cout << fixed << setprecision(10) << ans;  
}

Measured memory_bytes: 3812
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;

int main(){
  int n;cin>>n;
  map<int, int> ans;
  vector<pair<string, int>> store(n);
  for(int i=0;i<n;i++){
    string s;int p;cin>>s>>p;
    ans[p]=i+1;
    store[i]=make_pair(s, -p);
  }
  sort(store.begin(), store.end());
  for(pair<string, int> st:store){
    cout << ans[-st.second] << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);


  ll n;
  cin >> n;
  string s;
  cin >> s;

  map<ll, ll> a;
  REP(i, n)
    a[s[i]-'a'] += 1;

  //bit search
  ll ans = 1;
  REP(j, 26){
    ans *= a[j]+1;
    ans %= MOD;
  }
  ans--;

  cout << ans << endl;
}


Measured memory_bytes: 512
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection.Metadata.Ecma335;

namespace AtCoder
{
    class Program
    {

        const int BiggestMod = 1000000007;
        public static void Main()
        {

            var num = int.Parse(Console.ReadLine());
            var args = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            var result = 1L;

            if (args.Any(x => x == 0))
            {

                Console.WriteLine(0);
                return;

            }
            

            foreach (var data in args)
            {

                if (data > 1)
                {

                    if (Math.Log10(result) + Math.Log10(data) > 18.0)
                    {

                        Console.WriteLine(-1);
                        return;

                    }
                    result *= data;
                    if (result > 1000000000000000000)
                    {
                        Console.WriteLine(-1);
                        return;
                    }

                }

            }

            Console.WriteLine(result);

        }

    }

}


Measured memory_bytes: 41624
import java.util.*;

/**
 * Copyright © 2018 Chris. All rights reserved.
 *
 * @author Chris
 * 2018/7/5 22:51
 */
public class Main {
    
    @SuppressWarnings("unchecked")
    private static void solve(Scanner sc) {
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();
        int n = s.length;

        Set<Integer>[] idx = new Set[128];
        for (int i = 'a'; i <= 'z'; i++) {
            idx[i] = new HashSet<>();
        }
        for (int i = 0; i < n; i++) {
            idx[s[i]].add(i);
        }
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < n; i++) {

            if (s[i] == t[i]) {
                set.add(t[i]);
                continue;
            }
            if (set.contains(s[i]) || set.contains(t[i])) {
                System.out.println("No");
                return;
            }
            set.add(t[i]);
            char cs = s[i];
            Iterator<Integer> it = idx[cs].iterator();
            List<Integer> ls = new ArrayList<>();
            while (it.hasNext()) {
                int index = it.next();
                s[index] = t[i];
                it.remove();
                ls.add(index);
            }

            it = idx[t[i]].iterator();
            List<Integer> lt = new ArrayList<>();
            while (it.hasNext()) {
                int index = it.next();
                s[index] = cs;
                it.remove();
                lt.add(index);
            }
            for (int k : ls) {
                idx[t[i]].add(k);
            }
            for (int k : lt) {
                idx[cs].add(k);
            }
        }

        System.out.println("Yes");
    }

    public static void main(String args[]) {

        solve(new Scanner(System.in));
    }
}


Measured memory_bytes: 66256
def main():
    n, m, d = (int(i) for i in input().split())
    if d == 0:
        ans = 1/n
        ans *= (m-1)
        print(ans)
    else:
        ans = 2*(n-d)/n**2
        ans *= (m-1)
        print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38256
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;
int n,m,d1,d2,col[610][610],col2[610][610];
int cnt,dx[1100000],dy[1100000];
void dfs(int x,int y){
	int nx,ny;
	for (int i=1;i<=cnt;i++){
		nx=x+dx[i]; ny=y+dy[i];
		if (nx>=0&&nx<m&&ny>=0&&ny<m&&col[nx][ny]==-1){
			col[nx][ny]=col[x][y]^1;
			dfs(nx,ny);
		}
	}
}
void work(int d){
	cnt=0;
	for (int i=0;i<=d;i++){
		int j=sqrt(d-i*i);
		if (i*i+j*j==d){
			cnt++; dx[cnt]=i; dy[cnt]=j;
			cnt++; dx[cnt]=-i; dy[cnt]=j;
			cnt++; dx[cnt]=i; dy[cnt]=-j;
			cnt++; dx[cnt]=-i; dy[cnt]=-j;
		}
	}
	for (int i=0;i<m;i++)
		for (int j=0;j<m;j++)
			col[i][j]=-1;
	for (int i=0;i<m;i++)
		for (int j=0;j<m;j++)
			if (col[i][j]==-1){
				col[i][j]=0;
				dfs(i,j);
			}
}
void print(){
	int tot=0;
	for (int i=0;i<m;i++)
		for (int j=0;j<m;j++)
			if (!col[i][j]&&!col2[i][j]){
				printf("%d %d\n",i,j);
				tot++; if (tot==n*n) return;
			}
}
int main(){
	scanf("%d%d%d",&n,&d1,&d2); m=n*2;
	work(d1);
	for (int i=0;i<m;i++)
		for (int j=0;j<m;j++)
			col2[i][j]=col[i][j];
	work(d2);
	print();
	return 0;
}

Measured memory_bytes: 28672
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s, t;
  cin >>s >>t;

 for(int i = 0; i<s.length(); i++){
    if(s.at(i)!=t.at(i)){
    cout <<"No";
   return 0;
    }
 }
  cout<< "Yes";
 }


Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAXN = 100005;
int n, x[MAXN], op[MAXN];
LL ans, rs[MAXN], suf[MAXN];
int main () {
	scanf("%d", &n);
	char ch[2]; op[1] = 1;
	for(int i = 1; i < n; ++i) {
		scanf("%d%s", &x[i], ch); op[i+1] = ch[0]=='+'?1:-1;
		ans += x[i]*op[i];
	}
	scanf("%d", &x[n]); ans += x[n]*op[n];
	for(int i = n; i >= 1; --i)
		rs[i] = (op[i+1] == 1 ? rs[i+1] : 0) + x[i],
		suf[i] = suf[i+1] + x[i];
	LL pre = 0;
	for(int i = 1; i <= n; pre += x[i]*op[i], ++i)
		if(op[i] == -1 ) {
			ans = max(ans, pre + suf[i] - 2*rs[i]);
		}
	printf("%lld\n", ans);
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define ld long double
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
//#define endl "\n"
#define show(a) for(int i=0;i<a.size();i++) cout<<a[i & 1]<<" ";
#define fi first
#define se second
#define vi vector<int>
#define vs vector<string>
#define vll vector<ll>
#define pb push_back
#define pi pair<int,int>
#define si set<int>
#define sll set<ll>
#define pll pair<ll, ll>
#define sci(x) scanf("%d",&x)
#define scs(x)  scanf("%s", x)
#define scll(x) scanf("%I64d",&x)
#define all(v) v.begin(),v.end()
#define sot(v) sort(v.begin(), v.end())
#define maxheap priority_queue<int>
#define mp make_pair
#define fast_io() cin.sync_with_stdio(false);cout.sync_with_stdio(false);
#define PI 3.1415926535
#define long_zero 0ll
#define long_one 1ll

inline int sbt(int x) {return __builtin_popcount(x);}

using namespace std;
using namespace __gnu_pbds;
#define FOR(i, j, k, in) for ( i=j ; i<k ; i+=in)
#define TRACE
#ifdef TRACE
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#else
#define deb(...)
#endif
#define N 10003
bool ok;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;

inline int mul(int a, int b, int m = mod) { return (a * b) % m; }
inline int add(int a, int b, int m = mod) { return (a + b) % m; }
inline int sub(int a, int b, int m = mod) { return (a - b + m) % m; }

bool Comparator (pair <int, int> x, pair <int, int> y) {
	return x.first < y.first;
}

int32_t main()
{
	fast_io();
	string s,t;
	cin>>s>>t;
	int c=0;
	if(s==t){
		cout<<0<<endl;
	}
	else{
		for(int i=0;i<t.size();i++){
			if(s[i]!=t[i])
				c++;
		}
		cout<<c<<endl;
	}

}


Measured memory_bytes: 3864
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int n = sc.nextInt();
        int tmp;
 
        for (int i = 1; i <= n; i++) {
            if (i % 3 == 0 || i % 10 == 3) {
                System.out.print(" " + i);
            } else if (i >= 30) {
                tmp = i;
                while (tmp >= 30) {
                    tmp /= 10;
 
                    if (tmp == 3 || tmp % 10 == 3) {
                        System.out.print(" " + i);
                        break;
                    }
                }
 
            }
        }
        System.out.println();
    }
}
 


Measured memory_bytes: 28880
#include<bits/stdc++.h>
using namespace std;
int n,k,ans,lim,cnt,mn;
vector<int> adj[2002];
vector<pair<int,int> > e;
int dis[2002][2];
void dfs(int v,int par,int r){
	for (int i:adj[v]){
		if (i != par){
			dis[i][r] = dis[v][r]+1;
			dfs(i,v,r);		
		}
	}	
}
int main(){
	cin >> n >> k;
	for (int i = 1; i < n; i++){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
		e.push_back({a,b});
	}
	mn = INT_MAX;
	if (k%2==0){
		lim = k/2;
		for (int i = 1; i <= n; i++){
			cnt = 0;
			dis[i][0]= 0;
			dfs(i,i,0);
			for (int i = 1; i <= n; i++)
			if (dis[i][0] > lim)
				cnt ++;
			mn = min(mn,cnt);	
		}		
	}
	else {
		lim = k/2;
		for (auto i:e){
			int v1 = i.first, v2 = i.second;
			cnt = 0;
			dis[v1][0] = 0;
			dfs(v1,v1,0);
			dis[v2][1] = 0;
			dfs(v2,v2,1);
			for (int i = 1; i <= n; i++)
			if (min(dis[i][0],dis[i][1]) > lim)
				cnt ++;
			mn = min(mn,cnt); 	
		}
	}
	cout << mn;      
}

Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<climits>
#include<bitset>
#include<stack>
#include<fstream>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> lltpl;
typedef tuple<int, int, int> tpl;

int dy8[8] = { 2,2,-2,-2,1,1,-1,-1 };
int dx8[8] = { 1,-1,1,-1,2,-2,2,-2 };
int dx4[4] = { 1,0,0,-1 };
int dy4[4] = { 0,1,-1,0 };


/******************************************************************************************/

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}

// vector
template <typename T>
istream& operator>>(istream & is, vector<T> & vec) { for (T& x : vec) is >> x; return is; }
// pair
template <typename T, typename U>ostream& operator<<(ostream & os, pair<T, U> & pair_var) { os << "(" << pair_var.first << ", " << pair_var.second << ")"; return os; }
// vector
template <typename T>ostream& operator<<(ostream & os, const vector<T> & vec) { os << "{";	for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); }os << "}"; return os; }
// map
template <typename T, typename U>ostream& operator<<(ostream & os, map<T, U> & map_var) { os << "{";	repi(itr, map_var) { os << *itr; itr++; if (itr != map_var.end()) os << ", "; itr--; }os << "}"; return os; }
// set
template <typename T>ostream& operator<<(ostream & os, set<T> & set_var) { os << "{"; repi(itr, set_var) { os << *itr; itr++; if (itr != set_var.end()) os << ", "; itr--; }os << "}"; return os; }



const int IINF = 1e9 + 7;
const ll LINF = 1e18 + 7;
constexpr ll MOD = 1e9 + 7;

//ここから書くこと






int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	cout << n * n << endl;

	
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

const int mx=1e6+11;
const double PI = acos(-1);
#define MOD 1000000007


#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define tt int t; cin>>t; while(t--)
#define lo(i,a,b) for(int i=a;i<b;i++)
#define rlo(i,n) for(int i=n-1;i>=0;i--)
#define be(a) (a).begin(),(a).end()
#define rbe(a) (a).rbegin(),(a).rend()
#define mem(a,b) memset(a,b,sizeof(a))
#define pr(a) {for(auto x:a)cout<<x<<" ";cout<<nl;}

#define su ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define frac cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}

void f()
{
  string s;
  cin>>s;
  int cnt=0;
  lo(i,0,4)
  {
    if(s[i]=='+')
      cnt++;
    else
      cnt--;
  }
  cout<<cnt<<nl;
}

int main()
{
    su;
    f();
    return 0;
}



Measured memory_bytes: 3596
n = int(input())
s = list(map(str,input()))
ansl = []
for i in range(1,n):
  ans = 0
  x = list(set(s[:i]))
  y = list(set(s[i:]))
  for j in range(len(x)):
    if x[j] in y:
      ans += 1
  ansl.append(ans)
print(max(ansl))

Measured memory_bytes: 9128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		char s[] =  scan.next().toCharArray();
		int zeroCount = 0;
		int oneCount = 0;

		for(int i = 0; i < s.length; i++) {
			if(s[i] == '0') {
				zeroCount++;
			}else {
				oneCount++;
			}
		}
		
		System.out.println(2 * Math.min(zeroCount, oneCount));
		
	}
}

Measured memory_bytes: 27348
import bisect
A,B,Q = map(int,input().split())
INF = 10**18
# s=[-INF]
# t=[-INF]
# for _ in range(A):
    # s.append(int(input()))
# for _ in range(B):
    # t.append(int(input()))
# s.sort()
# t.sort()
s = [int(input()) for _ in range(A)]
t = [int(input()) for _ in range(B)]
# s.append(INF)
# t.append(INF)

def solve(x):
    sr = bisect.bisect(s,x)
    tr = bisect.bisect(t,x)
    sRight = s[sr] if sr < A else s[sr-1]
    tRight = t[tr] if tr < B else t[tr-1]
    sLeft = s[sr-1] if sr>0 else s[sr] 
    tLeft = t[tr-1] if tr>0 else t[tr]
    # return(min(
    # print([[sr,sLeft,sRight],[tr,tLeft,tRight]])
    cand = [
        abs(x-sRight) + abs(sRight-tRight),
        abs(x-sRight) + abs(sRight-tLeft),
        abs(x-tRight) + abs(tRight-sRight),
        abs(x-tRight) + abs(tRight-sLeft),
        abs(x-sLeft) + abs(sLeft-tLeft),
        abs(x-sLeft) + abs(sLeft-tRight),
        abs(x-tLeft) + abs(tLeft-sRight),
        abs(x-tLeft) + abs(tLeft-sLeft),
    ]
    # print(cand)
    return(min(cand))
for _ in range(Q):
    print(solve(int(input())))

Measured memory_bytes: 12208
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


inf = 10 ** 18
mod = 10 ** 9 + 7

n,k = lr()
d = [lr() for i in range(k)]
c = [lr() for i in range(n)]
ans = [0 for i in range(3)]
pre = inf
fir = []
sec = []
thr = []
firkouho = []
seckouho = []
thrkouho = []
for y in range(n):
    for x in range(n):
        if (y + x) % 3 == 0:
            fir.append(c[y][x]-1)
        elif (y + x) % 3 == 1:
            sec.append(c[y][x]-1)
        else:
            thr.append(c[y][x] - 1)

for i in range(k):
    ans[0] = 0
    for ind in fir:
        ans[0] += d[ind][i]
    firkouho.append([ans[0], i])

for i in range(k):
    ans[1] = 0
    for ind in sec:
        ans[1] += d[ind][i]
    seckouho.append([ans[1], i])

for i in range(k):
    ans[2] = 0
    for ind in thr:
        ans[2] += d[ind][i]
    thrkouho.append([ans[2], i])

firkouho.sort()
seckouho.sort()
thrkouho.sort()

for i in range(k):
    ans[0] = 0
    ans[0],ind1 = firkouho[i]
    for j in range(k):
        if seckouho[j][1] != ind1:
            ans[1] = 0
            ans[1],ind2 = seckouho[j]
            for l in range(k):
                if thrkouho[l][1] != ind1 and thrkouho[l][1] != ind2:
                    ans[2] = 0
                    ans[2],ind3 = thrkouho[l]
                    pre = min(pre,sum(ans))
print(pre)

Measured memory_bytes: 97128
#include <bits/stdc++.h>

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define deb(x) cout << x << endl
#define done(x) {cout << x << endl;return;}
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;


const int N = 1e6 + 5;

void solve() {

  string s;
  cin>>s;
  int l = 0, ans=0;
  rep(i,0,3){
    if(s[i]=='R')
      l++;
    else
      ans=max(ans,l),l=0;
  }
  ans=max(ans,l);
  cout<<ans;
   
}


signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
    //cin >> t;

    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}




int powm(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1)
            res = (res*a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return res;
}


int divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}


int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

Measured memory_bytes: 3652
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1000000007
typedef long long ll;
const int INF32 = 2147483647;
const ll INF64  = 9223372036854775807;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int A, B;
    cin >> A >> B;
    int ans = 0;
    FOR(i, A, B + 1) {
        int a = i / 1000;
        int b = (i % 10) * 10 + ((i % 100) / 10);
        if (a == b)
            ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0 ; i--)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    ll W;
    cin >> N >> W;
    vector<int> w(N), v(N);
    rep(i, N) cin >> w[i] >> v[i];
    vector<ll> dp(1e5+1,1e9+5);

    int ans=-1;
    dp[0]=0;
    rep(i,N){
        rrep(j,1e5+1){
            if(j-v[i]>=0){
                dp[j]=min(dp[j],dp[j-v[i]]+w[i]);
                if(dp[j]<=W){
                    ans = max(j,ans);
                }
            }
        }
    }
    cout<<ans<<endl;
 //   system("pause");
    return 0;
}

Measured memory_bytes: 1024
#include <math.h>
#include <ctype.h>
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, n) for (int i = a; i < n; i++)
#define REP(i, n) for(int i = 0; i < n; i++)

int main(){
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;

    if(s == t) cout << n << endl;
    else{
        string ans = s + t;
        int cnt;
        REP(i, n){
            cnt = 0;
            FOR(j, i, n){
                //cout << j << " " << j - i<< endl;
                if(s[j] == t[j - i]){
                    cnt++;
                    //break;
                }else break;
            }
            if(cnt == n - i){
                ans = "";
                REP(j, i) ans += s[j];
                ans += t;
            }
        }
        cout << ans.size() << endl;
    }

    return 0;
}

Measured memory_bytes: 764
/// Assembled By : FuadNafiz98

#include <bits/stdc++.h>

using namespace std;

#define dbg(x) { cerr << #x << " -- " << x << endl;}
#define             IO                                      ios_base::sync_with_stdio(0); cin.tie(0)

const int maxn = 100005;
int n, m, dp[maxn], best, path[maxn], root;
vector <pair <int, int> > adj[maxn];

int dfs(int node){
    if(dp[node] != -1) return dp[node];
    dp[node] = 1;
    for(int i = 0; i < (int)adj[node].size(); i++){
        int v = adj[node][i].first;
        if(dp[node] < dfs(v) + 1){
            dp[node] = dp[v] + 1;
        }
    }
    return dp[node];
}

int main(){
 IO;   
 cin >> n >> m;
 for(int i = 0; i < m; i++){
    int x,y;
    cin >> x >> y;
    x--,y--;
    adj[x].push_back({y, i + 1});
 }
 memset(dp, -1, sizeof(dp));
 best = -1;     
 for(int i = 0; i < n; i++){
    int mid = dfs(i);
    if(best < mid)
        best = mid;
 }
 cout << best - 1 << endl;
}

Measured memory_bytes: 8832
#include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
	cin>>a>>b;
	int n=a.size();
	int k=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]!=b[i]) k++;
	}
	cout<<k<<endl;
}

Measured memory_bytes: 3864
import sys
r=sys.stdin.readline
N,M=map(int,r().split())
city=[[] for _ in range(N+1)]
for _ in range(M):
    a,b=map(int,r().split())
    city[a].append(b)
    city[b].append(a)
check=[True]+[False]*(N)
def dfs(v):
    stack=[v]
    while stack:
        cur=stack.pop()
        check[cur]=True
        for v in city[cur]:
            if not check[v]:
                stack.append(v)
cnt=0
for i in range(1,N+1):
    if not check[i]:
        dfs(i)
        cnt+=1
print(cnt-1)

Measured memory_bytes: 27068
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> pi;
typedef pair<int,int> vi;

#define F first
#define S second
#define PB push_back
#define MK make_pair
#define REP(i, a, b) for (int i=a; i < b; i++)


bool sort_by(vi c, vi d){
	return c.S < d.S;
}

int main() {
	string s;
	cin >> s;
	set<char> m;
	for(char z: s) m.insert(z);
	cout << (m.size() == s.size()? "yes":"no");
}


Measured memory_bytes: 256
#最小コストソート

n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
c = 0
for i in range(n-1):
    t = cnt = 0
    x = a.index(b[i])
    while x != i:
        y = a.index(b[x])
        a[x],a[y] = a[y],a[x];cnt += 1
        t += a[x] + a[y]
        x = y
    if cnt: c += min(t, (b[i]+b[0])*2 + t -(b[i]-b[0])*cnt)
print(c)



Measured memory_bytes: 5624
import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)
  val s = sc.next

  val chs = s.split("(?<=.)").sorted

  val judge =
    chs(0) == chs(1) &&
    chs(2) == chs(3) &&
    chs(1) != chs(2)

  val res = if(judge) "Yes" else "No"

  println(res)

}


Measured memory_bytes: 27436
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll mod = 1000000007;

const ll LINF = 1e13;
const ll LLINF = 1e18;
const ll ALPHABET = 26;

template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x; //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいい
  return is;
}



int main() {
  // ll n;
  // cin >> n ;
  // vector<ll> a(n,0);
  // cin >> a;
  string s;
  cin >> s;

  int i = s[0] - '0';
  i*=10;
  i += s[1] - '0';


  int j = s[2] - '0';
  j*=10;
  j += s[3] - '0';

  cerr << i << " " <<j <<endl;

  bool ismonth[2];
  bool isyear[2];


  //iは先

  ismonth[0] =  (i>=1 && i<=12);
  ismonth[1] =  (j>=1 && j<=12);

  isyear[0] = true;
  isyear[1] = true;

  // isyear[0] =  (i>=1 && i<=19);
  // isyear[1] =  (j>=1 && j<=19);

  if (isyear[0] && ismonth[1]){
    if (isyear[1] && ismonth[0]){
      cout <<"AMBIGUOUS";
    }else{
      cout <<"YYMM";
    }

  }else if (isyear[1] && ismonth[0]){
    cout <<"MMYY";
  }else{
    cout <<"NA";
  }


  // cout << (true? "MMYY":"YYMM");


  // cout << ans << endl;

}







Measured memory_bytes: 256
import java.math.*;
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException{
		FastScanner sc = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		int t = 1;
		while (t-->0) {
		    String s = sc.nextLine();
		    boolean ok = false;
		    for(int i=0;i<s.length();i++) if(s.charAt(i)=='7') ok = true;
		    out.println((ok?"Yes":"No"));
		}
		out.close();
	}
	static int gcd(int a, int b){
	    if(b==0) return a;
	    return gcd(b,a%b);
	}
	static class Pair implements Comparable<Pair>{
		int a, b;
		public Pair(int c, int d){
			a = c;
			b = d;
		}
		public int compareTo(Pair p){
		    return a-p.a;
		}
	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}
		FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}
		String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				return null;
			}
		}
		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}

Measured memory_bytes: 32804
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll n;
ll a[200005];
ll ans;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    sort(a,a+n);
    if(n%2==0){
        for(int i=0;i<n/2;i++){
            ans+=(a[n-1-i]*2);
        }
        ans-=a[n-1];
        cout<<ans<<endl;
    }else{
        for(int i=0;i<=n/2;i++){
            ans+=(a[n-1-i]*2);
        }
        ans-=(a[n-1]+a[n-1-n/2]);
        cout<<ans<<endl;
    }
    
}



Measured memory_bytes: 5180
package main
import "fmt"

var (n int
	a[1001] int
)
func main(){
	fmt.Scan(&n)
	for i:=2;i <=n;i++ {
		t := i
		for j:=2;j<=t;j++{

			if t%j == 0{
				for;t%j == 0;{
					t/=j
					a[j]++
				}
			}
		}

	}
	ans := 1
	for i:=0;i<=n;i++ {
		ans *= (a[i]+1)
		ans %= 1000000007
	}
	fmt.Println(ans)
}

Measured memory_bytes: 512
#coding : utf-8

if __name__ == "__main__":
    n = input()
    a = list(map(int,input().split()))
    m = 0
    for i in a:
        n = 0
        while i % 2 == 0:
            i = i / 2
            n = n + 1
        m = m + n
    print(m)

Measured memory_bytes: 4148
#include <bits/stdc++.h>
#include <numeric>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;

const int MAX = 510000;
const int MOD = 998244353;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    rep(i, 2, MAX){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}

ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    COMinit();

    ll N, A, B, K;
    cin >> N >> A >> B >> K;

    ll res = 0LL;
    for (ll a = 0LL; a <= N; ++a) {
        // a*A + b*B == K
        ll bB = K - a*A;
        if (bB % B != 0) continue;

        // a + b <= N
        ll b = bB / B;
        if (b > N) continue;
        
        res += COM(N, a) * COM(N, b) % MOD;
        res %= MOD;
    }

    cout << res << endl;
}

Measured memory_bytes: 12160
#include<bits/stdc++.h>
using namespace std;

int main(void){
  int n,count =0,max=0;
  string s;
  cin >> n >> s;
  for(int i=0; i< n; i++){
    if( s[i] == 'I'){
      count++;
      if(max <= count) max =count;
    }else if( s[i] == 'D'){
      count--;
    }
  }
  cout << max << endl;
  return 0;
}

Measured memory_bytes: 3572
s = str(input())
t = str(input())
s_length = len(s) 
t_length = len(t)

if s_length < t_length:
    s, t = t, s
    s_length, t_length = t_length, s_length

dp = [[0 for j in range(s_length + 1)] for i in range(t_length + 1)]

for i in range(0, t_length):
    for j in range(0, s_length):
        if s[j] == t[i]:
            dp[i + 1][j + 1] = dp[i][j] + 1
        else:
            dp[i + 1][j + 1] = max(dp[i][j + 1], dp[i + 1][j])

lcs = ""
i = t_length
j = s_length

while (i > 0 and j > 0):
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        lcs += s[j-1]
        i -= 1
        j -= 1

print(lcs[::-1])

Measured memory_bytes: 119772
#include <bits/stdc++.h>
using namespace std;

int main(){
    int k,a,b;
    cin>>k>>a>>b;
    for(int i=a;i<=b;i++){
    	if(i%k==0){
		    cout<<"OK"<<endl;
		    return 0;
	    }
	}
	cout<<"NG"<<endl;
	return 0;
}


Measured memory_bytes: 3636
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  int N,K;
  cin >> N >> K;
  int V[N];
  for(int i=0;i<N;i++) cin >> V[i];



  int ans = 0;
  for(int i=0;i<=N;i++){
    for(int j=0;j<=N;j++){
      if(i + j > N) break;
      //cout << "aa" << endl;

      int res = K - i - j;
      if(res < 0) break;

      priority_queue<int, vector<int>, greater<int> > que;
      //cout << "aa" << endl;
      for(int k = 0; k < i; k++) que.push(V[k]);
      for(int k = 0; k < j; k++) que.push(V[N - 1 - k]);
      //cout << "aa" << endl;

      for(int k = 0; k < res; k++){
        if(que.size() == 0) break;
        int p = que.top();
        if(p < 0) que.pop();
        else break;
      }

      int tmp = 0;
      //cout << "a" << endl;
      while(que.size()){
        tmp += que.top();
        que.pop();
      }

      //if(tmp == 19) cout << i << j << endl;

      ans = max(ans, tmp);
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
ll a,b,v,w,t;
int main(){
	ios::sync_with_stdio(0);
	cin>>a>>v>>b>>w>>t;
	ll z=t*(v-w),l=abs(a-b);
	if(z>=l)
	cout<<"YES";
	else
	cout<<"NO";
	re 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define REPR(i, m, n) for (int i = (int)(m); i >= (int)(n); i--)
#define all(v) v.begin(), v.end()
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;

struct Card{
  char suit;
  int value;
};

void bubbleSort(struct Card c[], int n)
{
  REP(i, 0, n-1){
    REPR(j, n-1, i+1){
      if(c[j-1].value > c[j].value){
        swap(c[j-1], c[j]);
      }
    }
  }
}

void selectionSort(struct Card c[], int n)
{
  REP(i, 0, n-1){
    int minj = i;
    REP(j, i, n-1){
      if(c[j].value < c[minj].value){
        minj = j;
      }
    }
    if(minj != i) swap(c[i], c[minj]);
  }
}

bool isStable(struct Card c[], struct Card c2[], int n)
{
  rep(i, n) if(c[i].suit != c2[i].suit) return false;
  return true;
}

int main(){
  struct Card c[40], c2[40];
  int n;
  cin >> n;
  rep(i, n) cin >> c[i].suit >> c[i].value;
  memcpy(c2, c, sizeof(c));

  bubbleSort(c, n);
  rep(i, n){
    if(i>0) cout << " ";
    cout << c[i].suit << c[i].value;
  }
  cout << endl;
  cout << "Stable" << endl;

  selectionSort(c2, n);
  rep(i, n){
    if(i>0) cout << " ";
    cout << c2[i].suit << c2[i].value;
  }
  cout << endl;
  cout << (isStable(c, c2, n) ? "Stable" : "Not stable") << endl;

  return 0;
}




Measured memory_bytes: 3112
let main () =
  let s = Scanf.scanf "%d\n" Batteries.identity in
  let arr = Array.make s 0 in
  for i = 0 to s - 2 do
    Array.set arr i (Scanf.scanf "%d " Batteries.identity)
  done;
  Array.set arr (s - 1) (Scanf.scanf "%d\n" Batteries.identity);
  let is_all_even arr = Array.fold_left (fun acc elm -> elm mod 2 = 0 && acc) true arr in
  let rec loop acc arr = (
    if is_all_even arr then (
      let arr = Array.map (fun i -> i / 2) arr in
      loop (acc + 1) arr
    ) else acc
  ) in
  Printf.printf "%d\n" (loop 0 arr)

let _ = main ()


Measured memory_bytes: 512
//
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define lch (o << 1)
#define rch (o << 1 | 1)

typedef double db;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int, int> pint;
typedef tuple<int, int, int> tint;

const int N = 5e5 + 5;
const int INF = 0x3f3f3f3f;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f;

struct BITree {
	int t[N];
	int Lowbit(int x) {
		return x & -x;
	}
	void Add(int x, int det) {
		for (; x < N; x += Lowbit(x))
			t[x] += det;
	}
	int Query(int x) {
		int ret = 0;
		for (; x; x -= Lowbit(x))
			ret += t[x];
		return ret;
	}
};
BITree bt;

struct Query {
	int l, r, id, ans;
};
Query qry[N];
vector<int> pos[N];

int main() {
	ios::sync_with_stdio(0);

	int n, q;
	cin >> n >> q;
	for (int i = 1; i <= n; i++) {
		int c;
		cin >> c;
		pos[c].push_back(i);
	}
	for (int i = 1; i <= q; i++) {
		int l, r;
		cin >> l >> r;
		qry[i] = (Query){l, r, i, 0};
	}
	sort(qry + 1, qry + q + 1, [](Query a, Query b) {
		return a.r < b.r;
	});

	vector<tint> pts;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j < pos[i].size(); j++) {
			pts.push_back(make_tuple(pos[i][j], pos[i][j], 1));
			if (j > 0)
				pts.push_back(make_tuple(pos[i][j - 1], pos[i][j], -1));
		}
	}
	sort(all(pts), [](tint a, tint b) {
		return get<1>(a) < get<1>(b);
	});

	auto p = pts.begin();
	for (int i = 1; i <= q; i++) {
		int l = qry[i].l, r = qry[i].r;
		while (p != pts.end() && get<1>(*p) <= r) {
			bt.Add(get<0>(*p), get<2>(*p));
			// bt.Add(get<1>(*p) + 1, -get<2>(*p));
			p++;
		}
		// cout << bt.Query(n) << endl;
		// cout << bt.Query(l - 1) << endl;
		qry[i].ans = bt.Query(n) - bt.Query(l - 1);
	}
	sort(qry + 1, qry + q + 1, [](Query a, Query b) {
		return a.id < b.id;
	});

	for (int i = 1; i <= q; i++)
		cout << qry[i].ans << endl;

	return 0;
}


Measured memory_bytes: 46948
using System;
using System.Collections.Generic;
using static System.Console;

class Program
{
    public static void Main()
    {
        int n = int.Parse(ReadLine());
        var h = new HashSet<string>();

        string s0 = ReadLine();
        h.Add(s0);
        char c = s0[s0.Length - 1];

        for (int i = 1; i < n; i++)
        {
            string s = ReadLine();

            if (s[0] != c)
            {
                WriteLine("No");
                return;
            }

            if (h.Contains(s))
            {
                WriteLine("No");
                return;
            }

            h.Add(s);
            c = s[s.Length - 1];
        }
        WriteLine("Yes");
    }
}


Measured memory_bytes: 13396
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <bitset>

using namespace std;

int main() {
	int n,q;
	cin>>n>>q;
	string s;
	cin>>s;
	
	vector<int> l(q),r(q);
	for(int i=0; i<q; i++){
		cin>>l.at(i)>>r.at(i);
	}

	vector<int> sum(n);
	sum.at(0)=0;
	for (int i=0; i<n-1; i++){
		sum.at(i+1)=sum.at(i);
		if(s.at(i)=='A' && s.at(i+1)=='C') sum.at(i+1)++;
	}
	
	for(int i=0; i<q; i++){
		cout<<sum.at(r.at(i)-1)-sum.at(l.at(i)-1)<<endl;
	}
}
	


Measured memory_bytes: 2176
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void){
 int a,b,c;
 scanf("%d %d %d",&a,&b,&c);
 if(a==b&&a!=c&&b!=c){printf("Yes");}
 else if(a==c&&b!=c&&b!=a){printf("Yes");}
 else if(b==c&&a!=b&&a!=c){printf("Yes");}
 else {printf("No");}
}



Measured memory_bytes: 128
import java.util.*;

public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		
		int totalCells = H*W;
		int filledCells = h*W + w*H - h*w;
		
    	System.out.println(totalCells-filledCells);
    }
  
}

Measured memory_bytes: 23764
#include <iostream>
#include <vector>
#define int long long
using namespace std;

int mod = 998244353;
int p10[600001];
int repunit[600001];	//repunit[5] = 11111

const int DEPTH = 18;

struct SegTree {
	int lazyT[1 << DEPTH + 1];
	int lazyV[1 << DEPTH + 1];
	int segSum[1 << DEPTH + 1];
	
	SegTree() {
		for (int i = 0; i < (1 << DEPTH + 1); i++) {
			lazyT[i] = -1;
			lazyV[i] = 0;
			segSum[i] = 0;
		}
	}
	
	void lazy_evaluate(int id, int len) {
		if (lazyT[id] == -1) return;	//id
		
		segSum[id] = lazyV[id] * repunit[len] % mod;	//mapping
		if (id < (1 << DEPTH) - 1) {
			if (lazyT[id * 2 + 1] < lazyT[id]) { //composition
				lazyT[id * 2 + 1] = lazyT[id];
				lazyV[id * 2 + 1] = lazyV[id];
			}
			if (lazyT[id * 2 + 2] < lazyT[id]) { //composition
				lazyT[id * 2 + 2] = lazyT[id];
				lazyV[id * 2 + 2] = lazyV[id];
			}
		}
		lazyT[id] = -1;	//f <- id
	}
	
	void update(int l, int r, int x, int Time, int a = 0, int b = 1 << DEPTH, int id = 0) {
		lazy_evaluate(id, b - a);
		
		if (a >= r || b <= l) return;
		if (l <= a && b <= r) {
			lazyT[id] = Time;	//(composition)
			lazyV[id] = x;
			lazy_evaluate(id, b - a); //mapping, composition, id
			return;
		}
		
		update(l, r, x, Time, a, (a + b) / 2, id * 2 + 1);
		update(l, r, x, Time, (a + b) / 2, b, id * 2 + 2);
		segSum[id] = (p10[(b - a) / 2] * segSum[id * 2 + 1] + segSum[id * 2 + 2]) % mod;	//op
	}
	
	pair<int, int> getSum(int l, int r, int a = 0, int b = 1 << DEPTH, int id = 0) {
		if (a >= r || b <= l) return pair<int, int>(0, 0);	//e
		
		lazy_evaluate(id, b - a);
		if (l <= a && b <= r) {
			return pair<int, int>(segSum[id], b - a);
		}
		
		pair<int, int> res1 = getSum(l, r, a, (a + b) / 2, id * 2 + 1);
		pair<int, int> res2 = getSum(l, r, (a + b) / 2, b, id * 2 + 2);
		return pair<int, int>((res1.first * p10[res2.second] + res2.first) % mod, res1.second + res2.second);	//op
	}
};

SegTree seg;

signed main() {
	int n, q;
	cin >> n >> q;
	
	p10[0] = 1;
	repunit[0] = 0;
	for (int i = 0; i < (1 << (DEPTH + 1)); i++) {
		p10[i + 1] = (p10[i] * 10) % mod;
		repunit[i + 1] = (p10[i] + repunit[i]) % mod;
	}
	
	seg.update(0, n, 1, 0);

	for (int i = 0; i < q; i++) {
		int l, r, d;
		cin >> l >> r >> d;
		l--;
		
		//update a[l, r) <- d
		seg.update(l, r, d, i + 1);
		
		//digit sum
		cout << seg.getSum(0, n).first << endl;
	}
	return 0;
}

Measured memory_bytes: 24100
#include<bits/stdc++.h>
using namespace std;
typedef signed long long sll;
sll x,ans;
 
int main(){
	cin>>x;
	
	sll n=100;
	while(n<x){
		n*=1.01;
		ans++;
	}
	
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i,n) for (int i=(int)(n)-1; i>=0; --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) rep(i, x.size()) cerr << x[i] << (i == x.size() - 1 ? "\n" : " ")
#define all(x) x.begin(),x.end()
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = ((1LL << 30) + (1LL << 29));
const int MOD = 1000000007;
const int FIVE = 101010;

//=============================
int N,M,K;
string S,T;
vector<int> A;
vector<int> B;
vector<pii> sushi;
int C;
//=============================
void input()
{
    cin>>N>>C;
    sushi.push_back(make_pair(0,0));
    rep(i,N){
        int f,s;
        cin>>f>>s;
        sushi.push_back(make_pair(f,s));
    }
    sushi.push_back(make_pair(C,0));
}
//=============================
void func(){}

vector<vector<int>> mem(2,vector<int>(111111,0));
//=============================
void solve()
{
    enum STATE {
        STARTED = 0,
        BACKED = 1,
    };
    STATE state = STARTED;

    int ca = 0;
    for (int i=1; i<=N; ++i){
        ca -= sushi[i].first - sushi[i-1].first;
        ca += sushi[i].second;
        mem[0][i] = max(mem[0][i-1], ca);
    }

    ca = 0;
    for (int i=N; i>=1; --i) {
        ca -= sushi[i+1].first - sushi[i].first;
        ca += sushi[i].second;
        mem[1][i] = max(mem[1][i+1], ca);
    }

    int calmax = -INF;
    for (int i=0; i<=N; ++i){
        ca = mem[0][i] + mem[1][i+1] - sushi[i].first;
        calmax = max(calmax, ca);

        ca = mem[0][i] + mem[1][i+1] - C + sushi[i+1].first;
        calmax = max(calmax,ca);
    }
    cout<<calmax<<endl;

    // always (@)


}
//=============================
signed main()
{
    input();
    solve();
    return 0;
}

Measured memory_bytes: 5016
a, b, k = map(int, input().split())

cnt = 0
if b - a + 1>= 2 * k:
  for i in range(a, a + k):
    print(i)
  for i in range(b - k + 1, b + 1):
    print(i)
else:
  for i in range(a, b + 1):
    print(i)

Measured memory_bytes: 3316
import numpy as np

#周りの'#'をカウントする関数
def countsherp(S_pad,i,j):
    count = 0
    for k in range(-1,2):
        for l in range(-1,2):
            if S_pad[i+k][j+l]=='#':
                count += 1
    return count

#入力
h, w = map(int,input().split()) 
S = np.array([list(input()) for i in range(h)])

#変数の初期化
w_pad = np.array([['p' for i in range(w)]])
h_pad = 'p'
S_pad = np.empty((0,w),int)

#padding処理(2次元配列の周りを'.'で囲む)
S_pad = np.append(S_pad,w_pad,axis=0)
S_pad = np.append(S_pad,S,axis=0)
S_pad = np.append(S_pad,w_pad,axis=0)
S_pad = np.insert(S_pad,0,h_pad,axis=1)
S_pad = np.insert(S_pad,S_pad.shape[1],h_pad,axis=1)

#'.'を数字に変換
for i in range(1,S_pad.shape[0]-1):
    for j in range(1,S_pad.shape[1]-1):
        count = 0
        if S_pad[i][j] == '.':
            S_pad[i][j] = countsherp(S_pad,i,j)

ans = S_pad[1:-1,1:-1]
for i in range(ans.shape[0]):
    print(''.join(ans[i]))

Measured memory_bytes: 13088