akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
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 S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long A, long long B, long long C, std::vector<std::string> s){
  vector<ll> use[3];
  vector<ll> ABC(3);
  ABC[0]=A;ABC[1]=B;ABC[2]=C;
  REP(N){
    if(s[i]=="AB"){
      use[0].push_back(i);
      use[1].push_back(i);
    }else if(s[i]=="AC"){
      use[0].push_back(i);
      use[2].push_back(i);
    }else{
      use[1].push_back(i);
      use[2].push_back(i);
    }
  }
  string ans="";
  REP(N){
    ll x,y;
    if(s[i]=="AB"){
      x=0;
      y=1;
    }else if(s[i]=="AC"){
      x=0;
      y=2;
    }else{
      x=1;
      y=2;
    }
    if(ABC[x]>ABC[y]){
      ans+=s[i][1];
      --ABC[x];
      ++ABC[y];
    }else if(ABC[x]<ABC[y]){
      ans+=s[i][0];
      ++ABC[x];
      --ABC[y];
    }else{
      auto itrx=upper_bound(use[x].begin(),use[x].end(),i);
      auto itry=upper_bound(use[y].begin(),use[y].end(),i);
      if(itrx==use[x].end()){
        ans+=s[i][1];
        --ABC[x];
        ++ABC[y];
      }
      else if(itry==use[y].end()||*itrx<*itry){
        ans+=s[i][0];
        ++ABC[x];
        --ABC[y];
      }else{
        ans+=s[i][1];
        --ABC[x];
        ++ABC[y];
      }
    }
    if(ABC[0]<0||ABC[1]<0||ABC[2]<0){
      cout<<"No"<<endl;
      return ;
    }
    ans+='\n';
    dump(ABC);
  }
  cout<<"Yes"<<endl;
  cout<<ans;
}

int main(){
  cout<<setprecision(1000);
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    std::vector<std::string> s(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> s[i];
    }
    solve(N, A, B, C, std::move(s));
    return 0;
}


Measured memory_bytes: 8744
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {
	double r,g;
	cin>>r>>g;
	cout<<2*g-r;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3800
import java.io.*;
import java.util.*;
import java.lang.Math.*;

class Main{

    static int N;
    static int M;

    static ArrayList< ArrayList<Integer> > mData = new ArrayList< ArrayList<Integer> >(100000);

    static int[] dp = new int[100000];

    static int f(int v){
        if( dp[v] != -1 ) return dp[v];
        if( mData.get(v).isEmpty() ){
            dp[v] = 0;
            return 0;
        }      
        /*  
        if( mData.get(v).size() == 1 && f( mData.get().get(0) ) == 0 ){
            dp[v] = 1;
            return 1;
        }
        */
        int res = f( mData.get(v).get(0) );
        for(int i = 1; i < mData.get(v).size(); i++){
            res = Math.max( res, f( mData.get(v).get(i) ) );
        }
        dp[v] = res + 1;
        return res + 1;
    }

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        N = sc.nextInt();
        M = sc.nextInt();

        for(int i = 0; i < N; i++){
            mData.add( new ArrayList<Integer>() );
            dp[i] = -1;
        }

        for(int i = 0; i < M; i++){
            int a = sc.nextInt();
            int b = sc.nextInt();
        
            mData.get(a-1).add(b-1);
        }

    /*
        //ispis grafa
        for(int i = 0; i < N; i++){
            int ii = i+1;
            System.out.print("\n" + i + ":  ");
            for(int j = 0; j < mData.get(i).size(); j++){
                System.out.print( mData.get(i).get(j) + " " );
            }
        }
    */

        int res = 0;
        for(int i = 0; i < N; i++){
            res = Math.max( f(i), res );
        
        }

        System.out.println(res);
        sc.close();    
    }
}


Measured memory_bytes: 101084
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <queue> //std::priority_queue<int> que; // 4, 3, 2, 1 (defualt, less) : 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm>
#include <numeric>  // std::accumulate(m.begin(), m.end(), 0LL);
#include <functional>
#include <cassert>
#include <cctype>  // std::islower(), std::isupper(), std::tolower, std::toupper
#include <iomanip> // std::setprecision(X)
#include <limits>  //std::numeric_limits<int>::max(), min()

typedef long long ll;

int main (void) {

  int c11, c12, c13;  std::cin >> c11 >> c12 >> c13;
  int c21, c22, c23;  std::cin >> c21 >> c22 >> c23;
  int c31, c32, c33;  std::cin >> c31 >> c32 >> c33;

  int a1 = 0;
  int b1 = c11-a1;
  int b2 = c12-a1;
  int b3 = c13-a1;
  int a2 = c21-b1;
  int a3 = c31-b1;

  bool ok = true;
  if ( a1 + b1 != c11 ) ok = false;
  if ( a1 + b2 != c12 ) ok = false;
  if ( a1 + b3 != c13 ) ok = false;
  if ( a2 + b1 != c21 ) ok = false;
  if ( a2 + b2 != c22 ) ok = false;
  if ( a2 + b3 != c23 ) ok = false;
  if ( a3 + b1 != c31 ) ok = false;
  if ( a3 + b2 != c32 ) ok = false;
  if ( a3 + b3 != c33 ) ok = false;

  if ( ok ) std::cout << "Yes" << std::endl;
  else std::cout << "No" << std::endl;
  return 0;
}


