akhauriyash/Code-Regression huggingface dataset:
/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

int main()
{   
    

    ll n , x , y;
    cin >> n >> x >> y;

    ll dist[n+1] = {0};

    for(ll i=1 ; i<=n ;i++){
        for(ll j=i+1 ; j<=n ; j++) {
            ll d = min(j-i , abs(i-x) +1 + abs(j-y));
            dist[d]++;
        }
    }


    for(ll i=1;  i<n ; i++) {

        cout << dist[i] << endl;

    }
    
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int a,b,c,d,e;
    scanf("%d",&a);
	b=a/1000;
	c=(a%1000)/100;
	d=(a%100)/10;
	e=a%10;
	if(((b==c)&&(c==d)&&(d==b))||((e==c)&&(c==d)&&(d==e)))
	    printf("Yes");
	else 
	    printf("No");

	return 0;
	   
} 

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		
		// ??\???
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("\\r\\n");
		
		// ??????
		int count[];
		count = new int[26];
		int x = 0;
		while(scan.hasNext()) {
			String S = scan.nextLine();
			if(S.equals ("")) break;
			// ???????????????
			int sl = S.length();
			if(sl == 0000) break;
			// ?°???????????????????
			String s = S.toLowerCase();
			// 1????????\???char??????????´?
			char[] charArray = s.toCharArray();
			for (char ch : charArray) {
				int CH = ch;
				x = CH;
				// a-z?????°??????
				if(((CH-97)>=0) && ((CH-97)<26)){
					count[CH-97]++;
				}
			}
			if(x == 0000) break;
		}
		// ??????
		for (int i=0; i<26; i++) {
			int cords = i + 97;
			char c = (char)cords;
			System.out.println(c + " : " + count[i]);
		}

		
	}

}

Measured memory_bytes: 25968
#include <iostream>
#include <cstring>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <bits/stdc++.h>

