akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>

using namespace std;
#define ALL(a) (a).begin(), (a).end()
#define REP(i, n) for (size_t i = 0; i < (n); i++)
#define nvec(T, v, n) vector<T> v(n); REP(i, n) {cin>>(v)[i];}
#define npairs(T1, T2, v, n) vector<pair<T1, T2>> v(n); REP(i, n){cin>>v[i].first>>v[i].second;}
#define ntuples(T1, T2, T3, v, n) vector<tuple<T1, T2, T3>> v(n); REP(i, n){cin>>get<0>(v[i])>>get<1>(v[i])>>get<2>(v[i]);}
#define vec2d(T, v, m, n) vector<vector<T>> (v)(m, vector<T>(n))
#define nvec2d(T, v, m, n) vec2d(T, v, m, n); REP(j, m){REP(i, n) {cin>>(v[j])[i];}}

#define min_index(v) size_t( min_element(all(v)) - (v).begin() )
#define max_index(v) size_t( max_element(all(v)) - (v).begin() )
#define min_e(v) *min_element(ALL(v))
#define max_e(v) *max_element(ALL(v))

#define count_le(v, a) size_t( upper_bound(ALL(v), a) - (v).begin() )
#define count_lt(v, a) size_t( lower_bound(ALL(v), a) - (v).begin() )
#define count_ge(v, a) size_t( (v).end() - lower_bound(ALL(v), a) )
#define count_gt(v, a) size_t( (v).end() - upper_bound(ALL(v), a) )

#define order(neq_sl) [](const auto s, const auto l){return neq_sl;}
#define make_lr(v,type,l,r) vector<type> l(n+1),r(n+1);FOR(i,n){l[i+1]=l[i]+v[i];r[i+1]=r[i]+v[n-1-i];}

#define acm accumulate
#define SUM(v) accumulate(ALL(v), 0l)
#define SORT(v) sort(ALL(v))
#define P 1000000007
long powP (long a, long b) {
  if (b == 1) return a;
  else if (b == 0) return 1;
  else if (b < 0) return powP(a, P + b - 1);
  else return (powP(a, b/2) * powP(a, b/2 + b%2)) % P;
}

#define GCD(v) gcd(ALL(v), 0l)

/*template <typename T>
T gcd(T a, T b) {
    if (a > b) swap(a, b);
    if (a == 0) return b;
    return gcd(b%a, a);
}
template <typename InputItr, typename T>
T gcd(InputItr first, InputItr last, T init) {
    for (; first != last; ++first) init = gcd(init, *first);
    return init;
}*/

template <typename T>
using vec = vector<T>;

template <typename T>
using vvec = vector<vector<T>>;



int main() {
  int h,w,k; cin>>h>>w>>k;
  vvec<char> c(h,vec<char>(w));
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin>>c[i][j];
    }
  }
  
  int cnt=0, temp;
  for (int p = 0; p < (int)pow(2,h); p++) {
    for (int q = 0; q < (int)pow(2,w); q++) {
      temp=0;
      int b=p;
      for (int i = 0; i < h; i++) {
        if (b%2==0) {
          int d=q;
          for (int j = 0; j < w; j++) {
            if (d%2==0) {
              if (c[i][j]=='#') temp++;
            }
            d/=2;
          }
        }
        b/=2;
      }
      if (temp==k) cnt++;
    }
  }
  cout<<cnt;
}


/* きょむ〜 */


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