Measured memory_bytes: 256
# ダブリング
 
N,K = map(int,input().split())
A = [-1] + list(map(int,input().split()))
 
D = 60
 
to = [[-1 for i in range(N+1)] for j in range(D)]
to[0] = A
 
for i in range(1,D):
    for j in range(1,N+1):
        to[i][j] = to[i-1][to[i-1][j]]
 
ans = 1
for i in range(D):
    if K>>i&1:
        ans = to[i][ans]
 
print(ans)

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

int main() {
    int a,b;
    cin >> a >> b;
    if (a == 1)
        a = 14;
    if(b==1) b=14;
    if(a>b) cout<<"Alice"<<endl;
    else if(a<b) cout<<"Bob"<<endl;
    else cout<<"Draw"<<endl;
    return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!
    val k = readLine()!!.toInt()

    // 1: Nと一致, 0: Nより真に小さい
    val dp = Array(101) { Array(4) { Array(2) { 0 } } }
    dp[0][0][1] = 1

    var ans = 0
    for (len in n.indices) {
        for (countNotZero in 0..k) {
            for (matchN in 0..1) {
                if (dp[len][countNotZero][matchN] == 0) continue

                for (nextDigit in '0'..'9') {
                    var nextMatchN = matchN
                    if (matchN == 1) {
                        if (nextDigit > n[len]) {
                            continue
                        } else if (nextDigit < n[len]) {
                            nextMatchN = 0
                        }
                    }

                    var nextCountNotZero = countNotZero
                    if (nextDigit != '0') {
                        nextCountNotZero++
                    }

                    if (nextCountNotZero <= k) {
                        dp[len + 1][nextCountNotZero][nextMatchN] += dp[len][countNotZero][matchN]
                    }
                }
            }
        }
    }
    println(dp[n.length][k][0] + dp[n.length][k][1])
}


Measured memory_bytes: 33660
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>

using namespace std;

typedef long long int ll; 
typedef pair<int,int> Pii;