using namespace std;
#define pb push_back
#define rep(x, n) for(int x = 0; x < n; x++)
#define f first
#define sc second
typedef pair<int, int> p;
typedef pair<string, p> pairs;
#define mp make_pair
int main()
{
    int n;
    cin >> n;
    vector<pairs> v;
    string restaurant;
    int score;
    for (int i = 0; i < n; i++)
    {
        string s; int a;cin>>s>>a;
        v.pb(mp(s,mp(-a, i + 1)));
    }
    sort(v.begin(), v.end());
    rep(i, n)
    {
        cout << v[i].sc.sc << " ";
    }


    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
template<typename T>
void chmax(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void chmin(T& a, T b) {
	a = min(a, b);
}

template<typename T>
void IN(vector<T> &A,int N=-1) {
	if (N == -1) {
		N = A.size();
	}
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}
}

template<typename T>
void SO(vector<T> &A,bool F=false) {
	sort(A.begin(), A.end());
	if (F) {
		reverse(A.begin(), A.end());
	}
}
//////////////

void solve() {
	int N;
	cin >> N;
	vector<int> X(N),Y(X);
	IN(X);
	Y = X;
	SO(X);

	int L = X[N / 2-1];
	int R = X[N / 2];
	for (int i = 0; i < N; ++i) {
		if (Y[i] <= L) {
			cout << R << endl;
		}
		else {
			cout << L << endl;
		}
	}
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}

Measured memory_bytes: 3840
#include "bits/stdc++.h"
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long int
#define int ll
//#define slld(t) scanf("%lld",&t)
//#define sd(t) scanf("%d",&t)
//#define pd(t) printf("%d\n",t)
//#define plld(t) printf("%lld\n",t)
#define vec vector < int >
#define vecp vector < pair < int , int > >
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define debug(x)   cerr<<#x<<": "<<x<<endl
#define pii pair < int , int >
#define pll pair < ll , ll > 
#define debug(x)   cerr<<#x<<": "<<x<<endl
#define mod  1000000007
#define N   200005
#define MAX 300005
#define mod1 1000000007
#define mod2 998244353
#define bitcnt __builtin_popcount
#define PI acos(-1)
//#define endl "\n"
 
const int inf = (int)1e18 + 10;

void mul(int& a , int b){
  a = (a*b) % mod2;
}
signed main(){
  fast;
 

  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = n , r = 0 , b = 0 , g = 0 , rb = 0 , bg = 0 , gr = 0;
  int ans = 1;
  for(int i  = 0 ; i < 3*n ; i++){
        if(s[i] == 'R'){
            if(bg  > 0)
              mul(ans , bg) , bg-- ;
            else if(b > 0)
              mul(ans , b) , b-- , rb++;
            else if(g > 0)
               mul(ans , g) , g-- , gr++;
            else
              mul(ans , a) , a-- , r++;

        }
        if(s[i] == 'B'){
            if(gr  > 0)
              mul(ans , gr)  , gr--; 
            else if(r > 0)
              mul(ans , r) , r-- , rb++;
            else if(g > 0)
               mul(ans , g) , g-- , bg++;
             else
              mul(ans , a) , a-- , b++;

        }
        if(s[i] == 'G'){
            if(rb  > 0)
             mul(ans , rb) , rb--;
            else if(r > 0)
              mul(ans , r) , r-- , gr++;
            else if(b > 0)
              mul(ans , b) , b-- , bg++;
            
             else 
              mul(ans , a) , a-- , g++;

        }
  }
  cout << ans << endl;

 
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

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

int main () {
  int n;
  cin >> n;
  string s;
  cin >> s;
  rep(i,sz(s)) {
    s[i] = (s[i]-'A'+n)%26 + 'A';
  }
  cout << s << endl;
  return 0;
}

Measured memory_bytes: 256
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    lstr = ""
    d = collections.defaultdict(int)
    for i in range(n):
        s = str(input().rstrip('\n'))
        if s not in d:
            d[s]
            if lstr == "" or lstr == s[0]:
                lstr = s[-1]
            else:
                print("No")
                exit()
        else:
            print("No")
            exit()
    print("Yes")


if __name__ == '__main__':
    slove()


Measured memory_bytes: 38640
import java.io.File;
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;

public class Main {
	
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		Scanner sc = new Scanner(System.in);
		
		StringBuilder ans = new StringBuilder();
		int sx = sc.nextInt();
		int sy = sc.nextInt();
		int tx = sc.nextInt();
		int ty = sc.nextInt();
		
		StringBuilder U = new StringBuilder();
		StringBuilder D = new StringBuilder();
		StringBuilder L = new StringBuilder();
		StringBuilder R = new StringBuilder();
		for(int i = 0; i < ty - sy; i++){
			U.append("U");
			D.append("D");
		}
		for(int i = 0; i < tx - sx; i++){
			L.append("L");
			R.append("R");
		}
		
		ans.append(U);
		ans.append(R);
		ans.append(D);
		ans.append(L);
		ans.append("L");
		ans.append(U);
		ans.append("U");
		ans.append("R");
		ans.append(R);
		ans.append("D");
		ans.append("R");
		ans.append("D");
		ans.append(D);
		ans.append(L);
		ans.append("L");
		ans.append("U");
		System.out.println(ans);
		
	}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>
#include <sstream>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) x.begin(),x.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))

int main(){ 
    ll N;
    cin >> N;
    vector<ll> A(N);
    set<ll> ss;

    for(ll i = 0;i < N;i++){
        cin >> A.at(i);
        ss.insert(A.at(i));
    }
    
    map<ll,ll>mpa;

    ll goukei = 0;

    for(auto x:ss)
        mpa[x] = 0;

    for(ll i = 0;i < N;i++)
        mpa[A.at(i)]++;
    
    ll ans = 0;

    for(auto x:ss){
        goukei += mpa[x] * (mpa[x] - 1) / 2;
    }

    for(ll i = 0;i < N;i++){
        ll sub = mpa[A.at(i)] - 1; 
        cout << goukei - sub << endl;
    }
    

    
    
}

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

#define MAXN 110000
ll n,m;
vector<vector<int>>edges(MAXN, vector<int>());

ll dp1[MAXN];
void dfs1(int x, int p=-1){
  dp1[x]=1;
  for(auto c:edges[x]){
    if(c==p)continue;
    dfs1(c,x);
    dp1[x] *= dp1[c];
    dp1[x] %= m;
  }
  dp1[x]++;
}

ll dp2[MAXN];
void dfs2(int x, int p=-1){
  if(p==-1)dp2[x]=1;
  int ec=edges[x].size();

  ll pr = 1;

  vector<ll> lprod;
  rep(i, ec){
    int c = edges[x][i];

    if(c==p){
      lprod.push_back(pr);
      continue;
    }
    pr *= dp1[c];
    pr %= m;
    lprod.push_back(pr);
  }


  pr = 1;
  vector<ll> rprod;
  rrep(i, ec){
    int c = edges[x][i];

    if(c==p){
      rprod.push_back(pr);
      continue;
    }

    pr *= dp1[c];
    pr %= m;
    rprod.push_back(pr);

  }
  reverse(rprod.begin(), rprod.end());

//for(auto c: lprod)cout<<c<<' ';cout<<endl;
//for(auto c: rprod)cout<<c<<' ';cout<<endl;

  rep(i, ec){
    int c = edges[x][i];
    if(c==p)continue;
    dp2[c] = dp2[x];
    if(i)dp2[c] *= lprod[i-1];
    dp2[c]%=m;
    if(i<ec-1)dp2[c] *= rprod[i+1];
    dp2[c]++;
    dp2[c]%=m;
    dfs2(c, x);
  }
}

ll ans[MAXN];
void dfs3(int now, int p=-1){
  ans[now] = dp2[now];
  for(auto c:edges[now]){
    if(c==p)continue;
    ans[now] *= dp1[c];
    ans[now] %= m;
    dfs3(c, now);
  }
}

int main(){
  cin>>n>>m;
  rep(i, n-1){
    int x,y;cin>>x>>y;x--,y--;
    edges[x].push_back(y);
    edges[y].push_back(x);
  }

  dfs1(0);
  dfs2(0);
  dfs3(0);
 
  rep(i, n)cout<<ans[i]<<endl;

  return 0;

  rep(i, n)cout<<dp1[i]<<' ';cout<<endl;
  rep(i, n)cout<<dp2[i]<<' ';cout<<endl;

  return 0;
}

Measured memory_bytes: 27100
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }


struct Edge {
    ll to;
    ll weight;
    Edge(ll t, ll w) : to(t), weight(w) { }
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, ll>;


typedef vector<vector<int> > Matrix;

const int INF = 100000000;
Matrix d;

void warshall_floyd(int n) { // nは頂点数
    for (int i = 0; i < n; i++)      // 経由する頂点
        for (int j = 0; j < n; j++)    // 開始頂点
            for (int k = 0; k < n; k++)  // 終端
                d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

ll modnum = 1e9+7;

int main() {
    string s; cin >> s;
    char prev = '_';
    int section = 0;
    rep(i, s.size()) {
        if(prev == '_') {
            prev = s[i];
            section++;
            continue;
        }
        if(prev != s[i]) section++;
        prev = s[i];
    }

    cout << section-1 << endl;

    return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <cfenv>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>

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

int main() {
    char c;
    cin >> c;

    cout << char(c+1) << endl;
}

Measured memory_bytes: 760
/*
    Author:zeke

    pass System Test!
    GET AC!!
*/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
ll MOD = 1e9 + 7;
ll INF = 1e18;
// cout << "Case #" << index << " :IMPOSSIBLE";
struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
    vector<int> tree_size;
    UnionFind(int N) : par(N),tree_size(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++){
            par[i] = i;
            tree_size[i] = 1;  //集合ごとのサイズは1と初期化しておきます
        }
    }

    int root(int x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y)
    {                     // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry)
            return;   //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
        tree_size[ry]+=tree_size[rx];
    }

    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
    int tree_size_info(int x){//xの属する集合のサイズを返す
        return tree_size[root(x)];
    }
};
/*
実装例
int main(){
    UnionFind tree(V);
    //UnionFind 構造体のインスタンス化　まず最初にこれを書いてください　Vは頂点数を入れてください(頂点数初期化)
    tree.unite(x,y);//xとyの頂点をつなげる
    tree.same(x,y);//xとyが同じグループに存在するかどうか
    tree.root(x);//xの根を返す
    tree.tree_size_info(x);//xの属するグループのサイズを返す
}
*/
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    ll n,m;
    cin>>n>>m;
    UnionFind tree(n);
    rep(i,m){
        ll a,b;
        cin>>a>>b;
        a--;b--;
        tree.unite(a,b);
    }
    set<ll> st;
    rep(i,n){
        st.insert(tree.root(i));
        //cout<<tree.root(i)<<endl;
    }
    cout<<st.size()-1<<endl;
}


Measured memory_bytes: 7816
#include "bits/stdc++.h"
    #define ALL(obj) (obj).begin(),(obj).end()
    #define RALL(obj) (obj).rbegin(),(obj).rend()
    #define REP(i, n) for(int i = 0; i < (int)(n); i++)
    #define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
    #define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++)
    using namespace std;
    typedef long long ll;
    const int MOD = 1e9 + 7;
    const int INF = 1e9 + 6;
    const ll LLINF = 4e18;
     
    int main() {
        string s, t; cin >> s >> t;
        vector<vector<int>> ind(s.size(), vector<int>(26,INF));
        ind[s.size() - 1][s[s.size() - 1]-'a'] = s.size()-1;
        for (int i = s.size() - 2; i >= 0; i--) {
            REP(j, 26) {
                if (s[i] != 'a' + j) {
                    ind[i][j] = ind[i + 1][j];
                }
                else {
                    ind[i][j] = i;
                }
            }
        }
        ll ans = 0;
        int p = 0;
        REP(i, t.size()) {
            if (ind[p][t[i]-'a'] != INF) {
                ans += ind[p][t[i] - 'a'] - p + 1;
                p = ind[p][t[i] - 'a'] + 1;
                if (p == s.size()) p = 0;
            }
            else if (ind[0][t[i]-'a'] != INF){
                ans += s.size() - p;
                i--;
                p = 0;
            }
            else {
                ans = -1;
                break;
            }
        }
        cout << ans << endl;
        getchar(); getchar();
    }

Measured memory_bytes: 13696
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;

int main()
{
	int a, b;
	scanf("%d%d",&a,&b);
	if(a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) printf("Possible\n");
	else printf("Impossible\n");
	return 0;
}

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

const int INF = 1001001001;
vector<int> to[100005];

int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  
  int mini = a * x + b * y;
  for (int i = 1; i <= 100000; i++)
  {
      /* code */
      if (2 * c * i + max(x-i, 0) * a + max(y-i, 0) * b < mini)
      {
          /* code */
          mini = 2 * c * i + max(x-i, 0) * a + max(y-i, 0) * b;
        //   cout << mini << endl;
      }
  }
  

  cout << mini << endl;
  return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define LOL cout<<'\n';
#define MOD 1000000007
#define sz(x) ((int)x.size())
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define deb(x) cout << "[" << #x << "=" << x << "]" << '\n';
#define deb2(x,y) cout << "[" << #x << "=" << x << "] [" << #y << "=" << y << "]" << '\n';
#define deb3(x,y,z) cout << "[" << #x << "=" << x << "] [" << #y << "=" << y << "] [" << #z << "=" << z << "]" << '\n';

void solve(){
	int l; cin>>l;
    ld chandler = l/3.0;
    cout<<(chandler*chandler*chandler);LOL
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
    cout<<setprecision(9)<<fixed;
  int _=1; //cin>>_;
  while(_--) solve();
  return 0;
}

Measured memory_bytes: 3652
#include<stdio.h>
#include<string.h>
int main(){
  char word[1111];
  int a,i;
  gets(word);
  a = strlen(word);
  for(i=0;i<a;i++){
    if(word[i] <= 122 && word[i] >= 97){
      word[i] -= 32;
    }
  }
  printf("%s\n",word);
  return 0;
}

Measured memory_bytes: 524
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: String = read();
    let b: String = read();

    let c: String = a + &b;
    let cn: i64 = c.parse().unwrap();

    let mut d = 1;

    while d * d <= cn {
        if d * d == cn {
            println!("Yes");
            return;
        }
        d += 1;
    }
    println!("No")
}


