akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

using namespace std;

//------------------------------- Libraries --------------------------------//

//------------------------------- Type Names -------------------------------//

using i64 = int_fast64_t;

using seika = string;
//akari : 1D, yukari : 2D, maki : 3D vector
template <class kizuna>
using akari = vector<kizuna>;
template <class yuzuki>
using yukari = akari<akari<yuzuki>>;
template <class tsurumaki>
using maki = akari<yukari<tsurumaki>>;
//akane : ascending order, aoi : decending order
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha>
using aoi = priority_queue<kotonoha>;

//------------------------------- Dubug Functions ---------------------------//
inline void print()
{
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest)
{
    cout << first << ' ';
    print(rest...);
}
//------------------------------- Solver ------------------------------------//

void solve()
{
    int n;
    cin >> n;
    akari<i64> as(n), bs(n);
    for (int i = 0; i < n; i++)
    {
        cin >> as[i];
    }
    sort(as.begin(), as.end());
    if (n & 1)
    {
        i64 ans = 0, ans2 = 0;
        int plus = (n + 1) / 2, minus = n - plus;
        ans += accumulate(as.begin() + minus + 2, as.end(), (i64)0) * 2;
        ans -= accumulate(as.begin(), as.begin() + minus, (i64)0) * 2;
        ans += as[minus + 1] + as[minus];
        swap(plus, minus);
        ans2 += accumulate(as.begin() + minus, as.end(), (i64)0) * 2;
        ans2 -= accumulate(as.begin(), as.begin() + minus - 2, (i64)0) * 2;
        ans2 -= as[minus - 2] + as[minus - 1];
        ans = max(ans, ans2);
        cout << ans << endl;
    }
    else
    {
        i64 ans = 0;
        ans += accumulate(as.begin() + n / 2 + 1, as.end(), (i64)0) * 2;
        ans -= accumulate(as.begin(), as.begin() + n / 2 - 1, (i64)0) * 2;
        ans += as[n / 2] - as[n / 2 - 1];
        cout << ans << endl;
    }
}

int main()
{
    solve();
    return 0;
}


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

inline void chmax(int &a,int b) {
  a = max(a,b);
}

int main()
{
  int N,C;
  while(cin >> N >> C,N || C) {
    vector<vector<int> > dp(35,vector<int>(1 << 16,-1));
    int beat[35] = {0};
    int place[35] = {0};
    int point[1 << 16][35] = {0};
    int bit;
    Rep(i,N) {
      Rep(j,16) {
	cin >> bit;
	beat[i] |= bit << j;
      }
    }
    Rep(i,C) {
      Rep(j,16) {
	cin >> bit;
	place[i] |= bit << j;
      }
    }
    Rep(i,1 << 16) {
      Rep(j,C) {
	Rep(k,16) {
	  if(((i >> k) & 1) == 1 && ((place[j] >> k) & 1) == 1)point[i][j]++;
	}
      }
    }
    dp[0][0] = 0;
    int maxv = -(1 << 30);
    Rep(i,N) {
      Rep(j,1 << 16) {
	if(dp[i][j] == -1)continue;
	int nb = j | beat[i];
	chmax(dp[i + 1][nb],dp[i][j]);
	chmax(maxv,dp[i + 1][nb]);
	Rep(k,C) {
	  chmax(dp[i + 1][nb ^ (nb & place[k])],dp[i][j] + point[nb][k]);
	  chmax(maxv,dp[i + 1][nb ^ (nb & place[k])]);
	}
      }
    }
    cout << maxv << endl;
  }
  return 0;
}

Measured memory_bytes: 21016
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>
#include <queue>

using namespace std;
typedef long long ll;
using Graph = vector<vector<ll>>;

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

int main() {
    ll D;
    cin >> D;
    string out = "Christmas";
    if(D==24) out = "Christmas Eve";
    else if(D==23) out = "Christmas Eve Eve";
    else if(D==22) out = "Christmas Eve Eve Eve";
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
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;}

// 0 false, 1 true 
// string to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

struct PrimeNumber
{
    //O(sqrt(n))
    bool is_prime(long long n){
        for(long long i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return n != 1;
    }

    //O(sqrt(n))  isn't sorted
    vector<long long> divisor(long long n){
        vector<long long> res;
        for(long long i = 1; i * i <= n; i++){
            if(n % i == 0){
                res.push_back(i);
                if(i != n / i) res.push_back(n / i);
            }
        }
        return res;
    }

    //O(sqrt(n))
    map<long long, long long> prime_factor(long long n){
        map<long long, long long> res;
        for(long long i = 2; i * i <= n; i++){
            while(n % i == 0){
                n /= i;
                res[i]++;
            }
        }
        if(n != 1) res[n] = 1;
        return res;
    }

    //O(n log log n)
    vector<long long> eratosthenes(long long n){
        vector<long long> prime;
        vector<bool> is_prime(n + 1, true);
        long long p = 0;
        is_prime[0] = false; is_prime[1] = false;
        for(long long i = 2; i <= n; i++){
            if(is_prime[i]) prime.push_back(i);
            for(long long j = 2 * i; j <= n; j += i) is_prime[j] = false;
        }
        return prime;
    }
};


int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll N;
    cin >> N;