int main(){
    int H,A,ans;
    cin >> H >> A;
    ans = 0;
    ans = H/A;
    if(H%A != 0){
        ans++;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rrep(i,n) for(int i=(int)(n)-1; i>=0; i--)
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define pr(a) cout << (a) << endl
#define PR(a,b) cout << (a) << " " << (b) << endl
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000001;
const ll MAXL=1000000000000000001LL;
const ll mod=1000000007;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main() {
  string s;
  bool ck=false;
  while(cin >> s) {
    if(ck) cout << endl;
    ck=true;
    char t[8][5];
    rep(i,8) {
      if(i==2) fill(t[i],t[i]+5,'=');
      else fill(t[i],t[i]+5,'*');
    }
    rep(i,5) {
      if(i>=5-s.size()) {
	int d=(int)s[i+s.size()-5]-'0';
	t[(d/5==0)?1:0][i]=' ';
	t[d%5+3][i]=' ';
      } else {
	t[1][i]=' ';
	t[3][i]=' ';
      }
    }
    rep(i,8) {
      rep(j,5) cout << t[i][j];
      cout << endl;
    }
  }
  return 0;
}


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

int main(void){
    int N; cin >> N;
    map<int, int> A; 
    for(int i = 0; i < N; i++){
        int a; cin >> a; 
        A[a] += 1;
    }
    
    int ans = 0;
    for(auto p : A){
        int p1 = p.first, p2 = p.second;
        if (p2 < p1) ans += p2;
        else ans += p2 - p1;
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 4736
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
   long long int n;
   cin>>n;
   vector<long long int> h(n);
   for(long long int i=0; i<n; i++){
     cin>>h.at(i);
   }
   long long int nmax=h.at(0);
   long long int ans=1;
   for(long long int i=1; i<n; i++){
     if(nmax<=h.at(i)){
       ans++;
       nmax=h.at(i);
     }
   }
   cout<<ans<<endl;
}

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

using namespace std;
#define int long long
const int maxn=1e3+5;
pair <int,int> a[maxn][maxn];
void merg(pair <int,int> b1,pair<int,int> b2)
{
    a[b1.first][b1.second]=b2;
    a[b2.first][b2.second]=b1;
}
void go4(int n)
{
    merg({n-4,n-4},{n-4,n-3});
    merg({n-3,n-4},{n-3,n-3});
    merg({n-4,n-2},{n-3,n-2});
    merg({n-4,n-1},{n-3,n-1});
    merg({n-2,n-2},{n-2,n-1});
    merg({n-1,n-2},{n-1,n-1});
    merg({n-2,n-4},{n-1,n-4});
    merg({n-2,n-3},{n-1,n-3});
}
void f3(int n)
{
    merg({n-1,n-1},{n-1,n-2});
    merg({n-1,n-3},{n-2,n-3});
    merg({n-3,n-3},{n-3,n-2});
    merg({n-2,n-1},{n-3,n-1});
}
void go5(int n)
{
    f3(n);
    merg({n-5,n-3},{n-4,n-3});
    merg({n-5,n-2},{n-4,n-2});
    merg({n-5,n-1},{n-4,n-1});
    merg({n-3,n-5},{n-3,n-4});
    merg({n-2,n-5},{n-2,n-4});
    merg({n-1,n-5},{n-1,n-4});
}
void f6(int n)
{
    f3(n);
    f3(n-3);
}
void go7(int n)
{
    merg({n-3,n-1},{n-3,n-2});
    merg({n-3,n-3},{n-4,n-3});
    merg({n-5,n-3},{n-5,n-2});
    merg({n-4,n-1},{n-5,n-1});
    merg({n-1,n-5},{n-2,n-5});
    merg({n-1,n-4},{n-2,n-4});
    merg({n-1,n-3},{n-2,n-3});
    merg({n-3,n-6},{n-3,n-7});
    merg({n-4,n-6},{n-4,n-7});
    merg({n-5,n-6},{n-5,n-7});
    merg({n-6,n-1},{n-7,n-1});
    merg({n-6,n-2},{n-7,n-2});
    merg({n-6,n-5},{n-6,n-4});
    merg({n-7,n-5},{n-7,n-4});
}
void go(int n)
{
    if(n==0)
    {
        return;
    }
    if(n==1 || n==2)
    {
        cout<<(-1);
        exit(0);
    }
    if(n==3)
    {
        f3(n);
        return;
    }
    if(n==6)
    {
        f6(n);
        return;
    }
    if(n==4)
    {
        go4(n);
        return;
    }
    if(n==5)
    {
        go5(n);
        return;
    }
    if(n==7)
    {
        go7(n);
        return;
    }
    if(n!=10)
    {
        go4(n);
        n-=4;
        go(n);
        return;
    }
    else
    {
        go5(n);
        n-=5;
        go(n);
        return;
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    for(int i=0;i<maxn;++i)
    {
        for(int j=0;j<maxn;++j)
        {
            a[i][j]={-1,-1};
        }
    }
    int n;
    cin>>n;
    go(n);
    for(int i=0;i<n;++i)
    {
        for(int j=0;j<n;++j)
        {
            if(a[i][j]==(pair <int,int>) make_pair(-1,-1))
            {
                cout<<'.';
            }
            else
            {
                cout<<(char) ('a'+(i+6*j+a[i][j].first+6*a[i][j].second)%26);
            }
        }
        cout<<endl;
    }
    return 0;
}


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

using namespace std;
using namespace __gnu_pbds;

#define ll          long long
#define fio         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define vi          vector<ll>
#define pp          push_pop
#define pll         pair<ll,ll>
#define in          insert
#define ini(a,n)    memset(a,n,sizeof(a))
#define ff          first
#define ss          second
#define inf         10000000000000000
#define all(p)      p.begin(), p.end()
#define que_max     priority_queue <int>
#define que_min     priority_queue <int, vi, greater<int>>
#define print(a)    for(auto i:a){cout<<i<<" ";}
#define print1(a)   for(auto i:a){cout<<i.ff<<" "<<i.ss<<endl;}

typedef tree<pll, null_type, less<pll>, rb_tree_tag, tree_order_statistics_node_update> Set;
unordered_map<ll,set<pll,greater<pll>>> g;
unordered_map<ll,ll> vis;

const ll mod = 1e9+7;

ll power(ll x,ll y,ll p){ll r=1;x=x%p;while(y>0){if(y&1)r=(r*x)%p;y=y>>1;x=(x*x)%p;}return r;}
const ll N = 2e5+10;
bool imp = false;
ll n,m,k;
ll xx1,yy1,x1,x2;
vector<vector<char>> a;
vector<vi> v,dp;
ll dx[4]={-1, +1, 0, 0};
ll dy[4]={0, 0, +1, -1};

void bfs(ll x,ll y)
{
    queue<pll> q;
    q.push({x,y});
    v[x][y] = 1;
    dp[x][y] = 0;

    while(!q.empty()){
        x = q.front().ff;
        y = q.front().ss;
        ll d = dp[x][y];
        q.pop();

        for(ll i=0;i<4;i++){

            for(ll j=1;j<=k;j++){

                ll xp = x + dx[i]*j;
                ll yp = y  + dy[i]*j;

                if(xp < 0 or xp >= n or yp < 0 or yp >= m) break;

                if(a[xp][yp] == '@')    break;

                if((d + 1) > dp[xp][yp]) break;
                dp[xp][yp] = d + 1;
                if(v[xp][yp] == -1)
                    q.push({xp,yp});
                v[xp][yp] = 1;
            }

        }

    }

}


void solve() {
    cin>>n>>m>>k;
    a.resize(n+1,vector<char>(m+1));
    cin>>xx1>>yy1>>x1>>x2;

    v.resize(n+1,vi (m+1,-1));
    dp.resize(n+1,vi (m+1,INT_MAX));

    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
            cin>>a[i][j];
    }

    bfs(xx1-1,yy1-1);

    if(v[x1-1][x2-1] == -1){
        cout<<-1<<endl;
    }
    else{
        cout<<dp[x1-1][x2-1]<<endl;
    }





}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif

    fio
    int t=1;
    if(imp) cin>>t;
    while(t--)
    {
        // cout<<"Case #"<<tc<<": ";
        g.clear();
        vis.clear();
        solve();
        // tc++;
    }

}


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

int main(){
    int c;
  	cin>>c;
    set <int> st;
    int x = c;
    while (st.count(x)==0)
    {   
        st.insert(x);
            if (x % 2 ==0){
                x =x/2;
            }else{
                x=x*3+1;
            }
    
    }
  cout<<st.size()+1<<endl;
}


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

typedef long long ll;

int main() {
    string S;
    cin >> S;
    string a[16] = {"AKIHABARA", "AKIHBARA", "AKIHABRA", "AKIHABAR", "AKIHBRA", "AKIHBAR", "AKIHBR", "AKIHABR", "KIHBR", "KIHBRA", "KIHBAR", "KIHBARA", "KIHABR", "KIHABRA", "KIHABAR", "KIHABARA"};

    for (int i = 0; i < 16; i++) {
        if (S == a[i]) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
}


Measured memory_bytes: 3648
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string str;
	while (cin >> str) {
		for (int i = 0; i < str.size(); i++) {
			if (str[i] >= 'D' && str[i] <= 'Z') {
				str[i] += 'A' - 'D';
			}
			else if (str[i] >= 'd' && str[i] <= 'z') {
				str[i] += 'a' - 'd';
			}
			else if (str[i] >= 'A' && str[i] < 'D') {
				str[i] -= 'A' - 'X';
			}
			else if (str[i] >= 'a'&&str[i] < 'd') {
				str[i] -= 'a';
				str[i] += 'd';
			}
			cout << str[i];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3136
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define REP(var, s, n) for (int var = (s); var < (n); ++var)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()

int main() {
  //
  int a, b, c;
  cin >> a >> b >> c;
  vector<vector<vector<int> > > data(
      100, vector<vector<int> >(100, vector<int>(100, -1)));
  data[a][b][c] = 0;
  REP(i, a, 100) {
    REP(j, b, 100) {
      REP(k, c, 100) {
        rep(x, 3) {
          int pi = i * (x != 0) + (i - 2) * (x == 0);
          int pj = j * (x != 1) + (j - 2) * (x == 1);
          int pk = k * (x != 2) + (k - 2) * (x == 2);
          if (pi < 0 || pj < 0 || pk < 0) continue;
          if (data[pi][pj][pk] >= 0) {
            if (data[i][j][k] >= 0) {
              data[i][j][k] = min(data[i][j][k], data[pi][pj][pk] + 1);
            } else {
              data[i][j][k] = data[pi][pj][pk] + 1;
            }
          }
        }
        rep(x, 3) {
          int pi = (i - 1) * (x != 0) + i * (x == 0);
          int pj = (j - 1) * (x != 1) + j * (x == 1);
          int pk = (k - 1) * (x != 2) + k * (x == 2);
          if (pi < 0 || pj < 0 || pk < 0) continue;
          if (data[pi][pj][pk] >= 0) {
            if (data[i][j][k] >= 0) {
              data[i][j][k] = min(data[i][j][k], data[pi][pj][pk] + 1);
            } else {
              data[i][j][k] = data[pi][pj][pk] + 1;
            }
          }
        }
      }
    }
  }
  int ans = INT_MAX;
  REP(i, a, 100) {
    if (data[i][i][i] >= 0) {
      ans = min(ans, data[i][i][i]);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5240
#include <stdio.h>
int main()
{
	int a, b;

	scanf("%d", &a);
	scanf("%d", &b);

	if (a < b)
		printf("a < b\n");
	else if (a == b)
		printf("a == b\n");
	else
		printf("a > b\n");

	return 0;
}


Measured memory_bytes: 2616
#include <stdio.h>
int main (void){

  int n = 0;
  int x[10] = {111,222,333,444,555,666,777,888,999};

  scanf("%d", &n);
  
  if(n <= x[0]){
    n = x[0];
  }else if(n > x[0] && n <= x[1]){
    n = x[1];
  }else if(n > x[1] && n <= x[2]){
    n = x[2];
  }else if(n > x[2] && n <= x[3]){
    n = x[3];
  }else if(n > x[3] && n <= x[4]){
    n = x[4];
  }else if(n > x[4] && n <= x[5]){
    n = x[5];
  }else if(n > x[5] && n <= x[6]){
    n = x[6];
  }else if(n > x[6] && n <= x[7]){
    n = x[7];
  }else if(n > x[7] && n <= x[8]){
      n = x[8];
    }
  
  printf("%d\n",n);
  return 0;
}


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

//Made with <3 by MinumCoklatPanas
typedef long long ll;
const int INF = 1e9;
const ll INFF = 1e18;
const int MAXN = 510;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const double INFD = 1E9;
const double EPS = 1e-9;

int tab[200010];
int ans[200010];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int tot = 0;
    int n;
    cin >> n;
    for (int i = 1 ; i <= n ; i++)
    {
        cin >> tab[i];
        tot ^= tab[i];
    }
    for (int i = 1 ; i <= n ; i++)
        ans[i] = tot ^ tab[i];
    for (int i = 1 ; i <= n ; i++)
    {
        if (i == n)
            cout << ans[i] << endl;
        else
            cout << ans[i] << " ";
    }
    return 0;
}

Measured memory_bytes: 5200
M = 1000000007
N = gets.to_i
S = 2.times.map { gets.chomp.chars }.transpose

if S[0][0] == S[0][1]
  ans = 3
else
  ans = 6
end

S.each_cons(2) do |(a1,a2), (b1,b2)|
  case
  when a1 == a2 && b1 == b2
    ans *= 2
  when a1 == a2 && b1 != b2
    ans *= 2
  when a1 != a2 && b1 == b2
    ans *= 1
  when a1 != a2 && b1 != b2 && a1 == b1 && a2 == b2
    ans *= 1
  else
    ans *= 3
  end
end

p ans % M


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
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;
}
double calc(double h, double m){
  double hcalc = 30*h+0.5*m;
  double mcalc = 6*m;
  return min(abs(hcalc-mcalc),360-abs(hcalc-mcalc));
}
int main() {
  cout << fixed << setprecision(10);
  int a,b,h,m;
  cin >> a >> b >> h >> m;

  double ans = a*a+b*b-2*a*b*cos(calc(h,m)/180*PI);
  cout << sqrt(ans) << endl;
}


Measured memory_bytes: 4192
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int a,b;

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  cin>>a>>b;
  int ans = 0;
  for(int i=a;i<=b;i++){
    vi digsf,digsr;
    for(int d=i;d;d/=10)digsr.pb(d%10),digsf.pb(d%10);
    reverse(all(digsr));
    if(digsr==digsf)ans++;
  }
  cout << ans << endl;


return 0;
}
///....


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

string s;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> s;
    int n = (int)s.size();
    s = '0' + s;
    if(s[1] == '0') finish(-1);
    for(int i = 0 ; i <= n ; i++)
        if(s[i] != s[n - i])
            finish(-1);
    int sum = 1;
    int root = 1;
    int cnt = 2;
    while(sum != n){
        cout << root << " " << cnt << endl;
        if(s[sum] == '1') root = cnt;
        cnt++;
        sum++;
    }
}


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

using namespace std;

using ll=long long;

vector<pair<int,int>> adj[200001];
bool vis[200001];
int ans[200001];

int main() 
{
  //ifstream cin("input.txt");

  int n,m;
  cin>>n>>m;

  for(int i=1; i<=m; i++)
  {
    int a,b;
    cin>>a>>b;
    adj[a].push_back({b,i});
    adj[b].push_back({a,i});
  }

  // cout << "here" << endl;

  vector<int> BFS={1};
  vis[1]=1;

  while(!BFS.empty())
  {
    vector<int> new_BFS;

    for(auto u:BFS)
    {
      for(auto v:adj[u])
      {
        if(!vis[v.first])
        {
          ans[v.first]=u;
          vis[v.first]=1;
          new_BFS.push_back(v.first);
        }
      }
    }

    BFS=new_BFS;
  }

  cout << "Yes" << endl;
  for(int i=2; i<=n; i++)
  {
    cout << ans[i] << endl;
  }
}

Measured memory_bytes: 15092
// AOJ 0144 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0144)
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#define rep(i,a) for(int i=0;i<(a);++i)
#define clr(a,v) memset((a),(v),sizeof(a))

typedef std::pair<int, int> P;

const int MAX_N = 100;

int n, p;
std::vector<int> G[MAX_N];
bool used[MAX_N];

int bfs( int s, int d, int tl )
{
	clr( used, false );
	std::queue<P> que;
	que.push( P( s, 1 ) );

	while( !que.empty() )
	{
		P p = que.front(); que.pop();
		int v = p.first, dep = p.second;

		if( used[v] || dep > tl )
			continue;
		if( v == d )
			return dep;

		used[v] = true;

		rep( i, G[v].size() )
		{
			int u = G[v][i];

			if( !used[u] )
				que.push( P( u, dep+1 ) );
		}
	}

	return -1;
}

int main()
{
	scanf( "%d", &n );
	rep( i, n )
	{
		int r, k;
		scanf( "%d%d", &r, &k );
		--r;

		rep( j, k )
		{
			int t;
			scanf( "%d", &t );
			G[r].push_back(t-1);
		}
	}

	scanf( "%d", &p );
	rep( i, p )
	{
		int s, d, v;
		scanf( "%d%d%d", &s, &d, &v );

		int c = bfs( s-1, d-1, v );

		if( ~c )
			printf( "%d\n", c );
		else
			puts("NA");
	}

	return 0;
}

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

int main() {
  int n, r;
  cin >> n >> r;
  if (n < 10) cout << r + 100 * (10 - n) << endl;
  else cout << r << endl;
}

Measured memory_bytes: 256
from bisect import bisect_left

n, m = map(int, input().split())
py = [tuple(map(int, input().split())) for _ in range(m)]
pym = {}
for i, (p, y) in enumerate(py):
    if p not in pym:
        pym[p] = []
    pym[p].append(y)

for p, yy in pym.items():
    yy.sort()

for (p, y) in py:
    ps = ('000000' + str(p))[-6:]
    ys = ('000000' + str(bisect_left(pym[p], y) + 1))[-6:]
    print(ps+ys)



Measured memory_bytes: 35268
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(){
  int n; cin >> n;
  while(n>1000){
    n -= 1000;
  }
  if(n<1000) cout << 1000-n <<endl;
  else cout << 0 << endl;
  return 0;
}

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

int main() {
    int N;
    int t[110000], x[110000], y[110000];
    cin >> N;
    t[0] = x[0] = y[0] = 0;  // 初期状態
    for (int i = 0; i < N; ++i) cin >> t[i+1] >> x[i+1] >> y[i+1];  // 1-index にしておく

    bool can = true;
    for (int i = 0; i < N; ++i) {
        int dt = t[i+1] - t[i];
        int dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i]);
        if (dt < dist) can = false;
        if (dist % 2 != dt % 2) can = false;  // dist と dt の偶奇は一致する必要あり！
    }

    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 4772
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    int a = 0;
    int b = 0;
    for(int i = 0; i<s.length(); i++) {
        if(s[i] == '0') a++;
        else b++;
    }
    int m =  min(a,b);
    cout << m*2 << endl;
    
}

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

int main() {
  int H, W;
  bool loop = true;
  while (loop) {
    cin >> H >> W;
    if ((H == 0) && (W == 0)) {
      loop = false;
      continue;
    }
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
	if ((i+j) % 2 == 0) {
          cout << "#";
	} else {
          cout << ".";
	}
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 1152
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

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

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

void Main()
{
    int n;cin>>n;
    vector<pair<double, double>> v(n);
    REP(i,n){
        cin>>v[i].first>>v[i].second;
    }

    VI p(n);
    REP(i,n) p[i] = i;

    double result = 0;
    int c = 0;

    do{
        c++;
        REP(i,n-1){
            result+=sqrt((v[p[i]].first-v[p[i+1]].first)*(v[p[i]].first-v[p[i+1]].first) + (v[p[i]].second-v[p[i+1]].second)*(v[p[i]].second-v[p[i+1]].second));
        }

    } while (next_permutation(ALL(p)));

    cout<<result/c<<endl;

	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 256
import sys
from io import StringIO
import unittest

class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]

def resolve():
    n,m,k=list(map(int,input().strip().split()))

    uf = UnionFind(n)

    res=[[] for i in range(n)]
    frd=[0 for i in range(n)]
    blk=[0 for i in range(n)]

    for i in range(m):
        a,b=list(map(int,input().strip().split()))
        a-=1
        b-=1
        uf.Unite(a,b)
        frd[a]+=1
        frd[b]+=1
    
    for i in range(k):
        a,b=list(map(int,input().strip().split()))
        a-=1
        b-=1
        if uf.isSameGroup(a,b):
            blk[a]+=1
            blk[b]+=1
    
    rescnt=[]

    for i in range(n):
        ri=uf.Count(i)-1-blk[i]-frd[i]
        rescnt.append(str(ri))
        ##rescnt.append(str(n-uf.size(i)-len(blk[i])))
    
    print(" ".join(rescnt))

resolve()

Measured memory_bytes: 122396
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val range = 0 to 2
  val points = for {
    i <- range
    j <- range
  } yield (i, j)
  val lines = range.map(k => points.filter(_._1 == k)) ++
    range.map(k => points.filter(_._2 == k)) :+
    points.filter { case (i, j) => i == j } :+
    points.filter { case (i, j) => i + j == range.max }
  val bingo = points.map(sc.nextInt() -> _).toMap
  val winnings = Seq.fill(sc.nextInt())(sc.nextInt()).flatMap(bingo.get)
  println(if (lines.exists(line => line.forall(winnings.contains))) "Yes" else "No")
}


Measured memory_bytes: 25424
X = list(input())
N = len(X)
NHALF = N // 2

def solve():
    nt, ns = 0, 0
    for i in range(N):
        if X[i] == 'S':
            ns += 1
        elif ns > 0:
            ns -= 1
        else:
            nt += 1
    return nt + ns


print(solve())

Measured memory_bytes: 61808
#include <bits/stdc++.h>
#include<chrono>
using namespace std;
using ll = long long;

int main() {
  string S;
  cin >> S;
  int N = S.size();
  map<char, int> A;
  bool check = true;
  for (int i = 0; i < N; i++) {
    char s = S[i];
    if (A.count(s)) {
      check = false;
      break;
    }
    else {
      A[s] = 1;
    }
  }
  if (check) {
    cout << "yes" << endl;
  }
  else {
    cout << "no" << endl;
  }
}


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;


//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

struct score{
  ll l = 0;
  ll r = 0;
  ll u = 0;
  ll d = 0;
};
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int h,w;

    cin >> h >> w;
    vector<string> board(h);
    rep(i,h) cin >> board[i];

    score s[h][w];
    rep(i,h)rep(j,w){
      s[i][j].l = 0;
      s[i][j].r = 0;
      s[i][j].u = 0;
      s[i][j].d = 0;
    }
    // left -> right
    rep(i,h){
      int cnt = 0;
      rep(j,w){
        if(board[i][j] == '.'){
          s[i][j].l = cnt;
          cnt++;
        }else{
          cnt = 0;
          s[i][j].l = 0;
        }
      }
    }
    // righ -> left
    rep(i,h){
      int cnt = 0;
      for(int j = w-1; j >= 0; j--){
        if(board[i][j] == '.'){
          s[i][j].r = cnt;
          cnt++;
        }else{
          cnt = 0;
          s[i][j].r = 0;
        }
      }
    }

    rep(j,w){
      int cnt = 0;
      rep(i,h){
        if(board[i][j] == '.'){
          s[i][j].u = cnt;
          cnt++;
        }else{
          cnt = 0;
          s[i][j].u = 0;
        }
      }
    }

    rep(j,w){
      int cnt = 0;
      for(int i = h-1; i >= 0; i--){
        if(board[i][j] == '.'){
          s[i][j].d = cnt;
          cnt++;
        }else{
          cnt = 0;
          s[i][j].d = 0;
        }
      }
    }
    ll ans = 0;
    rep(i,h)rep(j,w){
      if(board[i][j] == '.')ans = max(s[i][j].l + s[i][j].r + s[i][j].u + s[i][j].d + 1LL, ans);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 129536
/*
    Code written by Talant I.D.
*/
   
#include <bits/stdc++.h>
   
using namespace std;
   
typedef long long ll;
typedef pair <int, int> pii;
typedef tuple <int, int, int> tiii;
   
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define mod (int)1e9+7
#define eps (double)1e-9
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);
#define curMod 998244353

int main(){
		//do_not_disturb
		string s;
		cin >> s;
		
		for(int i = 0; i < s.size(); i++){
			if(!(i&1)){
				if(s[i] == 'L'){
					cout << "No\n";
					return 0;
				}
			}
			else{
				if(s[i] == 'R'){
					cout << "No\n";
					return 0;
				}
			}
		}
		
		cout << "Yes\n";
    return 0;
} // What is to be written here?


Measured memory_bytes: 256
NIL = -1
MAX = 25


class Node:
    def __init__(self):
        self.parent = NIL
        self.left = NIL
        self.right = NIL
        self.depth = NIL
        self.height = NIL
        self.sibling = NIL


T = [Node() for i in range(MAX)]


def set_height(u):
    h1 = 0
    h2 = 0
    if T[u].left != NIL:
        h1 = set_height(T[u].left) + 1
    if T[u].right != NIL:
        h2 = set_height(T[u].right) + 1
    T[u].height = max(h1, h2)
    return T[u].height


def set_depth(u, d):
    T[u].depth = d
    if T[u].left != NIL:
        set_depth(T[u].left, d + 1)
    if T[u].right != NIL:
        set_depth(T[u].right, d + 1)


if __name__ == '__main__':
    n = int(raw_input())
    for i in range(n):
        u, left, right = map(int, raw_input().split())
        if left != NIL:
            T[left].parent = u
            T[u].left = left
        if right != NIL:
            T[right].parent = u
            T[u].right = right
        if left != NIL and right != NIL:
            T[left].sibling = right
            T[right].sibling = left

    # find root
    root = 0
    for i in range(n):
        if T[i].parent == NIL:
            root = i
            break
   # print "root=", root

    set_height(root)
    set_depth(root, 0)
    for i in range(n):
        print "node %d: parent = %d, sibling = %d," % (
            i, T[i].parent, T[i].sibling),

        degree = 0
        if T[i].left != NIL:
            degree += 1
        if T[i].right != NIL:
            degree += 1
        print "degree = %d," % degree,

        print "depth = %d, height = %d," % (T[i].depth, T[i].height),

        if T[i].parent == NIL:
            print "root"
        elif T[i].left == NIL and T[i].right == NIL:
            print "leaf"
        else:
            print "internal node"


Measured memory_bytes: 4712
#include<bits/stdc++.h>
using namespace std;
#define MAX 100005
int main()
{ 
	long long n,a,b;
	long long x[MAX];
	long long ans=0;
	scanf("%lld %lld %lld",&n,&a,&b);
	for(int i=0;i<n;i++)
	{
		scanf("%lld",&x[i]);
	}
	for(int i=1;i<n;i++)
	{
		ans+=min(a*(x[i]-x[i-1]),b);
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>

int main(void)
{
	int n;
	int a[100];
	int b[100];
	int i;
	int j;
	
	scanf("%d", &n);
	for(i = 0;i < n;i++){
		scanf("%d", &a[i]);
	}
	j = n - 1;
	for(i = 0;i < n;i++){
		b[i] = a[j];
		printf("%d", b[i]);
		j--;
		if(i + 1 == n){
			printf("\n");
		}
		else {
			printf(" ");
		}
	}
	
	return (0);
}

Measured memory_bytes: 600
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

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

  std::sort(s.begin(), s.end());
  std::sort(t.begin(), t.end(), std::greater<char>());

  std::cout << (s < t ? "Yes" : "No") << std::endl;

  return 0;
}

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

using namespace std;

using ll = long long;

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

    int n, a, bf, len = 0, ans = 0;

    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        if (i == 0 || bf == a) ++len;
        else {
            ans += floor(0.5 * len);
            len = 1;
        }
        bf = a;
    }
    ans += floor(0.5 * len);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
#define REP(i, n) for(ll i=0; i<(ll)(n); i++)
#define REPD(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=a; (ll)(b)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))


int main(){
    int n;  cin >> n;
    vector<ll> a(n);
    ll sum=0, sum2=0;
    REP(i, n){
        ll x;   cin >> x;
        a.at(i) = x-(i+1);
    }
    sort(ALL(a));
    int nv, nv2=0;
    nv=a[n/2];
    if(n%2==0) nv2=a[n/2-1];

    REP(i, n){
        sum += abs(a.at(i)-nv);
        sum2 += abs(a.at(i)-nv2);
    }
    cout << min(sum, sum2) << endl;
}

Measured memory_bytes: 1792
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

int main()
{
    int n;
    cin >> n;
    int n4 = 0;
    int n2 = 0;
    vi a;
    a.resize(n);
    rep(i,n) cin >> a[i];
    rep(i,n){
        if(a[i]%4 == 0) n4++;
        else if(a[i]%2 == 0) n2++;
        else continue;
    }
    int tukaeru = n4 + n2/2;
    if(tukaeru >= n/2) puts("Yes");
    else puts("No");
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
typedef struct{
    int x;
    int y;
} P;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    ll T[1010], A[1010];
    cin >> N;
    rep(i,0,N){
        cin >> T[i] >> A[i];
    }
    ll t = T[0], a = A[0];
    rep(i,1,N){
        if(t <= T[i] && a <= A[i]){
            t = T[i];
            a = A[i];
        }else if(t > T[i] && a <= A[i]){
            ll num = (t - 1) / T[i];
            t = (num + 1) * T[i];
            a = (num + 1) * A[i];
        }else if(t <= T[i] && a > A[i]){
            ll num = (a - 1) / A[i];
            t = (num + 1) * T[i];
            a = (num + 1) * A[i];
        }else{
            ll num1 = (t - 1) / T[i];
            ll num2 = (a - 1) / A[i];
            ll num = max(num1, num2);
            t = (num + 1) * T[i];
            a = (num + 1) * A[i];
        }
    }
    print(t + a);
}


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


int main() {
    int n;
    cin >> n;
    priority_queue<int, vector<int>, greater<int> > Ap;
    priority_queue<int> Am;
    rep(i, n) {
        int a;
        scanf("%d", &a);
        if(a<0) {
            Am.push(a);
        } else {
            Ap.push(a);
        }
    }
    if(!Ap.size()) {
        Ap.push(Am.top());
        Am.pop();
    }
    if(!Am.size()) {
        Am.push(Ap.top());
        Ap.pop();
    }

    vi vecx(n-1), vecy(n-1);
    int i=0;
    while(Ap.size() != 1) {
        vecx[i] = Am.top();
        vecy[i] = Ap.top();
        Am.pop();
        Ap.pop();
        Am.push(vecx[i]-vecy[i]);
        ++i;
    }
    while(Am.size() != 1) {
        vecx[i] = Ap.top();
        vecy[i] = Am.top();
        Ap.pop();
        Am.pop();
        Ap.push(vecx[i]-vecy[i]);
        ++i;
    }
    cout << Ap.top()-Am.top() << '\n';
    rep(i, n-2) {
        cout << vecx[i] << ' ' << vecy[i] << '\n';
    }
    cout << Ap.top() << ' ' << Am.top() << '\n';
}

Measured memory_bytes: 3192
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
// #define ll int
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

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

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};



void solve(){
    string s;
    cin>>s;
    ll ans=0;
    rep(i,3){
        if(s[i]=='1')ans++;
    }
    cout<<ans<<endl;

}


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    solve();

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  long N;
  scanf("%ld",&N);
  char S;
  long sum[N];

  scanf("%c",&S);
  for(int i = 0;i < N;i++){
    sum[i] = 0;
    scanf("%c",&S);
    if(S == 'W'){
      sum[i]++;
    }
    if(i != 0){
      sum[i] += sum[i-1];
    }
  }

  long ans = N;
  //printf("%ld\n",N-1-sum[N-1]+sum[0]);
  //printf("%ld\n",sum[N-2]);
  if(ans > N-1-sum[N-1]+sum[0]){
    ans = N-1-sum[N-1]+sum[0];
  }
  if(ans > sum[N-2]){
    ans = sum[N-2];
  }
  for(int i = 1;i < N-1;i++){
    long counter = 0;
    counter = sum[i-1]+N-i-1-sum[N-1]+sum[i];
    //printf("%ld %ld\n",sum[i-1],N-i-1-sum[N-1]+sum[i]);

    if(ans > counter){
      ans = counter;
    }
  }

  printf("%ld\n",ans);
  return 0;
}

Measured memory_bytes: 2560
n = int(input())
arr = [ [ [0]*10 for j in range(3) ] for i in range(4) ]
i = 0
while i < n:
    a, b, c, d = map(int,input().split())
    arr[a-1][b-1][c-1] += d
    i += 1
for i in range(4):
    if i > 0:
        print('#'*20)
    for j in range(3):
        print('', *arr[i][j])


Measured memory_bytes: 5624