Measured memory_bytes: 4352
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
using namespace std;
int color[710],sum[2],ans=0x7fffffff;
int n,m,x,y;
bool f[710][710],flag[710],vis[710],flag1[710];
void Exit(){
	puts("-1");
	exit(0);
}
void dfs(int x,int co){
	color[x]=co;
	sum[color[x]]++;
	for(int i=1;i<=n;i++){
		if(i==x||f[i][x])continue;
		if(color[i]==-1)dfs(i,co^1);
		else if(color[i]==co)Exit();
	}
} 
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		f[x][y]=f[y][x]=1;
	}
	flag[0]=1;
	memset(color,-1,sizeof(color));
	color[0]=1;
	for(int i=1;i<=n;i++){
		if(color[i]!=-1)continue;
		sum[0]=sum[1]=0;
		dfs(i,0);
		memset(flag1,0,sizeof(flag1));
		for(int j=0;j<=n;j++){
			flag1[j+sum[0]]|=flag[j];
			flag1[j+sum[1]]|=flag[j];			
		}
		for(int j=0;j<=n;j++)
			flag[j]=flag1[j];
	}
	for(int i=0;i<=n;i++)
		if(flag[i])ans=min(ans,i*(i-1)/2+(n-i)*(n-i-1)/2);
	printf("%d\n",ans);
}

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

