akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
using namespace std;

int n;

void dfs(string s, char mx)
{
    if (s.length() == n)
    {
        cout << s << endl;
    }
    else
    {
        for (char c = 'a'; c <= mx; c++)
        {
            dfs(s + c, ((c == mx) ? (char)(mx + 1) : mx));
        }
    }
}

int main(void)
{
    cin >> n;
    dfs("", 'a');
    return 0;
}


Measured memory_bytes: 1536
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

struct DATA{
  int time;
  int log;
};

int GetTime(const string);
int AtoiString(const string);
bool Compare(const DATA&, const DATA&);

int main(){
  int i, n, count, _count;
  string s, t;
  DATA _data;
  vector<DATA> data;

  while(1){
    cin >> n;
    if(n == 0) break;

    for(i=0; i<n; ++i){
      cin >> s >> t;
      _data.time = GetTime(s);
      _data.log = 1;
      data.push_back(_data);
      _data.time = GetTime(t);
      _data.log = -1;
      data.push_back(_data);
    }

    sort(data.begin(), data.end(), Compare);

    for(i=0, count=0, _count=0; i<data.size(); ++i){
      _count += data[i].log;
      if(count < _count) count = _count;
    }
    cout << count << endl;
    data.clear();
  }
  return 0;
}

int GetTime(const string str){
  string s, t, u;
  copy(str.begin(), str.begin()+2, back_inserter(s));
  copy(str.begin()+3, str.begin()+5, back_inserter(t));
  copy(str.begin()+6, str.end(), back_inserter(u));
  return AtoiString(s) * 3600 + AtoiString(t) * 60 + AtoiString(u);
}

int AtoiString(const string s){
  int i, x, d;
  for(i=s.size()-1, x=0, d=1; i>=0; --i, d*=10)
    x += ((s[i] - 48) * d);
  return x;
}

bool Compare(const DATA& x, const DATA& y){
  if(x.time == y.time)
    return x.log < y.log; 
  else
    return x.time < y.time;
}

Measured memory_bytes: 1532
import java.util.*;
 

public class Main{
	
	
	
	
	public static long answer = 0;
	public static long MOD=1000000007;
	
	
	

	

 
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd(long a, long b) {
		if (b == 0) {
			return a;			
		}
		return gcd(b, a % b);
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}
 
 
 
	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}
 
 
	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}
 
 
	//階乗
	static long factorial (int k) {
		long sum = 1;
		for(int i=1;i<=k;i++) {
			sum = (sum*i)%MOD;
		}
		return sum;
		
	}
 
 
	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
	private static String convertToOiginal(String unicode)
	{
	    String[] codeStrs = unicode.split("\\\\u");
	    int[] codePoints = new int[codeStrs.length - 1]; // 最初が空文字なのでそれを抜かす
	    for (int i = 0; i < codePoints.length; i++) {
	        codePoints[i] = Integer.parseInt(codeStrs[i + 1], 16);
	    }
	    String encodedText = new String(codePoints, 0, codePoints.length);
	    return encodedText;
	}
	
	
 public static void main(String[] args) {
	 
	Scanner sc=new Scanner(System.in);
	int N=sc.nextInt(),K=sc.nextInt(),R=sc.nextInt(),S=sc.nextInt(),P=sc.nextInt();
	char[] c=sc.next().toCharArray();
    long result = 0;
	for(int i=0;i<N;i++) {
		if(c[i]=='f') {
			continue;
		}
		
		if(i+K<N) {
			if(c[i]==c[i+K]) {
				c[i+K]='f';
			}
		}
		if(c[i]=='r') {
			result+=P;
		}else if(c[i]=='s') {
			result+=R;
		}else {
			result+=S;
		}
	}
	System.out.println(result);
	
	 

	 
	 
	
}
 
 
}

Measured memory_bytes: 26324
// #define _CRT_SECURE_NO_WARNINGS
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cassert>
#include <unordered_set>
#include <set>

#define prev asasddlsa
#define rank aljds

using namespace std;

typedef long long ll;

