akhauriyash/Code-Regression huggingface dataset:
/*
 ________  ___   ___  ________
|\   __  \|\  \ |\  \|\   __  \
\ \  \_\ /\ \  \\_\  \ \  \|\  \
 \ \   __\_\ \______  \ \  \\\  \
  \ \  \_\  \|_____|\  \ \  \\\  \
   \ \______/|     \ \__\ \_______\
    \|______|/      \|__|\|_______|

*/
#include<bits/stdc++.h>

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

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

#define all(x) x.begin(),x.end()
#define pb push_back
#define lowbit(x) x&-x
#define lc rt<<1
#define rc rt<<1|1
#define ls lc,l,m
#define rs rc,m+1,r

#define dbg(x) cout<<' '<<#x<<" = "<<x<<endl;
#define dbg2(x,y) {cout<<' '<<#x<<" = "<<x<<',';dbg(y)}
#define dbg3(x,y,z) {cout<<' '<<#x<<" = "<<x<<',';dbg2(y,z)}

int read(int &x){return scanf("%d",&x);}
int read(ll &x){return scanf("%lld",&x);}
int read(double &x){return scanf("%lf",&x);}

int read(int &x,int &y){return scanf("%d%d",&x,&y);}
int read(ll &x,ll &y){return scanf("%lld%lld",&x,&y);}
int read(double &x,double &y){return scanf("%lf%lf",&x,&y);}

int read(int &x,int &y,int &z){return scanf("%d%d%d",&x,&y,&z);}
int read(ll &x,ll &y,ll &z){return scanf("%lld%lld%lld",&x,&y,&z);}
int read(double &x,double &y,double &z){return scanf("%lf%lf%lf",&x,&y,&z);}

ll qpow(ll a,ll b,ll mod){if(a==0)return 0;ll ans=1;a%=mod;while(b){if(b&1)ans=ans*a%mod;a=a*a%mod;b>>=1;}return ans%mod;}
ll inv(ll x,ll mod){return qpow(x,mod-2,mod);}


int dir[4][2]={0,1,0,-1,1,0,-1,0};
int mon[13]={ 0,31,28,31,30,31,30,31,31,30,31,30,31};

const int INF =0x3f3f3f3f;
const int mod = 1e9+7;
const int N = 5e5+5;

struct DSU{
	int f[N];
	void init(int n){fe(i,0,n)f[i] = i;}//remember initial
	int fa(int x){return f[x]==x?x:f[x]=fa(f[x]);}
	void join(int x,int y){x=fa(x);y=fa(y);if(x!=y)f[x]=y;}
};
struct CombMath{
	int C[2005][2005];
    void init(int n){
		fe(i,1,n)
			fe(j,1,n)
                C[i][j] = (C[i-1][j] + C[i-1][j-1])%mod;
    }
};

char s[N];
ll a[N];