#define pb push_back
#define F first
#define S second
#define fo(i,a,b)  for(int i = a; i < b; i++)

using ll = long long;
using ld = long double;
using ul = unsigned long long;
using ii = pair<int, int>;
#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ReadFile            freopen("input.in","r",stdin)
#define WriteFile           freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;
const ld EPS = 1e-7;
double Pi=acos(-1);
const ld rad=Pi/180.0;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll nCr (ll n,ll m)
{
    return(m == 0)?1:n*nCr(n-1,m-1)/m;
}
/*****************************************************/

const int N = 103;

int n , a[N] , ans = INT_MAX;

int main()
{
    cin >> n;

    for(int i = 1; i <= n; ++i)
        cin >> a[i];

    for(int i = 1; i <= 101; ++i){
        int x = 0;
        for(int j = 1; j <= n; ++j){
            x += (a[j] - i) * (a[j] - i);
        }
    ans = min(ans , x);
    }

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	s := nextLine()

	res := strings.Split(s, " ")

	i1, _ := strconv.Atoi(res[0])
	i2, _ := strconv.Atoi(res[1])
	i3, _ := strconv.Atoi(res[2])

	arr1, arr2 := generateArray(i1, i2, i3)

	arr1 = inputArray(arr1, i1, i2)
	arr2 = inputArray(arr2, i2, i3)

	result := productMatrix(arr1, arr2, i1, i3)

	// print
	outputMatrix(result)
}

func outputMatrix(result [][]string) {
	size := len(result)

	for i := 0; i < size; i++ {
		fmt.Println(strings.Join(result[i][:], " "))
	}
}

func productMatrix(arr1, arr2 [][]int, i1, i3 int) (result [][]string) {
	// result初期化
	result = make([][]string, i1)
	for i := 0; i < i1; i++ {
		result[i] = make([]string, i3)
	}

	for i := 0; i < i1; i++ {
		for j := 0; j < i3; j++ {
			// resultを作るためのループ
			result[i][j] = strconv.Itoa(decompose(arr1[i], arr2, j))
		}
	}
	return
}

func decompose(arr1 []int, arr2 [][]int, i int) int {
	add := 0
	size := len(arr1)

	for j := 0; j < size; j++ {
		add = add + arr1[j]*arr2[j][i]
	}
	return add
}

func inputArray(arr [][]int, i1, i2 int) [][]int {
	for i := 0; i < i1; i++ {
		input := nextLine()
		ss := strings.Split(input, " ")

		for j := 0; j < i2; j++ {
			hoge, _ := strconv.Atoi(ss[j])
			arr[i][j] = hoge
		}
	}
	return arr
}

func generateArray(i1, i2, i3 int) (array1, array2 [][]int) {
	// make i1 x i2 matrix
	array1 = make([][]int, i1)
	for i := 0; i < i1; i++ {
		array1[i] = make([]int, i2)
	}

	// make i2 x i3 matrix
	array2 = make([][]int, i2)
	for i := 0; i < i2; i++ {
		array2[i] = make([]int, i3)
	}
	return
}