template<typename T>
void print(const vector<T>& s){
    for (auto x : s)
        cout << x << " ";
    cout << endl;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int m, d;
    cin >> m >> d;
    int cnt = 0;
    for (int i = 1; i <= m; i++){
        for (int j = 10; j <= d; j++){
            if (j % 10 > 1 && j / 10 > 1 && i == (j % 10) * (j / 10)){
                cnt++;
                // cout << i << " " << j << endl;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}

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

int main() {
  int n,l;
  cin>>n>>l;
  vector<string>s(n);
  for(int i=0;i<n;i++) cin>>s[i];
  sort(s.begin(),s.end());
  for(int i=0;i<n;i++) cout<<s[i];
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main() {
    FAST
    string s,t;
    cin>>s>>t;
    int n=s.length();
    if(s==t.substr(0,n)) cout<<"Yes";
    else cout<<"No";
}

Measured memory_bytes: 3644
#!/usr/bin/env python3
from collections import Counter

s = input()
ans = 100
cs = set(i for i in s)
for c in cs:
    a = 0
    ns = s
    while ns.count(c) < len(ns):
        nns = ""
        for i in range(len(ns) - 1):
            if c in (ns[i], ns[i + 1]):
                nns += c
            else:
                nns += ns[i]
        ns = nns
        a += 1
    ans = min(a, ans)
print(ans)


Measured memory_bytes: 9396
using System;

namespace takahashikun
{
    class Program
    {
        static void Main(string[] args)
        {
            string inX = Console.ReadLine();

            int X = int.Parse(inX);
            
            int K = 1;
            while (!(K * X >= 360 && K * X % 360 == 0)) K++;
                    Console.WriteLine(K);

        }

    }
}


Measured memory_bytes: 27468
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (true) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            String score = "A";

            int sum = m + f;
            if (m + f + r == -3) {
                return;
            } else if (m * f < 0) {
                score = "F";
            } else if (sum < 30) {
                score = "F";
            } else if (sum < 50) {
                score = r < 50 ? "D" : "C";
            } else if (sum < 65) {
                score = "C";
            } else if (sum < 80) {
                score = "B";
            }

            System.out.println(score);
        }
    }
}


Measured memory_bytes: 26156
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,h,len;
        String s,sa,sb;
        while(true) {
        	s=scan.next();
        	if(s.equals("-")) {
        		break;
        	}
        	len=s.length();
        	n=scan.nextInt();
        	for(i=0;i<n;i++) {
        		h=scan.nextInt();
        		sa=s.substring(0,h);
        		sb=s.substring(h);
        		s=sb+sa;
        	}
        	System.out.println(s);
        }
    }
}


Measured memory_bytes: 26484
// C++(GCC 9.2.1)
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define pb push_back
int connection[202020]; // 連結成分番号を保存.
int appearance[202020]; // 連結成分番号の出現回数.

// グラフを幅優先探索する.
// https://ja.wikipedia.org/wiki/幅優先探索
// ※bfsの動作確認用.
// @param G: グラフ.
// @param s: グラフの探索開始頂点.
// @param l: 連結成分番号(※1以上).
// @return: 特に無し.
void bfs(vvi &G, int s, int l){
    // 1. 空のキュー.
    queue<int> q;
    
    // 2. 連結成分番号を設定.
    connection[s] = l;
    
    // 3. 探索地点 s をキュー q に追加.
    q.push(s);
    while(!q.empty()){
        // 4. キューから取り出す.
        int u = q.front();
        q.pop();
        
        // 5. 取り出した要素を処理.
        for(auto &e : G[u]){
            // 6. 訪問済であれば, 処理をスキップ.
            if(connection[e])            continue;
            if(!connection[e] && e != s) connection[e] = l, q.push(e);
        }
    }
    return;
}

int main() {
    
    // 1. 入力情報取得.
    int N, M, a, b;
    scanf("%d %d", &N, &M);
    vvi G(N);
    rep(i, M){
        scanf("%d %d", &a, &b);
        a--, b--;
        G[a].pb(b);
        G[b].pb(a);
    }
    
    // 2. 探索を行い, 連結成分に分割.
    int idx = 0;
    rep(i, N) if(!connection[i]) bfs(G, i, ++idx);
    
    // 3. 各連結成分番号の出現回数を計算.
    rep(i, N) appearance[connection[i]]++;
    
    // 4. 連結成分の最大出現回数は？
    int ans = 0;
    repx(i, 1, idx + 1) ans = max(ans, appearance[i]);
    
    // 5. 出力.
    printf("%d\n", ans);
    return 0;
    
}

Measured memory_bytes: 15684
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF 1e8;
typedef long long ll;
ll mod = 1e9+7;
long long fast_exp(long long a, long long b)
{
    if(b == 0)
	   return 1;
    else
    {
	   long long res = 1;
	   res = fast_exp(a,b/2);
	   res = (res*res)%mod;
	   if(b%2 == 1)
		  res = (res*a)%mod;
	   return res;
 
    }
}
const ll N = 1e6;
ll n,m;
//string s,t;
int s[3000],t[3000];
ll dp[3000][3000]={};
bool vis[3000][3000]={};
ll num_common(ll first, ll second)
{
	//cout<<"euler\n";
	
	if(first == -1 || second == -1)
		{
			//cout<<"first : "<<first<<"  second: "<<second<<"  ans : "<<1<<endl;
			return 1;
		}	
	else if(vis[first][second] == 1)
		{
			//cout<<"first : "<<first<<"  second: "<<second<<"  ans : "<<dp[first][second]<<endl;

			return dp[first][second];
		}

	
	else
	{
		ll ways = 0;
		//if(first-1>=0)
			ways = (ways + num_common(first-1,second))%mod;
		//if(second-1>=0)
			ways = (ways + num_common(first,second-1))%mod;
		//if(second-1>=0 && first-1>=0)
			ways = (ways - num_common(first-1,second-1)+mod)%mod;
		if(s[first] == t[second])
		{
			
				ways = (ways + num_common(first-1,second-1))%mod;
			
		}
		dp[first][second] = ways;
		vis[first][second] = 1;
		//cout<<"first : "<<first<<"  second: "<<second<<"  ans : "<<dp[first][second]<<endl;

		return dp[first][second];
	}
}


 int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	cin>>n>>m;
	
	for(ll i = 0; i<n ; i++)
	{	
		cin>>s[i];

	}
	for(ll j = 0; j<m ; j++)
		cin>>t[j];

	// vis[0][0] = 1;
	// dp[0][0] = 1;
	// if(s[0] == t[0])
	// 	dp[0][0]+=1;

	cout<<num_common(n-1,m-1)<<endl;
	return 0;
	
}