    PrimeNumber num;
    map<ll, ll> mp = num.prime_factor(N);
    ll ans = 0;
    for(auto i: mp){
        ll tmp = i.second;
        ll j = 1;
        while(true){
            if(tmp >= j){
                tmp -= j;
                ans++;
                j++;
            }else{
                break;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 3632
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << endl;
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << "";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define wh while
#define ve vector
#define mp make_pair
#define tp tuple
#define mt make_tuple
#define pb push_back
#define pof pop_front
#define pob pop_back
#define pf push_front
#define fr front
#define ft first
#define sc second
#define tos to_string
#define len length
#define rt return
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, m) revi(i, m, 0)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define allr(n) (n.rbegin(), n.rend())
#define sp(n) cout << fixed << setprecision(n)
#define inf pow(10, 9)
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

ve<int> dx = {0, 0, 1, -1}, dy = {1, -1, 0, 0};

int main() {
  int A, B, K;
  ci(K, A, B);
  repi(i, A, B + 1){
    if(i % K == 0){
      co("OK");
      rt 0;
    }
  }
  co("NG");
}

Measured memory_bytes: 3640
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int card[5];
int main()
{
  while(scanf("%d,%d,%d,%d,%d",&card[0],&card[1],&card[2],&card[3],&card[4]) !=EOF){
    sort(card,card+5);
    bool four,one,two,three,full,straight,flag;
    flag = false;
    one = two = three =four= full =straight = false;
    if(!flag){
      if(card[0]==card[1]&&card[0]==card[2]&&card[0]==card[3]||card[1]==card[2]&&card[1]==card[3]&&card[1]==card[4]){
	four = true;
	flag = true;
      }else if(card[0]==card[1]&&card[0]==card[2]&&(card[3]==card[4])||card[0]==card[1]&&card[2]==card[3]&&card[2]==card[4]){
	full = true;
	flag = true;
      }else if(card[0]==1&&card[1]==10&&card[2]==11&&card[3]==12&&card[4]==13||card[1]==card[0]+1&&card[2]==card[0]+2&&card[3]==card[0]+3&&card[4]==card[0]+4){
	straight = true;
	flag = true;
      }else if(card[0]==card[1]&&card[0]==card[2]||card[1]==card[2]&&card[1]==card[3]||card[2]==card[3]&&card[2]==card[4]){
	three = true;
	flag = true;
      }else if(card[0]==card[1]&&(card[2]==card[3]||card[3]==card[4])||card[1]==card[2]&&card[3]==card[4]){
	two = true;
	flag = true;
      }else if(card[0]==card[1]||card[1]==card[2]||card[2]==card[3]||card[3]==card[4]){
	one = true;
	flag = true;
      }
    }
    if(!flag)
      cout <<"null"<<endl;
    else if(four)
      cout <<"four card"<<endl;
    else if(full)
      cout <<"full house"<<endl;
    else if(straight)
      cout <<"straight"<<endl;
    else if(three)
      cout <<"three card"<<endl;
    else if(two)
      cout <<"two pair"<<endl;
    else if(one)
      cout <<"one pair"<<endl;
  }
  return 0;
}

Measured memory_bytes: 1224
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define N 300010
#define Mod 998244353
#define LL long long
LL s1[N],s2[N];
LL find(LL x,LL y)
{
    LL ans=1;
    x=x%Mod;
    while(y)
    {
        if(y%2)
            ans=ans*x%Mod;
        x=x*x%Mod;
        y=y/2;
    }
    return ans;
}
int main()
{
    LL n,m,x,y;
    LL i,j,k;
    LL ans;
    scanf("%lld%lld%lld%lld",&n,&x,&y,&m);
    s1[0]=1;
    for(i=1;i<=n;i++)
        s1[i]=s1[i-1]*i%Mod;
    s2[n]=find(s1[n],Mod-2);
    for(i=n;i>=1;i--)
        s2[i-1]=s2[i]*i%Mod;
    ans=0;
    for(i=0;i<=n;i++)
    {
        if((m-i*x)%y!=0||(m-i*x<0)||(m-i*x)/y>n)
            continue;
        ans=(ans+s1[n]*s2[i]%Mod*s2[n-i]%Mod*s1[n]%Mod*s2[(m-i*x)/y]%Mod*s2[n-(m-i*x)/y]%Mod)%Mod;
    }
    printf("%lld\n",ans);
    return 0;
}

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

#define int long long
#define forn(i,a,n) for (int i=a; i<n; i++)

int n,m;
int stx,sty,edx,edy;
const int INF=1e9;
char c[1001][1001];
int d[1001][1001];
char vis[1001][1001];
int dx[]={0,0,-1,1};
int dy[]={-1,1,0,0};
deque<int> q;

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

	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	cin>>n>>m>>stx>>sty>>edx>>edy;
	stx--,sty--,edx--,edy--;
	forn(i,0,n)
		forn(j,0,m)
			cin>>c[i][j];
	forn(i,0,n)
		forn(j,0,m)
			d[i][j]=INF;
	q.push_back(stx);
	q.push_back(sty);
	d[stx][sty]=0;
	while (!q.empty()){
		int x=q.front();
		q.pop_front();
		int y=q.front();
		q.pop_front();
		if (vis[x][y]) continue;
		vis[x][y]=1;
		forn(i,0,4){
			int nx=x+dx[i];
			int ny=y+dy[i];
			if (nx<0 || nx>=n || ny<0 || ny>=m || c[nx][ny]=='#') continue;
			if (d[nx][ny]>d[x][y]){
				q.push_front(ny);
				q.push_front(nx);
				d[nx][ny]=d[x][y];
			}
		}
		forn(i,x-2,x+3){
			forn(j,y-2,y+3){
				if (i<0 || i>=n || j<0 || j>=m || c[i][j]=='#') continue;
				if (d[i][j]>d[x][y]+1){
					q.push_back(i);
					q.push_back(j);
					d[i][j]=d[x][y]+1;
				}
			}
		}
	}
	cout<<(d[edx][edy]==INF?-1:d[edx][edy])<<endl;
	return 0;
}

Measured memory_bytes: 13552
#include <iostream>

using namespace std;

int main() {
  for (;;) {
    int sum;
    cin >> sum;
    if (!sum) return 0;
    for (int i = 0; i < 9; i++) {
      int p;
      cin >> p;
      sum -= p;
    }
    cout << sum << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
	for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
	for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
	return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
	os<<"{ ";for(auto m:M)os<<"("<<m.F<<":"<<m.S<<")";
	return os<<"}";
}
#define cerr cout
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpii;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)


int main(){
	fio; cout<<fixed<<setprecision(25);	
	
	int a; cin >> a;
	cout << a + a*a + a*a*a << endl;





	return 0;
}


Measured memory_bytes: 3648
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in [0]*D]
k=[]
for i in range(D):
    l=-1
    p=0
    for j in range(26):
        q=s[i][j]-sum([c[a]for a in k])
        p=max([p,q])
        if p==q:
            l=j
    if l==-1:
        l=k[-1]
    k+=[l]
    print(l+1)

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


int main (){
	
	lli a, b, t;
	
	cin >> t >> a >> b;
	lli ti = t;
	bool vale = b-a > 2;
	lli atual = 1;
	
	
	
	if(a < t){
		atual = a;
		t -= a-1;
	}else{
		cout << ti+1 << endl;
		return 0;
	}
	//cout << t << endl;
	
	if(vale){
		atual += (t/2)*(b-a);
		t = t%2;
		cout << atual + t << endl;
	}else{
		cout << ti+1 << endl;
		return 0;
	}
	
	
	
}


Measured memory_bytes: 256
import java.io.*;
import java.util.StringTokenizer;
public class Main{
    public static void main(String[] args) throws IOException {
        scanner sc = new scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int a = sc.nextInt();
        String s = sc.next();

        out.println(a<3200?"red":s);

        out.flush();

    }
}
class scanner{
    StringTokenizer st;
    BufferedReader br;
    public scanner(InputStream s){
        br = new BufferedReader(new InputStreamReader(s));
    }
    public scanner (String s) throws FileNotFoundException { br = new BufferedReader(new FileReader(s));}