Measured memory_bytes: 2428
#include<stdio.h>
int main()
{	
	int a,b,c,t;
	while(scanf("%d%d%d",&a,&b,&c)!=EOF){
		if(a>b){
			t=a;a=b;b=t;
		}
		if(a>c){
			t=a;a=c;c=t;
		}
		if(b>c){
			t=b;b=c;c=t;
		}
		printf("%d\n",c-a);
	}
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int i;
	char s[19];

	scanf("%s", s);
	
	for (i = 0; i < 19; i++) {
		if (s[i] == ',')
			printf(" ");
		else
			printf("%c", s[i]);
	}

	return 0;
}

Measured memory_bytes: 128
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * 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;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        static final long MODULO = (long) (1e9 + 7);
        static int[] invs;
        static int[] facts;
        static int[] invfacts;

        static {
            int k = (int) 2e6;
            invs = new int[k + 2];
            invs[1] = 1;
            for (int i = 2; i <= k + 1; ++i) {
                invs[i] = (int) ((MODULO - (MODULO / i) * (long) invs[(int) (MODULO % i)] % MODULO) % MODULO);
            }
            facts = new int[k + 2];
            invfacts = new int[k + 2];
            facts[0] = 1;
            invfacts[0] = 1;
            for (int i = 1; i <= k + 1; ++i) {
                facts[i] = (int) (facts[i - 1] * (long) i % MODULO);
                invfacts[i] = (int) (invfacts[i - 1] * (long) invs[i] % MODULO);
            }
        }

        static long c(int n, int k) {
            if (k < 0 || k > n) return 0;
            return facts[n] * (long) invfacts[k] % MODULO * (long) invfacts[n - k] % MODULO;
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long res = 0;
            for (int k = 1; k <= n - 1; ++k) {
                long ways = c(n - 2 - k, k);
                ways = ways * facts[k] % MODULO;
                ways = ways * facts[n - 1 - k] % MODULO;
                res = (res + ways) % MODULO;
            }
            res = (facts[n - 1] * (long) (n - 1) % MODULO - res + MODULO) % MODULO;
            out.println(res);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 47828
A,B,C = list(map(int, (input().split())))
K = int(input())
count=0
while(1):
    if (A>=B):
        B = B*2
        count += 1
    elif(B>=C):
        C = C*2
        count += 1
    else:
        print("Yes")
        exit(0)
    if (count > K):
        print("No")
        exit(0)

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


int main() {
 int r, c, num;
 cin >> r >> c;
 int a[r+1][c+1];
 for (int i = 0; i < r; i++) {
  int b = 0;
  for (int j = 0; j < c; j++) {
   cin >> a[i][j];
   b += a[i][j];
  }
  a[i][c] = b;
 }
 for (int j = 0; j <= c; j++) {
   int b = 0;
   for (int i = 0; i < r; i++) {
    b += a[i][j];
   }
   a[r][j] = b;
 }
 for (int i = 0; i <= r; i++) {
  for (int j = 0; j < c; j++)
    cout << a[i][j] << " ";
  cout << a[i][c] << endl;
 }
}

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

int main(){
	char s[100000];
	gets(s);
	int len = strlen(s);
	s[len]=s[len-1];
	
	int cnt = 0;
	for(int i=0;i<len;i++){
		if(s[i+1]!=s[i]){
			cnt++;
		}
	}
	printf("%d\n",cnt);
	return 0;
}

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

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int N; cin >> N;
    deque<int> dq;
    rep(i, N){
        int a; cin >> a;
        if(i % 2 == 0){
            dq.push_back(a);
        }
        else{
            dq.push_front(a);
        }
    }
    while(!dq.empty()){
        int op;
        if(N % 2 == 1){
            op = dq.back();
            dq.pop_back();
        }
        else{
            op = dq.front();
            dq.pop_front();
        }
        if(dq.empty()) cout << op << endl;
        else cout << op << " ";
    }
    return 0;
}

