akhauriyash/Code-Regression huggingface dataset:
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_2_A&lang=ja
//最小全域木
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
const ll LINF = 0x1fffffffffffffff;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}

template< typename T >
struct edge {
	int src, to;
	T cost;
	edge(int _to, T _cost) : src(-1), to(_to), cost(_cost) {}
	edge(int _src, int _to, T _cost) : src(_src), to(_to), cost(_cost) {}
	edge &operator=(const int &x) {
		to = x;
		return *this;
	}
	operator int() const { return to; }
};

template< typename T>
struct node {
	vector<edge<T>> edges;
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< node< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;
#if 10
template< typename T >
bool operator<(const edge<T> &e, const edge<T> &f) { return e.cost > f.cost; }
template< typename T >
std::pair<T, Edges<T>> prim(const WeightedGraph<T> &g, int r = 0) {
    Edges<T> edges;
    T total = T();
    std::vector<int> vis(g.size());
    std::priority_queue<edge<T>> q;
    q.emplace(-1, r, 0);
    while (q.size()) {
        auto e = q.top();
        q.pop();
        if (vis[e.to]) continue;
        vis[e.to] = true;
        total += e.cost;
        if (e.src != -1) edges.emplace_back(e);
        for (auto &f : g[e.to].edges)
            if (!vis[f.to]) q.emplace(f);
    }
    return std::make_pair(total, edges);
}
#else
template< typename T >
struct MinimumSpanningTree {
  T cost;
  Edges< T > edges;
};

template< typename T >
MinimumSpanningTree< T > prim(WeightedGraph< T > g) {
  T total = T();
  vector< int > used(g.size());
  vector< edge< T > * > dist(g.size());
  using pi = pair< T, int >;
  priority_queue< pi, vector< pi >, greater<> > que;
  que.emplace(T(), 0);
  Edges< T > edges;
  while(!que.empty()) {
    auto p = que.top();
    que.pop();
    if(used[p.second]) continue;
    used[p.second] = true;
    total += p.first;
    if(dist[p.second]) edges.emplace_back(*dist[p.second]);
    for(auto &e : g[p.second].edges) {
      if(used[e.to] || (dist[e.to] && dist[e.to]->cost <= e.cost)) continue;
      e.src = p.second;
      que.emplace(e.cost, e.to);
    }
  }
  return {total, edges};
}
#endif
int main() {
  ll V,E; cin>>V>>E;
  WeightedGraph<ll> graph(V);
  REP(i,E){
    ll s,t,w; cin>>s>>t>>w;
    graph.at(s).edges.emplace_back(t,w);
    graph.at(t).edges.emplace_back(s,w);
  }

  auto result=prim<ll>(graph);
  //cout<<result.cost<<endl;
  cout<<result.first<<endl;

  return 0;
}


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

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 _: i32 = read();
    let s: String = read();