    public String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

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

    public long nextLong() throws IOException {
        return  Long.parseLong(next());
    }

    public String nextLine() throws IOException {
        return br.readLine();
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public boolean ready() throws IOException {
        return br.ready();
    }
}

Measured memory_bytes: 20692
#include <stdio.h>

int main(void)
{
	int n, i, x, y;
	long int z;
	scanf("%d", &n);
	int a;
	x=1000000;
	y=-1000000;
	z=0;
	for(i=0; i<n; i++)
	{
		scanf("%d", &a);
		if(x>a)
		{
			x=a;
		}
		if(y<a)
		{
			y=a;
		}
		z=z+a;
	}
	printf("%d %d %ld\n", x, y, z);
	
	return 0;
}


Measured memory_bytes: 2676
#![allow(non_snake_case)]
use proconio::input;
use std::collections::HashSet;

fn main() {
    input! {
        N: usize,
        mut As: [i32; N],
    }

    let set: HashSet<i32> = As.into_iter().collect();

    let rest = N - set.len();

    if rest % 2 == 0 {
        let ans = set.len();
        println!("{}", ans);
    } else {
        let ans = set.len() - 1;
        println!("{}", ans);
    }
}


Measured memory_bytes: 3628
import sys
sys.setrecursionlimit(10 ** 6)
import sys
def input():
    return sys.stdin.readline()[:-1]
N , Q = map(int,input().split())
graph = [[] for _ in range(N)]
point = [0] * N
for _ in range(N - 1):
    a , b = map(int,input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
#print(graph)
for _ in range(Q):
    a , b = map(int,input().split())
    a = a - 1
    point[a] += b
# dfsを用いて累積和を計算する
# 初期状態だと前の値がないためデフォルト引数に-1を代入
def dfs(now , prev = -1):
    for next in graph[now]:
        # 次のノードが前に参照した値の時はcontinue
        if next == prev:
            continue
        # 現在の値を次のポイントに加算することで累積和をとる
        point[next] += point[now]
        # 次のノードと現在のノードを引数にdfsを継続する
        dfs(next , now)

dfs(0)
print(*point)

Measured memory_bytes: 282944
#include <iostream>

#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>
#include<stack>
#include<queue>
#include<string>
#include <cstdlib>
#include <typeinfo>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP2(i, s, n) for(int i=s;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
#define bitSearch(bit, n) for(int bit = 0; bit < (1 << N); bit++)
using namespace std;

template<class T>
void print(const T &value) {
    std::cout << value << std::endl;
}

void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }

void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }

typedef long long ll;
typedef unsigned long ul;
typedef long double ld;

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 INF = 10000000;
//ll mod = 1000000007;//10^9+7

//using Graph = vector<vector<pair<int, int>>>;
//Graph G(100100);


//番号ズレ注意！！
int main() {
    int N, A, B;
    cin >> N >> A >> B;
    if((B-A)%2==0){
        print("Alice");
    }else{
        print("Borys");
    }
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
long long n,o;
long long sum,flag;
long long a[100005];
long long b[100005];
bool cmp(long long a,long long y){
	return a<y;
}
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(a[i]<0){
			b[o++]=-a[i];
			flag++;
		}
		else b[o++]=a[i];
	}
	sort(b,b+o,cmp);
		for(int i=0;i<n;i++){
			sum+=b[i];
		}
	if(flag%2!=0){
		sum-=b[0]*2;
	}
	cout<<sum;
}

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