Measured memory_bytes: 55808
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(int)(n);i++)
using namespace std;

int main(){
    int n;
    cin>>n;
    int AC=0,WA=0,TLE=0,RE=0;
    vector<string> list(n);
    rep(i,n){
        cin>>list[i];
        if(list[i]=="AC"){
            AC++;
        }else if(list[i]=="WA"){
            WA++;
        }else if(list[i]=="TLE"){
            TLE++;
        }else if(list[i]=="RE"){
            RE++;
        }
    }
    cout<<"AC x "<<AC<<endl;
    cout<<"WA x "<<WA<<endl;
    cout<<"TLE x "<<TLE<<endl;
    cout<<"RE x "<<RE<<endl;

}

Measured memory_bytes: 6372
#include <bits/stdc++.h>
using namespace std;
int n, m, h[100005], ans=0;
vector<int> r[100005];
int main() {
    cin >> n >> m;
    for (int i=1; i<=n; i++) cin >> h[i];
    for (int i=0; i<m; i++) {
        int a, b; cin >> a >> b;
        r[a].push_back(b);
        r[b].push_back(a);
    }
    bool ok=1;
    for (int i=1; i<=n; i++) {
        ok=1;
        for (int j=0; j<r[i].size(); j++) {
            if (h[i]<=h[r[i][j]]) ok=0;
        }
        if (ok) ans++;
    }
    
    cout << ans;
}

Measured memory_bytes: 9056
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e12);
const ll mod = ll(1e9) + 7;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()

ll gcd(ll a,ll b){
    if(a < b)swap(a, b);
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll t = 1;
    rep1(i, n){
        t *= i;
        t %= mod;
    }
    return t;
}

ll power(ll a, ll b){
    a %= mod;
    if(b == 0){
        return 1;
    }
    ll ans = power(a, b / 2);
    ans = ans * ans % mod;
    if(b % 2 == 1){
        ans = ans * a % mod;
    }
    return ans;
}

ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    if(a < b) return 0;
    ll ans = 1;
    for(ll i = 0; i < b; i++) {
        ans *= (a - i);
        ans /= (i + 1);
        ans %= mod;
    }
    return ans;
}

vector<ll> lunnum;

int make(ll n){
    if(n <= 3234566667){
        lunnum.push_back(n);
        string a = to_string(n);
        if(a[a.size() - 1] == '9'){
            make(n * 10 + 8);
            make(n * 10 + 9);
        }else if(a[a.size() - 1] == '0'){
            make(n * 10 + 0);
            make(n * 10 + 1);
        }else{
            make(n * 10 + a[a.size() - 1] - 49);
            make(n * 10 + a[a.size() - 1] - 48);
            make(n * 10 + a[a.size() - 1] - 47);
        }
    }
    return 0;
}

int main(){
    ll k;
    cin >> k;
    rep1(i, 9)make(i);
    sort(all(lunnum));
    pf(lunnum[k - 1]);
    return 0;
}



Measured memory_bytes: 1400
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"
 
using namespace std;

int compute_sum_of_digit(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
  int N;
  cin >> N;
  
  int sum = compute_sum_of_digit(N);
  if (N % sum == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define pu_b push_back

using namespace std;

const int N=1e5+10, Mod=1e9+7;
int n, max_floor=0;
ll dp[2][N];
int dis[N], par[N];
bool visible[N]={};
vector<int> adj[N], flor[N];

void dfs(int x){
    for(int v:adj[x]){
        if(visible[v]) continue;
        visible[v]=1;
        dis[v]=dis[x]+1;
        flor[dis[v]].pu_b(v);
        max_floor=max(max_floor, dis[v]);
        par[v]=x;
        dfs(v);
    }
}

int main()
{
    cin>>n;
    for(int i=0; i<n-1; i++){
        int x, y;
        cin>>x>>y;
        x--; y--;
        adj[x].pu_b(y);
        adj[y].pu_b(x);
    }
    dis[0]=0;
    visible[0]=1;
    flor[0].pu_b(0);
    dfs(0);
    //Computing dp
    int t=max_floor;
    for(int u:flor[max_floor]){
        dp[0][u]=1;
        dp[1][u]=2;
    }
    for(int i=max_floor-1; i>=0; i--){
        for(int p:flor[i]){
            ll blval=1, whval=1;
            for(int v:adj[p]){
                if(v!=par[p]){
                    blval=(blval*dp[0][v])%Mod;
                    whval=(whval*dp[1][v])%Mod;
                }
            }
            dp[0][p]=whval;
            dp[1][p]=(blval+whval)%Mod;
        }
    }
    cout<<dp[1][0];
}

























Measured memory_bytes: 18944
using System;

namespace abc112A
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            if (N == 1)
                Console.WriteLine("Hello World");
            else
            {
                int A = int.Parse(Console.ReadLine());
                int B = int.Parse(Console.ReadLine());
                int C = A + B;
                Console.WriteLine(C);
            }
        }
    }
}