    let mut last_char = 'A';
    let mut ans: i32 = 0;
    for c in s.chars() {
        if c != last_char { ans += 1; last_char = c; }
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<iostream>
using namespace std;
int main(){
	int x,y;
	cin>>x>>y;
	int flagx=0,flagy=0;
	int a[7]={1,3,5,7,8,10,12};
	int b[4]={4,6,9,11};
	int c[1]={2};
	for(int i=0;i<7;i++){
		if(x==a[i]){
			flagx=1;
			for(int i=0;i<7;i++){
				if(y==a[i]){
					flagy=1;
				}
			}
			if(flagx==flagy&&flagx==1){
				cout<<"Yes"<<endl;
			}
			else cout<<"No"<<endl;
			return 0;
		}
	}
	for(int i=0;i<4;i++){
		if(x==b[i]){
			flagx=1;
			for(int i=0;i<4;i++){
				if(y==b[i]){
					flagy=1;
				}
			}
			if(flagx==flagy&&flagx==1){
				cout<<"Yes"<<endl;
			}
			else cout<<"No"<<endl;
			return 0;
		}
	}
	for(int i=0;i<1;i++){
		if(x==c[i]){
			flagx=1;
			for(int i=0;i<1;i++){
				if(y==c[i]){
					flagy=1;
				}
			}
			if(flagx==flagy&&flagx==1){
				cout<<"Yes"<<endl;
			}
			else cout<<"No"<<endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <ctype.h>
#include <stdlib.h>
using namespace std;

int main()
{
    int A,B,C;
    cin >> A >> B >> C;
    int K;
    cin >> K;

    int maxNum = max(A,B);
    maxNum = max(maxNum,C);

    int ans = A + B + C - maxNum;
    
    int tmp = maxNum;
    for (int i = 0; i < K; i++)
    {
        /* code */
        
        tmp *= 2;
    }
    ans += tmp;
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N(111111);
int modulo(1e9 + 7);
int cnt[N];
int main() {
	int n;
	scanf("%d", &n);
	for(int i(0); i < n; i++) {
		int x;
		scanf("%d", &x);
		cnt[x]++;
	}
	for(int i(0); i < n; i++) {
		cnt[abs(i - (n - i - 1))]--;
	}
	for(int i(0); i < n; i++) {
		if(cnt[i]) {
			printf("0\n");
			return 0;
		}
	}
	int ans(1);
	for(int i(0); i < n / 2; i++) {
		ans = ans * 2 % modulo;
	}
	cout << ans << endl;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define Cout(s) cout << s << endl;
#define CoutV(vec)     \
    for (auto v : vec) \
        Cout(v);
#define CoutVV(vecvec)      \
    for (auto vec : vecvec) \
        CoutV(vec);

using ll = long long;
using P = pair<int, int>;

const ll INF = 1ll << 60;
ll MOD = 1e9 + 7;
//int t[10010];

int main()
{

    int h, w;
    cin >> h >> w;
    vector<vector<char>> m(h, vector<char>(w));
    REP(i, h)
    {
        REP(j, w)
        {

            cin >> m[i][j];
        }
    }
    vector<bool> ziph(h, false);
    vector<bool> zipw(w, false);
    REP(y, h)
    {
        bool ok = true;
        REP(x, w)
        {
            if (m[y][x] == '#')
            {
                ok = false;
            }
        }
        if (ok)
        {
            ziph[y] = true;
        }
    }

       REP(x, w)
    {
        bool ok = true;
        REP(y, h)
        {
            if (m[y][x] == '#')
            {
                ok = false;
            }
        }
        if (ok)
        {
            zipw[x] = true;
        }
    }

    REP(y, h)
    {
        REP(x, w)
        {
            if (!zipw[x] && !ziph[y])
            {
                cout << m[y][x];
            }
            if (x == w - 1 && !ziph[y])
                cout << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int search(int A[], int n, int key) {
  int i = 0;  A[n] = key;
  while(A[i] != key) i++;
  return i != n;
}

int main(void) {
  int i, n, A[10000+1], q, key, sum = 0;
  scanf("%d",&n);
  for(i=0; i<n; i++) scanf("%d", &A[i]);
  scanf("%d",&q);
  for(i=0; i<q; i++) {
    scanf("%d", &key);
    if(search(A, n, key))sum++;
  }
  printf("%d\n", sum);
  return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef vector<double> Vec;
typedef vector<Vec> Mat;
typedef pair<ll,ll> P;
typedef pair<double,ll> Pd;
typedef pair<double,double> PD;
typedef priority_queue<P,vector<P>,greater<P> > P_queue;
typedef priority_queue<Pd,vector<Pd>,greater<Pd> > Pd_queue;

const ll MOD=998244353;
const ll mod=1000000007;
const ll INF=1e15;
const double DEL=1e-6;


#define REP(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end());
#define ADD(a,b) a=(a+b)%mod
#define MUL(a,b) a=(a*b)%mod

ll Solve(){
    ll N,K; cin>>N>>K;
    vec d(N);
    rep(i,N) cin>>d[i];
    ll SUM=0, MAX=0;
    rep(i,N){
        MAX=max(MAX,d[i]);
        SUM+=d[i];
    }
    if(SUM-N<=K) return 1;
    ll OK=MAX, NG=1;
    while(OK>NG+1){
        ll MID=(OK+NG)/2;
        ll Count=0;
        rep(i,N) Count+=(d[i]+MID-1)/MID;
        Count-=N;
        if(Count<=K) OK=MID;
        else NG=MID;
    }
    return OK;
}
int main(){
    cout<<Solve()<<endl;
}

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

#define ROLL(a,b,c,d) tmp = o[(a)]; o[(a)]=o[(b)]; o[(b)]=o[(c)]; o[(c)]=o[(d)]; o[(d)]=tmp 

class Dice
{
public:
	int label[7];
	int orientation[7];

	Dice() { }
	Dice(int l[6]) : orientation{0,1,2,3,4,5,6}
	{
		for(int i=1; i<7; ++i) label[i] = l[i-1];
	}

	Dice &roll(char r) {
		auto &o = orientation;
		int tmp;

		switch(r) {
		case 'E': ROLL(1,4,6,3); break;
		case 'N': ROLL(1,2,6,5); break;
		case 'S': ROLL(1,5,6,2); break;
		case 'W': ROLL(1,3,6,4); break;
		}

		return *this;
	}

	int top() const { return label[orientation[1]]; }
};


int main()
{
	int label[6];
	for(auto &l : label) cin >> l;

	Dice dice(label);

	string roll;
	cin >> roll;

	for(auto r : roll)
		dice.roll(r);

	cout << dice.top() << endl;

	return 0;
}




Measured memory_bytes: 3184
#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

long long N, M, H,K,W,re;
//long long A[200001];
bool B[200001][21];
bool f;
int A[21] = {};
string S;
set <long long>sll;
vector <long long>vl;

int main() {
	cin >>N;
	
	for (int i = 0; i < N; i++) {
		cin >> M;

		for (int j = 0; j < 21; j++) {
			if (M == 0) {
				break;
			}
			B[i][j] = M % 2;
			M /= 2;
		}

	}

	H = 0;
	re = 0;
	for (int i = 0; i < N; i++) {

		for (int j = 0; j < 21; j++) {

			A[j] += B[i][j];

			if (A[j] >= 2) {

				f = false;

				for (int k = i - H; k < i; k++) {
					for (int l = 0; l < 21; l++) {
						A[l] -= B[k][l];
					}

					if (B[k][j] == 1) {
						f = true;
						H = i - k - 1;
						break;
					}
				}

				if (f == false) {
					H = 0;
					for (int k = 0; k < 21; k++) {
						A[k] = 0;
					}
					for (int k = 0; k < 21; k++) {
						A[k] += B[i][k];
					}
					break;
				}

			}

		}

		H++;
		re += H;
	}
	

	cout << re << endl;

	return 0;
}


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

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

    for(int x = 0; x <= N; x++){
      for(int y = 0; y <= N; y++){
        int z = N - x - y;
        if(z <= 0) z = 0;
        if((x*10000 + y*5000 + z*1000 == Y) && (x + y + z == N)){
          printf("%d %d %d\n", x, y, z);
          return 0;
        }
      }
    }

    printf("-1 -1 -1\n");

  return 0;

}


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

using namespace std;

int main() {
    while (true) {
        int a[2];
        cin >> a[0] >> a[1];
        if (a[0] == 0 && a[1] == 0)return 0;
        sort(a, a + 2);
        cout << a[0] << ' ' << a[1] << endl;
    }

}


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MAXN 1000010
#define rep(i,n) for (int i = 0; i < (n); ++i)
const ll mod = 1e9+7;

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; }

bool pairCompare(const P& firstElof, const P& secondElof)
{
    return firstElof.second < secondElof.second;
}

char a[55][55];
char b[55][55];
int n, m;

bool judge() {

    bool flag = true;
    rep(si, n-m+1) {
        rep(sk, n-m+1) {
            flag = true;
            for(int i=0; i<m; ++i) {
                for(int k=0; k<m; ++k) {
                    //cout << si+i << " " << sk+k << endl;
                    if (a[si+i][sk+k] != b[i][k]) {
                        flag = false;
                    }
                }
            }
            if (flag == true) return true;
        }
    }

    return false;
}

int main() {
    cin >> n >> m;

    rep(i, n) {
        rep(k, n) {
            cin >> a[i][k];
        }
    }

    rep(i, m) {
        rep(k, m) {
            cin >> b[i][k];
        }
    }


    bool flag = judge();

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



Measured memory_bytes: 256
import Text.Printf (printf)

s = printf "%.6f"

main = do
	r <- readLn
	--[a,b,c] <- map (read :: String -> Int) . words <$> getLine
	putStrLn $ s ((pi::Double) * r ^ 2) ++ " " ++ s (2 * (pi::Double) * r)

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

int main() {
  ll n; cin>>n;
  
  ll ans=(1+(n-1))*(n-1)/2;
  cout << ans << endl;
  
  return 0;
}
  
  


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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  int maxi = 0;
  string s;
  cin >> n;

  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
    maxi = max(mp[s], maxi);
  }

  for (auto& p : mp) {
    if (p.second == maxi) {
      cout << p.first << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 25308
#include<bits/stdc++.h>
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int&
#define I inline
#define W while
#define N 100000
#define add(x,y) (e[++ee].nxt=lnk[x],e[lnk[x]=ee].to=y)
using namespace std;
int n,m,ee,d[N+5],lnk[N+5];struct edge {int to,nxt;}e[N<<1];
class FastIO
{
	private:
		#define FS 100000
		#define tc() (A==B&&(B=(A=FI)+fread(FI,1,FS,stdin),A==B)?EOF:*A++)
		#define pc(c) (C==E&&(clear(),0),*C++=c)
		#define tn (x<<3)+(x<<1)
		#define D isdigit(c=tc())
		int T;char c,*A,*B,*C,*E,FI[FS],FO[FS],S[FS];
	public:
		I FastIO() {A=B=FI,C=FO,E=FO+FS;}
		Tp I void read(Ty& x) {x=0;W(!D);W(x=tn+(c&15),D);}
		Ts I void read(Ty& x,Ar&... y) {read(x),read(y...);}
		Tp I void write(Ty x) {W(S[++T]=x%10+48,x/=10);W(T) pc(S[T--]);}
		Tp I void writeE(Con Ty& x,Con Ty& y) {write(x),pc(' '),write(y),pc('\n');}
		I void clear() {fwrite(FO,1,C-FO,stdout),C=FO;}
}F;
template<int SZ> class UnionFindSet
{
	private:
		int f[SZ+5];
		I int getfa(CI x) {return f[x]?f[x]=getfa(f[x]):x;}
	public:
		I void Union(CI x,CI y) {f[getfa(x)]=getfa(y);}
		I bool Identify(CI x,CI y) {return getfa(x)==getfa(y);}
};UnionFindSet<N> U;
I void dfs(CI x,CI lst=0)
{
	RI i;for(i=lnk[x];i;i=e[i].nxt) e[i].to^lst&&(dfs(e[i].to,x),0);
	lst&&(d[x]?F.writeE(x,lst):(d[lst]^=1,F.writeE(lst,x)),0);
}
int main()
{
	RI i,x,y;if(F.read(n,m),m&1) return puts("-1"),0;
	for(i=1;i<=m;++i) F.read(x,y),U.Identify(x,y)?
		(F.writeE(x,y),d[x]^=1):(U.Union(x,y),add(x,y),add(y,x));
	return dfs(1),F.clear(),0;
}

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

using namespace std;
using Graph = vector<vector<int>> ;
Graph G;

void dfs(int v, vector<bool> &seen, int & res){
    bool end  = true; //すべての頂点を探索済か否かを表す
    for(int i = 0; i < seen.size(); i++){
        if(!seen[i] && i != v){ //その頂点iを訪問していない && 頂点iは
            end = false;
        }
    }
    if(end){
        res++; //すべての頂点を探索したことがわかったら答えをインクリメントした上でリターンする
        return;
    }

    seen[v] = true; //その頂点を訪問済みにする
    for(auto nv: G[v]){ //vの隣接する点を調べる
        if(seen[nv])continue; //vの隣接する点の中ですでに訪問済みの点の場合は調べない（重複防止）
        dfs(nv, seen, res); //vの隣接する点についてdfsを行って再帰的に調べる
    }

    seen[v] = false;
}

int main(void){
    int N, M;
    cin >> N >> M;
    G.assign(N, vector<int>()); // グラフ入力受取 (ここでは無向グラフを想定)
    for(int i = 0; i < M; i++){
        int a, b;
        cin >> a >> b;
        --a; //0-indexのためデクリメント
        --b; //0-indexのためデクリメント
        G[a].push_back(b); //隣接リストを作る
        G[b].push_back(a); //隣接リストを作る
    }
    vector<bool> seen(N, false); //seen: その頂点を検知済みかどうかを表す配列
    int number_of_Hamilton_path = 0;
    dfs(0, seen, number_of_Hamilton_path); //dfs(parent, 検知済み配列, pathの数)
    cout << number_of_Hamilton_path  << endl;
    return 0;
}

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

#define ll long long

const int MOD=1e9+7;

ll mod(ll x){
	return (x%MOD+MOD)%MOD;
}
ll mul(ll a,ll b){
	return mod(mod(a)*mod(b));
}

int main() {
//#ifndef ONLINE_JUGDE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//#endif
    ios::sync_with_stdio(0);
    cin.tie(0);

	int n,k;
	cin>>n>>k;
	vector<ll> pos;
	vector<ll> neg;
	for(int i=0;i<n;i++){
		int c;
		cin>>c;
		if(c>0)
			pos.push_back(c);
		else
			neg.push_back(c);
	}
	ll ans=1;
	if((int)pos.size()){
		if(k%2){
			sort(pos.begin(),pos.end());
			ans=mul(ans,pos.back());
			pos.pop_back();
			k--;
		}
		vector<ll> arr;
		sort(pos.begin(),pos.end(),greater<ll>());
		sort(neg.begin(),neg.end());
		for(int i=0;i+1<(int)pos.size();i+=2)
			arr.push_back(pos[i]*pos[i+1]);
		for(int i=0;i+1<(int)neg.size();i+=2)
			arr.push_back(neg[i]*neg[i+1]);
		if((int)pos.size()%2&&(int)neg.size()%2)
			arr.push_back(pos.back()*neg.back());
		sort(arr.begin(),arr.end(),greater<ll>());
		for(int i=0;i<(k/2);i++)
			ans=mul(ans,arr[i]);
		cout<<ans;
	}
	else{
		sort(neg.begin(),neg.end());
		if(k%2)
			reverse(neg.begin(),neg.end());
		for(int i=0;i<k;i++)
			ans=mul(ans,neg[i]);
		cout<<ans;
	}
	
	return 0;
}


Measured memory_bytes: 6556
import sys
# 整数を一つ入力
N = int(input())
# スペース区切りの整数をリストに入力
a = [int(x) for x in input().split()]

abox = {}

for i in a:
    if i in abox:
        print("NO")
        sys.exit()
    else:
        abox[i] = 1

print("YES")

Measured memory_bytes: 32848
#include <stdio.h>

class Dice3{
public:
	Dice3(){
		number = new int[6];
		checkTable = new int[101];
		for(int i = 0; i < 101; i++) checkTable[i] = -1;
	};
	~Dice3(){
		delete[] number;
		delete[] checkTable;
	};

	void setLabel(int index,int num){
		number[index] = num;
		checkTable[num] = index;
	};

	void roll(char dst){
		switch(dst){
		case 'E':
			setNumber(number[3],number[1],number[0],number[5],number[4],number[2]);
			break;
		case 'N':
			setNumber(number[1],number[5],number[2],number[3],number[0],number[4]);
			break;
		case 'S':
			setNumber(number[4],number[0],number[2],number[3],number[5],number[1]);
			break;
		case 'W':
			setNumber(number[2],number[1],number[5],number[0],number[4],number[3]);
			break;
		}
	};

	bool isValidMember(int inputed[]){
		for(int i = 0; i < 6; i++)
		{
			if(checkTable[inputed[i]] == -1)
				return false;
		}
		return true;
	}
	bool isSameDice(int inputed[]){
		char order[25] = "NNNNWNNNWNNNENNNENNNWNNN";
		for(int i = 0; i < 24; i++){
			roll(order[i]);
			for(int j = 0; j < 6; j++){
				if(inputed[j] != number[j])
					break;
				if(j == 5)
					return true;
			}
		}
		return false;
	}

private:
	void setNumber(int n0,int n1,int n2,int n3,int n4,int n5){
		number[0] = n0;
		number[1] = n1;
		number[2] = n2;
		number[3] = n3;
		number[4] = n4;
		number[5] = n5;
	}

private:
	int* number;
	int* checkTable;
};

int main(){
	Dice3 dice3;
	int tmp,inputed[6];
	for(int i = 0; i < 6; i++){
		scanf("%d",&tmp);
		dice3.setLabel(i,tmp);
	}
	for(int i = 0; i < 6; i++) scanf("%d",&inputed[i]);

	if(dice3.isValidMember(inputed) && dice3.isSameDice(inputed))
		printf("Yes\n");
	else{
		printf("No\n");
	}
}



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

void bubble_sort(int list[], int n);
int main()
{
    int  n, c, sum=0;
    int k;
    scanf("%d", &n);
    int array[n];
    scanf("%d", &k);
    for(c=0; c < n; c++)
    {
        scanf("%d", &array[c]);
    }
    bubble_sort(array, n);

    for(c=0; c <k; c++)
    {
        sum = sum+array[c];
    }
    printf("%d\n", sum);
    return 0;
}
void bubble_sort(int list[], int n)
{
    int i,j,temp;
    int count =0;
    for(i=0; i<n; i++)
    {
        for(j=0; j<n-i-1; j++)
        {
            if(list[j]>list[j+1])  // use < to sort in descending order//;
            {
                temp = list[j];
                list[j] = list[j+1];
                list[j+1] = temp;
            }
        }
    }
}


Measured memory_bytes: 3748
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;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int A = in.Int();
            int B = in.Int();
            int C = in.Int();
            int X = in.Int();
            int Y = in.Int();

            int Z = Math.max(X, Y) * 2;
            int min = (int) 1e10;
            for (int i = 0; i <= Z; i += 2) {
                int n = i / 2;
                int cost = A * Math.max(0, X - n) + B * Math.max(0, Y - n) + C * i;
                min = Math.min(min, cost);
            }
            out.println(min);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

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

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

    }
}



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

using namespace std;

int main(){
        string ans="ABC";
        string a, b, c;
        cin>>a>>b>>c;
        int res=0;
        int now=0;
        while(1){
                if(now==0&&a.length()==0){
                        res=0;
                        break;
                }
                else if(now==1&&b.length()==0){
                        res=1;
                        break;
                }
                else if(now==2&&c.length()==0){
                        res=2;
                        break;
                }

                if(now==0){
                        if(a[0]=='b'){
                                now=1;
                        }
                        else if(a[0]=='c'){
                                now=2;
                        }
                        a.erase(a.begin());
                }
                else if(now==1){
                        if(b[0]=='a'){
                                now=0;
                        }
                        else if(b[0]=='c'){
                                now=2;
                        }
                        b.erase(b.begin());
                }
                else if(now==2){
                        if(c[0]=='a'){
                                now=0;
                        }
                        else if(c[0]=='b'){
                                now=1;
                        }
                        c.erase(c.begin());
                }
                //cout<<a<<":"<<b<<":"<<c<<endl;
        }
        cout<<ans[res]<<endl;
        return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int a,b,c,x;
    scanf("%d %d %d",&a,&b,&c);
    if(a<=c&&c<=b){
        printf("%d %d %d\n",a,c,b);
    }else if(b<=a&&a<=c){
        printf("%d %d %d\n",b,a,c);
    }else if(c<=b&&b<=a){
        printf("%d %d %d\n",c,b,a);
    }else if(b<=c&&c<=a){
        printf("%d %d %d\n",b,c,a);
    }else if(c<=a&&a<=b){
        printf("%d %d %d\n",c,a,b);
    }else{
        printf("%d %d %d\n",a,b,c);
    }
    return 0;
 }

Measured memory_bytes: 596
using System;
using System.Linq.Expressions;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder {
    public class Program {
        static int[] getKeys(char delimiter) {
            var Keys = Console.ReadLine().Split(' ');
            int[] Ns = new int[Keys.Length];
            for (int i = 0; i < Keys.Length; i++) {
                Ns[i] = int.Parse(Keys[i]);
            }
            return Ns;
        }

        static void Main() {
            var Cookies = getKeys(' ');
            if (Cookies[1] >= Cookies[2]) {
                Console.WriteLine(Cookies[1] + Cookies[2]);
                return;
            } else {
                if (Cookies[0] >= Cookies[2] - Cookies[1]) {
                    Console.WriteLine(Cookies[1] + Cookies[2]);
                    return;
                } else {
                    Console.WriteLine(2 * Cookies[1] + Cookies[0] + 1);
                    return;
                }
            }
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int m, d;
  cin >> m >> d;
  int ans = 0;
  rep(i, m){
    int mm = i+1;
    rep(j, d){
      int dd = j + 1;
      string s = to_string(dd);
      if(s.size() == 1) continue;
      int d1 = s.at(0) - '0';
      int d2 = s.at(1) - '0';
      if(d1 > 1 && d2 > 1 && d1*d2 == mm) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3684
#include <iostream>
#include <algorithm>
#define int long long
using namespace std;

int n, a, b, c, d, e;

signed main() {
	cin >> n >> a >> b >> c >> d >> e;
	int mn = min({a, b, c, d, e});
	cout << 5 + (n - 1) / mn << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s, t;
    cin >> s >> t;
    if(s[0] == t[2] && s[1] == t[1] && s[2] == t[0])
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }




}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[allow(unused_macros)]
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

fn main() {
    input! {
        n: i32,
        a: i32,
    }
    if (n % 500) <= a {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2160
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ld eps = 1e-9;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
int main() {
  cout << fixed << setprecision(10);
  int cntout = 0;
  int q; cin >> q;
  while(q) {
    q--;
    vi v;
    int tmp;
    int cnt = 0;
    while(1) {
      cin >> tmp;
      if(tmp == 0) break;
      cnt += tmp > 0;
      v.push_back(tmp);
    }
    vector<P> st;
    vvi g(cnt);
    int id = 0;
    for(int i=0;i<(int)(v.size());++i) {
      if(st.empty()) {
        assert(v[i] > 0);
        st.push_back({id, v[i]});
        id++;
        continue;
      } else if(v[i] > 0) {
        int pre = st.back().first;
        st.back().second--;
        v[i]--;
        g[pre].push_back(id);
        g[id].push_back(pre);
        st.push_back({id, v[i]});
        while(!st.empty() && st.back().second == 0) st.pop_back();
        id++;
      } else {
        int diff = -v[i];
        int pos = (int)(st.size()) - 1 - diff;
        int id1 = st[pos].first;
        int id2 = st.back().first;
        g[id1].push_back(id2);
        g[id2].push_back(id1);
        st[pos].second--;
        st.back().second--;
        while(!st.empty() && st.back().second == 0) st.pop_back();
      }
    }
    assert(cnt == id);
    for(int i=0;i<cnt;++i) {
      cout << i+1;
      cntout++;
      sort(g[i].begin(), g[i].end());
      for(int j=0;j<(int)(g[i].size());++j) {
        cout << " " << g[i][j] + 1;
        cntout++;
      }
      cout << endl;
      cntout++;
    }
  }
}



Measured memory_bytes: 3088
# solution

import io
import sys
import math

def prime(n):
  if n==1:
    return False
  elif n==2:
    return True
  else:
    for i in range(2,int((n)**(1/2))+1):
      if n%i==0:
        return False
    return True

list=[True]*100001

for i in range(1,100001):
  if not prime(i):
    list[i]=False

list1=[0]

count=0

for i in range(1,100001):
  if i%2==1:
    if list[i] and list[(i+1)//2]:
      count+=1
  list1.append(count)

n=int(input())

for i in range(n):
  a,b=map(int,input().split())
  print(list1[b]-list1[a-1])


Measured memory_bytes: 5292
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define int long long
using namespace std;

typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);

int calcmod(int x, int M){
    if(x >= 0) return x % M;
    int n = -1 * (x / M) + 1;
    return (x + n * M) % M; 
}

int extgcd(int a, int b, int &x, int &y){
    int d = a;
    if(b != 0){
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }else{
        x = 1;
        y = 0;
    }
    return d;
}

int mod_inverse(int a, int m){
    int x, y;
    extgcd(a, m, x, y);
    return (m + x % m) % m;
}

signed main(){

    int N, M;
    cin >> N >> M;

    vector< vector<int> > dp(N + 1, vector<int>(N + 1, 0));
    FOR(i, 0, N + 1){
        dp[i][0] = 1;
    }
    FOR(j, 1, N + 1){
        dp[0][j] = 0;
    }
    FOR(i, 1, N + 1){
        FOR(j, 1, N + 1){
            dp[i][j] = (dp[i - 1][j - 1] + (j + 1) * dp[i - 1][j]) % M;
        }
    }

    //2^(i*j)
    vector< vector<int> > pow1(N + 1, vector<int>(N + 1, 1));
    FOR(i, 1, N + 1){
        pow1[i][1] = (2 * pow1[i - 1][1]) % M;
    }
    FOR(i, 1, N + 1){
        FOR(j, 2, N + 1){
            pow1[i][j] = (pow1[i][j - 1] * pow1[i][1]) % M;
        }
    }

    //2^(2^i)
    vector<int> pow2(N + 1, 1);
    REP(i, N + 1){
        //2^(M-1)=1(mod M)
        //2^i mod(M-1)を知りたい
        int t = 1;
        for(int j = 50; j >= 0; j--){
            t = (t * t) % (M - 1);
            if(((i >> j) & 1) == 1){
                t = (t * 2) % (M - 1);
            }
        }
        //2^t mod Mを求める
        for(int j = 50; j >= 0; j--){
            pow2[i] = (pow2[i] * pow2[i]) % M;
            if(((t >> j) & 1) == 1){
                pow2[i] = (pow2[i] * 2) % M;
            }
        }
    }

    vector<int> ways(N + 1);
    vector< vector<int> > ways2(N + 1, vector<int>(N + 1));

    FOR(i, 0, N + 1){
        ways[i] = 0;
        FOR(j, 0, i + 1){
            ways2[i][j] = dp[i][j];
            //j杯に他のトッピング載せる？(*2^(j*(N-i)))
            ways2[i][j] = (ways2[i][j] * pow1[j][N - i]) % M;

            //残りのN-i種類のトッピングのみで作る2^(N-i)種類のそれぞれ食べる?(*2^(2^(N-i)))
            ways2[i][j] = (ways2[i][j] * pow2[N - i]) % M;

            ways[i] = (ways[i] + ways2[i][j]) % M;
        }
    }

    vector<int> fact(N + 1, 1);
    FOR(i, 1, N + 1){
        fact[i] = (fact[i - 1] * i) % M;
    }
    
    int ans = 0;
    REP(i, N + 1){
        int tmp = (fact[N] * mod_inverse(fact[i], M)) % M;
        tmp = (tmp * mod_inverse(fact[N - i], M)) % M;
        if(i % 2 == 0){
            tmp = calcmod(tmp, M);
        }else{
            tmp = calcmod(-1 * tmp, M);
        }
        tmp = tmp * ways[i];
        ans = (ans + tmp) % M;
    }

    cout << ans;
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 211712
#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<int> G[100005];
std::vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
#define p(x) cout<<x<<endl;
#define e cout<<endl;
#define pe(x) cout<<x<<" ";
#define re(i,a,b) for(i=a;i<=b;i++)
 
ll i,j,k,l,ii,jj;
ll n,m;
ll x,y;
ll ans=0;
ll a[100005];
ll kazu;
ll saidai=0;
bool used[100005];
bool flag;

int main(){
	cin>>n;
	re(i,0,n-1){
		cin>>a[i];
		used[i]=false;
		saidai = max(saidai,a[i]);
	}
	for(i=30;i>=0;i--){
		kazu=0;
		for(j=0;j<n;j++){
			if(a[j] & (1<<i))kazu++;
			//pe(a[j]);
		}
		//e;
		//cout<<i<<" kazu="<<kazu<<endl;
		if(kazu%2==0)continue;
		else{
			m=(1<<i);
			flag=false;
			for(j=0;j<n;j++){
				if(a[j]%m==0 && a[j]%(2*m)!=0 &&  !used[j]){
					//cout<<"_Yeeeee"<<endl;
					flag=true;
					ans++;
					used[j]=true;
					a[j]=a[j]-1;;
					break;
				}
			}
			if(!flag){
				ans=-1;
				break;
			}
		}
	}
	
	p(ans);
	return 0;
}

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

int main(){
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  cout << max({a*c,a*d,b*c,b*d}) << endl; 
  return 0;
}


Measured memory_bytes: 3632
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include <map>
#include <fstream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <assert.h>
#include <complex>
#include<omp.h>
using namespace std;
#define eps 0.000001
#define LONG_INF 10000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 65536*4
#define REP(i,n) for(long long i = 0;i < n;++i)
unsigned long xor128() {
	static unsigned long x = time(NULL), y = 362436069, z = 521288629, w = 88675123;
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
int union_seg[200000] = {};
long long nums[200000] = {};
int union_find(int now) {
	if (union_seg[now] == now) return now;
	return union_seg[now] = union_find(union_seg[now]);
}
long long bobo = 0;
int union_merge(int a, int b) {
	a = union_find(a);
	b = union_find(b);
	if (a != b) {
		bobo += nums[a] * (nums[a] - 1LL) / 2LL;
		bobo += nums[b] * (nums[b] - 1LL) / 2LL;
		union_seg[a] = b;
		nums[b] += nums[a];
		bobo -= nums[b] * (nums[b] - 1LL) / 2LL;
	}
	return 0;
}
int main(){
	long long n, m;
	cin >> n >> m;
	bobo = n * (n - 1LL) / 2LL;
	vector<long long> ans;
	vector<pair<long long, long long>> input;
	REP(i, m) {
		int a, b;
		cin >> a >> b;
		input.push_back(make_pair(a, b));
	}
	REP(i, n + 1) {
		union_seg[i] = i;
		nums[i] = 1;
	}
	reverse(input.begin(), input.end());
	long long geko = 0;
	REP(i, input.size()) {
		ans.push_back(bobo);
		union_merge(input[i].first, input[i].second);
	}
	reverse(ans.begin(), ans.end());
	REP(i, ans.size()) {
		cout << ans[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 5872
def main():
    N = int(input())
    D = list(map(int,input().split()))
    D_sorted = sorted(D)
    if D_sorted[int(N/2-1)] == D_sorted[int(N/2)]:
        print(0)
        return
    print(D_sorted[int(N/2)]-D_sorted[int(N/2-1)])


if __name__ == '__main__':
    main()

Measured memory_bytes: 14428
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<numeric>
#include<utility>

#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)

#define INF 1000000000
#define MOD 1000000007

typedef  long long ll;

using namespace std;

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 euclid_distance(double a,double b){
    return sqrt(a*a+b*b);
}

ll gcd(ll  a,ll b){
    ll r;
    if(a < b){
        ll tmp;
        tmp = a;
        a = b;
        b = tmp;
    }
    while(r = a % b){
        a = b;
        b = r;
    }
    return b;
}

void Integer_factorization(long long int b,long long int n){
    long long int a = 2;
    long long int count = 0;
    long long int ans = 1;
    long long int ndash = n;
    if(b == 1) cout << n << endl;
    else{
    while(ndash >= a*a){
        if(n % a  == 0){
            count++;
            n/=a;

        if(count % b == 0){
            ans *= a;
        }
        }else{a++;count = 0;}
    }

    cout<<  ans << endl;
    }
}

ll r_fuct[2000];
ll fuct[2000];

//MOD逆元
void conb(ll n,ll k){
    fuct[0] = 1;
    for(int i = 1;i < k+1;i++){
        fuct[i] *= fuct[i-1]%MOD;
        
        ll b = MOD, u = 1, v = 0;
        ll value = fuct[i];
        while (b) {
            ll t = value / b;
            value -= t * b;
            swap(value, b);
            u -= t * v;
            swap(u, v);
        }
        u %= MOD;
        if (u < 0) u += MOD;
        r_fuct[i] = u;
    }
}


ll n,A,B,C;

vector <ll>vec;


ll rec(ll cur,ll a,ll b,ll c){
    if(cur == n){
        if(min(a, min(b, c)) == 0) return INF;
        else return abs(a-A)+abs(b-B)+abs(c-C)-30; //最初の合成にかかるコストを引く
    }

    ll res = rec(cur+1,a,b,c);
    chmin(res,rec(cur+1,a+vec[cur],b,c)+10);
    chmin(res,rec(cur+1,a,b+vec[cur],c)+10);
    chmin(res,rec(cur+1,a,b,c+vec[cur])+10);
    return res;
}

void solve() {
    cin >> n >> A >> B >> C;
    vec.resize(n);
    for(int i = 0;i < n;i++){
        cin >> vec[i];
    }
    cout << rec(0,0,0,0);
}
int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int lastKiss =0; //奇数文字目の最後尾のインデックス
		if(s.length()%2==0) {//文字列が偶数文字数
			lastKiss=s.length()-2;
		}else {//文字列が奇数文字数
			lastKiss=s.length()-1;
		}

		for(int i=0;i<=lastKiss;i=i+2) {
			System.out.print(s.charAt(i));
		}
	}

}


Measured memory_bytes: 27756
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll N;
  cin>>N;
  set<string> S;
  for(ll i=0;i<N;i++) {
string s;
    cin>>s;
    S.insert(s);
  }
  cout<<S.size()<<endl;
}
  

Measured memory_bytes: 19132
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
#define llx(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
using namespace std;
long long n,m,i,j,num[200005],l,r,ans,f;
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n;
	for (i=1;i<=n;i++) cin>>num[i];
	for (i=1;i<=n;i++)
	{
		while (j<n&&((f&num[j+1])==0))
		{
			j++;
			f|=num[j];
		}
		ans+=j-i+1;
		f^=num[i];
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
ll dp[41][2];
int main(){
    int n;cin >> n;
    ll k;cin >> k;
    vector<ll> a(n);
    for(int i=0;i<n;i++) cin >> a[i];
    for(int i=0;i<41;i++){
        for(int j=0;j<2;j++){
            dp[i][j]=-LINF;
        }
    }
    dp[40][1]=0;
    int cnt;
    for(int i=39;i>=0;i--){
        int A=0,B=0;
        for(int j=0;j<n;j++){
            if(a[j]&(1ll<<i)) A++;
            else B++;
        }
        dp[i][0]=max(dp[i][0],dp[i+1][0]+(1ll<<i)*max(A,B));
        if(k&(1ll<<i)){
            dp[i][0]=max(dp[i][0],dp[i+1][1]+(1ll<<i)*A);
            dp[i][1]=max(dp[i][1],dp[i+1][1]+(1ll<<i)*B);
        }
        else{
            dp[i][1]=max(dp[i][1],dp[i+1][1]+(1ll<<i)*A);
        }
    }
    ll ans=max(dp[0][0],dp[0][1]);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
 
#define rep(i, n) for(int i = 0; i < (n); ++i)
 
using namespace std;

int n;
string s[10000];
string t;
int f[10000];
int b[10000];

void check(int p){
    if(t.size() == p){
        rep(i, n){
            if(f[i] == -1){
                f[i] = (s[i].size() == p);
            }
            
            if(b[i] == -1){
                b[i] = 1;
            }
        }
        return;
    }

    rep(i, n){
        if(f[i] == -1){
            if(s[i].size() == p){
                f[i] = 1;
            }
            else{
                if(s[i][p] == '?'){
                    if(t[p] != 'a'){
                        f[i] = 1;                   
                    }
                }
                else if(s[i][p] != t[p]){
                    f[i] = s[i][p] < t[p];
                }
            }
        }

        if(b[i] == -1){
            if(s[i].size() == p){
                b[i] = 0;
            }
            else{
                if(s[i][p] == '?'){
                    if(t[p] != 'z'){
                        b[i] = 1;                   
                    }
                }
                else if(s[i][p] != t[p]){
                    b[i] = s[i][p] > t[p];
                }
            }
        }
    }

    check(p + 1);
}

int main(){
    cin >> n;
    rep(i, n){
        cin >> s[i];
    }
    cin >> t;

    fill_n(f, n, -1);
    fill_n(b, n, -1);

    check(0);

    int p = 0;
    int q = 0;
    rep(i, n){
        if(f[i] && b[i]){
            ++q;
        }
        else if(f[i]){
            ++p;
        }
    }

    for(int i = 0; i <= q; ++i){
        if(i != 0){
            cout << ' ';
        }
        cout << p + i + 1;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1024
#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 mod = 1e9 + 7;
//const int mod = 998244353;

const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;


int main() {
  char c;
  cin >> c;
  c++;
  cout << c << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;
const long long INF = 1LL << 60;

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

ll count_attack(ll h){
    if(h <= 1) return 1;
    return (2*count_attack((h)/2) + 1);
}
int main()
{
    ll h; cin>> h;
    cout << count_attack(h) << endl;
}
    

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int INF = 1000000007;

int di[4] = {-1, 0, 1, 0};
int dj[4] = {0, 1, 0, -1};


int main(){

    int h, w, k; cin >> h >> w >> k;
    vector<vector<bool> > G(h + 2, vector<bool> (w + 2, false));


    int si, sj;
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            char in; cin >> in;
            if(in == '#') continue;

            G[i][j] = true;
            if(in == 'S'){
                si = i;
                sj = j;
            }
        }
    }

    vector<pair<int, int> > ans;
    G[si][sj] = false;
    queue<pair<int, pair<int, int> > > que;
    que.push({k, {si, sj}});
    while(!que.empty()){
        pair<int, pair<int, int> > info = que.front();
        que.pop();
        int i = info.second.first;
        int j = info.second.second;
        ans.push_back({i, j});
        for(int h = 0; h < 4 && info.first > 0; h++){
            int ni = i + di[h];
            int nj = j + dj[h];
            if(G[ni][nj]){
                G[ni][nj] = false;
                que.push({info.first - 1, {ni, nj}});
            }
        }

    }

    int anss = INF;
    for(int i = 0; i < ans.size(); i++){
        int tmp = min(min(ans[i].first - 1, ans[i].second - 1), min(h - ans[i].first, w - ans[i].second));
        if(tmp != 0) anss = min(anss, 2 + (tmp - 1) / k);
        if(tmp == 0) anss = 1;
    }
    

    cout << anss << endl;
    return 0;
}


Measured memory_bytes: 9964
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,cnt=0;
  cin>>n;
  vector<int> b,c;
  map<int,int> bb,cc;
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    if(a%2==0){
      b.push_back(a);
      bb[a]++;
    }else{
      c.push_back(a);
      cc[a]++;
    }
  }
  sort(b.begin(),b.end());
  reverse(b.begin(),b.end());
  sort(c.begin(),c.end());
  reverse(c.begin(),c.end());
  int beki=1;
  if(b.size()>0){
  while(b[0]>=beki) beki*=2;
  for(int i=0;i<b.size()-1;i++){
    if(bb[b[i]]>0){
      while(beki>b[i]) beki/=2;
      beki*=2;
      int bekki=beki;
      while(bekki>=b[i]){
        if(bekki!=2*b[i]){
          if(bb[bekki-b[i]]>0){
            cnt++;
            bb[bekki-b[i]]--;
            bb[b[i]]--;
            break;
          }else{
            bekki/=2;
          }
        }else{
          if(bb[bekki-b[i]]>1){
            cnt++;
            bb[bekki-b[i]]--;
            bb[b[i]]--;
            break;
          }else{
            bekki/=2;
          }
        }
      }
    }
  }
  }
  beki=1;
  if(c.size()>0){
  while(c[0]>=beki) beki*=2;
  for(int i=0;i<c.size()-1;i++){
    if(cc[c[i]]>0){
      while(beki>c[i]) beki/=2;
      beki*=2;
      int bekki=beki;
      while(bekki>=c[i]){
        if(c[i]!=1){
          if(cc[bekki-c[i]]>0){
            cnt++;
            cc[bekki-c[i]]--;
            cc[c[i]]--;
            break;
          }else{
            bekki/=2;
          }
        }else{
          if(cc[bekki-c[i]]>1){
            cnt++;
            cc[bekki-c[i]]--;
            cc[c[i]]--;
            break;
          }else{
            bekki/=2;
          }
        }
      }
    }
  }
  }
  cout<<cnt;
}

Measured memory_bytes: 19824