using namespace std;
using ll = long long;
const long long INF = 1LL<<60;

typedef pair<ll,ll> Pair;
int main(){

ll N,Q;
ll sum = 0;

cin >> N;

vector<ll> A(N);
vector<ll> cnt(100001,0);

for(ll i = 0;i < N;++i){
    cin >> A[i];
    sum += A[i];
    ++cnt[A[i]];
}

cin >> Q;

ll B,C;
vector<ll> S(Q,0);

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

    cin >> B >> C;

    sum += (C - B)*cnt[B];
    cnt[C] += cnt[B];
    cnt[B] = 0;
    
    S[i] = sum;

}

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

    cout << S[i] << endl;

}

return 0;

}


Measured memory_bytes: 5576
#include <stdio.h>

int main(void)
{
	int a,b,c;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if(a<b) {
		if(b<c) {
			printf("%d %d %d\n",a,b,c);
		} else { 
		if(a<c) {    
			printf("%d %d %d\n",a,c,b);
		} else {
			printf("%d %d %d\n",c,a,b);
		}
		}
		
		} else {
			if(b>c) {
				printf("%d %d %d\n",c,b,a);
			} else {
				if(a<c) { 
					printf("%d %d %d\n",b,a,c);
				} else{
					printf("%d %d %d\n",b,c,a);
				}
			}
		}
		return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

template<class T1, class T2>
istream &operator>>(istream &in, pair<T1, T2> &P){
	in >> P.first >> P.second;
	return in;
}
template<class T1, class T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &P){
	out << "(" << P.first << ", " << P.second << ")";
	return out;
}
template<class T>
istream &operator>>(istream &in, vector<T> &arr){
	for(auto &x: arr) in >> x;
	return in;
}
template<class T>
ostream &operator<<(ostream &out, const vector<T> &arr){
	for(auto &x: arr) out << x << ' '; cout << "\n";
	return out;
}
template<class T>
istream &operator>>(istream &in, deque<T> &arr){
	for(auto &x: arr) in >> x;
	return in;
}
template<class T>
ostream &operator<<(ostream &out, const deque<T> &arr){
	for(auto &x: arr) out << x << ' '; cout << "\n";
	return out;
}

int32_t main(){
	vector<string> v = {"SUN" , "MON" , "TUE", "WED" , "THU" , "FRI" , "SAT"};
	string s;
	cin>>s;
	int ans = 0;
	for(int i = 0 ; i < v.size() ;i ++){
		if(v[i] == s){
			for(int j = i + 1 ; j ; j++){
				ans++;
				if(v[j%(v.size())] == "SUN"){
					cout<<ans<<endl;
					return 0;
				}
			}
		}
	}
}

Measured memory_bytes: 256
inp = []
for i in range(5):
    inp.append(int(input()))

k = int(input())
def kyori(p,q):
    if p-q > 0:
        return p-q
    else:
        return q-p

sub = []
for i in range(len(inp)):
  for j in range(len(inp)):
      if i < j:
          sub.append(kyori(inp[i],inp[j]))
      else:
          pass

if max(sub) > k:
    print(":(")
else:
    print("Yay!")

    


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
 
int main(void){
  int N, M;
  cin >> N >> M;
  vector<int> A(N);
  for(int i = 0; i < M; i++){
    int s, c;
    cin >> s >> c;
    int keta = s - 1;
    if(N > 1 && keta == 0 && c == 0){
      cout << "-1";
      return 0;
    }
    else if(A[keta] == 0 || A[keta] == c){
      A[keta] = c;
    }
    else{
      cout << "-1";
      return 0;
    }
  }
  int B = 0;
  if(A[0] == 0 && N > 1) B += pow(10, N - 1);
  for(int i = 0; i < N; i++){
    B += pow(10, i) * A[N - i - 1];
  }
  cout << B;
  return 0;
}

Measured memory_bytes: 256
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
#define add_edge(u,v) nxt[++cnt]=head[u],head[u]=cnt,to[cnt]=v
#define open(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
char ch;bool fs;void re(int& x)
{
	while(ch=getchar(),ch<33);
	if(ch=='-')fs=1,x=0;else fs=0,x=ch-48;
	while(ch=getchar(),ch>33)x=x*10+ch-48;
	if(fs)x=-x;	
}
using namespace std;
int a,b,c;
int main()
{
	re(a),re(b),re(c);
	if(a==b)printf("%d\n",c);
	else if(a==c)printf("%d\n",b);
	else if(b==c)printf("%d\n",a);
}

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

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  ll ans = 0;
  rep(i, 60) {
    ll x = 0;
    rep(j, n) if (a[j]&(1ll<<i)) x++;
    ll t = x * (n - x) % mod;
    rep(j, i) t *= 2, t %= mod;
    ans += t;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int>> pipii;
typedef priority_queue<pii, vector<pii>, greater<pii>> minpq;
typedef priority_queue<pii> maxpq;
//const double PI = acos(-1);
const int mod =1000000007;

// ----------------------DEBUG TEMPLATE--------------------------
void __print(int x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x)
{
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x)
{
    int f = 0;
    cerr << '{';
    for (auto &i : x)
        cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v)
{
    __print(t);
    if (sizeof...(v))
        cerr << ", ";
    _print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif
// ----------------------DEBUG TEMPLATE--------------------------



int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    vi h(n+1);
    Fo(i,1,n+1) cin>>h[i];
    int dp[n+1];
    dp[1]=0;
    dp[2] = abs(h[2]-h[1]);

    for(int i =3;i <=n;i++){
        dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]),dp[i-2] + abs(h[i]-h[i-2]));
    }
    cout<<dp[n]<<endl;


    

}