Measured memory_bytes: 11092
x, k, d = map(int, input().split())
tmp = x
limit = abs(x) // d
if limit >= k:
    print(abs(x+k*d) if x < 0 else abs(x-k*d))
else:
    if x > 0:
        plus = abs(x - limit*d)
        minus = abs(x - (limit+1)*d)
        if limit % 2 == 0:
            if k % 2 != 0:
                print(minus)
            else:
                print(plus)
        else:
            if k % 2 != 0:
                print(plus)
            else:
                print(minus)
    else:
        plus = abs(x + (limit+1)*d)
        minus = abs(x + limit*d)
        if limit % 2 == 0:
            if k % 2 != 0:
                print(plus)
            else:
                print(minus)
        else:
            if k % 2 != 0:
                print(minus)
            else:
                print(plus)

Measured memory_bytes: 61776
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(obj) (obj).begin(),(obj).end() 
#define dump(x)  cout << #x << " = " << (x) << endl;
typedef long long lint;
using namespace std;
int main(){
	string s;
	cin>>s;
	rep(i,3){
		if(s.at(i)=='1')s.at(i)='9';
		else s.at(i)='1';
	}
	cout<<s<<endl;
}


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

typedef long long ll;
#define fio() cin.tie(0); ios::sync_with_stdio(false);
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define all(c) c.begin(),c.end()
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
#define pu push
#define pb push_back
vi dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
vi dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };
const ll MOD = 1000000007;
const int inf = 1000000001;
const ll INF = 1e16;
#define max 105

int main(){
    fio();
    ll ver,edge;
    cin>>ver>>edge;
    ll i,j,k,v1,v2,weight;
    int adjmat[max][max];
    int cost[max][max]; //defind to store shortest distance from any node to any node
    vii l(edge,vi(3));


    rep(i,105)
        rep(j,105){
            adjmat[i][j] = inf;
            if(i==j)
                adjmat[i][j] = 0;
        }
    rep(i,edge){
        cin>>v1>>v2>>weight;
        adjmat[v1][v2] = weight;
        adjmat[v2][v1] = weight;
        l[i][0] = v1;
        l[i][1] = v2;
        l[i][2] = weight;
    }
    rep1(i,ver)
        rep1(j,ver)
            cost[i][j] = adjmat[i][j]; 
    //floydWarshal algorithm
    rep1(k,ver){
        rep1(i,ver){
            rep1(j,ver){
                if(cost[i][k]+cost[k][j] < cost[i][j])
                    cost[i][j] = cost[i][k]+cost[k][j];
            }
        }
    }
    ll ans=0;
    rep(i,edge){
        bool flag = false;
        rep1(j,ver){
            rep1(k,ver){
               if(cost[j][k] == cost[j][ l[i][0] ] + cost[ l[i][1] ][k] + l[i][2]  )
                    flag = true; 
            }
        }
        if(!flag)
            ans++;
    }
    cout<<ans;
    // rep1(i,ver){
    //     rep1(j,ver){
    //         cout<<cost[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }
    // rep1(i,ver){
    //     rep1(j,ver){
    //         cout<<i<<" "<<j<<" "<<adjmat[i][j]<<endl;
    //     }
    // }


}
    //adj_list
    // vector< vector< pair<int, int> > > adjlist(ver + 1);
    // rep(i,edge){
    //     cin>>v1>>v2>>weight;
    //     adjlist[v1].pb( make_pair(v2,weight) );
    // }
    // rep(i,adjlist.size()){
    //     rep(j,adjlist[i].size()){
    //         cout<<i<<" "<<adjlist[i][j].first<<" "<<adjlist[i][j].second<<endl;
    //     }
    // }


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define RI(a) scanf("%d",&a)
#define RII(a,b) scanf("%d%d",&a,&b)
#define RIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll mod=ll(1e9+7);

vector<pair<pii,int>> meow;
vector<pii> child[maxn];
ll c[maxn];
bool vis[maxn];

void dfs(int u){
   vis[u]=1;
   for(pii p:child[u]) if(!vis[p.F]){
      c[p.F]=c[u]+p.S;
      dfs(p.F);
   }
}

