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

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define inf 100000000000010
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
#define all(x) (x).begin(), (x).end()

typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> pi;

bool isprime(ll n)
{
    if(n<=1)return false;
    if(n<=3)return true;
    if(n%2==0||n%3==0)return false;
    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)return false;
    }
    return true;
}

ll modexp(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b>0)
    {
        if(b&1)r=(r*a)%m;
        b = b>>1;
        a=(a*a)%m;
    }
    return r%m;
}

struct CustomCompare
{
    bool operator()(const int& lhs, const int& rhs)
    {
        return lhs < rhs;
    }
};

bool comp(pair<ll, ll>a,pair<ll,ll>b)
{
    return a.fi>=b.fi;
}

ll builtin_popcount(ll x)
{
    ll cnt = 0;
    for(ll i=60;i>=0;i--)
    {
        if((1LL<<i)&x)cnt++;
    }
    return cnt;
}

ll addmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a+b)%mod;
}
ll mulmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
/*
const int mxn = 5*(1e6) +10;
vi spf(mxn);
void sieve()
{
    for(ll i =0;i<mxn;i++)spf[i]  = i;
    for(ll i=2;i<mxn;i+=2)spf[i] = 2;
    for(ll i = 3;i*i<mxn;i++)
    {
        if(spf[i]==i)
        {
            for(ll j = i*i;j<mxn;j+=i)
            {
                if(spf[j]==j)spf[j] = i;
            }
        }
    }
}
*/

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
ll n; cin>>n;
ll mxn = 1e6;
vi dp(mxn+1,0);
for(ll x = 1;x*x<=n;x++)
{
    for(ll y = 1;y*y<=n;y++)
    {
        for(ll z =1;z*z<=n;z++)
        {
            ll p  = x*x + y*y + z*z + x*z + z*y + y*x;
            dp[p]++;
        }
    }
}
for(ll i =1;i<=n;i++)cout<<dp[i]<<endl;
//cout<<cnt<<endl;
return 0;

}
/*
1
8
1 7 3 4 7 6 2 9
*/


Measured memory_bytes: 11032
n = gets.to_i
a = gets.split.map(&:to_i)
ns = Array.new(n)

numcnt = 0
num = n
div = 1
while num >= 1
  div = n / num
  
  if div == 1
    ns[num-1] = a[num-1]
  else
    cnt = 0
    for i in 2..div
      if ns[num*i - 1] == 1
        cnt += 1
      end
    end
    if cnt % 2 == a[num-1]
      ns[num-1] = 0
    else
      ns[num-1] = 1
    end
  end
  numcnt += 1 if ns[num-1] == 1
  num -= 1
end

puts numcnt
for i in 0..(n-1)
  if ns[i] == 1
    print "#{i+1} "
  end
end
puts ""

Measured memory_bytes: 20492
n = gets.chomp.to_i
heights = gets.chomp.split(" ").map(&:to_i)
dp = Array.new(n, Float::INFINITY)
dp[0] = 0

n.times do |i|
  next if i==0

  dp[i] = dp[i-1] + (heights[i] - heights[i-1]).abs if dp[i-1] + (heights[i] - heights[i-1]).abs < dp[i]
  if i > 1
    dp[i] = dp[i-2] + (heights[i] - heights[i-2]).abs if dp[i-2] + (heights[i] - heights[i-2]).abs < dp[i]
  end
end

p dp.last

Measured memory_bytes: 9228
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int lli;