Measured memory_bytes: 4776
def q3():
    N = int(input())
    H = [int(i) for i in input().split()]

    ans = 0
    cnt = 0  # H[i+1] が H[i] 以下になる回数
    for i in range(N-1):
        if H[i+1] <= H[i]:
            cnt += 1
        else:
            ans = max(ans, cnt)
            # print(i, ans)
            cnt = 0  # 回数カウントのリセット

    ans = max(ans, cnt)  # 最後にもう一度比較する
    print(ans)


if __name__ == '__main__':
    q3()


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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define INF (1<<30)
#define INFLL (1L<<63)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define MAX_A 100000

int cnt[MAX_A+1];

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int N; cin >> N;

  int nkind = 0;
  for (int i = 0; i < N; i++) {
    int A; cin >> A; cnt[A]++;
    if (cnt[A] == 1) nkind++;
  }

  cout << (nkind % 2 != 0 ? nkind : nkind - 1) << endl;
  return 0;
}


Measured memory_bytes: 640
h,w = map(int, input().split())
a = []
row_check = []
for i in range(h): #横が消える
    tmp = list(input())
    a.append(tmp)
    if '#' in tmp:
        row_check.append(i)
col_check = []
for i in range(w):
    columns =[]
    for j in range(h):
        columns.append(a[j][i])
    if '#' in columns:
        col_check.append(i)
res = []
for i in range(h):
    if i in row_check:
        tmp = []
        for j in range(w):
            if j in col_check:
                tmp.append(a[i][j])
        print(''.join(tmp))


Measured memory_bytes: 3188
#include<iostream>
#include<cstdio>
#include<algorithm>
int a[11];
bool cmp(int a,int b)
{
	return a>b;
}
int main()
{
	int n;std::cin>>n;int sum=0;
	for(int i=1;i<=n;i++)
	{
		std::cin>>a[i];
	}
	std::sort(a+1,a+1+n,cmp);
	a[1]/=2;
	for(int i=1;i<=n;i++)
	{
		sum+=a[i];
	}
	std::cout<<sum;
	return 0;
 } 

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

int N;
int p[100],q[100],r[100],b[100];

int gcd(int x,int y){
    return y?gcd(y,x%y):x;
}
int lcm(int x,int y){
    return x/gcd(x,y)*y;
}

int dfs(int pos){
    if(!~pos)return 1;
    int x=dfs(r[pos])*p[pos],y=dfs(b[pos])*q[pos];
    int l=lcm(x,y);
    return l/p[pos]+l/q[pos];
}

void solve(){
    int D[100]={0};
    for(int i=0;i<N;i++){
        scanf("%d%d%d%d",&p[i],&q[i],&r[i],&b[i]);
        r[i]--;b[i]--;
        if(~r[i])D[r[i]]++;
        if(~b[i])D[b[i]]++;
    }

    for(int i=0;i<N;i++){
        if(!D[i]){
            printf("%d\n",dfs(i));
            return;
        }
    }

}

int main(){
    while(scanf("%d",&N),N)solve();
    return 0;
}

Measured memory_bytes: 1188
#include<bits/stdc++.h>
#define ll long long
#define pii pair<ll,ll>
#define pi 3.14
#define maxn 10009
#define eps (long double)1e-9 
#define MOD 1000000007
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    int k,x;
    cin>>k>>x;
    vector<ll> ans;
    for(int i=x-1;i>x-k;i--){
        ans.push_back(i);
    }
    for(int i=x+1;i<x+k;i++){
        ans.push_back(i);
    }
    ans.push_back(x);
    sort(ans.begin(),ans.end());
    for(auto e: ans){
        cout<<e<<" ";
    }
    cout<<endl;
    return 0;   
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#define ll long long int
#define hell 1000000007LL
using namespace std;
ll power(ll x, ll y, ll z){ 
    if(y==0)
     return 1;
    else
    {
        ll p=power(x,y/2,z);
        if(y%2==0)
         return (p*p)%z;
        else
        return (x*((p*p)%z))%z;
    }}
ll gcd(ll x,ll y)
{
    if(y==0)
     return x;
    else
    return gcd(y,x%y);
}
ll fun(ll x)
{
    ll c=0;
    while(x>0)
    {
        x=x&(x-1);
        c++;
    }
    return c;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(20);
    ll n;
    string s;
    cin>>n>>s;
    ll c=0,r=0,r1=0,r2=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='1')
        c++;
    }
    for(int i=0;i<n;i++)
    {
        if(s[i]=='1')
        {
            r=(r+power(2,n-i-1,c))%c;
            r1=(r1+power(2,n-i-1,c+1))%(c+1);
            if(c==1)
             r2=-1;
             else
             r2=(r2+power(2,n-i-1,c-1))%(c-1);
        }}
    for(int i=0;i<n;i++)
    {
        if(s[i]=='0')
        {
            ll x=(r1+power(2,n-i-1,c+1))%(c+1);
            ll d=1;
            while(x)
            {
                ll y=fun(x);
                x=x%y;
                d++;
            }
            cout<<d<<"\n";
        }
        else
        {
            if(r2==-1)
            cout<<0<<"\n";
            else
            {
                 ll x=(r2-(power(2,n-i-1,c-1))+c-1)%(c-1);
                 ll d=1;
            while(x)
            {
                ll y=fun(x);
                x=x%y;
                d++;
            }
            cout<<d<<"\n";
                 
            }
        }
    }}