int main()
{
	//IOS;
   int n,m;
   cin>>n>>m;
   REP(i,m){
      int u,v;
      ll d;
      cin>>u>>v>>d;
      child[u].pb({v,d});
      child[v].pb({u,-d});
      meow.pb({{u,v},d});
   }
   REP(i,n) if(!vis[i]) dfs(i);

   for(auto i:meow){
      int u=i.F.F,v=i.F.S;
      ll d=i.S;
      if(c[v]-c[u]!=d){
         cout<<"No\n";
         return 0;
      }
   }
   cout<<"Yes\n";
	return 0;
}


Measured memory_bytes: 19888
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecVec = vector<Vec>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}
template <typename T>
void co(const T n){cout << n << endl;}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void coVec(const Vec &v){for(ll i : v) cosp(i); cout << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const double PI = acos(-1);
const double EPS = 1e-9;

int main(void){
	ll n, a, b;
	cin >> n >> a >> b;
	if(!(abs(a-b)%2)) co(abs(a-b)/2);
	else co(min((a+b-1)/2, (n*2-a-b+1)/2));

	return 0;
}


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

using namespace std;
using ll = long long;

#pragma region Macros
#define FOR(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define rep(i, n) FOR(i, 0, n)

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 (a > b) { a = b; return true; } return false; }

template <class T> string join(const T &v, const string delim = ",")
{
    if (v.empty())
        return "";

    ostringstream res;
    res << v[0];
    for (int i = 1; i < v.size(); i++)
    {
        res << delim << v[i];
    }
    return res.str();
}

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << ":" << #x << " = " << (x) << endl;
#else
#define dbg
#endif

#pragma endregion Macros

int main()
{
    string S;
    cin >> S;

    char x = 'x';
    int c = 0;
    int ans = 0;
    rep(i, S.size()) {
        if (S[i] == 'R') c++;
        else
            c = 0;
        chmax(ans, c);
    }

    cout << ans << endl;

}


Measured memory_bytes: 3612
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;

const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };
int H, W, white;
vector<string> F;

int main() {
	cin >> H >> W;
	F.resize(H);
	for (int i = 0; i < H; ++i) {
		cin >> F[i];
		for(int j=0;j<W;++j)
		    if (F[i][j] == '.') white++;
	}
	int sh = 0, sw = 0, gh = H - 1, gw = W - 1;
	int step[55][55];
	for (int i = 0; i < 55; i++) for (int j = 0; j < 55; ++j)
		step[i][j]=-1;
	queue<pair<int, int>> que;

	step[sh][sw] = 1;
	que.push(make_pair(sh, sw));
	while (!que.empty()) {
		int h = que.front().first;
		int w = que.front().second;
		que.pop();
		for (int d = 0; d < 4; d++) {
			int nh = h + dx[d];
			int nw = w + dy[d];
			if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;
			if (F[nh][nw] == '#') continue;
			if (step[nh][nw] != -1) continue;

			step[nh][nw] = step[h][w] + 1;
			que.push(make_pair(nh, nw));
		}
	}

	/*for (int i = 0; i < H; i++) for (int j = 0; j < W; ++j)
		cout <<i<<" "<<j<<":"<< step[i][j] << endl;*/

	if (step[gh][gw] != -1)
		cout << white - step[gh][gw] << endl;
	else cout << -1 << endl;

	
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void) {
	int h, w;
	char pic[111][111];

	scanf("%d%d", &h, &w);
	for (int i = 0; i < h; i++)
	{
		scanf("%s", pic[i]);
	}

	for (int i = 0; i < w+2; i++)
	{
		printf("#");
	}
	printf("\n");
	for (int i = 0; i < h; i++)
	{
		printf("#%s#\n", pic[i]);
	}
	for (int i = 0; i < w + 2; i++)
	{
		printf("#");
	}
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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;}

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

    int n,x,y;cin>>n>>x>>y;
    x--,y--;
    ll g[n][n]={};
    rep(i,n)rep(j,n) g[i][j]=INF;
    rep(i,n-1){
        g[i][i+1]=1;
        g[i+1][i]=1;
    }
    int cnt[n]={};
    rep(i,n){
        for(int j=i+1;j<n;j++){
            int dis=min(j-i,1+abs(i-x)+abs(j-y));
            // cout<<i<<" "<<j<<" "<<dis<<endl;
            cnt[dis]++;
        }
    }
    for(int i=1;i<n;i++){
        cout<<cnt[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 31488
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}
    
int main(){
    LL x,y;
    cin>>x>>y;
    if(abs(x-y)>1)cout<<"Alice"<<endl;
    else cout<<"Brown"<<endl;
    return 0;
}


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

int main() {
  long long n, m, l;
  cin >> n >> m >> l;
  vector<vector<long long> > arr(n, vector<long long>(n));

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      arr[i][j] = (i == j) ? 0 : INT_MAX;
    }
  }

  for (int i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    arr[a-1][b-1] = arr[b-1][a-1] = c;
  }

  // first floyd warshall to find shortest paths across the entire graph
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        arr[i][j] = min(arr[i][k] + arr[k][j], arr[i][j]);
      }
    }
  }

  vector<vector<long long> > oldArr = arr;

  // store 1's at all places where oldArr[i][j] = l
  // This signifies that this path can be traversed with l litres of fuel
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      arr[i][j] = (oldArr[i][j] <= l) ? 1 : INT_MAX;
    }
  }

  // second floyd warshall to calculate the minimum no. of times tank fuel needs to be filled
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        arr[i][j] = min(arr[i][k] + arr[k][j], arr[i][j]);
      }
    }
  }

  int q;
  cin >> q;
  while (q--) {
    int a, b;
    cin >> a >> b;
    long long ans = arr[a-1][b-1];
    if (ans >= INT_MAX) {
      cout << "-1" << endl;
    } else {
      cout << --ans << endl;
    }
  }
}