Measured memory_bytes: 2944
/*
 * atcoder/abc141/d.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
#include <queue>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

int N, M;
void solve() {
  cin >> N >> M;
  priority_queue<ll> Q;
  ll a;
  loop(n,0,N) {
    cin >> a;
    Q.push(a);
  }

  while (M) {
    ll top = Q.top(); Q.pop();
    top /= 2;
    M--;
    Q.push(top);
  }

  ll total = 0;
  while (Q.size()) {
    total += Q.top(); Q.pop();
  }
  cout << total << endl;
}
int main() {
  // cout.precision(15); cout << fixed;

  solve();

  return 0;
}


Measured memory_bytes: 1400
package main

import (
	"fmt"
)

func solution(s string, K int) int {
	// DP定義
	var dp [105][4][2]int
	var n int = len(s)
	dp[0][0][0] = 1

	for i := 0; i < n; i++ {
		for j := 0; j < 4; j++ {
			for k := 0; k < 2; k++ {
				nd := int(s[i] - '0')
				for d := 0; d < 10; d++ {
					ni, nj, nk := i+1, j, k
					if d != 0 {
						nj++
					}
					if nj > K {
						continue
					}
					if k == 0 {
						if d > nd {
							continue
						}
						if d < nd {
							nk = 1
						}
					}
					dp[ni][nj][nk] += dp[i][j][k]
				}
			}
		}
	}
	var ans int = dp[n][K][0] + dp[n][K][1]
	return ans
}

func main() {
	var s string
	var K int
	fmt.Scan(&s)
	fmt.Scan(&K)
	fmt.Println(solution(s, K))
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define crap ios_base::sync_with_stdio(0);cin.tie(0)
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define endl "\n"
#define int ll

using namespace std;
const int INF = 1e18L;
int n;
double A[3001];
double dp[3001][3001];

double solve(int index,int head){
	if(index==n){
		if(index-head<head){
			return 1;
		}
		else 
			return 0;
	}
	if(dp[index][head]!=-1) return dp[index][head];
	if(index-head>(n-1)/2) return 0;
	double a,b=0;

	a =  A[index]*solve(index+1,head+1);
//	/if(index-head+1<=(n-1)/2)/
	b = (1-A[index])*solve(index+1, head);
	

	return dp[index][head]=a+b;
}

int32_t main()
{
   
   
    crap;
    for(int i=0;i<=3000;i++){
    	for(int j=0;j<=3000;j++)
    		dp[i][j]=-1;
    }
    cin>>n;
    for(int i=0;i<n;i++) cin>>A[i];

    double ans = solve(0,0);//index and count of head
    cout<<fixed<<setprecision(9)<<ans<<endl;
   
}

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

struct intv
{
    bool operator() (const pair<int,int>& a, const pair<int,int>& b)
    {
        return ((a.second<b.second) || (a.second==b.second && a.first<b.first));
    }
};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
 
    set<pair<int,int>,intv> send;
    set<pair<int,int> > sbeg;
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;++i)
    {
        int a,b;
        cin>>a>>b;
        send.insert({a,b});
        sbeg.insert({a,b});
    }


    int cnt = 0;
    while(send.size()>0)
    {
        int lim = send.begin()->second;
        ++cnt;
        while(sbeg.size()>0 && sbeg.begin()->first<lim)
        {
            pair<int,int> cur = *sbeg.begin();
            sbeg.erase(cur);
            send.erase(cur);
        }
    }
    cout<<cnt<<'\n';
    return 0;
}   

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

string sortString(string &str) 
{ 
   sort(str.begin(), str.end()); 
   return str;
} 

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n;
	ll ans,cur;
	cin>>n;
	string s;
	string a[n];
	for (int i=0;i<n;++i)
	{
		cin>>s;
		s=sortString(s);
		a[i]=s;
		//cout<<s<<"\n";
	}
	sort(a,a+n);
	cur=1;
	ans=0;
	for (int i=1;i<n;++i)
	{
		if (a[i-1]==a[i])
		{
			++cur;
		}
		else
		{
			cur*=(cur-1);
			cur/=2;
			ans+=cur;
			cur=1;
		}
	}
	cur*=(cur-1);
	cur/=2;
	ans+=cur;
	cur=1;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 5888
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)

	nmax := 10000
	cs := make([]int, nmax+1)
	imax := 110
	for i := 1; i < imax; i++ {
		for j := 1; j < imax; j++ {
			for k := 1; k < imax; k++ {
				res := i*i + j*j + k*k + i*j + j*k + k*i
				if res <= nmax {
					cs[res]++
				}
			}
		}
	}
	for i := 1; i <= N; i++ {
		fmt.Println(cs[i])
	}

}


Measured memory_bytes: 1984
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include<vector>
#include<iostream>
#include<set>
#include<map>
#include<algorithm>
using namespace std;


long long int divide(long long int h,long long w){
	if(h %2 == 0){
		return (h/2)*w;
	}
	if(w %2 == 0){
		return (w/2)*h;
	}
	
	long long int mi = min(h,w);
	long long int ma = max(h,w);
	return (ma/2)*mi;
	
}

long long int calcRes(long long int rect1,long long int rect2,long long int rect3){
	long long int ma = max(rect1,max(rect2,rect3));
	long long int mi = min(rect1,min(rect2,rect3));
	
	return ma - mi;
}

int main() {
	int H,W;
	int h,w;
	cin >> H >> W;
	cin >> h >> w;
	cout << (H-h)*(W-w) <<endl;
	
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<iomanip>
using namespace std;
int main(){
	long double n,m;
	cin >> n >> m;
	n*=1.0000000000;
	long double t1=0.00000000000000;
	for(int i = 1; i <= n; i++){
		long double tot2=0;
		long double p = i,tot1 = 1;
		while(p < m) p *= 2, tot1 *= 2.0000000000000;
		t1 += (1.000000000000000 / n) * (1.000000000000000 / tot1);
	}
	cout << fixed<< setprecision(12) << t1 << endl; 
}

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

int main() {
  double w,h,x,y;
  cin>>w>>h>>x>>y;
  cout<<fixed<<setprecision(15);
  cout<<w*h/2<<" ";
  if(x==w/2&&y==h/2){
    cout<<1<<endl;
    return 0;
  }
  cout<<0<<endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
ll = sorted([list(map(int,input().split())) for _ in range(n)])

ans = 0
cnt = 0
for l in ll:
  if cnt + l[1] > m:
    ans += (m-cnt)*l[0]
    break
  else:
    cnt += l[1]
    ans += l[0]*l[1]

print(ans)

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

int main() {
    int n;
    cin >> n;
    ll a;
    map<ll,ll> m; // <length,count>
    for(int i=0; i<n; i++){
        cin >> a;
        m[a]++;
    }
    vector<ll> hw = {0,0};
    for(auto x : m){
        if(x.second < 2){
            continue;
        }
        else{
            if(x.second >= 4){
                hw.push_back(x.first);
                hw.push_back(x.first);
            }
            else{
                hw.push_back(x.first);
            }
        }
    }
    sort(hw.begin(),hw.end());
    reverse(hw.begin(),hw.end());
    ll ans = hw.at(0) * hw.at(1);
    cout << ans << endl;
}

Measured memory_bytes: 6528
#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;

int main(){
  long long x,k,d;
  cin >> x >> k >> d;
  if(x < 0) x*= -1;
  if(x/d < k) {k -= x/d;x = x % d;}
  else {cout << x - d*k << endl; return 0;}

  if(k % 2 == 0) cout << x << endl;
  else cout << d-x << endl;
  return 0;
}


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

int main() {
    string S;
    cin >> S;
    int N = S.size();
    ll front = 0;
    ll ans =0;
    for(int i=0;i<N;i++){
        if(S[i] == 'A'){
            front++;
            continue;
        }
        if(i<N-1 && S[i] =='B' && S[i+1] == 'C'){
            ans += front;
            i++;
            continue;
        }
        front =0;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3724
/*#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#define ll long long
#define inf 1000000005
#define mod 1000000007
#define put putchar('\n')
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,t) for (int i=head[t];i;i=Next[i])
#define sqr(x) ((x)*(x))
#define re register
#define mp make_pair
#define fi first
#define se second
#define pa pair<int,int>
#define pb push_back
#define be begin()
#define en end()
//#define ret return puts("-1"),0;
#define N 500055
//#define int ll
using namespace std;
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();}
int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;}
inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');}
inline void wrn(int x,int y){wri(x);wrn(y);}inline void wrn(int a,int b,int c){wri(a);wrn(b,c);}
int f[N],n,m,fa[N],p[N],l[N],r[N],k,x;
inline void ret(){
	puts("No");exit(0);
}
int nedge,head[N*2],to[N*2],Next[N*2];
#define V to[i]
void add(int a,int b){
   Next[++nedge]=head[a];head[a]=nedge;to[nedge]=b;
}
void add_ne(int a,int b){add(a,b);add(b,a);}
void dfs(int x){
	go(i,x){
		if (fa[x]==V) continue;
		fa[V]=x;dfs(V);
		if (p[V]!=-1){
			if (p[x]==-1) p[x]=p[V]^1,l[x]=l[V]-1,r[x]=r[V]+1;
			else if (p[x]==p[V]) ret();
			l[x]=max(l[x],l[V]-1);r[x]=min(r[x],r[V]+1);
		}
	}
	if (l[x]>r[x]) ret();
}
void solve(int x){
	if ((f[x]>r[x]||f[x]<l[x])&&p[x]!=-1) ret();
	go(i,x){
		if (V==fa[x]) continue;
		if 	(f[x]-1>=l[V]||p[V]==-1) f[V]=f[x]-1;
		else f[V]=f[x]+1;
		solve(V);
	}
}
signed main(){
	n=read();F(i,1,n) p[i]=-1;
	F(i,1,n-1) add_ne(read(),read());
	k=read();
	F(i,1,k){
		x=read();l[x]=r[x]=read();p[x]=l[x]&1;
	}
	dfs(1);f[1]=l[1];
	solve(1);
	puts("Yes");
	F(i,1,n){
		wrn(f[i]);
	}
	return 0;
}

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

int main(){
  string S;
  cin >> S;
  
  bool ans=true;
  
  
  for(int i=0;i<S.size();i++){
    if(i%2==0&&S.at(i)=='h'||i%2!=0&&S.at(i)=='i'&&S.size()%2==0){
    }
    else {
      ans=false;
    }
  }
  
  if(ans) cout << "Yes" << endl;
  
  else if(!ans) cout << "No" << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  ll n, k;
  cin >> n >> k;
  cout << min(n % k, abs(n % k - k)) << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int n,m,a[55],sum;
int main(){
	cin>>n>>m;
	for(int i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	for(int i=n-1;i>=0&&m;i--){
		m--;
		sum+=a[i];
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var s string
	fmt.Println(textEdit(s))
}

func textEdit(s string) string {
	/*入力を受け取る*/
	fmt.Scan(&s)

	/*入力をstring→文字の配列*/
	sRune := []rune(s)
	size := len(s)

	/*空の文字列*/
	s2 := make([]string, size+1)
	j := 0

	for i := 0; i < size; i++ {
		switch text := string(sRune[i]); text {
		case "1":
			s2[j] = text
			j++

		case "0":
			s2[j] = text
			j++

		case "B":
			if j > 0 {
				j--
			}

		}
	}

	var s3 string

	for i := 0; i < j; i++ {
		s3 += s2[i]
	}

	return s3

}