Measured memory_bytes: 3764
import java.util.Scanner;

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

    while(true){
      int a = scan.nextInt();
      int b = scan.nextInt();
      if(a==0 && b==0) break;

      for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
          if(i==0 || i==a-1){
            System.out.print("#");
          }else{
            if(j==0 || j==b-1){
              System.out.print("#");
            }else{
              System.out.print(".");
            }
          }
        }System.out.println();
      }System.out.println();
    }
  }
}



Measured memory_bytes: 34252
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
   long x,c=100,ans=0;
   cin >> x;
   while(c<x){
       c*= 1.01;
       ans++;
   }
   cout << ans << endl;
}


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

using namespace std;

int n, m, k;
long long x[3005][3005], dp[3005][3005][4], ans;

int main() {
	scanf("%d%d%d", &n, &m, &k);
	while (k--) {
		int ta, tb;
		long long tc;
		scanf("%d%d%lld", &ta, &tb, &tc);
		x[ta][tb] += tc;
	}
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++) {
			for (int ii = 0; ii <= 3; ii++) {
				dp[i][j][ii] = max(dp[i][j - 1][ii], dp[i - 1][j][3]);
				if (ii)
					dp[i][j][ii] = max(dp[i][j][ii], max(dp[i][j - 1][ii - 1], dp[i - 1][j][3]) + x[i][j]);
			}
		}
	printf("%lld\n", dp[n][m][3]);
}

Measured memory_bytes: 355720
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

struct Item{
    int idx,Y,P;
    char ID[13];
    Item(){}
    bool operator<(const Item& b){
        if(P!=b.P)return P<b.P;
        return Y<b.Y;
    }
};

bool cmp(const Item& a,const Item& b){
    return a.idx<b.idx;
}

Item city[100000+5];

void setID(char* s,int a,int b){
    for(int i=5;i>=0;i--){
        s[i]=a%10+'0';
        a/=10;
    }
    for(int i=11;i>=6;i--){
        s[i]=b%10+'0';
        b/=10;
    }
    s[12]='\0';
}

int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;i++){
        scanf("%d%d",&city[i].P,&city[i].Y);
        city[i].idx=i;
    }
    sort(city,city+m);
    int curP=city[0].P,num=1;
    for(int i=0;i<m;i++){
        if(city[i].P!=curP){num=1;curP=city[i].P;}
        setID(city[i].ID,curP,num);
        num++;
    }
    sort(city,city+m,cmp);
    for(int i=0;i<m;i++){
        printf("%s\n",city[i].ID);
    }
}



Measured memory_bytes: 4224
MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = [0] * W

row = input()
for w in range(W):
  if row[w] == '#':
    break
  else:
    count[w] = 1

for h in range(1, H):
  row = input()
  if row[0] == '#':
    count[0] = 0
  for w in range(1, W):
    if row[w] == '#':
      count[w] = 0
    else:
      count[w] = (count[w-1] + count[w]) % MOD
print(count[-1])

Measured memory_bytes: 3064
#include <iomanip>
#include <iostream>
using namespace std;
int n, m, p;
int main() {
	while (cin >> n >> m, n) {
		int f = 0;
		for (int i = 0; i < m; i++) {
			cin >> p;
			if (p == 1) f = 1;
		}
		long double r = f ? 0 : n / 2.0;
		cout << fixed << setprecision(15) << r << endl;
	}
}

Measured memory_bytes: 3240
#include <iostream>
#include <iomanip>

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

  double a, b, c, d, e, f, x, y;
  while (std::cin >> a >> b >> c >> d >> e >> f) {
    x = (b * f - e * c) / (b * d - a * e);
    y = (c - a * x) / b;
    if (x == 0) x = 0;
    if (y == 0) y = 0;
    std::cout << std::fixed << std::setprecision(3) << x << " " << y << std::endl;
  }
}



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

#define int long long
#define PB push_back
#define PPB pop_back
typedef pair<int, int> pii;
static const int INF = 1LL<<61;
static const int MAX_N = 100005;

int n, w, h, x[100005], y[100005];
pii pos[100005];

int calDist(int bx, int by) {
  int ans = 0, tmax = 0;
  
  for (int i = 0; i < n; ++i) {
    int temp = abs(bx - pos[i].first) + abs(by -pos[i].second);
    ans += temp * 2;
    tmax = max(tmax, temp);
  }
  ans -= tmax;

  return ans;
}

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

  cin >> w >> h >> n;
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    x[i] = a;
    y[i] = b;
    pos[i] = pii({a, b});
  }
  sort(x, x + n);
  sort(y, y + n);

  int bx, by, ans = INF;

  for (int i = -1; i < 1; ++i) {
    for (int j = -1; j < 1; ++j) {
      int tx = x[n / 2 + i], ty = y[n / 2 + j], dist = calDist(tx, ty);
      if (dist < ans) {
	bx = tx;
	by = ty;
	ans = dist;
      }
    }
  }

  cout << ans << endl << bx << " " << by << endl;

  return 0;
}

Measured memory_bytes: 6348
using System;
class Program
{
	static void Main(string[] args)
	{
		string[] s = Console.ReadLine().Split(' ');
		long A = long.Parse(s[0]);
		long B = long.Parse(s[1]);
		long K = long.Parse(s[3]);
		if(K%2 == 0){
			Console.WriteLine(A-B);
		} else {
			Console.WriteLine(B-A);
		}
	}
}

Measured memory_bytes: 11092
//

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

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

	set<string> items;

	string S;
	for (int i=0; i<N; i++) {
		cin >> S;
		items.insert(S);
	}

	int ans = items.size();

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 19220
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<set>
#include<map>
using namespace std;