int main() {
  ll int n, m, k;
  cin >> n >> m >> k;
  
  vector<ll int> suma(n+1), sumb(m+1);
  ll int reada, readb = 0;
  rep(i, n) {
    int a;
    cin >> a;
    suma[i+1] = suma[i] + a;
    if(suma[i+1] <= k) ++reada;
  }
  
//  cout << reada << endl;
  
  ll int ans = reada;
  rep(i, m) {
    int b;
    cin >> b;
    sumb[i+1] = sumb[i] + b;
    
    while(reada > 0 && suma[reada] + sumb[i+1] > k) --reada;
    if(suma[reada] + sumb[i+1] <= k) readb = i+1;
//    cout << reada << " " << readb << endl;
    ans = max(ans, reada+readb);
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 6416
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define sz(x) (int)(x).size()
/* --- */
int c[4][4];

bool check() {
	for (int i = 1; i < 3; i++)
		for (int j = 1; j < 3; j++)
			if (c[i][j] != c[i][0] + c[0][j] - c[0][0]) return false;
	return true;
}

int main() {
	for (int i = 0; i < 3; i++)
		for (int j = 0; j < 3; j++)
			scanf("%d", &c[i][j]);
	printf("%s\n", check() ? "Yes" : "No");
}



Measured memory_bytes: 256
def task(n, k, a):
    cache = [0] * (n + 1)
    pos = 1
    sequence = [1]
    cache[1] = pos
    index = 1
    prefix = 0
    ks = k

    while True:
        index += 1
        nxt = a[pos - 1]

        if cache[nxt] != 0:
            prefix = cache[nxt] - 1
            cycle = sequence[prefix:]
            break

        sequence.append(nxt)
        cache[nxt] = index
        pos = nxt

        ks -= 1

        if ks == 0:
            print(nxt)
            return

    target = (k - prefix) % len(cycle)
    print(cycle[target])


n, k = map(int, input().split())
a = list(map(int, input().split()))
task(n, k, a)


Measured memory_bytes: 32400
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)
 
int main(void) {
  int n;
  string s, t;
  cin>>n>>s>>t;
  fr(i,n) cout << s[i] << t[i];

  cout << endl;


  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
int main(){
int n, t;
scanf("%d %d", &n,&t);
int k[n];
for (int i=0; i<n; i++){
  scanf("%d",&k[i]);
 }
int a=t;
for  (int i=1; i<n; i++){
  if (k[i]-k[i-1]>=t) a+=t;
  else a+=k[i]-k[i-1];
  
 }
 printf ("%d", a);
 return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <cstdio>
#include <bitset>
using namespace std;

int bit(int bits) {
  bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
  bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
  bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
  bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
  return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}


int main(){
	int n,a,b,c,mask,ret;
	while(cin >> n && n){
		vector<int> data(5001,0);
		data[5000] = 63;
		ret = 0;
		while(n--){
			cin >> a >> b >> c;
			c--;
			if(a==1){
				mask  =  ( (1<<b)-1 ) << c;
				for(int i=0;i+1<data.size();i++){
					if(data[i+1] & mask){
						data[i] += mask;
						break;
					}
				}
			}else{
				mask  = 1 << c;
				for(int i=0;i+1<data.size();i++){
					if(data[i+1] & mask){
						for(int j=0;j<b;j++)
							data[i-j]+=mask;
						break;
					}
				}		
			}
			vector<int>::iterator it = data.begin();
			while(it != data.end()){
				if((*it) == 31){
					it = data.erase(it);
					it--;
				}
				it++;
			}
		}
		for(int i=0;i<data.size()-1;i++){
			ret += bit( data[i] );
		}
		cout << ret << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

vector<int> zAlgorithm(const vector<int> &s){
  int n = s.size();
  vector<int> a(n+1,0);
  int i=1, j=0;
  while(i<n){
    while(i+j<n && s[j] == s[i+j]) j++;
    a[i] = j;
    if(j==0){i++; continue;}
    int k = 1;
    while(i+k<n && k+a[k]<j) a[i+k]=a[k], k++;
    i += k;
    j -= k;
  }
  return a;
}

int main(){
  int n;
  cin>>n;
  vector<int> vec(n);
  rep(i,n) cin>>vec[i];

  vector<int> v = zAlgorithm(vec);

  rep(i,1,n) if(n%i==0){
    if(v[i] == n-i){
      cout << n/i << endl;
      return 0;
    }
  }

  cout << 1 << endl;

  return 0;
}

Measured memory_bytes: 4396
#include <vector>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;


int main(){
    int N;
    cin >> N;
    long long out = 0;
    for(int i=0; i!=N+1; i++){
        if((i%3)&&(i%5)) out+=i;
    }
    cout << out << endl;

    return 0;
}

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

def Cost(a, Sum):
    if Sum > 0:
        if Sum + a < 0:
            return 0
        else:
            return abs(Sum + a) + 1
    if Sum < 0:
        if Sum + a > 0:
            return 0
        else:
            return abs(Sum + a) + 1

Sum = lambda a, preSum:preSum + a if Cost(a, preSum) == 0 else (-1)**int(preSum > 0)

pCost, pSum = (lambda:(0, A[0]) if A[0] > 0 else (abs(A[0])+1, 1))()
nCost, nSum = (lambda:(0, A[0]) if A[0] < 0 else (abs(A[0])+1,-1))()
for a in A[1:]:
    pCost += Cost(a, pSum)
    pSum = Sum(a, pSum)
    nCost += Cost(a, nSum)
    nSum = Sum(a, nSum)
print(min(pCost, nCost))


Measured memory_bytes: 19928
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>  // min, max
#include <fstream>  // ifstream
#include <iomanip>  // setprecision
using namespace std;
typedef long long ll;

int main(void)
{
#ifdef FILE_DEBUG
    ifstream inputFile("data/input.txt");
    cin.rdbuf(inputFile.rdbuf());
#endif
    // これより下にコードを書く

    int A, B, C;
    cin >> A >> B >> C;
    vector<int> diff(3);
    diff[0] = abs(A-B);
    diff[1] = abs(C-B);
    diff[2] = abs(A-C);

    sort(diff.begin(), diff.end());

    cout << diff[0] + diff[1] << endl;

    return 0;
}


Measured memory_bytes: 256
n,x = map(int,input().split())
size = [1]
pati = [1]
for i in range(n):
    size.append(size[i]*2 + 3)
    pati.append(pati[i]*2 + 1)
ans = 0
for i in range(n):
    if x == 1:
        x -= 1
        break
    elif x == size[n-i]:
        ans += pati[n-i]
        break
    elif x == size[n-i-1]+2:
        ans += pati[n-i-1]+1
        break
    elif x > size[n-i-1] + 2:
        ans += pati[n-i-1]+1
        x -= size[n-i-1] + 2
    else:
        x -= 1
if x == 1:
    ans += 1
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
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); }


void solve(void)
{
  
  //dp[i][ca][cb] := 1{i番目までの薬品の組み合わせで、物質Aがcaグラム、物質Bがcbグラムとなる溶液の最小コスト
  int N,Ma,Mb;
  cin>>N>>Ma>>Mb;
  vector<vector<int> > DATA(N,vector<int>(3));
  for (int i = 0; i < N; i++)
  {
    cin>>DATA[i][0]>>DATA[i][1]>>DATA[i][2];
  }
  int N_MAX = 40;
  int M_MAX = 10;

  vector<vector<vector<int> > > DP(N+1,vector<vector<int> > (N_MAX*M_MAX+1,vector<int>(N_MAX*M_MAX+1,INF)));
  DP[0][0][0] = 0;

  for (int i = 0; i < N; i++)
  {
    for (int b = 0; b < N_MAX*M_MAX; b++)
    {
      for (int a = 0; a < N_MAX*M_MAX; a++)
      {
        if(DP[i][b][a] == INF) continue;
        DP[i+1][b][a] = min (DP[i+1][b][a],DP[i][b][a]);
        DP[i+1][b + DATA[i][1]][a + DATA[i][0]] = min(DP[i+1][b + DATA[i][1]][a + DATA[i][0]],DP[i][b][a] + DATA[i][2] );
      } 
    }
  }
  
  int ANS = INF;
  // DEBUG(DP[N]);
  for (int a = 1; a <  N_MAX*M_MAX; a++)
  {
    for (int b = 1; b <  N_MAX*M_MAX; b++)
    {
      if(Mb*a == Ma*b) ANS = min(ANS,DP[N][b][a]);
    }
  }
  cout<<((ANS == INF)?-1:ANS)<<endl;
  

  
  return; 
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 53504
import sys, math
MOD = 10**9+7
n, k = map(int, sys.stdin.readline().split())
res = 0
for kk in range(k, n+2):
    mm = (kk-1)*kk // 2
    MM = (n-kk + n + 1) * kk // 2
    #print (mm,MM)
    res = (res + (MM-mm+1)) % (MOD)
print(res)

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

int main(){
    int a,b,d,r;
    double f;
    cin >> a >> b;
    d = a/b;
    r = a%b;
    f = (double) a/ (double) b;
    cout << fixed <<  d << " " << r << " " << f << endl;
    return 0; 
}


Measured memory_bytes: 3284
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define RNG(i,from,to) for(int i=(from); i<(int)(to); i++)
#define gcd(i,j) __gcd((i), (j))
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vecll;
template<typename S, typename T> string to_string(pair<S, T> p) { return "("+to_string(p.first)+","+to_string(p.second)+")"; }
template<typename T> string to_string(T p[2]) { return "["+to_string(p[0])+","+to_string(p[1])+"]"; }
template<typename T> void println(T e){ cout << to_string(e) << endl; }
template<typename T> void println(const vector<T>& v){ cout << "[";for(const auto& e : v){ cout << to_string(e) << ","; }cout << "]";cout << endl; }
template<typename T> void println(const vector<vector<T>>& vv){ for(const auto& v : vv){ println(v); } }
template<typename Iter> void println(Iter first, Iter last){ for(auto it=first; it != last; it++){ cout << *it << " "; }; cout << endl; }
const ll DVSR = 1e9+7;


int main(int argc, char const *argv[])
{
  ll N, K; cin >> N >> K;
  vecll LI(N);
  REP(i, N) cin >> LI[i];
  sort(LI.begin(), LI.end());
  ll hi = 1000000000000000000;
  ll lo = -1000000000000000000;
  ll value_mid = 0;
  while (hi != lo) {
    ll cnt = 0;
    value_mid = lo + (hi - lo)/2;
    REP(i, N-1) {
      ll llo = 0, hhi = N-1-i, mmid = 0;
      while (hhi != llo) {
        mmid = (hhi + llo)/2;
        if (LI[i]*(LI[i] >= 0 ? LI[i+1+mmid] : LI[N-1-mmid]) < value_mid) llo = mmid + 1;
        else hhi = mmid;
      }
      cnt += llo;
    }
    if (cnt < K) lo = value_mid + 1;
    else hi = value_mid;
  }
  cout << lo-1 << endl;
  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main (){
	int a,b,c;
	cin>>a>>b>>c;
   // scanf("%d%d%d",&a,&b,&c);
	if(a==5){
		if((b==5&&c==7)||(b==7&&c==5))
		cout<<"YES";
		else
     	cout<<"NO"<<endl;
	}
	else if(a==7){
		if(b==5&&c==5)
		cout<<"YES"<<endl;
		else
     	cout<<"NO"<<endl;
	}
	else
	cout<<"NO"<<endl;
	return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 100005
using namespace std;
bool cur1;
int n,ans,sze;
int a[N];
struct node{
	int x,id;
}Q[N];
inline bool cmp(node a,node b){
	return a.x<b.x;
}
inline void Rd(int &res){
	char c;res=0;
	while(c=getchar(),c<48);
	do res=(res<<3)+(res<<1)+(c^48);
	while(c=getchar(),c>47);
	return;
}
struct YDtree{
	#define ls p<<1
	#define rs p<<1|1
	int cnt[N<<2],mn[N<<2];
	inline void up(int p){
		mn[p]=max(mn[ls],mn[rs]);
	}
	void update(int l,int r,int x,int v,int p){
		if(l==r){
			cnt[p]+=v;
			if(!cnt[p])mn[p]=0;
			else mn[p]=l;
			return;
		}
		int mid=(l+r)>>1;
		if(mid>=x)update(l,mid,x,v,ls);
		else update(mid+1,r,x,v,rs);
		up(p);
	}
	int query(int l,int r,int L,int R,int p){
		if(L<=l&&r<=R)return mn[p];
		int mid=(l+r)>>1,res=2e9;
		if(mid>=L)res=query(l,mid,L,R,ls);
		if(mid<R)res=max(res,query(mid+1,r,L,R,rs));
		return res;
	}
}YD;
bool cur2;
int main(){
//	printf("%lf MB\n",(&cur2-&cur1)/1024.0/1024);
	Rd(n);
	for(int i=1;i<=n;i++)Rd(Q[i].x),Q[i].id=i;
	sort(Q+1,Q+n+1,cmp);
	Q[0].x=-2e9;
	for(int i=1;i<=n;i++){
		if(Q[i].x!=Q[i-1].x)a[Q[i].id]=++sze;
		else a[Q[i].id]=sze;
	}
	ans=n;
	for(int i=1;i<=n;i++){
		int o;
		if(a[i]==1)o=0;
		else o=YD.query(1,n,1,a[i]-1,1);
		if(o!=0){
			ans--;
			YD.update(1,n,o,-1,1);
		}
		YD.update(1,n,a[i],1,1);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3712
#define D(x) cout << #x " = " << x << endl
#define DD(x, y) cout << "(" #x ", " #y ") = (" << x << ", " << y << ")" << endl
#define DDD(x, y, z) cout << "(" #x ", " #y ", " #z ") = (" << x << ", " << y << ", " << z << ")" << endl
#define DV(v) for (auto __macro_vi : v){ cout << __macro_vi << " ";} cout << endl;
#define DA(a, n) for (int __macro_i = 0; __macro_i < n; ++__macro_i) { cout << a[__macro_i] << " "; } cout << endl;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) (v).begin(), (v).end()
#include<iostream>
#include<vector>
#include<cassert>
#include<cmath>
#include<string>
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p){ os << "(" << p.first << ", " <<  p.second << ")"; return os; }

using namespace std;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a;
    string s;
    cin >> a >> s;
    cout << (a >= 3200 ? s : "red") << endl;
}


Measured memory_bytes: 888
s=input()

if s[0]=="A":
  if s[2:-1].count("C")==1:
    if s.count("A")==1 and s.count("C")==1 and s[1].islower()==True and s[-1].islower()==True:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

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

int main() {
	int pt[100010];
	int N, K, Q;
	cin >> N >> K >> Q;
	for (int i = 0; i < N; i++) {
		pt[i] = 0;
	}
	int tmp;
	for (int i = 0; i < Q; i++) {
		cin >> tmp;
		pt[tmp - 1]++;
	}
	for (int i = 0; i < N; i++) {
		if (K - Q + pt[i] > 0) {
			cout << "Yes" << endl;
		}
		if (K - Q + pt[i] <= 0) {
			cout << "No" << endl;
		}
	}
}

Measured memory_bytes: 1024
N,M = list(map(int,input().split()))
colect_quest = [0]*N
WA_quest = [0]*N
for i in range(M):
    pi,si = list(map(str,input().split()))
    pi = int(pi)
    if si == "AC":
        colect_quest[pi-1] = 1
    if si == "WA" and colect_quest[pi-1] != 1:
        WA_quest[pi-1] += 1
WA_count = 0
for i in range(len(WA_quest)):
    if colect_quest[i] == 1 :
        WA_count += WA_quest[i] 
print(sum(colect_quest),WA_count)

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

#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define ANS(ans) cout << (ans) << endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (long long i = 0; i < (n); ++i)

int main() {
  int X, Y, Z;
  cin >> X >> Y >> Z;

  swap(X, Y);
  swap(X, Z);

  cout << X << " " << Y << " " << Z << endl;
  return 0;
}


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

using namespace std;

const long long INF = 1000000000000000000;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
	cin >> n;
	vector<long long> A(n + 1);
	vector<long long> lim(n + 1);
	for (int i = 0; i <= n; i++) cin >> A[i];
	lim[0] = 1;
	for (int i = 1; i <= n; i++)
	{
		long long m = (lim[i-1] - A[i-1]) * 2;
		if (m < 0)
		{
		    cout << -1 << '\n';
			return 0;
		}
		lim[i] = min(INF, m);
	}
	if (lim[n] < A[n])
	{
	    cout << -1 << '\n';
		return 0;
	}
    long long ret = A[n];
    long long now = A[n];
	for (int i = n-1; i >= 0; i--)
	{
		now += A[i];
		now = min(now, lim[i]);
		ret += now;
	}
	printf("%lld\n", ret);
	return 0;
}

Measured memory_bytes: 4788
/// --- In the name of ALLAH --- ///


#include <cmath>
#include<bits/stdc++.h>
using namespace std;


typedef long long              ll;
typedef vector<int>            vi;
typedef vector<ll>             vl;
typedef vector<vi>             vvi;
typedef vector<vl>             vvl;
typedef pair<int,int>          pii;
typedef pair<double, double>   pdd;
typedef pair<ll, ll>           pll;
typedef vector<pii>            vii;
typedef vector<pll>            vll;
typedef double                 dl;

#define endl                   '\n'
#define PB                     push_back
#define F                      first
#define S                      second
#define all(a)                 (a).begin(),(a).end()
#define rall(a)                (a).rbegin(),(a).rend()
#define sz(x)                  (ll)x.size()
#define wt                     ll t; cin>>t; while(t--)
#define input(a,n)             for(int i=0;i<n;i++) cin>>a[i];

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;


#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))
#define mod 10000007
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}

ll gcd ( ll a, ll b ) { return __gcd ( a, b ); }
ll lcm ( ll a, ll b ) { return a * ( b / gcd ( a, b ) ); }


const ll mx=1e9;



//q=51;

//ll b[q+1][q+1];


 main()
{
    optimize();
    string s;
    cin>>s;
    ll n=0,p;
    for(auto u:s)
    {
       n=n+(u-48);
    }
    p=stoi(s);
    if(p%n==0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;










    return 0;
}






























































































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

using namespace std;

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

    int n,k,x,y,ans=0;
    cin>>n>>k>>x>>y;

    ans=min(n,k)*x;

    if(n>k){
       ans+=((n-k)*y);
    }

    cout<<ans<<"\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> // サイズはマイナスなので慎重に
using namespace std;
using ll = long long;
using P = pair<int, int>;

struct UnionFind
{
    vector<int> d;
    UnionFind(int n = 0) : d(n, -1) {} // すべて根でサイズは1
    int find(int x)
    {
        if (d[x] < 0)
            return x;
        d[x] = find(d[x]); // メモ化
        return d[x];
    }

    bool unite(int x, int y)
    {
        x = find(x);
        y = find(y); // 根同士を連結する
        if (x == y)
            return false; // 同じ根なら何もしない
        if (d[x] > d[y])  // サイズはマイナスなので慎重に
            swap(x, y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }

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

    int size(int x)
    {
        return -d[find(x)];
    }
};

int deg[1000005];
vector<int> to[1000005];
int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    for (int i = 0; i < m; i++)
    {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        deg[a]++;
        deg[b]++;
        uf.unite(a, b);
    }

    for (int i = 0; i < k; i++)
    {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        to[a].push_back(b);
        to[b].push_back(a);
    }

    for (int i = 0; i < n; i++)
    {
        int ans = uf.size(i) - 1 - deg[i];
        for (int u : to[i])
        {
            if (uf.same(i, u))
                --ans;
        }
        printf("%d%c", ans, i == n - 1 ? '\n' : ' ');
    }

    return 0;
}

Measured memory_bytes: 28544
def input_multiple_number():
    return map(int, input().split())
def input_multiple_number_as_list():
    return list(map(int, input().split()))

xgiven,ygiven,agiven,bgiven,cgiven = input_multiple_number()

p_array = input_multiple_number_as_list()
q_array = input_multiple_number_as_list()
r_array = input_multiple_number_as_list()
INF = 99999999999999999
p_array.sort(reverse=True)
q_array.sort(reverse=True)
r_array.sort(reverse=True)

#ぐりいでぃい
i = xgiven
p_array = p_array[0:xgiven]
q_array = q_array[0:ygiven]
xxx_array = p_array+q_array+r_array


xxx_array.sort(reverse=True)
nnn_arrat = xxx_array[0:xgiven+ygiven]

value=0
for aaaaa in nnn_arrat:
	value += aaaaa

print(value)

Measured memory_bytes: 23328
MOD = 1000000007
m = 13
S = input()
start = int(S.replace('?', '0')) % m
dp = [0] * 13; dp[start] = 1
for i, s in enumerate(S[::-1]):
    nextDP = [0] * 13
    if (s != '?'): continue
    mul = pow(10, i, m)
    for j in range(10):
        for k in range(m):
            nextDP[(mul*j + k) % m] += dp[k]
            nextDP[(mul*j + k) % m] %= MOD
    dp = nextDP
print(dp[5])


Measured memory_bytes: 45532
import java.io.*
import java.util.*


fun solve(N: Int, K: Int, h: IntArray){
    val dp = LongArray(N)
    for (i in 1 until N){
        var ret = Long.MAX_VALUE
        for(j in 1..K){
            if(i-j < 0) continue
            ret = Math.min(ret, dp[i-j] + Math.abs(h[i-j]-h[i]))
        }
        dp[i] = ret
    }
    println(dp[N-1])
    return

}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val N = sc.next().toInt()
    val K = sc.next().toInt()
    val h = IntArray(N)
    for (i in 0 until N) {
        h[i] = sc.next().toInt()
    }
    solve(N, K, h)
}



Measured memory_bytes: 37800
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define INF             1e14
#define dd              double
#define MOD             1000000007
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type)) 
#define nl              cout<<endl
#define fill(a,val)     memset(a,val,sizeof(a))
#define mp              make_pair
#define endl            "\n"
#define pb              push_back
#define ff              first    
#define ss              second
#define SIZE            200005
#define all(v)          v.begin(),v.end()
#define s(ar,n)         sort(ar,ar+n)
#define rs(ar,n)        sort(ar, ar+n, greater<ll>()) 
#define oa(a,n)         for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n)         for(ll i=0;i<n;i++)cin>>a[i];
#define maxa(ar,N)      *max_element(ar,ar+N)
#define mina(ar,N)      *min_element(ar,ar+N)
#define fastio()        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define printclock      cerr<<"Time : "<<1000*(long double)clock()/(long double)CLOCKS_PER_SEC<<"ms\n";
ll power(ll x, ll y){
    ll res=1;x=x;
    while(y>0){
        if(y&1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}  
ll logtwo(ll n){
    if(n==1)
        return 0;
    return logtwo(n/2)+1;
}
signed main()
{
    fastio(); 
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll N,M;
        cin>>N;
        ll ar[N]={};
        ll a;
        for(ll i=0;i<N-1;i++)
        {
            cin>>a;
            ar[a-1]++;
        }
        for(ll i=0;i<N;i++)
            cout<<ar[i]<<endl;
    }
}

Measured memory_bytes: 5224
A, B = map(int, input().split())
def isP(number):
    s = str(number)
    length = len(s)
    for i in range(int(length / 2)):
        if s[i] != s[length-i-1]:
            return False
    return True

res = 0
for i in range(A, B+1):
    if (isP(i)):
        res += 1
print(res)

Measured memory_bytes: 3060
import math
def primes(x):
    x+=1
    if x < 2:
        return []

    prime = [i for i in range(x)]
    prime[1] = 0

    for p in prime:
        if p > math.sqrt(x):
            break
        if p == 0:
            continue
        for non_prime in range(2 * p, x, p):
            prime[non_prime] = 0

    return [p for p in prime if p != 0]

p = primes(55555)
one = []
for x in p:
    if str(x)[-1]=='1':
        one.append(x)

for i in range(int(input())):
    print(one[i],end=' ')


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

namespace AtCoder.BC088
{
    public class B
    {
        public static void Main()
        {
            Console.ReadLine();
            List<int> cards = Console.ReadLine().Split(" ").Select(n => int.Parse(n)).OrderByDescending(n => n).ToList();
            int a = 0, b = 0;

            for (int i = 0; i < cards.Count(); i++)
            {
                if (i % 2 == 0)
                {
                    a += cards[i];
                }
                else
                {
                    b += cards[i];
                }
            }

            Console.WriteLine(a - b);
        }
    }
}

Measured memory_bytes: 19128
#include <iostream>

using namespace std;

int main(){
	uint32_t x = 0;

	cin >> x;

	if(x == 3 || x == 5 || x == 7){
		cout << u8"YES" << endl;
	}
	else{
		cout << u8"NO" << endl;
	}

	return(0);
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;



int main() {
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    for (int i = 0; i < m; ++i) {
        v[n-i-1] = 1;
    }
    vector<array<double, 3>> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i][0] >> a[i][1] >> a[i][2];
    }
    double ans = 0;
    do {
        double s = 0;
        for (int i = 0; i < n; ++i) {
            if(!v[i]) continue;
            for (int j = i+1; j < n; ++j) {
                if(!v[j]) continue;
                s += pow(a[i][0]-a[j][0], 2)+pow(a[i][1]-a[j][1], 2)+pow(a[i][2]-a[j][2], 2);
            }
        }
        ans = max(ans, s);
    }while(next_permutation(v.begin(),v.end()));
    cout << setprecision(15) << ans << "\n";
    return 0;
}


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

long long f(long long a, long long b){
    string s1, s2;
    s1 = to_string(a);
    s2 = to_string(b);

    return max(s1.size(), s2.size());
}

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}

int main(){
    long long n;
    cin >> n;
    vector<long long> ret;
    ret = divisor(n);

    long long minv = 1e12;
    for(long long i = 0; i < ret.size(); i++){
        minv = min(minv, f(ret[i], n/ret[i]));
    }
    cout << minv << endl;
    return 0;
}

Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
double a, b, p, q, r;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b >> p >> q >> r;
    double delta = b * p - (b - a) * q;
    cout << fixed << setprecision(10) << delta / (r + q) + b << endl;
    return 0;
}



Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = INT64_MAX;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(ll i=0;i<N;i++)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