Measured memory_bytes: 1920
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
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; }

struct MinimumCostFlow {
	using Flow = int;
	using Cost = int;
	struct Edge {
		int to, rev;
		Flow cap;
		Cost cost;
		Edge() {}
		Edge(int to, int rev, Flow cap, Cost cost) :to(to), rev(rev), cap(cap), cost(cost) {}
	};
	int n;
	vector<vector<Edge>> g;
	vector<int> dist;
	vector<int> prevv, preve;
	MinimumCostFlow(int n) :n(n), g(n), dist(n), prevv(n), preve(n) {}
	void addEdge(int from, int to, Flow cap, Cost cost) {
		g[from].emplace_back(to, (int)g[to].size(), cap, cost);
		g[to].emplace_back(from, (int)g[from].size() - 1, 0, -cost);
	}
	// s??????t????????????f???????°??????¨???
	// ??????????????´?????? -1
	Cost minimumCostFlow(int s, int t, Flow f) {
		Cost total = 0;
		while (f > 0) {
			// Bellman-Ford
			fill(dist.begin(), dist.end(), INF);
			dist[s] = 0;
			bool update = true;
			while (update) {
				update = false;
				for (int v = 0; v < n; v++) {
					if (dist[v] == INF)continue;
					for (int i = 0; i < g[v].size(); i++) {
						Edge &e = g[v][i];
						if (e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
							dist[e.to] = dist[v] + e.cost;
							prevv[e.to] = v;
							preve[e.to] = i;
							update = true;
						}
					}
				}
			}
			// ????????\???????????????
			if (dist[t] == INF)
				return -1;
			// ?????????????????£??????????????????
			int d = f;
			for (int v = t; v != s; v = prevv[v])
				d = min(d, g[prevv[v]][preve[v]].cap);
			f -= d;
			total += d*dist[t];
			for (int v = t; v != s; v = prevv[v]) {
				Edge &e = g[prevv[v]][preve[v]];
				e.cap -= d;
				g[v][e.rev].cap += d;
			}
		}
		return total;
	}

};

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int V, E, F; cin >> V >> E >> F;
	MinimumCostFlow mcf(V);
	rep(i, 0, E) {
		int u, v, c, d; cin >> u >> v >> c >> d;
		mcf.addEdge(u, v, c, d);
	}
	cout << mcf.minimumCostFlow(0, V - 1, F) << endl;
	return 0;
}

Measured memory_bytes: 3248
#include<stdio.h>
#include<string.h>