int main(){
    while(1){
        lli n,a,b;
        cin >> n >> a >> b;
        if(n == 0) break;

        vector<bool> table(n+1, false);
        table[0] = true;
        int ans = 0;
        for(int i=0; i<=n; i++){
            if(!table[i]){
                ans++;
                continue;
            }
            if(i+a <= n) table[i+a] = true;
            if(i+b <= n) table[i+b] = true;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3196
#include<iostream>
using namespace std; 
int main(){
    int W,H,x,y,r;
    cin>>W>>H>>x>>y>>r;
    if(x+r<=W){
        if(y+r<=H){
            if(x-r>=0){
                if(y-r>=0){
                    cout<<"Yes"<<endl;
                }else{
                    cout<<"No"<<endl;
                }
            }else{
                cout<<"No"<<endl;
            }
        }else{
                cout<<"No"<<endl;
        }       
    }else{
            cout<<"No"<<endl;
    }
    return 0;    
}



Measured memory_bytes: 3092
#include<bits/stdc++.h>
 #define int long long
using namespace std;
bool isPal(string s){
    string t = s;
    reverse(t.begin(),t.end());

    return (s == t);

}
 main()
{
    string ar;
    cin>>ar;
    int n=  ar.size();
    ar = '#' + ar;
    int firstind = (n-1)/2;
    int secind = (n + 3)/2;
    string second = "",third = "";
    for(int i = 1; i<=firstind; i++)
        second+=ar[i];
    for(int i = secind; i<=n; i++)
        third+=ar[i];
    ar+='#';
    if(isPal(ar) && isPal(second) && isPal(third))cout<<"Yes\n";
    else cout<<"No\n";



    return 0;
}



Measured memory_bytes: 256
// #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define N 1000000007
#define N2 998244353
#define Nmax 100001
#define INF (ll)1e18
#define pll pair<ll,ll>
#define pii pair<ll,ll>
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(ll i=m;i<(n);i++)
#define repr(i,n) repr2(i,n,0)
#define repr2(i,m,n) for(ll i=m;i>=(n);i--)
#define get(n) ll (n); scanf("%lld",&(n));
#define get2(n,k) ll (n),(k); scanf("%lld%lld",&(n),&(k));
#define get3(n,m,k) ll (n),(m),(k); scanf("%lld%lld%lld",&(n),&(m),&(k));
#define gets(s) string (s); cin >> (s);
#define ALL(c) (c).begin(),(c).end()
#define fill_nums(A,n) vector<ll> A((n)); for(ll i=0;i<n;i++) scanf("%lld",&A[i]);
#define fill_edges(adj,m) for(ll i=0;i<m;i++) {ll a, b; scanf("%lld %lld",&a,&b); adj[a-1].pb(b-1); adj[b-1].pb(a-1);}
#define fill_direct(adj,m) for(ll i=0;i<m;i++) {ll a, b; scanf("%lld %lld",&a,&b); adj[a-1].pb(b-1);}
#define pi 3.1415926535897

int main() {

    get(n);
    gets(s);

    s.insert(0,1,'<');

    vector<vector<ll>> dp(n+1, vector<ll>(n+1,0));
    vector<vector<ll>> dp2 = dp;

    dp[n][0]=1;
    dp2[n][0]=1;

    repr(i,n-1) {
        ll nums = n-i;
        rep(j,nums+1) {
            if(s[i]=='<') {
                dp[i][j] = ((dp[i][j] + (j-1>=0 ? dp[i+1][j-1] : 0))%N+N)%N;
            }
            else {
                ll sm = nums - j;
                dp[i][j] = ((dp[i][j] + (nums-1>=0 ? dp[i+1][nums-1] : 0) - (j-1>=0 ? dp[i+1][j-1] : 0))%N+N)%N;
            }
            dp2[i][j] = dp[i][j];
        }

        rep2(j,1,n+1) {
            dp[i][j] = (dp[i][j] + dp[i][j-1])%N;
        }
    }

    printf("%lld\n", dp2[0][n]);

    return 0;  
}

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

#define REP(i ,n) for(int i=0 ;i < n; i++)
#define REPB(i ,n) for(int i=n; i >= 0; i--)
#define FOR(i ,m ,n) for(int i=m; i < n; i++)
#define FORB(i, m, n) for(int i=m; i>= n; i--)
#define ll long long
#define pb push_back
#define popb pop_back
using namespace std;

int main(){
    int a;
    string s;
    cin >> a >> s;

    if(a >= 3200) cout << s << endl;
    else cout << "red" << endl;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int ans = 0;
  for (int i = a; i <= b; i++) {
    string t = to_string(i);
    if (t.at(0) == t.at(4) && t.at(1) == t.at(3)) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3676
#include <iostream>
using namespace std;

int main(){
	int a,b,c;
	
	cin >> a >> b >> c;

	if (a <= b && b <= c)
		cout << a << " " << b << " " << c << endl;
	else if (b <= a && a <= c)
		cout << b << " " << a << " " << c << endl;
	else if (a <= c && c <= b)
		cout << a << " " << c << " " << b << endl;
	else if (c <= a && a <= b)
		cout << c << " " << a << " " << b << endl;
	else if (b <= c && c <= a)
		cout << b << " " << c << " " << a << endl;
	else
		cout << c << " " << b << " " << a << endl;

	return 0;
}

Measured memory_bytes: 1168
def call( n )
  s = ""
  
  (1..n).each do |i|
    if i % 3 == 0
      s << " #{i}"
      next
    end
      
    x = i
    while x > 0
      if x % 10 == 3
        s << " #{i}"
        break
      end
      x /= 10
    end
  end

  s << "\n"

  return s
end

n = gets.to_i
print call n

Measured memory_bytes: 8816
N, M, X = map(int, input().split())
A = []
C = []
for i in range(N):
    tmp = list(map(int, input().split()))
    C.append(tmp[0])
    A.append(tmp[1:])

INF = float('INF')
min_cost = INF


def dfs(i, cost, learn):
    if i == N:
        if min(learn) >= X:
            return cost
        else:
            return INF
    else:
        new_learn = [x + y for (x, y) in zip(A[i], learn)]
        cost = min(dfs(i + 1, cost, learn), dfs(i + 1, cost + C[i], new_learn))
        return cost


min_cost = dfs(0, 0, [0] * M)

if min_cost == INF:
    print(-1)
else:
    print(min_cost)


Measured memory_bytes: 9208
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
4
1 2 2 4
2 1 4
3 0
4 1 3

output:
1 0
2 1
3 2
4 1
"""

import sys
from collections import deque

UNVISITED, VISITED_IN_QUEUE, POPPED_OUT = 0, 1, 2


def graph_bfs(v_init):
    queue = deque()
    visited[v_init] = VISITED_IN_QUEUE
    distance[v_init] = 0
    queue.appendleft(v_init)

    while queue:
        current = queue.popleft()
        for adj in adj_table[current]:
            if visited[adj] is UNVISITED:
                visited[adj] = VISITED_IN_QUEUE
                distance[adj] = distance[current] + 1
                queue.append(adj)
        visited[current] = POPPED_OUT
    return None


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    v_num = int(_input[0])
    vertices = map(lambda x: x.split(), _input[1:])

    visited = [UNVISITED] * (v_num + 1)
    distance = [-1] * (v_num + 1)

    adj_table = tuple([] for _ in range(v_num + 1))
    for v_info in vertices:
        v_index, adj_num, *adj_list = map(int, v_info)
        # assert len(adj_list) == adj_num
        adj_table[v_index].extend(adj_list)

    graph_bfs(v_init=1)
    for index, v in enumerate(distance[1:], 1):
        print(index, v)

Measured memory_bytes: 8004
#include<iostream>
#include<string>
using namespace std;
string s;
bool c=false,f=false;
int main(){
	cin>>s;
	for(register int i=0;i<s.size();i++){
		if(s[i]=='C')c=true;
		if(s[i]=='F'&&c==true)f=true;
	}
	if(c && f)cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
N=int(input())
h=[int(i) for i in input().split()]

cost=[0]
for i in range(1,N):
    if i!=1: 
        cost.append(min(cost[i-1]+abs(h[i]-h[i-1]), cost[i-2]+abs(h[i]-h[i-2])))
    else:
        cost.append(cost[i-1]+abs(h[i]-h[i-1]))
print(cost.pop()) 

Measured memory_bytes: 55360
import sys

input = sys.stdin.readline

def calc(n):
    if n%2 == 0:
        return n//2
    else:
        return n*3 + 1
        
def main():
    ans = 1
    s = int(input())
    l = [s]
    while True:
        temp = calc(l[ans-1])
        ans += 1
        if temp in l:
            break
        else:
            l.append(temp)
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>

#define REP(i,a,n) for(int i=a;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define vsort(v) sort(v.begin(),v.end())
#define asort(a,n) sort(a, a + n)
#define vi vector<int>
#define vd vector<double>

//ここからAtCoder向けdefine
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vi vec(n);
    rep(i, n){
        cin >> vec[i];
    }
    int min = 100000000;
    int cnt;
    rep(i, n){
        cnt = 0;
        while(true){
            if(vec[i] % 2 != 0){
                break;
            }
            vec[i] /= 2;
            cnt++;
        }
        if(min > cnt) min = cnt;
    }
    cout << min << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long double X[200100];
int N;
long long Count(long double len)
{
  long long Ans=0;
  for(int i=0;i<N;i++)
  {
    //Ans+=(long long)(X[i]/len);//解答引っ張ってきた人の条件。なぜか通る
    Ans+= ceil(X[i]/len)-1;//多少遅くなるがこっちが正解
  }
  return Ans;
}

int main()
	{
	  long long K;
	  cin>>N>>K;
	  for(int i=0;i<N;i++)
	{
		cin>>X[i];
		//X[i]-=0.1;
	}

  long double l=1,r=1e9;
  //while(l<r-0.1)//解答を引っ張ってきた人の条件。なぜかOKだったが、lとｒの整数部が異なる状態でループを出ると問題になるはず
	for(int i=0;i<35;i++)//OK log2(10^9)=30.二分探索だとこのやり方安定する。ただし、浮動小数のせいか34以上でないと通らず。
  //while(!((ceil(r)-ceil(l)) == 0))//NG:左端が初期値0のままだと、右端のceilは0にならず、無限ループ
	//while(!((floor(r)-floor(l)) == 0))//OK:右端がぴったり整数にならなければ成立.(あまりよくない)
  {
    long double mid=(l+r)/2;
    if(Count(mid)<=K) r=mid;
    else	l=mid;
  }
  cout<<(long long)(l+0.999)<<endl;
  return 0;
}


Measured memory_bytes: 6756
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextLine();
		String str = sc.nextLine(),temp;
		int swaps = 0, mini;
		String[] A = str.split(" ");
		for(int i=0; i<=A.length-1; i++) {
			mini = i;
			for(int j=i; j<=A.length-1; j++) {
				if(Integer.valueOf(A[j]) < Integer.valueOf(A[mini])) {
					mini = j;
				}
			}
			if(i!=mini) {
				temp = A[i];
				A[i]=A[mini];
				A[mini]=temp;
				swaps++;
			}
		}
		for(int i=0;i<A.length-1;i++) {
			System.out.print(A[i]+" ");
		}
		System.out.println(A[A.length-1]+"\n"+swaps);
	}

}



Measured memory_bytes: 27400
#include <iostream>
#include <vector>

using namespace std;

int N;
int M;
vector<int> A[300];

int ans;

int main()
{
	cin >> N >> M;
	for (int i = 0; i < N; i++){
		A[i] = vector<int>(M);
		for (int j = 0; j < M; j++){
			cin >> A[i][j];
		}
	}
	
	int minmax = N;
	while (!A[0].empty()){
		vector<int> count = vector<int>(M, 0);
		
		for (int i = 0; i < N; i++){
			count[A[i][0] - 1]++;
		}
		
		int maxA = A[0][0];
		for (int i = 0; i < M; i++){
			if (count[i] > count[maxA - 1]){
				maxA = i + 1;
			}
		}
		
		if (count[maxA - 1] < minmax){
			minmax = count[maxA - 1];
		}
		
		for (int i = 0; i < N; i++){
			for (int j = 0; j < M; j++){
				if (A[i][j] == maxA){
					A[i].erase(A[i].begin() + j);
					break;
				}
			}
		}
	}
	
	ans = minmax;
	
	cout << ans << endl;
	
	return 0;
}


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

#define int long long
#define rep(i,a,n) for(int i = a; i < n; i++)
#define pb push_back
#define eb emplace_back
#define dump(x) cout << #x << " = " << (x) << endl
#define chk() cout << "now" << endl;
#define SORT(c) sort((c).begin(), (c).end())
#define SORTG(c) sort((c).begin(), (c).end(), greater<int>());
#define fi first
#define se second
  
typedef pair<int,int> P;
typedef vector<int> vi;

bool pairCompare(const P& firstElof, const P& secondElof) {
    return firstElof.fi > secondElof.fi;
}

int N, M;
vector<P> D;

signed main() {
    cin >> N >> M;
    rep(i, 0, N) {
        int a;
        cin >> a;
        D.pb(make_pair(a, 1));
    }
    rep(i, 0, M) {
        int b, c;
        cin >> b >> c;
        D.pb(make_pair(c, b));
    }

    sort(D.begin(), D.end(), pairCompare);
    int sum = 0, i = 0;
    while(N > 0) {
        if(D[i].se < N) {
            sum += D[i].se * D[i].fi;
            N -= D[i].se;
            i++;
         }else{
            sum += N * D[i].fi;
            break;
         }
     }
     cout << sum << endl;
     return 0;
}



Measured memory_bytes: 6256
using System;

namespace MyProgram{
    class AtCoder{
        static void Main(string[] args){
            int N = int.Parse(Console.ReadLine());
            int[] v = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
            Array.Sort(v);
            double value = v[0];
            for(var i=1;i<N;i++){
                value = (v[i]+value)/2;
            }
            Console.WriteLine(value);
        }
    }
}

Measured memory_bytes: 11220
N = int(input())

MMM = map(int,input().split())
MM =list(MMM)
mini = 2020202020
list1 = []
total = 0
for i in MM:
  total+=i
  list1.append(total)
for i in list1:
  x = abs(total - 2*i)
  if mini > x:
    mini = x
print(mini)

Measured memory_bytes: 31476
#include<iostream>
#include<string>
using namespace std;

int main(){
  string S;
  cin >> S;
  size_t size=S.length();
  bool t=true;
  for(int i=0;i<size;i++){
    if((i%2==0 && S[i]=='L') || (i%2==1 && S[i]=='R'))t=false;
  }
  if(!t)cout << "No" << endl;
  else cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    vector<int> abc(3);
    for (int i = 0; i < 3; i++) {
        cin >> abc[i];
    }

    sort(abc.begin(), abc.end(), greater<int>());

    int k;
    cin >> k;

    for (int i = 0; i < k; i++) {
        abc[0] *= 2;
    }

    int res = 0;
    for (int i = 0; i < 3; i++) {
        res += abc[i];
    }

    cout << res << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define FAST {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pll pair<ll,ll>
#define LB lower_bound
#define UB upper_bound
#define endl "\n"
using namespace std;

int main()
{
    FAST
    ll d,t,s;cin>>d>>t>>s;
    if(t*s>=d) cout<<"Yes";
    else cout<<"No";
}


Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <numeric>

int main()
{
	int n;
	std::cin >> n;
	std::vector<int> input(n);
	
	for (int i = 0; i < n; ++i)
	{
		std::cin >> input[i];
	}
	
	std::reverse(input.begin(), input.end());
	
	size_t size = input.size();

	std::cout << input[0];;
	for (size_t i = 1; i < size; ++i)
	{
		std::cout << " " << input[i];;
	}
	std::cout << std::endl;;
	return 0;
}


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

using namespace std;

#define loop(i, n) for(int i = 0;i < int(n);i++)
#define rloop(i, n) for(int i = int(n);i >= 0;i--)
#define range(i, a, b) for(int i = int(a);i <= int(b);i++)
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1, v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1, v2, v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1, v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1, v2, v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define endl '\n'

typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
typedef long long ll;
typedef pair<int, int> pii;

const int N = 1e5 + 5;
int dis[N];
set<int> adj[3][N];
vi radj[3][N];
int n, m;

void Remove(int u, int i) {
    for (auto nxt : radj[i][u]) {
        adj[i][nxt].erase(u);
    }
}


int main() {

#ifndef ONLINE_JUDGE
//    freopen("in.in", "r", stdin);
    //freopen("out.in", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int a, b, s, t;
    cin >> n >> m;
    loop(i, m) {
        cin >> a >> b;
        loop(j, 3) {
            adj[j][a].insert(b);
            radj[j][b].pb(a);
        }
    }

    cin >> s >> t;
    memset(dis, -1, sizeof dis);
    dis[s] = 0;
    queue<int> q;
    q.push(s);
    Remove(s, 2);

    int tmp;
    while (!q.empty()) {
        int u = q.front();
        q.pop();
        for (auto it0 = adj[0][u].begin(); it0 != adj[0][u].end();) {
            for (auto it1 = adj[1][*it0].begin(); it1 != adj[1][*it0].end();) {
                for (auto it2 = adj[2][*it1].begin(); it2 != adj[2][*it1].end();) {
                    dis[*it2] = dis[u] + 1;
                    q.push(*it2);
                    tmp = *it2;
                    it2++;
                    Remove(tmp, 2);
                }
                tmp = *it1;
                it1++;
                Remove(tmp, 1);
            }
            tmp = *it0;
            it0++;
            Remove(tmp, 0);
        }
    }

    cout << dis[t] << endl;

    return 0;
}


Measured memory_bytes: 45184
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int  long long int
#define pb push_back
#define fe first
#define se second
#define endl "\n"
#define pii pair<int, int>
#define vi vector<int> 
#define vvi vector<vi>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORR(i,a,b) for(int i=a;i>=b;i--)
#define ALL(c) (c).begin(),()c.end() 

#define PI 3.14159265358979323846
const int N = 3e5 + 10;
const int INF=2e9;

int MOD=1e9+7;

void solve() {
    int n,tot=0;
    cin>>n;
    vi v(n);
    
    for(int i=0;i<n;i++)
        cin>>v[i];
        
    for(int i=0;i<n;i++) {
		   int cnt=0;
		    for(int j=0;j<i;j++) {
				   if(v[j]>v[i]){
				      cnt++;
				      break;
				   }
				}
				if(cnt==0)
				   tot++;		    
		}
		
		
		cout<<tot<<endl;  
        
	
	}  

int32_t main() {
  cool;
  int t = 1;
  while (t--)
	solve();

  return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);

  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int max=0;
  int ans=0;
  for(int i=0;i<N;i++)
    if(max<=vec.at(i)){
      max=vec.at(i);
      ans++;
    }
  cout<<ans<<endl;

}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;

class Program
{
	private static int h, w;
	private static char[][] m = new char[100][];
	private static int[] dx = new[] {0, 1, 0, -1, 1, 1, -1, -1};
	private static int[] dy = new[] {1, 0, -1, 0, 1, -1, 1, -1};
	public static int Main()
	{
		Scanner cin = new Scanner();
		while (true)
		{
			h = cin.nextInt();
			w = cin.nextInt();
			if (h == 0 || w == 0)
			{
				break;
			}
			int ans = 0;
			for (int i = 0; i < h; i++)
			{
				m[i] = cin.next().ToCharArray();
			}
			for (int i = 0; i < h; i++)
			{
				for (int j = 0; j < w; j++)
				{
					if (m[i][j] != '.')
					{
						dfs(i, j, m[i][j]);
						ans++;
					}
				}
			}
			Console.WriteLine(ans);
		}
		return 0;
	}

	public static void dfs(int x, int y, char nowchar)
	{
		m[x][y] = '.';
		for (int i = 0; i < 4; i++)
		{
			if (x + dx[i] < 0 || y + dy[i] < 0 || x + dx[i] == h || y + dy[i] == w || nowchar != m[x + dx[i]][y + dy[i]])
			{
				continue;
			}
			dfs(x + dx[i], y + dy[i], nowchar);
		}
	}
}

class Scanner {
	string[] s;
	int i;

	char[] cs = new char[] { ' ' };

	public Scanner() {
		s = new string[0];
		i = 0;
	}

	public string next() {
		if (i < s.Length) return s[i++];
		do {
			s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
		} while ((s.Length == 1 && s[0] == "") || s.Length == 0);
		i = 0;
		return s[i++];
	}

	public int nextInt() {
		return int.Parse(next());
	}

	public long nextLong() {
		return long.Parse(next());
	}

	public double nextDouble() {
		return double.Parse(next());
	}

}

Measured memory_bytes: 6172
N,M=map(int,input().split())
lis = [None]*N
for i in range(N):
    lis[i] = list(map(int,input().split()))
lis2=sorted(lis)
money=0
number = 0
i=0
while True:
    if number+lis2[i][1]<M:
        number+=lis2[i][1]
        money+=lis2[i][0]*lis2[i][1]
        i+=1
    elif number+lis2[i][1] == M:
        money+=lis2[i][0]*lis2[i][1]
        break
    else:
        temp = M-number
        money+=lis2[i][0]*temp
        break
print(money)


Measured memory_bytes: 28656
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            int cntlessa = 0;
            int cnteven = 0;
            int cntmoreb = 0;
            for (int i = 0; i < n; i++) {
                if (p[i] <= a) {
                    cntlessa++;
                } else if ((a + 1) <= p[i] && p[i] <= b) {
                    cnteven++;
                } else {
                    cntmoreb++;
                }
            }

            // 出力
            out.println(Math.min(cntlessa, Math.min(cnteven, cntmoreb)));

        }

    }
}



Measured memory_bytes: 23764
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    ans = float(0)
    for n in range(N):
        x, u = sl()
        if u == 'JPY':
            ans += float(x)
        else:
            ans += float(x) * 380000.0
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int x, y, flag;

int main() {
    string r,g,b;
    cin >> r >> g >> b;
    string s = r + g + b;
    if(stoi(s)%4==0)
        cout << "YES" << endl;
    else
        cout << "NO" <<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

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

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

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


template <typename T>
T amarinasi(T a,T b){
    if(a%b==0)
{
    return a/b;
}
else if(a%b>0)
{
    return a/b+1;
}
else
{
    return a/b-1;
}
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

//----------------------------------------------------------------

int main(){
string s,t;
cin>>s>>t;
s=s+s;
bool flag=false;
for(int i=0;i<s.size()/2;i++){
    if(s.substr(i,s.size()/2)==t){
        flag=true;
    }
}
if(flag){
    cout<<"Yes"<<endl;
}else{
    cout<<"No"<<endl;
}
}












Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    Double X=sc.nextDouble();
    Double N=100.0;
    long S=0;
    while(true){
      if(N>=X){
         break;
      }
        S++;
        N=N*1.01;
        if(!(N%1==0)){
          N=N-N%1;
        }
    }

      System.out.println(S);




  }
}


Measured memory_bytes: 37700
kr :: [Int] -> (Int, Int) -> Int
kr [h] x = fst x
kr (h:hs) x = if h >= head hs then kr hs (max (fst x) (snd x + 1), snd x + 1) else kr hs (fst x, 0)

main = do
    _ <- getLine 
    h <- map read . words <$> getLine :: IO [Int]
    print $ kr h (0,0)


Measured memory_bytes: 36220
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve() {
		int n = ni(), m = ni();
		int ans = n * (n - 1) / 2 + m * (m - 1) / 2;
		out.println(ans);
	}

	void run() throws Exception {
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if (!INPUT.isEmpty())
			tr(System.currentTimeMillis() - s + "ms");
	}

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private static void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

Measured memory_bytes: 22612
#include <stdio.h>
int main(){
  long long int a,b;
  int x,y;
  scanf("%lld %lld",&a,&b);
  if(a>0 && b>0)printf("Positive\n");
  else if(a<0 && b>0)printf("Zero\n");
  else if(a==0 || b==0)printf("Zero\n");
  else if(a<0 && b<0){
    
    if((b-a+1)%2==1)printf("Negative\n");
    else printf("Positive\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <map>
#define FOR(i,b) for(int i = 0; i < (b); i++)
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string str[3];
	FOR(i, 3)cin >> str[i];
	cout << str[0][0] << str[1][1] << str[2][2];
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> a(100010);
	for (int i = 0; i < N; ++i) {
		int x, y;
		cin >> x >> y;
		++a[x-1];
		--a[y];
	}
	int c = 0;
	int r = 0;
	for (int i = 1; i < a.size(); ++i) {
		c += a[i];
		if (c >= i) {
			r = i;
		}
	}
	cout << r << endl;
}


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

int main() {
  int n,count;
  count=0;
  cin>>n;
  vector<string>vec(n);
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    vec.at(i)=s;
  }
  sort(vec.begin(),vec.end());
  vector<int>a(n);
  a.at(0)=0;
  for(int i=1;i<n;i++){
    if(vec.at(i-1)==vec.at(i))count++;
    else count=0;
    a.at(i)=count;
  }
  vector<int>b(n);
  for(int i=0;i<n;i++){
    b.at(i)=a.at(i);
  }
  sort(b.begin(),b.end());
  for(int i=0;i<n;i++){
    if(a.at(i)==b.at(n-1)){
      cout<<vec.at(i)<<endl;
    }
  }
}


Measured memory_bytes: 17280
from enum import Enum
import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


class Type(Enum):
    win_Taro = 0
    win_Hanako = 1
    EVEN = 2

def comp_str(A,B):
    if A > B:
        return Type.win_Taro
    elif A < B:
        return Type.win_Hanako
    else:
        return Type.EVEN

N = int(input())

point_Taro = 0
point_Hanako = 0

for loop in range(N):
    line = str(input()).split()
    ret_type = comp_str(line[0],line[1])
    if ret_type == Type.win_Taro:
        point_Taro += 3
    elif ret_type == Type.win_Hanako:
        point_Hanako += 3
    else:
        point_Taro += 1
        point_Hanako += 1

print("%d %d"%(point_Taro,point_Hanako))



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

void counter(char a, char b, char c, int &count){
	// if(strcmp(a, b) and strcmp(b,c)){
	if(a==b and b==c){
		return;
	}else if(a==b or b==c or c==a){
		count++;
		return;
	}else{
		count += 2;
		return;
	}
}

int main(){
	int n;
	std::string a, b, c;
	std::cin >> n >> a >> b >> c;
	int count = 0;
	for(int i=0; i<n; i++){
		counter(a[i], b[i], c[i], count);

	}
	std::cout << count << std::endl;
	return 0;
}


Measured memory_bytes: 256
sa = input()
sb = input()
sc = input()

p = {'a': sa, 'b': sb, 'c': sc}
np = 'a'

while True:
    cards = p[np]

    # 終了は空じゃなくて、空からカードをさらにだそうとした時
    if len(cards) == 0:
        print(np.upper())
        exit()

    x = cards[0]
    p[np] = cards[1:]
    np = x

Measured memory_bytes: 3060
n = gets.to_i
m = n - 1
word = []
ans = "Yes"
n.times do |i|
  word[i] = gets.chomp
end
m.times do |i|
  w  = word[i]
  x = word[i+1]
  i.times do |j|
    if word[j] == x
      ans = "No"
    end
  end
  if w[-1] != x[0]
    ans = "No"
  end
  
  end
  puts ans



Measured memory_bytes: 1788
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

int main(void) {
    char S[4];

    scanf("%s", S);
    S[3] = '\0';

    if( strcmp(S, "RRR") == 0 ) {
        printf("3\n");
    }
    else if( strcmp(S, "RRS") == 0 ) {
        printf("2\n");
    }
    else if( strcmp(S, "SRR") == 0 ) {
        printf("2\n");
    }
    else if( strcmp(S, "SSS") == 0 ) {
        printf("0\n");
    }
    else {
        printf("1\n");
    }

    return 0;
}


Measured memory_bytes: 1656
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
vector<string>v;


int main(){

ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    bool prime[100012]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=100011; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=100011; i += p) 
                prime[i] = false; 
        } 
    }
	vector<int>v;
	for(int i=2;i<=100011;i++)
	{
		if(prime[i])
		v.push_back(i);
	 } 
    int t;
    cin>>t;
    for(int i=0;i<v.size();i++)
    {
    	if(v[i]>=t)
    	{
    		cout<<v[i];
    		break;
		}
	}
    
    
}

Measured memory_bytes: 512
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		char[] cstr = s.toCharArray();
		HashSet<Character> set = new HashSet<Character>();
		for(int i=0;i<cstr.length;i++){
			if(set.contains(cstr[i])){
				System.out.println("no");
				return ;
			}else{
				set.add(cstr[i]);
			}
		}
		System.out.println("yes");
	}
}


Measured memory_bytes: 20820
#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>

#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>

using namespace std;

typedef long long ll;

const ll INF = 1e18;
const int BIG = 1e9;
const int maxN = 100 * 1000 + 9;
const string FILENAME = "sample";

int a, p;

void read(){
	cin >> a >> p;
}

void solv(){
	cout << (a * 3 + p) / 2 << '\n';
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
#ifdef h4h4
	freopen((FILENAME + ".inp").c_str(), "r", stdin);
	freopen((FILENAME + ".out").c_str(), "w", stdout);
#endif

	read();
	solv();

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FORR(i,a,b) for (int i = b - 1; i >= a; --i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)

int A, B;

int main() {
  scanf("%d%d", &A, &B);
  if (A % 2 == 0 || B % 2 == 0) printf("No\n");
  else printf("Yes\n");
  return 0;
}


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

#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))

using namespace std;
using ll = long long;
using pii = pair<int, int>;

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'000'000'001;
constexpr ll LLINF = 4'000'000'000'000'000'001;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

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

vector<int> a, dp;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int n;
    cin >> n;
    a = vector<int>(n+1);
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }

    vector<vector<ll>> dp(n, vector<ll>(n)); //dp[i][j] := [a[i], a[j]]でゲームをしたときのX-Yの値
    for(int i = n-1; i >= 0; --i){
        for(int j = i; j < n; ++j){
            if((n-i-j+1) % 2 == 0){ //Fst
                dp[i][j] = -LLINF;
                if(i+1 < n)dp[i][j] = max(dp[i+1][j] + a[i], dp[i][j]);
                if(j-1 >= 0) dp[i][j] = max(dp[i][j], dp[i][j-1] + a[j]);
                if(n == 1) dp[0][0] = a[0];
            }
            else{// Snd
                dp[i][j] = LLINF;
                if(i+1 < n)dp[i][j] = min(dp[i+1][j] - a[i], dp[i][j]);
                if(j-1 >= 0) dp[i][j] = min(dp[i][j], dp[i][j-1] - a[j]);
            }
        }
    }

    cout << dp[0][n-1] << "\n";

    return 0;
}

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

using namespace std;

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

    long long ans;
    int n, m;
    cin >> n >> m;

    if (n == 1 && m == 1)
        ans = 1;
    else if (n == 1 || m == 1)
        ans = 1ll * n * m - 2;
    else if (n == 2 || m == 2)
        ans = 0;
    else
        ans = 1ll * n * m - (1ll * n * 2 + 1ll * (m - 2) * 2);

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 892
#include <iostream>
using namespace std;

int main()
{
	int N;
	cin >> N;

	int x[100];

	for(int n=0; n<N; n++){
		cin >> x[n];
	}

	int sum = 0;
	for(int n=0; n<N; n++){
		sum += x[n];
	}
	int P = sum / N;
	if(sum - P * N > (P+1) * N - sum){
		P ++;
	}

	int res = 0;
	for(int n=0; n<N; n++){
		res += (x[n] - P) * (x[n] - P);
	}

	cout << res;

	return 0;
}


Measured memory_bytes: 256
n,m=[int(x) for x in input().split()]
L=0
R=1000000
for i in range(m):
  l,r=[int(x) for x in input().split()]
  L=max(L,l)
  R=min(R,r)
ans=R-L+1
if ans<=0:
  print(0)
else:
  print(ans)

Measured memory_bytes: 9196
#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <string>
#include <tuple>
#include <random>
#include <map>
#include <queue>
#include <set>
#include <complex>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

const double eps = 1e-6;
const ll MOD = 1000000007;
const ll INF = 1e15;

int main() {
	ll N;
	cin >> N;
	vector<ll> v(N);
	for (int i = 0;i < N;i++) {
		cin >> v[i];
		v[i] -= i + 1;
	}
	sort(v.begin(), v.end());
	ll mid = v[N / 2];
	ll ans = 0;
	for (int i = 0;i < v.size();i++)
		ans += abs(v[i] - mid);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int A, B, C, D;
  cin >> A >> B >> C >> D ;
  if((A + B) > (C + D)){
    cout << "Left" << endl;
  }else if((A + B) == (C + D)){
    cout << "Balanced" << endl;
  }else{
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 768
/*********************************************************************************\
*  _________  _      _  ________  _       _       __       ________               *
* |___   ___|| |    | ||  ______|| |     | |     /  \     |  ____  |              *
*     | |    | |    | || |______ | |_____| |    / /\ \    | |____| |              *
*     | |    | |    | ||______  ||  _____  |   / /__\ \   |  __  __|              *
*     | |    | |____| | ______| || |     | |  / ______ \  | |  \ \                *
*     |_|    |________||________||_|     |_| /_/      \_\ |_|   \_\               *
*  ________       __      ________  _    __       __       ________               *
* |  ______|     /  \    |  ____  || |  / /      /  \     |  ____  |              *
* | |______     / /\ \   | |____| || |_/ /      / /\ \    | |____| |              *
* |______  |   / /__\ \  |  __  __||  __ \     / /__\ \   |  __  __|              *
*  ______| |  / ______ \ | |  \ \  | |  \ \   / ______ \  | |  \ \                *
* |________| /_/      \_\|_|   \_\ |_|   \_\ /_/      \_\ |_|   \_\               *
*                                                                                 *
*                                                                                 *
*   Department of Computer Science & Engineering                                  *
*   Student ID : 18CSE035                                                         *
*   Bangabnadhu Sheikh Mujibur Rahman Science & Technology University,Gopalgonj.  *
*                                                                                 *
\*********************************************************************************/

//Now Write to Code ___________________________

/*#include<bits/stdc++.h>
using namespace std;

int main()
{
	int i,x,cnt=0,cn=0;
	char a[100];

	cin >> a;
	x = strlen(a);

	for(i = 0; i < x; i++)
	{
		if(a[i] == '0')
		{
			cnt++;
			cn = 0;
			if(cnt == 7)
			{
				break;
			}
        }
        else
        {
        	cn++;
        	cnt = 0;
        	if(cn == 7)
        	{
        		break;
        	}
        }
	}

	if(cn == 7 || cnt == 7)
	{
		cout << "YES" << endl;
	}
     
    else
    {
        cout << "NO" << endl;
    }


	return 0;
}*/

#include<bits/stdc++.h>
using namespace std;

int main()
{
   char c;

   cin >> c;

   if(c == 'z')
   {
   	  printf("a\n");
   }
   else
   {
     printf("%c\n",c+1);
   }

   return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int p[] = new int[n];
		for(int i=0; i<n; i++) p[i] = sc.nextInt();
		int cnt=0;
		for(int i=1; i<n-1; i++) {
			if(p[i-1] < p[i] && p[i] < p[i+1] || p[i-1] > p[i] && p[i] > p[i+1]) {
				cnt++;
			}
		}
		System.out.println(cnt);
		sc.close();
	}
}


Measured memory_bytes: 35544
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
//l={1,2,3,4}
//greater<int>()
//sort(l,l+N)
//string 変数　　変数.size()で数字化


int main(void)
{
	int X, Y, N;
	cin >> X >> Y >> N;
	int x[105], y[105], a[105];
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i] >> a[i];
	}
	int xe = 0, ye = 0;
	for (int i = 0; i < N; i++) {
		if (a[i] == 1) {
			if (xe < x[i])
				xe = x[i];
		}
		if (a[i] == 2) {
			if (x[i] < X)
				X = x[i];
		}
		if (a[i] == 3) {
			if (ye < y[i])
				ye = y[i];
		}
		if (a[i] == 4) {
			if (y[i] < Y)
				Y = y[i];
		}
	}

	int ans = (Y - ye)*(X - xe);
	if (Y - ye < 0 || X - xe < 0)
		ans = 0;
	cout << ans << endl;
}

Measured memory_bytes: 256