ll x,a;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    cin>>x>>a;
    if(x<a){
        print(0);
    }else{
        print(10);
    }
    return 0;
}

Measured memory_bytes: 256
s = int(input())
LS = [s]
count = 0
i = int(2)
a = int(s)
ans = 0
while count == 0:
    if a%2==0:
        a = a/2
    else:
        a = 3*a+1
    LS.append(a)
    if LS.count(a)==2:
        count = 1
        ans = i
    else:
      i += 1
print(ans)


Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
using namespace std;
int a[32],n;
void DFS(int x,int len,int ran){
	if(!x){
		a[len]=x;
		for(int i=0;i<=len;i++){if(a[i]){if(i)cout<<" ";cout<<a[i];}}
		cout<<endl;
		return;
	}
	for(int i=min(x,ran);i>=1;i--){
		a[len]=i;
		DFS(x-i,len+1,a[len]);
	}
	return;
}
int main(){
	while(true){
		cin>>n;
		if(!n)break;
		DFS(n,0,n);
	}
	return 0;
}

Measured memory_bytes: 3028
x = int(input())
dp = [False] * (x+1)
dp[0] = 1
for i in range(0, x+1):
    if dp[i]:
        try:
            dp[i + 100] = True
            dp[i + 101] = True
            dp[i + 102] = True
            dp[i + 103] = True
            dp[i + 104] = True
            dp[i + 105] = True
        except:
            pass