int main(void) {
	char s[11];
	scanf("%s", s);
	int i, k = 0, ans = 0;
	for (i = 0; i < strlen(s)+1; i++) {
		if (s[i] == 'A'||s[i]=='T'||s[i]== 'C'||s[i]=='G') {
			k++;
		}
		else {
			if (k > ans) {
				ans = k;
			}
			k = 0;
		}
	}
	printf("%d", ans);

	return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#define fi first
#define se second
#define pb(i) push_back(i)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define mes(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e6+10;
const int INF = 0x3f3f3f3f;
const int inf = - INF;
const int mod = 1e9+7;
const double pi = acos(-1.0);

int a[27];
int main(){
    char w[105];
    cin>>w;
    rep(i,0,strlen(w)-1){
        a[w[i]-'a']++;
    }
    int flag=1;
    rep(i,0,25){
        if(a[i]&1) flag=0;
    }
    printf(flag?"Yes\n":"No\n");
    return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };




void solve() {
    string s; cin >> s;
    ll res = 0;
    ll cnt = 0;
    rep(i, s.size()){
        if(s[i] == 'B') cnt++;
        else res += cnt;
    }
    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4816
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] x = new int[N];
        int[] y = new int[N];
        for (int i = 0; i < N; i++) {
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
        }

        int ans = N;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if (i == j) {
                    continue;
                }
                int dx1 = x[j]-x[i];
                int dy1 = y[j]-y[i];

                int val = 1;
                for (int p = 0; p < N; p++) {
                    for (int q = 0; q < N; q++) {
                        if (p == q || (i == p && j == q)) {
                            continue;
                        }
                        int dx2 = x[q]-x[p];
                        int dy2 = y[q]-y[p];
                        if (dx1 == dx2 && dy1 == dy2) {
                            val++;
                        }
                    }
                }
                ans = Math.min(ans, N-val);
            }
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 24020
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 17
int n;
int bitcnt(int x)
{
	int pd=0;
	while(x){pd^=(x&1);x>>=1;}
	return pd;
}
int lowbit(int x){return x&(-x);}
int A,B,ans[MAXN+1][1<<MAXN];
void slove(int k,int A,int B,int *a,int l,int r)
{
	if(k==1){a[l]=A;a[r]=B;return ;}
	int C=A^B,t=lowbit(C);
	int tA=A%t+A/(t<<1)*t,tB=B%t+B/(t<<1)*t,tC=tA^1;
	int mid=(l+r)>>1;
	slove(k-1,tA,tC,ans[k-1],l,mid);
	slove(k-1,tC,tB,ans[k-1],mid+1,r);
	for(int i=l;i<=mid;i++)
	a[i]=ans[k-1][i]%t+ans[k-1][i]/t*(t<<1)+((A&t)?t:0);
	for(int i=mid+1;i<=r;i++)
	a[i]=ans[k-1][i]%t+ans[k-1][i]/t*(t<<1)+((B&t)?t:0);
}
int main()
{
	scanf("%d",&n);
	scanf("%d%d",&A,&B);
	if(bitcnt(A)==bitcnt(B)){puts("NO");return 0;}
	slove(n,A,B,ans[n],0,(1<<n)-1);
	puts("YES");
	for(int i=0;i<(1<<n);i++)printf("%d ",ans[n][i]);
}

Measured memory_bytes: 9728
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

int main()
{
   FAST/**/
   
   ll n,m;
   cin>>n>>m;
   
   ll ht[n];
   rep(n)
        cin>>ht[i];
   
   vector<ll> v[n];
   rep(m)
   {
       ll a,b;
       cin>>a>>b;
       a--,b--;
       v[a].pb(b);
       v[b].pb(a);
   }
   
   ll ans = 0;
   rep(n)
   {
       bool pos = 1;
       autoit(v[i],it)
            if(ht[*it]>=ht[i])
                pos = 0;
       ans+=((ll)pos);            
   }
   cout<<ans;
   
   
   return 0;        
}  
  
   

Measured memory_bytes: 10256
#include<bits/stdc++.h>
using namespace std;
#define nl cout<<'\n';
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    a=a+d-1;
    c=b+c-1;
    a=a/d;
    c=c/b;
    if(a<c)
      cout<<"No";
    else
      cout<<"Yes";
    nl;
    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
typedef long long ll;