int main() {
    string a;
    cin >> a;
    for(int i = 0; i < a.size(); i++){
        if(i == 3){
            cout << '8';
        }
        else
        {
            cout << a[i];
        }
        
    }
    
    cout << endl;
}


Measured memory_bytes: 256
//
//  main.cpp
//  atcoder - digitsum
//
//  Created by r on 6/5/19.
//  Copyright © 2019 r. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <assert.h>
#include <limits>
#include <cstdio>
using namespace std;

//#define RDEBUG 1
#ifdef RDEBUG
#define D(x) x
#else
#define D(x)
#endif
#define inf 0x7fffffff
#define MOD 1000000007

long long add(long long a, long long b) {
    a += b;
    if(a >= MOD) {
        a -= MOD;
    }
    return a;
}
long long sub(long long a, long long b) {
    a -= b;
    if(a < 0) {
        a += MOD;
    }
    return a;
}
void add_self(long long& a, long long b) {
    a = add(a, b);
}
void sub_self(long long& a, long long b) {
    a = sub(a, b);
}

long long dp[10010][110][2];
string digits;
long long N = 0;
long long D;

int main() {
    ios_base :: sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> digits >> D;
    dp[digits.length()][0][0] = 1;
    dp[digits.length()][0][1] = 1;
    for (long long i = digits.length()-1; i>=0; i--) {
        for (long long j = 0; j<D; j++) {
            for (long long k = 0; k<digits[i]-'0'; k++) {
                add_self(dp[i][j][0], dp[i+1][j+k>=D ? (j+k)%D : j+k][1]);
                add_self(dp[i][j][1], dp[i+1][j+k>=D ? (j+k)%D : j+k][1]);
            }
            add_self(dp[i][j][0], dp[i+1][j+(digits[i]-'0')>=D ? (j+(digits[i]-'0'))%D : j+(digits[i]-'0')][0]);
            for (long long k = digits[i]-'0'; k<10; k++) {
                add_self(dp[i][j][1], dp[i+1][j+k>=D ? (j+k)%D : j+k][1]);
            }
        }
    }
    cout << sub(dp[0][0][0], 1LL) << endl;
    return 0;
}





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

using namespace std;

typedef long long LL;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

int main(){
	int N,A,B; cin >> N >> A >> B;
	vector<int> V,U;
	repp(i,0,N){
		if((A^B)&(1<<i)) V.push_back(i);
		else U.push_back(i);
	}
	if(V.size()%2==0) return cout << "NO" << endl, 0;
	cout << "YES" << endl;
	int z = 1;
	vector<int> ans(1<<N,0);
	repp(i,1,1<<N){
		ans[i] = (i&-i);
		if(ans[i] == (1<<(N-1))) ans[i] = (1<<(V.size()-1));
		else if(ans[i] == (1<<(V.size()-1))) ans[i] = (1<<(N-1));
	}
	for(int i = 0 ; i+1 < V.size() ; i += 2){
		ans[(1<<i)] = (1<<(i+1));
		ans[(2<<i)] = (1<<i);
		ans[(3<<i)] = (1<<(i+1));
	}
	for(auto x : U) V.push_back(x);
	vector<int> T(1<<N,0);
	repp(i,0,N) T[1<<i] = (1<<V[i]);
	ans[0] = A;
	cout << A;
	repp(i,1,1<<N){
		ans[i] = (ans[i-1]^T[ans[i]]);
		cout << ' ' << ans[i];
	}
	cout << endl;
	return 0;
}


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

int main() {
    int N, M;
    cin >> N >> M;
    priority_queue<int> q;
    rep(i, N) {
        int a;
        cin >> a;
        q.push(a);
    }
    rep(i, M) {
        int a = q.top(); q.pop();
        q.push(a/2);
    }
    ll ans = 0;
    rep(i, N) {
        ans += q.top(); q.pop();
    }
    cout << ans << endl;
    return 0;
}


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

k = 0
f = False
for _ in range(N):
    d1, d2 = [int(_) for _ in input().split()]
    if d1 == d2:
        k += 1
    else:
        k = 0
    if k >= 3:
        f = True
if f:
    print("Yes")
else:
    print("No")


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

N = N % 10

if N == 2 or N == 4 or N == 5 or N == 7 or N == 9 :
    print('hon')
elif N == 0 or N == 1 or N== 6 or N == 8 :
    print('pon')
else :
    print('bon')


Measured memory_bytes: 9160
flg = True
while flg:
    m, f, r = map(int, input().split())
    if m == -1 :
        if f == -1:
            if r == -1:
                flg = False
    if flg:
        if m == -1 or f == -1:
            print("F")
        elif m+f >= 80:
            print("A")
        elif m+f < 80 and m+f >= 65:
            print("B")
        elif m+f < 65 and m+f >= 50:
            print("C")
        elif m+f < 50 and m+f >= 30:
            if r >= 50:
                print("C")
            else:
                print("D")
        elif m+f < 30:
            print("F")



Measured memory_bytes: 5596
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Linq;
using System.Text;
using static System.Math;

class MainClass
{