Measured memory_bytes: 512
#include<stdio.h>
int main(void)
{
	int N,a[100],s=0,n=1000000,i,j;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&a[i]);
	}
	for(i=-100;i<=100;i++){
		s=0;
		for(j=0;j<N;j++){
			s+=(i-a[j])*(i-a[j]);
		}
		if(s<n){
			n=s;
		}
	}
	printf("%d\n",n);
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <math.h>
#include <string.h>
#define rep(i,a,n) for(int i=a;i<n;i++)

char change(char c){
	char r=c;
	if('A'<=c && c<='Z') r+='a'-'A';
	return r;
}

int main(){
	int ans=0,lenw,lens;
	char w[11],s[1010];
	scanf("%s",w);
	lenw=strlen(w);
	rep(i,0,lenw){
		w[i]=change(w[i]);
	}
	while(1){
		scanf("%s",s);
		if(strcmp(s,"END_OF_TEXT")==0) break;
		lens=strlen(s);
		rep(i,0,lens){
			s[i]=change(s[i]);
		}
		if(strcmp(s,w)==0) ans++;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 976
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int x; cin >> x;
  cout << 10 - x / 200 << '\n';
  return 0;
}


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

int main()
{
    int n,a,i;
    map<int,int>mp;
    cin>>n;
    for(i=1;i<=n;i++)
    {
    cin>>a;
    mp[a]=i;
    }
    for(i=1;i<=n;i++)
    {
        cout<<mp[i]<<" ";
    }
}

Measured memory_bytes: 8312
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int i,j,k,l,n,m;
  cin>>n>>k;
  int a[n];
  int dp[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  dp[0]=0;
  dp[1]=abs(a[1]-a[0]);
  for(i=2;i<n;i++)
  {
      int mini=INT_MAX;
      for(j=i-1;j>=max(0,i-k);j--)
      {
         mini=min(mini,dp[j]+(abs(a[j]-a[i])));
      }
      dp[i]=mini;
   }
   cout<<dp[n-1];
   return 0;
}

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

ll ze(ll x,ll y){
    return max(x,y)-min(x,y);
};

int main(){
    int n,x;
    cin>> n >> x;
    int l[n];
    int sum=0;
    int cnt=1;
    for(int i=0; i<n; i++){
        cin >> l[i];
    }
    for(int i=0; i<n; i++){
        sum+=l[i];
        if(sum<=x)cnt++;
        else break;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

vec a(410),S(410);
mat memo(410,vec(410,-1));
ll dfs(int l, int r){
    if(r-l==1) return 0;
    if(memo[l][r]!=-1) return memo[l][r];
    ll res=INF;
    FOR(k,l+1,r){
        res=min(res,dfs(l,k)+dfs(k,r));
    }
    return memo[l][r]=res+S[r]-S[l];
}

int main(){
    int N; cin>>N;
    S[0]=0;
    rep(i,N){
        cin>>a[i];
        S[i+1]=S[i]+a[i];
    }
    cout<<dfs(0,N)<<endl;
    return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <iomanip>
using namespace std;


int main(){
  double a,b,c,S;
  cin >> a >> b >> c; 
   c = c*M_PI/180.0;
  S= 0.5*a*b*sin(c);
  cout <<fixed<<setprecision(12) << 0.5*a*b*sin(c) << endl;

  cout <<fixed <<setprecision(12) << a+b+sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(c)) << endl;
  cout <<fixed<<setprecision(12) << 2*S/a << endl;
 }

Measured memory_bytes: 1336
## abc070d: Transit Tree Path
import sys
from collections import deque
input = sys.stdin.readline

n = int(input())

T = [{} for _ in range(n)]
for _ in range(n-1):
    v1,v2,d = map(int, input().split())
    T[v1-1][v2-1] = d
    T[v2-1][v1-1] = d

q,k = map(int, input().split())

visit = [False]*n
depth = [0]*n
que = deque()
que.append(k-1)
while que:
    p = que.popleft()
    visit[p] = True
    for c in T[p].keys():
        if visit[c]: continue
        depth[c] = depth[p] + T[p][c]
        que.append(c)

for _ in range(q):
    v1,v2 = map(int, input().split())
    print(depth[v1-1]+depth[v2-1])

Measured memory_bytes: 53080
#include<stdio.h>
     
    int main(int argc, char *argv[]){
        int N;
        int K;
        int a=1;        
        char buf[128];
     
        if(argc==1){
            fgets(buf, 127, stdin);
            sscanf(buf, "%d", &N);
            fgets(buf, 127, stdin);
            sscanf(buf, "%d", &K);
     
        }else if(argc==3){
            printf("A: %s\n", argv[1]);
            sscanf(argv[1], "%d", &N);
            printf("B: %s\n", argv[2]);
            sscanf(argv[2], "%d", &K);
        }
        
        int i;
        for(i=1;i<N+1;i++){
            if(a*2<a+K){
                a=a*2;
            }else{
                a=a+K;
            }   
        //printf("%d\n",a);
        }
            printf("%d\n",a);
        return 0;
    }

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC068A
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            Console.WriteLine(String.Format("ABC{0:000}", N));
        }
    }
}

Measured memory_bytes: 13268