int main(){
    int N;
    cin >> N;
    vector<int> H(N+1);
    rep2(i,1,N+1) cin >> H[i];
    int ans=0;
    int best=0;
    rep2(i,2,N+1){
        if(H[i]<=H[i-1]) ans++;
        else{
            ans=0;
        }
        best = max(best,ans);
    }
    cout << best << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 510000;
const int MOD = 1000000007;

int main()
{
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < s.size();i++){
        if(s[i] != t[i]){
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 5;
const int MOD = 1e9 + 7;

ll n,x,y,m,k,ans,cnt,mini=N,flag;
ll a[N],c[N],b[N],dp[105][N];
vector< pair< ll,ll > > v;
string s;
map<char,ll>mp;
int main()
{
    ios_base ::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    cin>>n>>m;
    for(ll i=0;i<n;i++)
        cin>>a[i]>>b[i];

    for(ll i=0;i<=n;i++){
       for(int j=0;j<=m;j++)
       {
          if(i==0||j==0)dp[i][j]=0;
          else if (a[i-1]<=j)
          dp[i][j] = max(b[i-1]+dp[i-1][j-a[i-1]], dp[i-1][j]);
          else
          dp[i][j]=dp[i-1][j];
       }
    }
    cout<<dp[n][m];
return 0;
}


Measured memory_bytes: 82304
n = gets.chomp.to_i

tmp_x, tmp_y = 0, 0
tmp_t = 0

flag = true

n.times do
  reachble = true
  t,x, y = gets.chomp.split.map(&:to_i)

  reachble = false unless t % 2 == (x + y) % 2
  reachble = false unless (tmp_x - x ).abs+ (tmp_y - y).abs <= t-tmp_t

  tmp_t = t
  tmp_x, tmp_y = x, y


  flag = false unless reachble
end

puts flag ? 'Yes' : 'No'





Measured memory_bytes: 1788
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)

int main()
{

  int n;
  cin >> n;
  double x;
  string u;
  double ans = 0;
  rep(i, n)
  {
    cin >> x;
    cin >> u;

    if(u=="BTC")x*=380000.0;
    ans += x;

  }

  cout << ans << endl;

  return 0;
}


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

#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;
int main(){
  ll a,b;
  cin>>a>>b;
  cout<<max((ll)0,a-2*b);
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

int main(){
	ll a, b;
	cin >> a >> b;
	cout << a-b+1 << endl;
    return 0;
}

Measured memory_bytes: 256
import bisect as bi

A,B,Q=map(int,input().split())

s=[-10**11]
for i in range(A):
    s.append(int(input()))
s.append(10**11)

t=[-10**11]
for i in range(B):
    t.append(int(input()))
t.append(10**11)

for k in range(Q):
    x=int(input())
    i=bi.bisect_left(s,x)
    sl=s[i-1];sr=s[i]
    j=bi.bisect_left(t,x)
    tl=t[j-1];tr=t[j]
    # print(sl,sr,tl,tr)
    print(min(abs(x-sl)+abs(sl-tl),abs(x-sl)+abs(sl-tr),abs(x-sr)+abs(sr-tl),abs(x-sr)+abs(sr-tr),\
        abs(x-tl)+abs(tl-sl),abs(x-tl)+abs(tl-sr),abs(x-tr)+abs(tr-sl),abs(x-tr)+abs(tr-sr)))

Measured memory_bytes: 12084
using System;
class Program
{
	static void Main(string[] args)
	{
		int input = int.Parse(Console.ReadLine());
		for(int i=input;true;i++){
			if(IsPrime(i)){
				Console.WriteLine(i);
				break;
			}
		}
	}
	public static bool IsPrime(int num)
	{
	    if (num < 2) return false;
	    else if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
	
	    double sqrtNum = Math.Sqrt(num);
	    for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    }
	
	    // 素数である
	    return true;
	}
}

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

using namespace std;

int mod = 924844033, nr, N, K, v[4017], fac[2017], dp[4017][2017][2];

int add (int x, int y) {int ans = x + y; if (ans >= mod) ans -= mod; return ans;}
int substract (int x, int y) {if (x >= y) return x - y; return x - y + mod;}
int mul (int x, int y) {return 1LL * x * y % mod;}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d", &N, &K), fac[0] = 1;
for (int i=1; i<=N; i++)
    fac[i] = mul (fac[i - 1], i);
for (int i=1; i<=K && i + K <= N; i++)
{
    v[++nr] = 0;
    for (int j=i + 2 * K; j<=N; j+=K)
        v[++nr] = 1;
}
for (int i=1; i<=K && i + K <= N; i++)
{
    v[++nr] = 0;
    for (int j=i + 2 * K; j<=N; j+=K)
        v[++nr] = 1;
}
dp[0][0][0] = 1;
for (int i=0; i<nr; i++)
    for (int j=0; j<=i && j <= N; j++)
        for (int k=0; k<2; k++)
            for (int p=0; p<2; p++)
                if (v[i + 1] == 0 || k == 0 || p == 0)
                    dp[i + 1][j + p][p] = add (dp[i + 1][j + p][p], dp[i][j][k]);
int ans = 0;
for (int i=0; i<=N; i++)
{
    int curr = add (dp[nr][i][0], dp[nr][i][1]);
    curr = mul (curr, fac[N - i]);
    if (i & 1) ans = substract (ans, curr);
    else ans = add (ans, curr);
}
printf ("%d\n", ans);
return 0;
}


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

int main (){
    int a;
    cin >> a;
    int N = a%10;
    if(N >9){
        N = N%10;
    }
    if(N == 3){
        cout << "bon" << endl;
    }  
    else if(N == 8){
        cout << "pon" << endl;
    }  
    else if(N == 6){
        cout << "pon" << endl;
    }  
    else if(N == 1){
        cout << "pon" << endl;
    }  
    else if(N == 0){
        cout << "pon" << endl;
    }  
    else{
        cout << "hon" << endl;
    }
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <vector>

int main() {
	int n, t, a[200000];
	std::cin >> n >> t;
	for (int i = 0;i < n;i++) {
		std::cin >> a[i];
	}
	int nSum = 0;
	for (int i = 0;i < n-1;i++) {
		if (a[i + 1] - a[i] >= t) {
			nSum += t;
		}
		else {
			nSum += a[i + 1] - a[i];
		}
	}
	std::cout << nSum + t << std::endl;
	return 0;
}
	


Measured memory_bytes: 1024
#include <stdio.h>
int dp[50];
int fib(int n){
    if(n==0||n==1)return dp[n]=1;
    if(dp[n]!=-1)return dp[n];
    return dp[n]=fib(n-1)+fib(n-2);
}

int main(){
    int n,i;
    scanf("%d",&n);
    for(i=0;i<50;i++)dp[i]=-1;
    printf("%d\n",fib(n));
    return 0;
}

Measured memory_bytes: 596
N=int(input())
A,B=map(int,input().split())
P=[int(i) for i in input().split()]
P.sort()
a,b,c=0,0,0
for i in range(N):
  if P[i]<=A:
    a+=1
  elif A+1<=P[i]<=B:
    b+=1
  else:
    c+=1
print(min(a,b,c))


Measured memory_bytes: 38256