signed main(){
//	freopen("in1.txt","r",stdin);
//	freopen("in2.txt","r",stdin);
//	freopen("in3.txt","r",stdin);
//	freopen("in4.txt","r",stdin);
//	freopen("in5.txt","r",stdin);
//	freopen("BZW.txt","r",stdin);


	int n;
	read(n);
	fe(i,1,n){
		read(a[i]);
	}
	ll tot =0;
	fe(i,1,n){
		fe(j,i+1,n){
			tot+=1ll*a[i]*a[j];
		}
	}
	printf("%lld\n",tot);



    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{
        int n, i, j;
        int cards[4][13];
        char marks[4] = {'S', 'H', 'C', 'D'};
        char in_mark;
        int in_rank;
        char buf[256];

        fgets(buf, 256, stdin);
        sscanf(buf, "%d", &n);

        for (i = 0; i < 4; i++)
                for (j = 0; j < 13; j++)
                        cards[i][j] = 0;

        for (i = 0; i < n; i++) {
                fgets(buf, 256, stdin);
                sscanf(buf, "%c %d", &in_mark, &in_rank);
                switch(in_mark) {
                case 'S':
                        cards[0][in_rank - 1] = 1;
                        break;
                case 'H':
                        cards[1][in_rank - 1] = 1;
                        break;
                case 'C':
                        cards[2][in_rank - 1] = 1;
                        break;
                case 'D':
                        cards[3][in_rank - 1] = 1;
                        break;
                }
        }

        for (i = 0; i < 4; i++)
                for (j = 0; j < 13; j++)
                        if (cards[i][j] == 0)
                                printf("%c %d\n", marks[i], j + 1);

        return 0;
}

Measured memory_bytes: 604
N, M = map(int, input().split())
A = list(map(int, input().split()))

mod_dict = {
    0: 1,
}
B = [0 for _ in range(N+1)]
for i in range(N):
    B[i+1] = A[i] + B[i]
    mod = B[i+1] % M
    if mod in mod_dict:
        mod_dict[mod] += 1
    else:
        mod_dict[mod] = 1

ans = 0
for val in mod_dict.values():
    ans += val * (val-1) // 2
print(ans)


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

const int maxn = 50;
int count[maxn][26];

int main() {
    int n;
    cin>>n;
    memset(count, 0, sizeof count);
    for (int i = 0; i < n; ++i) {
        string temp;
        cin>>temp;
        for (int j = 0; j < temp.size(); ++j)
            count[i][temp[j]-'a']++;
    }
    /*for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 26; ++j) {
            cout<<char('a'+j)<<" "<<count[i][j]<<" ";
        }
        cout<<endl;
    }*/
    string res = "";
    for (int i = 0; i < 26; ++i) {
        int temp = 50;
        for (int j = 0; j < n; ++j)
            temp = min(temp, count[j][i]);
        //cout<<char('a'+i)<<temp<<endl;
        for (int j = 0; j < temp; ++j)
            res += char('a'+i);
    }
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001

int main(){
    string S; cin >> S;
    vector<char> V;
    
    int ret = 0;
    for(int i=0; i<S.size(); i++){
        if(V.size()==0) V.push_back(S[i]);
        else if((V.back()=='1' && S[i]=='0') || (V.back()=='0' && S[i]=='1')){
            ret++;
            V.pop_back();
        }else{
            V.push_back(S[i]);
        }
    }
    cout << 2*ret << endl;
    return 0;
}


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

int main() {
  int64_t N;
  cin >> N;
  
  if (N == 0) {
    cout << 2 << endl;
    return 0;
  } else if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  
  vector<int64_t> lucas(N+1);
  lucas.at(0) = 2;
  lucas.at(1) = 1;
  
  for (int64_t i = 2; i < N+1; i++) {
    lucas.at(i) = lucas.at(i-1) + lucas.at(i-2);
  }
  
  cout << lucas.at(N) << endl;
}

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

using namespace std;

int main(int argc, char const* argv[])
{
	int data[10000];
	unsigned int answer[10000];

	int n;
	while( cin >> n && n != 0 ){
		for( int i = 0;i < 10000;i++ ){
			data[i] = 0;
			answer[i] = 0;
		}
		for( int i = 0;i < n;i++ ) cin >> data[i];
		sort( data, data + n );
		answer[0] = 0;
		for( int i = 1;i < n;i++ ) answer[i] = data[i - 1] + answer[i - 1];
		unsigned a = 0;
		for( int i = 0;i < n;i++ ) a += answer[i];
		cout << a << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
int main(){
	int i,j,minj,n,a[100],tmp,cnt=0,k;
	
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	
	for(i=0;i<n;i++){
		minj=i;
		for(j=i;j<n;j++){
			if(a[j]<a[minj]){
				minj=j;
			}
		}
		k=a[minj];
		tmp=a[i];
		a[i]=a[minj];
		a[minj]=tmp;
		if(k!=a[minj]) cnt++;
	}
	
	for(i=0;i<n-1;i++) printf("%d ",a[i]);
	
	printf("%d\n%d\n",a[n-1],cnt);
	
	return 0;
}


Measured memory_bytes: 2144
#include <bits/stdc++.h>
using namespace std;
int main(){
  int m;
  cin >> m;
  vector<int> nodes;
  vector<pair<int, int>> child;
  int root = -1;
  for (int i = 0; i < m; i++){
    string S;
    cin >> S;
    if (S == "insert"){
      int k;
      cin >> k;
      if (!nodes.empty()){
        int v = 0;
        while (1){
          if (k < nodes[v]){
            if (child[v].first != -1){
              v = child[v].first;
            } else {
              child[v].first = nodes.size();
              break;
            }
          } else {
            if (child[v].second != -1){
              v = child[v].second;
            } else {
              child[v].second = nodes.size();
              break;
            }
          }
        }
      }
      nodes.push_back(k);
      child.push_back(make_pair(-1, -1));
    }
    if (S == "print"){
      //Inorder
      if (nodes.size() != 0){
        stack<int> S;
        vector<int> t(nodes.size(), 0);
        S.push(0);
        while (!S.empty()){
          int v = S.top();
          S.pop();
          if (t[v] == 1){
            cout << ' ' << nodes[v];
          }
          if (t[v] == 0){
            S.push(v);
            if (child[v].second != -1){
              S.push(child[v].second);
            }
            S.push(v);
            if (child[v].first != -1){
              S.push(child[v].first);
            }
          }
          t[v]++;
        }
      }
      cout << endl;
      //Preorder
      if (nodes.size() != 0){
        stack<int> S;
        vector<int> t(nodes.size(), 0);
        S.push(0);
        while (!S.empty()){
          int v = S.top();
          S.pop();
          if (t[v] == 0){
            cout << ' ' << nodes[v];
          }
          if (t[v] == 0){
            S.push(v);
            if (child[v].second != -1){
              S.push(child[v].second);
            }
            S.push(v);
            if (child[v].first != -1){
              S.push(child[v].first);
            }
          }
          t[v]++;
        }
      }
      cout << endl;
    }
  }
}


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

#define ll long long
#define forn(i, n) for(int i=0; i<int(n); i++)
#define endl '\n'
const int N = 1e5+5;
ll h[N];
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n; cin>>n;

    forn(i, n ) cin>>h[i];
    vector<ll> dp(n, INT_MAX);
    dp[0] = 0;

    forn(i, n-1) {
        if(i < n-2)
            dp[i+2] = min(abs(h[i+2] - h[i]) + dp[i], dp[i+2]);

        dp[i+1] = min(abs(h[i+1] - h[i]) + dp[i], dp[i+1]);


    }

    cout<<dp[n-1];
}



Measured memory_bytes: 4788
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 n: usize = read();
    let k: usize = read();
    let r: usize = read();
    let s: usize = read();
    let p: usize = read();
    let mut t: Vec<char> = read::<String>().chars().collect();
    let mut sum = 0;

    for c in t.iter() {
        sum += match c {
            &'r' => p,
            &'s' => r,
            &'p' => s,
            _ => r,
        }
    }

    //println!("{:?}", t);

    t.reverse();
    for i in 0..(t.len() - k) {
        if t[i] == t[i+k] {
            sum -= match &t[i] {
                &'r' => p,
                &'s' => r,
                &'p' => s,
                _ => r,
            };
            t[i+k] = 'x';
        }
    }
    //println!("{:?}", t);
    println!("{}", sum);

}


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { -1,0, 1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair


int main() {
  fio();
  string s;
  cin >> s;
  s += "EEEEE";
  int n = s.size();

  ll ans = 0;
  ll cnt = 0;
  int i = 0;
  while (i < n) {
    if (s[i] == 'E') break;
    if (s[i] == 'A') {
      cnt++;
      i++;
    }
    else if (s[i] == 'C') {
      cnt = 0;
      i++;
    }
    else {
      if (s[i + 1] == 'C') {
        ans += cnt;
        i += 2;
      }
      else {
        cnt = 0;
        i++;
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 720
#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#define MAX_N 100001
#define INF 2147483647
#define REP(i,n) for(int i=0;i<(int)(n);i++)
void init(int n);
int find(int n);
void unite(int x,int y);
bool same(int x, int y);
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
using namespace std;
int main()
{
  int N,A[101],M=0;
  cin >> N;
  REP(i,N)cin >> A[i];
  for(int i=0;i<N;i++){
    for(int j=i;j<N;j++){
      M = max(M,abs(A[i]-A[j]));
    }
  }
  cout << M << endl;
  return 0;
}

int par[MAX_N];
int ranks[MAX_N];

//n要素で初期化
void init(int n){
  REP(i,n){
    par[i] = i;
    ranks[i] = 0;
  }

}

//木の根を求める
int find(int x){
  if(par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x]);
  }
}

void unite(int x,int y){
  x = find(x);
  y = find(y);
  if(x == y) return ;
  if(ranks[x] < ranks[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(ranks[x] == ranks[y]) ranks[x]++;
  }
}

bool same(int x, int y){
  return find(x) == find(y);
}



Measured memory_bytes: 256
n, k = map(int, input().split())
s = list(map(int, input().split()))
inf = 10 ** 8
dp = [inf] * n
dp[0] = 0

for j in range(1, n):
    buf = [dp[i] + abs(s[j]-s[i]) for i in range(max(0, j - k), j)]
    dp[j] = min(buf)
print(dp[-1])


Measured memory_bytes: 52448
//https://atcoder.jp/contests/dp/tasks/dp_a
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;

#define f(i,a,b) for(int i = a;i<b;i++)
#define rep(i,a,b) for(int i = a;i<=b;i++)
#define fd(i,a,b) for(int i = a;i>b;i--)
#define repd(i,a,b) for(int i = a;i>=b;i--)

#define pii pair<int,int>
#define pll pair<ll,ll>

#define fi first
#define se second
#define pb push_back
#define sz(x) (int) (x).size()
#define all(x) x.begin(),x.end()
using namespace std;
const int mod = 1000000007;
const int maxn = 200000;
int main(){
    int n;
    scanf("%d", &n);
    vector<int> h(n);
    f(i,0,n) cin>>h[i];
    vector<int> dp(n);
    dp[0] = 0;dp[1] = abs(h[1]-h[0]);
    f(i,2,n)
        dp[i] = min(dp[i-2] + abs(h[i]-h[i-2]),dp[i-1] + abs(h[i]-h[i-1]));
    cout<<dp[n-1]<<endl;
}



Measured memory_bytes: 4056
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int> A(N),B(N-1);
  for(int i=0;i<N-1;i++){
    cin>>B.at(i);
    A.at(B.at(i)-1)++;
  }
  for(int i=0;i<N;i++)
    cout<<A.at(i)<<endl;
}
    

Measured memory_bytes: 4844
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fr first
#define sc second
using namespace std;
typedef long long ll;
const long long llnrm=LLONG_MAX;
const int nrm=INT_MAX;
const int nrn=INT_MIN;
const int nmax=1e5+5;
const int mod=1e9+7;
const int lim=1e8;
ll n,a[500000],ans,mx,tmp,x,y;
string s,t;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
    //freopen("solution.in","r",stdin);
    //freopen("solution.out","w",stdout);o
    cin>>x>>y;
    ans=abs(abs(x)-abs(y));
    if (x==0)
    {
        if(y<0)
        {
            ans++;
        }
    }
    else if(y==0)
    {
        if(x>0)
        {
            ans++;
        }
    }
    else if (x>0!=y>0)
    {
        ans++;
    }
    else if(x>y)
    {
        ans+=2;
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>


using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (998244353LL)

class mod {
public:
    mod() {m_n = 0;}
    mod(ll n) {if (n >= 0) m_n = n % MOD; else m_n = n % MOD + MOD;}
    friend bool operator== (const mod& a, const mod& b) {return a.m_n == b.m_n;}
    friend bool operator!= (const mod& a, const mod& b) {return !(a == b);}
    friend mod operator+ (const mod& a, const mod& b) {return (a.m_n + b.m_n) % MOD;}
    friend mod& operator+= (mod& a, const mod& b) {return a = a + b;}
    friend mod operator- (const mod& a) {return -a.m_n;}
    friend mod operator- (const mod& a, const mod& b) {return (a.m_n + (-b.m_n)) % MOD;}
    friend mod& operator-= (mod& a, const mod& b) {return a = a - b;}
    friend mod operator* (const mod& a, const mod& b) {return (a.m_n * b.m_n) % MOD;}
    friend mod& operator*= (mod& a, const mod& b) {return a = a * b;}
    friend mod pow(const mod& n, ll r) {
        if (r == 0) {
            return 1;
        } else if (r < 0) {
            return pow(n, (MOD - 2) * (-r));
        } else if (r % 2 == 0) {
            mod tmp = pow(n, r / 2);
            return tmp * tmp;
        } else {
            return n * pow(n, r - 1);
        }
    }
    friend mod operator/ (const mod& a, const mod& b) {return a * pow(b, -1);}
    friend mod& operator/= (mod& a, const mod& b) {return a = a / b;}
    friend ostream& operator<< (ostream& os, const mod& n) {os << n.m_n; return os;}
    friend istream& operator>> (istream& is, mod& n) {ll tmp; is >> tmp; n = mod(tmp); return is;}
private:
    ll m_n;
};
mod pow(ll n, ll r) {return pow(mod(n), r);}

int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    
    int N;
    cin >> N;
    vector<int> A(N);
    int S = 0;
    for (int n = 0; n < N; ++n) {
        cin >> A[n];
        S += A[n];
    }
    
    vector<mod> DP(S+1, 0);
    DP[0] = 1;
    for (int n = 0; n < N; ++n) {
        for (int s = S; s >= 0; --s) {
            DP[s] = 2 * DP[s];
            if (s >= A[n]) {
                DP[s] += DP[s-A[n]];
            }
        }
    }
    
    vector<mod> DP2(S+1, 0);
    DP2[0] = 1;
    for (int n = 0; n < N; ++n) {
        for (int s = S; s >= 0; --s) {
            if (s >= A[n]) {
                DP2[s] += DP2[s-A[n]];
            }
        }
    }
    
    mod All = pow(3, N);
    mod Tmp = 0;
    for (int s = (S+1)/2; s <= S; ++s) {
        Tmp += DP[s];
    }
    if (S%2 == 0) {
        Tmp -= DP2[S/2];
    }
    cout << All-3*Tmp << endl;

    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  string s;
  cin >> s;
  if (s.find("YAKI") == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Measured memory_bytes: 256
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end


x,a,b = gi
puts (a-x).abs > (b-x).abs ? 'B' : 'A'


Measured memory_bytes: 4732
A = int(input())
B = int(input())
C = int(input())
x = int(input())


count=0
for i in range(A+1):
    for j in range(B+1):
        for p in range(C+1):
          if(10*i+2*j+p==x/50):
          	count+=1
print(count)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,j,cool;
    cin>>n;
    for(j=n;;j++)
    {
         cool=0;
        for(i=2;i<=j/2;i++)
        {

            if(j%i==0)
            {
                cool=1;
            }
         }
    if(cool==0)
        break;
    }
    cout<<j;
return 0;}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(),(v).end())
typedef int64_t lint;
// lint mod = 998244353;
// lint mod = 1000000007;
template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

int app() {
  int h,w,K;
  cin>>h>>w>>K;

  vector<vector<bool>> c(h,vector<bool>(w));
  rep(i,h){
    string st;
    cin>>st;
    rep(j,w){
      c[i][j]=st[j]=='#';
    }
  }

  int ans=0;

  rep(k,1<<(h+w)){
    int b=0;
    rep(i,h)rep(j,w){
      if(
        (k&(1<<i))
        &&(k&(1<<(h+j)))
        &&c[i][j]
      ) b++;
    }
    if(b==K) ans++;
  }
  return ans;
}

int main(){cout<<app()<<endl;return 0;}


Measured memory_bytes: 3624
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    int K; scanf("%d", &K);

    vector<int> rec(K, INF);
    rec[7 % K] = 1;
    queue<int> que;
    que.emplace(7 % K);
    while(que.size()) {
        int v = que.front(); que.pop();
        int nv = (v * 10 + 7) % K;
        if(rec[nv] > rec[v] + 1) {
            rec[nv] = rec[v] + 1;
            que.emplace(nv);
        }
    }

    if(rec[0] == INF) puts("-1");
    else cout << rec[0] << endl;
    return 0;
}


Measured memory_bytes: 7152
#include<iostream>
#include<vector>
#include<string>

int main(){
  int N, L;
  std::cin >> N >> L;
  std::vector<std::string> S(N);
  for(int i = 0; i < N; i++) std::cin >> S.at(i);
  bool isISmall;
  std::string tempS;
  for(int i = 1; i < N; i++){
    for(int j = 0; j < i; j++){
      isISmall = false;
      for(int k = 0; k < L; k++){
        if(S.at(i - j).at(k) < S.at(i - j - 1).at(k)){
          isISmall = true;
          break;
        }else if(S.at(i - j).at(k) > S.at(i - j - 1).at(k)) break;
      }//k
      if(isISmall){
        tempS = S.at(i - j);
        S.at(i - j) = S.at(i - j - 1);
        S.at(i - j - 1) = tempS;
      }else break;
    }//j
  }//i
  for(int i = 0; i < N; i++){
    std::cout << S.at(i);
  }
  std::cout << std::endl;
}

Measured memory_bytes: 256
from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
#from math import *
from collections import defaultdict as dd, deque
def data(): return sys.stdin.readline().strip()
def mdata(): return map(int, data().split())
out=sys.stdout.write
#sys.setrecursionlimit(100000)
INF=int(10e9)


def knapSack(V):
    for i in range(n + 1):
        for v in range(V + 1):
            if v == 0:
                K[i][v] = 0
            elif val[i - 1] <= v:
                K[i][v] = min(wt[i - 1] + K[i - 1][v - val[i - 1]], K[i - 1][v])
            else:
                K[i][v] = K[i - 1][v]

    return K[n][V]

n,w=mdata()
val=[0]*(n)
wt=[0]*(n)
for i in range(n):
    wt[i],val[i]=mdata()
V=100005
K = [[1000000007 for x in range(V + 1)] for x in range(n + 1)]
knapSack(V)
m=0
for i in range(n + 1):
    for v in range(V + 1):
        if 1<=K[i][v]<=w :
            m=max(m,v)
print(m)


Measured memory_bytes: 173448
n=int(input())
s=list(input())
l=['SS','SW','WS','WW']
if s[0]=='o':
    g=['S','W','W','S']
else:
    g=['W','S','S','W']
for i in range(4):
    ans=l[i]
    for j in range(1,n):
        if s[j]=='o':
            for k in range(4):
                if ans[j-1]+ans[j]==l[k]:
                    if k==0 or k==3:
                        ans+='S'
                    else:
                        ans+='W'
        else:
            for k in range(4):
                if ans[j-1]+ans[j]==l[k]:
                    if k==0 or k==3:
                        ans+='W'
                    else:
                        ans+='S'
    if ans[-1]==ans[0] and ans[-2]==g[i]:
        print(ans[:-1])
        exit()
print(-1)
    


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

#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(var,start,end) for(int var=start; var<end; var++)
#define repr(var,start,end) for(int var=start; var>=end; var--)
#define repi(var,start,end) for(int var=start; var<=end; var++)
#define debg(var) cerr<<#var<<" : "<<var<<" "
#define pb push_back
#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

void solve() {
    int n;
    cin>>n;
    int a[n];
    rep(i,0,n)
        cin>>a[i];
    map<int,int> m;
    rep(i,0,n) {
        m[a[i]]++;
    }
    int q;
    cin>>q;
    ull sum = accumulate(a,a+n,(ull)0);
    while(q--) {
        ull b,c;
        cin>>b>>c;
        ull k = m[b];
        sum-=(b*k);
        m.erase(b);
        m[c] += k;
        sum+=(c*k);
        cout<<sum<<'\n';
    }    
}


int main() {
    fastio
    int t = 1;
    //cin>>t;
    while(t--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 6972
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
double dp[3001][3001];
double solve(double p[],int i,int x){
    if(x==0)
        return 1;
    if(i==0)
        return 0;
    if(dp[i][x] > -0.9)
        return dp[i][x];
    return dp[i][x]=p[i]*solve(p,i-1,x-1) +(1-p[i])*solve(p,i-1,x);
}
int main()
{
    int n;
    cin>>n;
    memset(dp,-1,sizeof dp);
    double p[n+1];
    for(int i=1;i<=n;i++)
        cin>>p[i];
    
    cout<<fixed<<setprecision(10)<<solve(p,n,n/2+1)<<endl;
    return 0;
}

Measured memory_bytes: 74352
#include <iostream>
#include <algorithm>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

int N, a[300000];

int main(void) {
  cin >> N;
  REP(i, 0, N * 3) cin >> a[i];

  sort(a, a + N * 3);
  reverse(a, a + N * 3);

  long ans = 0;
  REP(i, 0, N) ans += a[i * 2 + 1];

  cout << ans << endl;

  return 0;
}


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

int main() {
    ll n;
    cin>>n;
    vector<pair<ll,ll>> a(n);
    rep(i,n){
        ll aa;
        cin>>aa;
        a[i]=make_pair(aa,i);
    }
    sort(a.rbegin(), a.rend());
    VV dp(n+1,V(n+1,-1e9));
    dp[0][0]=0;
    rep(i,n){
        dp[i+1][0]=dp[i][0]+a[i].first*(a[i].second-i);
        dp[0][i+1]=dp[0][i]+a[i].first*(n-1-i-a[i].second);
    }
    for(ll sum=1;sum<=n;sum++){
        for(ll i=1;i<sum;i++){
            dp[i][sum-i]=max(dp[i][sum-i],dp[i-1][sum-i]+a[sum-1].first*(a[sum-1].second-i+1));
            dp[i][sum-i]=max(dp[i][sum-i],dp[i][sum-i-1]+a[sum-1].first*(n-sum+i-a[sum-1].second));
        }
    }
    ll ans=0;
    rep(i,n+1){
        ans=max(ans,dp[i][n-i]);
    }
    cout<<ans<<endl;
}


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

int main() {
  int N, sum = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int L, R;
    cin >> L >> R;
    sum += (R - L + 1);
  }
  cout << sum << endl;
}

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

#define REP(i,n) for(int i = 0;i < n;i++)
#define REPR(i,n) for(int i = n-1;i >= 0;i--)
#define FOR(i,m,n) for(int i = m;i < n;i++)
#define INF 2e9
#define ALL(v) v.begin(),v.end()
#define ll long long
#define GREATER greater<int>()

using namespace std;

string pop_back(string s){
    string t = s.substr(0,s.size()-1);
    return t;
}

int gcd(int max,int min){
    
    if(max<min){
        int tmp=max;
        max=min;
        min=tmp;
    }

    if(max%min==0)return min;
    else return gcd(min,max%min);

}

int main(void){

    int n;
    cin>>n;
    for(int i=0;i<=100;i+=4){
        for(int j=0;j<=100;j+=7){
            if(i+j==n){
                cout<<"Yes"<<endl;
                return 0;
            }
            if(i+j>n)break;
        }
    }
    cout<<"No"<<endl;

    return 0;
}




Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int num = Integer.parseInt(sc.next());
      int ticket = Integer.parseInt(sc.next());
      
      PriorityQueue<Integer> prices 
        = new PriorityQueue<Integer>(Collections.reverseOrder());
     
      for (int i = 0; i < num; i++) {
        prices.offer(Integer.parseInt(sc.next()));
      }
      
      while (ticket > 0) {
        prices.offer(prices.poll() / 2);
      	ticket--;
      }
      
      long sum = 0;
       for (int i: prices) {
         sum += i;
      }
      System.out.println(sum);
    }
}


Measured memory_bytes: 48856
using System;
using System.Collections.Generic;
using System.Linq;


namespace _511_Who_Are_The_Student_Yet_To_Submit
{
	class Program
	{
		static void Main ( string[] args )
		{
			//input
			int[] inputNumArray = new int[28];
			for (int lp = 0; lp < inputNumArray.Length; lp++)
			{
				inputNumArray[lp] = int.Parse (Console.ReadLine ().Trim ());
			}

			//process
			List<int> submitList = new List<int> (inputNumArray);
			submitList.Sort ();

			int notSubmitCount = 2;
			for (int searchNumber = 1; searchNumber <= 30; searchNumber++)
			{
				int result = submitList.BinarySearch (searchNumber);

				if (result < 0)
				{
					Console.WriteLine (searchNumber);

					if (notSubmitCount <= 0)
					{
						break;
					}					
				}
			}		
		}
	}
}

Measured memory_bytes: 9624
from math import ceil, log
from itertools import product


def solve(string):
    n = int(string)
    base = [2**i for i in range(1, 40)]
    inc = [(-2)**i for i in range(40)]
    ans = ""
    for b, i in zip(base, inc):
        if n % b >= b // 2:
            n -= i
            ans += "1"
        else:
            ans += "0"
        if n == 0:
            break
    return ans[::-1]


if __name__ == '__main__':
    print(solve(input()))


Measured memory_bytes: 3064
#include <stdio.h>
#include <vector>
#include <string.h>
#include <algorithm>
#include <map>
#include <string>
#include <deque>

#pragma warning(disable:4996)

int abs(int a) {
	if (a < 0) a *= -1;
	return a;
}

#define INF 100000

int main(void) {
	std::vector<int> A;
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		int w;
		scanf("%d", &w);
		A.push_back(w);
	}
	int min = INF;
	for (int i = 1; i < n; ++i) {
		int S0 = 0;
		int S1 = 0;
		for (int j = 0; j < n; ++j) {
			if (j < i) {
				S0 += A[j];
			}
			else {
				S1 += A[j];
			}
		}
		int diff = abs(S0 - S1);
		if (diff < min) {
			min = diff;
		}
	}

	printf("%d", min);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;
int main()
{
	int Rt[MAX], n;

	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> Rt[i];

	int maxdv = Rt[1] - Rt[0];
	int minv = Rt[0];
	for (int i = 1; i < n-1; i++)
	{
		minv = min(minv, Rt[i]);
		maxdv = max(maxdv, Rt[i + 1] - minv);
	}

	cout << maxdv << endl;
	return 0;
}


Measured memory_bytes: 3892
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

string s;
char s_[111111];
int k;

struct SA {
  string s;
  vector<int> sa, pos;
  int gap;
  
  void build(const string& s_) {
    s = s_;
    sa.resize(s.size());
    pos.resize(s.size());
    auto comp = [&](int a, int b) {
      if (pos[a] != pos[b]) return pos[a] < pos[b];
      a += gap;
      b += gap;
      return (a < int(s.size()) &&
              b < int(s.size())) ? pos[a] < pos[b] : a > b;
    };
    for (size_t i = 0; i < s.size(); i++) {
      sa[i] = i;
      pos[i] = s[i];
    }
    vector<int> t(s.size());
    for (gap = 1;; gap *= 2) {
      sort(sa.begin(), sa.end(), comp);
      for (size_t i = 0; i+1 < s.size(); i++) {
        t[i+1] = t[i] + (comp(sa[i], sa[i+1]) ? 1 : 0);
      }
      for (size_t i = 0; i < s.size(); i++) {
        pos[sa[i]] = t[i];
      }
      if (t.back() == int(s.size())-1) break;
    }
  }
};

SA sa;
vector<int> vs;
int l;

bool test(int j) {
  int c = 0;
  string buf = "";
  string t = s.substr(j, l);
  // printf("%s\n", t.c_str());
  for (size_t i = 0; i < s.size(); i++) {
    // printf("%zd: %d %d\n", i, x, c);
    // printf("%zd: %s %d\n", i, buf.c_str(), c);
    if (l == 1) {
      if (s[i] > t[0]) return false;
    }
    if (((buf.size()+1 == t.size() && buf+s[i] > t) || buf.size()+1 > t.size())) {
      buf = s[i];
      ++c;
    } else {
      buf += s[i];
    }
  }
  return c <= k;
}

int main(void) {
  scanf("%d%s", &k, s_); s = s_;
  sa.build(s);
  l = (s.size()+k)/(k+1);
  for (int i = 0; i < int(sa.sa.size()); i++) {
    if (sa.sa[i]+l <= int(s.size())) {
      vs.push_back(sa.sa[i]);
    }
  }

  int lb = -1;
  int rb = vs.size()-1;
  while (rb-lb > 1) {
    int mb = (lb+rb)/2;
    if (test(vs[mb])) {
      rb = mb;
    } else {
      lb = mb;
    }
  }
  printf("%s\n", s.substr(vs[rb], l).c_str());
  return 0;
}


Measured memory_bytes: 2296
#include<iostream>
#include<cstdio>
#include<queue>
#include<vector>
#include<string.h>

using namespace std;

long long a[100000];
long long N,K,Q;


int main()
{
  cin >> N >> K >> Q;
  
  vector<long long> vec(N,K-Q);
  
  int i,j;
  /*
  for(i=0;i<N;i++)
  {
    vec[i]=K-Q;
  }
*/
  for(i=0;i<Q;i++)
  {
    cin >> j;
    j--;
    vec[j]++;
  }
  
  for(i=0;i<N;i++)
  {
    if(vec[i]>0)
    {
      cout << "Yes\n";
    }
    else
    {
      cout << "No\n";
    }
  }
    


 return 0; 
}

Measured memory_bytes: 1408
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        long n = sc.NextLong();

        for (long i = 0; i <= n; i++)
        {
            if (i * 108 / 100 == n)
            {
                Console.WriteLine(i);
                return;
            }
        }

        Console.WriteLine(":(");
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


Measured memory_bytes: 27460
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = list(map(int,input().split()))

#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
#a,bの最小公倍数
def lcm(a, b):
	return a * b // gcd (a, b)

tmp = a[0]//2
con = 0
while True:
    if tmp%2 == 0:
        tmp = tmp//2
        con += 1
    else:
        break


x = 1

for i in range(n):
    a[i] = a[i]//2

    x = lcm(a[i],x)

    tmp = a[i]
    cnt = 0
    while True:
        if tmp%2 == 0:
            tmp = tmp//2
            cnt += 1
        else:
            break
    if cnt != con:
        print(0)
        exit()

if m < x:
    print(0)
else:
    print((m-x)//(2*x)+1)

Measured memory_bytes: 59632
import sys
input = sys.stdin.readline

N = int(input())
STATE = [[]]*N
for i in range(N):
    a = int(input())
    STATE[i] = [list(map(int, input().split())) for i in range(a)]

def main():
    ans = 0
    for i in range(1<<N):
        ans = max(ans, detect(i))
    print(ans)

def detect(i):
    ONT = 0
    for j in range(N):
        if  not (i & 1<<j):
            continue
        ONT += 1
        for x, y in STATE[j]:

            if (y==0) ^ (i>>(x-1) & 1) == 0:
                return 0
    return ONT

if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int rect1,rect2 = 0;
        rect1 = a * b;
        rect2 = c * d;
        if(rect1 >= rect2){
            System.out.println(rect1);
        }else{
            System.out.println(rect2);
        }
    }
}

Measured memory_bytes: 22612
#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::cin;
using std::string;

// ????????¨??¢??°
string battle_check(string taro, string hanako) {
	if (taro > hanako)
	{
		return "taro";
	}
	else if (taro < hanako) {
		return "hanako";
	}
	else {
		return "draw";
	}
}

int main() {
	
	int battle_num;	// ???????????°
	string taro_card;	// ????????????????????¢??????????????????
	string hanako_card;	// ??±?????????????????¢??????????????????
	int taro_score = 0;	
	int hanako_score = 0;
	string result;
	// ??\???
	cin >> battle_num;

	for (size_t i = 0; i < battle_num; i++)
	{
		cin >> taro_card;
		cin >> hanako_card;

		// ??????
		result = battle_check(taro_card, hanako_card);
		if (result == "taro")
		{
			taro_score += 3;
		}
		else if (result == "hanako") {
			hanako_score += 3;
		}
		else
		{
			taro_score += 1;
			hanako_score += 1;
		}
	}
	cout << taro_score << " " << hanako_score << endl;
	return 0;
}

Measured memory_bytes: 3136
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;

int a, b, c;

signed main() {
	cin >> a >> b >> c;
	
	int i;
	int wa;
	for (i = 0; ; i++) {
		if (a > i || b > i || c > i) continue;
		wa = i - a + i - b + i - c;
		if (wa % 2 == 0) break;
	}
	cout << wa / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
#7 B - Cut and Count
N = int(input())
S = list(input())

mcnt = 0
for i in range(N-1):
    count = 0
    l = S[:i]
    r = S[i:]
    l = set(l)
    r = set(r)
    for j in l:
        if j in r:
            count += 1
    mcnt = max(mcnt,count)
print(mcnt)

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

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

const long long INF = 1LL << 60;

int main() {
    int x, y, z;
    cin >> x >> y >> z;
    
    cout << z << " " << x << " " << y << endl;
    return 0;
}

Measured memory_bytes: 256
s_line = input()
s_file = {}
count = 0
for s in s_line:
    s_file[s] = 0
for s in s_line:
    s_file[s] += 1
    if s_file[s] > 1:
        print("no")
        break
    else:
        count += 1
if count == len(s_line):
    print("yes")

Measured memory_bytes: 3064
#include<stdio.h>
#define MAX 10000

int main(){
    int a[MAX], b[MAX];
    char op[MAX];
    int i;

    for(i = 0; i < MAX; i++){
        scanf("%d %c %d", &a[i], &op[i], &b[i]);
        if(op[i] == '?') break;
    }

    for(i = 0; i < MAX; i++){
        if(op[i] == '+') printf("%d\n", a[i] + b[i]);
        if(op[i] == '-') printf("%d\n", a[i] - b[i]);
        if(op[i] == '*') printf("%d\n", a[i] * b[i]);
        if(op[i] == '/') printf("%d\n", a[i] / b[i]);
        if(op[i] == '?') break;
    }

    return 0;
}


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

string w;
map<char, int> cnt;

signed main()
{
	cin >> w;
	rep(i,w.length()) cnt[w[i]]++;
	for (map<char, int>::iterator it=cnt.begin(); it!=cnt.end(); it++) {
		if (it->second % 2 != 0) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}


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


int main () {
	lli a,b=0;

	cin >> a;
	if(a%11!=0 && 6<a%11)b+=2;
	if(a%11!=0 && 7>a%11)++b;

	cout << a/11*2+b << 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);
	long long int n;
	cin>>n;
	set<string> s;
	while(n--){
		string ss;
		cin>>ss;
		s.insert(ss);
	}
	cout<<s.size();
	return 0;
}

Measured memory_bytes: 19192
// #define STOPIT
#include <bits/stdc++.h>
#define loop(n) for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  lint x, y; std::cin >> x >> y;
  lint ans = std::__gcd(x,y);
  std::cout << x*y/ans << std::endl;
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _2199 {
    class Program {
        static void Main(string[] args) {
            int yNum = 256;
            int MAX_VAL = int.MaxValue/10;
            while (true) {
                var nm = Console.In.ReadLine().Split(' ').Select(int.Parse).ToArray();
                var n = nm[0];
                var m = nm[1];
                if (n == 0 && m == 0) { break; }
                var c = new List<int>();
                var x = new List<int>();
                x.Add(128);
                for (int i = 0; i < m; i++) {
                    c.Add(int.Parse(Console.In.ReadLine()));
                }
                for (int i = 0; i < n; i++) {
                    x.Add(int.Parse(Console.In.ReadLine()));
                }
                //var values = new int[n + 1, yNum];
                var values = new int[2][];
                for (int i=0; i<values.Length; ++i) { values[i] = new int[yNum]; }
                for (int i = 0; i < 2; i++) {
                    for (int j = 0; j < yNum; j++) {
                        values[i][j] = MAX_VAL;
                    }
                }
                values[0][128] = 0;
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < yNum; j++) {
                        if (values[0][j] != MAX_VAL) {
                            for (int k = 0; k < m; k++) {
                                if ((0 <= j + c[k]) && (j + c[k] <= 255)) {
                                    values[1][j + c[k]] = Math.Min(values[1][j + c[k]], values[0][j] + (j + c[k] - x[i+1]) * (j + c[k] - x[i+1]));
                                }
                                else if (0 > j + c[k]) {
                                    values[1][0] = Math.Min(values[1][0], values[0][j] + (0 - x[i+1]) * (0 - x[i+1]));
                                }
                                else {
                                    values[1][255] = Math.Min(values[1][255], values[0][j] + (255 - x[i+1]) * (255 - x[i+1]));
                                }
                            }
                        }
                    }
                    for (int j=0; j<yNum; j++) {
                        values[0][j] = values[1][j];
                        values[1][j] = MAX_VAL;
                    }
                }
                Console.Out.WriteLine(values[0].Min());
            }
        }
    }
}

Measured memory_bytes: 6432
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N,A,B;
	string S;
	scan(N);scan(A);scan(B);
	scan(S);
	int Anow=0,Bnow=0;
	rep(i,N){
		if(S[i]=='a'&&Anow+Bnow<A+B){
			prin("Yes");
			Anow++;
		}
		else if(S[i]=='b'&&Anow+Bnow<A+B&&Bnow<B){
			prin("Yes");
			Bnow++;
		}
		else{
			prin("No");
		}
	}
	return 0;
}


Measured memory_bytes: 896