if dp[x]:
    print(1)
else:
    print(0)

Measured memory_bytes: 39536
#include <bits/stdc++.h>
#include <iostream>
#include<math.h>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main()
{
    int64_t N;
    int64_t waru = 1000000007;
    cin >> N;
    if (N == 1) {
        cout << 0 << endl;
    } else {
        int64_t count = N;
        int64_t zentai = 1;
        int64_t except_nine = 1;
        int64_t except_zero = 1;
        int64_t except_nine_and_zero = 1;
        while (count > 0) {
            zentai = (10 * zentai) % waru;
            except_nine = (9 * except_nine) % waru;
            except_zero = (9 * except_zero) % waru;
            except_nine_and_zero = (8 * except_nine_and_zero) % waru;
            count--;
        }

        int64_t ans = (zentai - except_nine - except_zero + except_nine_and_zero) % waru;
        ans = (ans+waru) % waru;
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N,T;
  cin >> N >> T;
  int c[102],t[102];
  for(int i = 0;i < N;++i) {
    cin >> c[i] >> t[i];
  }
  int res = c[0];
  int a = T + 1;
  for(int i = 0;i < N;++i) {
    if(t[i] <= T){
      a = t[i];
      if(res > c[i]){
        res = c[i];
      }
    }
  }
  if(a <= T){
   cout << res << endl;
  }
  else{
    cout << "TLE" << endl;
  }
 cout << endl;
}
  
      

Measured memory_bytes: 256
function Main(input) {
	const lines = input.split("\n");
	const line1 = lines[0].split(" ");
	var a = parseInt(line1[0], 10);
	var b = parseInt(line1[1], 10);	
	console.log('%s',a*b%2 === 1 ? 'Odd' : 'Even');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

using namespace std;

void solve()
{
	int n,m,c,ans = 0;
	cin >> n >> m >> c;
	int bs[m];
	for (int i = 0; i < m; i++)
	{
		cin >> bs[i];
	}
	for (int i = 0; i < n; i++)
	{
		int res = 0;
		for (int i = 0; i < m; i++)
		{
			int a;
			cin >> a;
			res += a*bs[i];
		}
		ans += res+c > 0;
	}

	cout << ans << endl;
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


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

using namespace std;

#define fastt ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main(){
    fastt;
    int n, aux, cont = 0;
    cin >> n;
    for(register int i = 1; i <= n; i++){
        cin >> aux;
        if(i != aux)
            cont++;
    }
    cout << ((cont <= 2) ? "YES" : "NO") << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int a,b,k;
    cin>>a>>b>>k;
    int index=0;
    int temp=k;
    for(index=a;index<=b&&temp>0;index++)
    {
        cout<<index<<"\n";
        temp--;
    }
    temp=k;
    for(int i=max(index,b-k+1);i<=b&&temp>0;i++)
    {
        cout<<i<<"\n";
        temp--;
    }
}

Measured memory_bytes: 3552
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>

using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define VI vector<int>
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl

string S;





int main()
{

	cin >> S;
	REP(i,S.length()-8){
		cout << S[i];
	}



}







Measured memory_bytes: 256
n = int(input())
c = []
s = []
f = []
for _ in range(n-1):
   ci, si, fi = map(int, input().split())
   c.append(ci)
   s.append(si)
   f.append(fi)

for i in range(n):
   t = 0
   for j in range(i, n-1):
      if (t < s[j]):
         t = s[j]
      elif (t % f[j] == 0):
         pass
      else:
         t = t + f[j] - (t % f[j])
      t += c[j]
   print(t)


Measured memory_bytes: 3064
package main

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

func main() {
	Count := ReadLineInt()[0]
	Results := make(map[string]int, Count)
	Max := 0

	for i := 0; i < Count; i++ {
		Input := ReadLine()
		v := Results[Input] + 1
		Results[Input] = v

		if v > Max {
			Max = v
		}
	}

	FinalResults := make([]string, 0, Count)
	for k, v := range Results {
		if v == Max {
			FinalResults = append(FinalResults, k)
		}
	}

	sort.Strings(FinalResults)

	for _, v := range FinalResults {
		fmt.Println(v)
	}
}

/////////////////////////////////////////

func fln(format string, elements ...interface{}) {
	fmt.Printf(format+"\n", elements...)
}

var BufReader = bufio.NewReaderSize(os.Stdin, 1e6)

func ReadLine() string {
	a, _, _ := BufReader.ReadLine()
	return string(a)
}

func ReadLineInt() (result []int) {
	in := strings.Split(ReadLine(), " ")
	result = make([]int, 0, 2)
	for _, v := range in {
		t, _ := strconv.Atoi(v)
		result = append(result, t)
	}
	return
}

Measured memory_bytes: 22016
def set_sns():
	sns[i] = ci
	next_i = set(e[i])
	while len(next_i):
		s = next_i.pop()
		if sns[s] != ci:
			sns[s] = ci
			next_i.update(e[s])
			
n, m = map(int, raw_input().split())

e = [set() for i in range(n)]
sns = [None] * n

for i in range(m):
	s, t = map(int, raw_input().split())
	e[s].add(t)
	e[t].add(s)

ci = 0
for i in range(n):
	if sns[i] == None:
		set_sns()
		ci += 1

q = int(input())
for i in range(q):
	s, t = map(int, raw_input().split())
	if sns[s] == sns[t]:
		print 'yes'
	else:
		print 'no'

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

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define mp make_pair
#define vi vector<int>
#define vip vector<pair<int,int> >
#define ff first
#define ss second
#define int long long
#define SIZE 200010
#define mod 1000000007
#define BIG 998244353
#define s(t) scanf("%d",&t)
#define p(t) printf("%d\n",t)
#define mii map<int,int>
#define MSET(table,i) memset(table, i, sizeof(table))
#define endl '\n'
#define tc int t;cin>>t;while(t--)
#define pi  3.1415926358
#define print(x) for(auto el: x) cout<<el<<" ";cout<<endl
#define bits(x) __builtin_popcount(x)
#define minimum(a,n) min_element(a,a+n)-a
#define maximum(a,n) max_element(a,a+n)-a
#define pqbig priority_queue<int>
#define pqsmall priority_queue<int,vector<int>,greater<int> >
#define all(v) v.begin(),v.end()
#define sitr set<int>:: iterator
#define mitr map<int,int>:: iterator

#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl


int32_t main()
{
    fast;
    int a,b;cin>>a>>b;
    if(b==1)
    {
        cout<<0;
        return 0;
    }
    for(int i=1;i<=1000;i++)
    {
        if((i-1)*(a-1)+a>=b)
        {
            cout<<i;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <cstdio>

using namespace std;

int main() {
  int n;
  while (scanf("%d", &n), n!=0) {
    int k[100];
    char s[101];
    for (int i=0;i<n;i++) scanf("%d", &k[i]);
    scanf("%s", s);
    for (int i=0;s[i]!='\0';i++) {
      int c = s[i];
      for (int j=0;j<k[i%n];j++) {
        if (c == 'a') c = 'Z';
        else if (c == 'A') c = 'z';
        else c--;
      }
      putchar(c);
    }
    putchar('\n');
  }
  return 0;
}

Measured memory_bytes: 2672
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
  cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  int x = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
    x += vec.at(i);
    }
    else{
    x -= vec.at(i);
    }
  }
  cout << x << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
#define absl(v) labs((v))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1},dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(cv *a, cv *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(cv *a, cv *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(cv *left, cv *right) {return strcmp((char *)left,(char *)right);}
int downchar(cv *left, cv *right) {return strcmp((char *)right,(char *)left);}
void tmpInit(int *c,ll m) {ll i;rep(i,m) c[i]=i;}
ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1){
            res *= a; if(mod>=1) res %= mod;
        }
        a *= a; if(mod>=1) a %= mod;
        n >>= 1;
    }
    return res;
}
void initialize(){
    
}
int main(void){
  initialize();
  ll n,i,j,k,result=0,h[2],m[2];
  int a[LIMIT2]={0};
  char s[LIMIT1];
  
  scanf("%lld %lld %lld %lld %lld",&h[0],&m[0],&h[1],&m[1],&k);
  result = h[1]*60+m[1];
  result -= h[0]*60+m[0];
  if(result <= 0) result += 24*60;
  result -= k;
  printf("%lld",result);
  
  return 0;
}



Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793


int main(){
    char a, b;
    cin >> a >> b;
    cout << (a == b ? 'H' : 'D') << endl;
}


Measured memory_bytes: 256
//参考：http://ehafib.hatenablog.com/entry/2015/12/23/164517
//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main(){
  ll N;
  cin >> N;

  ll ans = 0;
  for (ll i = 1; i < N + 1; i++) {
    if (i % 3 != 0 && i % 5 != 0) ans += i;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3632