    public static void Main(string[] args)
    {
        HashSet<int> lists = new HashSet<int>(LnInts());
        print(lists.Count == 2 ? "Yes" : "No");
    }

public static long PowLite(long n, long p, int mod = (int)1e9 + 7){long ans = 1;long now = n;for (; p > 0; p >>= 1){if ((p & 1) == 1){ans *= now;ans %= mod;}now *= now;now %= mod;}return ans;}
public static void print(object obj) { Console.WriteLine(obj); }
public static long Gcd(long a, long b) { if (a > b) { var r = a % b; if (r == 0) return b; else return Gcd(b, r); } else { var r = b % a; if (r == 0) return a; else return Gcd(a, r); } }
public static int Gcd(int a, int b) { if (a > b) { var r = a % b; if (r == 0) return b; else return Gcd(b, r); } else { var r = b % a; if (r == 0) return a; else return Gcd(a, r); } }
public static int[] LnInts() { var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); var ins = new int[vs.Length]; for (int i = 0; i < vs.Length; i++) ins[i] = int.Parse(vs[i]); return ins; }
public static int LnInt() { var vs = Console.ReadLine().Trim(); return int.Parse(vs); }
public static long[] LnLngs() { var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); var ins = new long[vs.Length]; for (int i = 0; i < vs.Length; i++) ins[i] = long.Parse(vs[i]); return ins; }
public static long LnLng() { var vs = Console.ReadLine().Trim(); return long.Parse(vs); }
public static string[] LnStrs() { var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); return vs; }
public static string LnStr() { var vs = Console.ReadLine().Trim(); return vs; }
public static List<T[]> AllPermutation<T>(params T[] array) where T : IComparable{var a = new List<T>(array).ToArray();var res = new List<T[]>();res.Add(new List<T>(a).ToArray());var n = a.Length;var next = true;while (next){next = false;int i;for (i = n - 2; i >= 0; i--){if (a[i].CompareTo(a[i + 1]) < 0) break;}if (i < 0) break;var j = n;do{j--;} while (a[i].CompareTo(a[j]) > 0);if (a[i].CompareTo(a[j]) < 0){var tmp = a[i];a[i] = a[j];a[j] = tmp;Array.Reverse(a, i + 1, n - i - 1);res.Add(new List<T>(a).ToArray());next = true;}}return res;}}



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

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

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  string S;
  cin>>S;
  if(S=="Sunny")cout<<"Cloudy"<<endl;
  if(S=="Cloudy")cout<<"Rainy"<<endl;
  if(S=="Rainy")cout<<"Sunny"<<endl;
  return 0;
}


Measured memory_bytes: 256
function main(s) {
	var n = Number(s.split("\n")[0]);
	var k = Number(s.split("\n")[1]);
	var x = 1;
	for (var i = 0; i < n; i++) {
		if (x < k) {x *= 2;} else {x += k;};
	}
	console.log(x);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));



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

int main() {
    long mod = 1e9+7;
    long N, K;
    cin>>N>>K;
    long DP[K+1];
    for(int i=0;i<=K;++i){
        DP[i] = 1;
    }
    long tmp, tmpnum, tmptwo, tmpN, tmpB, B;
    for(int i=K/2;i>=1;--i){
        tmpnum = 0;
        tmp = i;
        for(int j=1;j*tmp<=K;++j){
            tmpnum++;
        }
        tmpN = N;
        B = 1;
        while(tmpN>0){
            tmpB = tmpnum;
            tmptwo = 1;
            while(2*tmptwo <= tmpN){
                tmptwo *= 2;
                tmpB *= tmpB;
                tmpB %= mod;
            }
            tmpN -= tmptwo;
            B *= tmpB;
            B %= mod;
        }
        DP[i] = B;
        for(int j=2;j*i<=K;++j){
            DP[i] -= DP[j*i];
        }
    }
    long ans = 0;
    for(int i=1;i<=K;++i){
        ans += i*DP[i]%mod;
        ans %= mod;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 4412
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e9 + 5;
const int MAX = 1e6;
int main() {
	ll n, W;
	cin >> n >> W;
	vector<ll> dp(MAX, INF);
	dp[0] = 0;
	for(int i = 0; i < n; ++i) {
		int w, v;
		cin >> w >> v;
		for(int j = MAX - 1; j >= 0; --j) {
			if (j + v < MAX) {
				dp[j + v] = min(dp[j + v], dp[j] + w);
			}
		} 
	}
//	for(int i = 0; i < MAX; ++i) {
//		cerr << dp[i] << '\n';
//	}
	for(int i = MAX - 1; i >= 0; --i) {
		if (dp[i] <= W) {
			cout << i << '\n';
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 8064
use v5.18;
use warnings;
sub read_line { chomp(my $s = <>); $s }
sub splited_read_line { split / /, read_line }

sub divisor_num {
  my $n = shift;
  my @nums = grep {
    my $dev_num = $_;
    $n % $dev_num == 0;
  } 1 .. $n;
  scalar @nums;
}

my $n = read_line;
my @nums = grep { $_ % 2 == 1 && divisor_num($_) == 8 } 1 .. $n;
say scalar @nums;


Measured memory_bytes: 640
a = [list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
for k in range(n):
  for i in range(3):
    for j in range(3):
      if a[i][j]==b[k]:
        a[i][j]=-1
def result():
  for i in range(3):
    if a[i][0]==a[i][1]==a[i][2]==-1 or a[0][i]==a[1][i]==a[2][i]==-1:
      return 'Yes'
  if a[0][0]==a[1][1]==a[2][2]==-1 or a[0][2]==a[1][1]==a[2][0]==-1:
    return 'Yes'
  else:
    return 'No'
print(result())

Measured memory_bytes: 62144
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

void solve() {
    string s; cin >> s;
    bool c = false;
    REP(i,0,s.length()) {
        if (!c && s[i] == 'C')
            c = true;
        else if (c && s[i] == 'F') {
            cout << "Yes" << endl;
            return;
        }
    }
    cout << "No" << endl;

}

int main() {
    ios_base::sync_with_stdio(false);
    cout << setprecision(12) << fixed;

    solve();

	return 0;
}


Measured memory_bytes: 256