akhauriyash/Code-Regression huggingface dataset:
S = input()

ans = 0
for i in range(2**(len(S)-1)):
    tmpans = int(S[0])
    for j in range(len(S)-1):
        if i>>j&1:
            ans+=tmpans
            tmpans=int(S[j+1])
        else:
            tmpans*=10
            tmpans+=int(S[j+1])
    ans+=tmpans
print(ans)

Measured memory_bytes: 3064
/*
オーダー
10**6	余裕を持って間に合う	
10**7	おそらく間に合う	余裕を持って間に合う
10**8	非常にシンプルな処理でない限り厳しい	おそらく間に合う
10**9		非常にシンプルな処理でない限り厳しい
logn	:OK
n		:10^7
nlogn	:10^6
n**2	:10^4
n**3	:300
2**n	:20
n!		:10



// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/

#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <string.h>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18
// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
ll gcd(ll a, ll b) {
	if(b == 0) return a;
	return gcd(b, a % b);
}

// const ll MAX_N = 1e5;
// ll N;
// ll h[MAX_N];
// ll dp[MAX_N+1]; // メモ化テーブル
 
// // i番目以降の品物から重さの総和がj以下になるように選ぶ
// void rec(ll i){
// 	if (i==0) dp[i] = 0;
// 	else if (i==1) dp[i] = abs(h[1]-h[0]);
// 	else dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
// 	return;
// }
 
 
int main() {
	// 入力
	ll A,B,C;
	cin >>A>>B>>C;
	
	//出力
	if (A==B) printf("%lld\n", C);
	else if (B==C) printf("%lld\n", A);
	else printf("%lld\n", B);
}


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

int main(){
  ll k;
  cin >> k;
  int n = 50;
  ll a = k % 50, b = k / 50;
  ll ans[n];
  rep(i, n) ans[i] = n - 1 + b;
  rep(i, a){
    rep(j, n){
      if(j == i) ans[j] += n;
      else ans[j]--;
    }
  }
  cout << n << endl;
  rep(i, n) cout << ans[i] << " ";
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
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; }
const long long INF = 1LL<<60;

const int MAX_N = 110;
const int MAX_V = 100100;

// 入力
int N;
long long W, weight[MAX_N], value[MAX_N]; // 品物の個数は 100 個なので少し余裕持たせてサイズ 110 に

// DPテーブル
long long dp[MAX_N][MAX_V];

int main() {
    cin >> N >> W;
    for (int i = 0; i < N; ++i) cin >> weight[i] >> value[i];

    // 初期化
    for (int i = 0; i < MAX_N; ++i) for (int j = 0; j < MAX_V; ++j) dp[i][j] = INF;

    // 初期条件
    dp[0][0] = 0;

    // DPループ
    for (int i = 0; i < N; ++i) {
        for (int sum_v = 0; sum_v < MAX_V; ++sum_v) {

            // i 番目の品物を選ぶ場合
            if (sum_v - value[i] >= 0) chmin(dp[i+1][sum_v], dp[i][sum_v - value[i]] + weight[i]);

            // i 番目の品物を選ばない場合
            chmin(dp[i+1][sum_v], dp[i][sum_v]);
        }
    }

    // 最適値の出力
    long long res = 0;
    for (int sum_v = 0; sum_v < MAX_V; ++sum_v) {
        if (dp[N][sum_v] <= W) res = sum_v;
    }
    cout << res << endl;
}

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

typedef long long ll;
typedef unsigned long long ull;
//typedef long double ld;

typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<double,double> pdd;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<int> vi;
typedef vector<pair<int, int > > vii;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef vector<vll> vvll;

constexpr ll MOD = 1e9+7;
constexpr int INF = 1<<30;
constexpr ll  LINF = 1LL<<60;

#define Sort(x) sort(x.begin(),x.end())
#define Reverse(x) reverse(x.begin(),x.end())
#define ABS(a,b) ((a)<(b)?(b)-(a):(a)-(b))
#define nbit(n) (1ll<<(n))

// sort(begin(x), end(x), greater<ll>());
// lower_bound(a.begin(), a.end(), val): a[i] ≥ valである最左の位置
// upper_bound(a.begin(), a.end(), val): a[i] > valである最左の位置

// Returns minimum of a and b.
// If a is less b, a is set to b.
template<typename T>
T chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
  return a;
}

// Returns maximum of a and b.
// If a is less b, a is set to b.
template<typename T>
T chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
  return a;
}

// a = (a+b)%MOD;
void addmod(ll& a, ll b) {
  a = (a+b)%MOD;
}

template <typename T>
void dumpContents(const T& v, const string& msg)
{
  cerr << "### " << msg << " ###\n";
  for (const auto& x : v) {
    cerr << x << " ";
  }
  cerr << endl;
}

struct before_main_function {
  before_main_function() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<setprecision(20)<<fixed;
    #define endl "\n"
  }
} before_main_function;

// ========== end of template ==========
constexpr int N_MAX = 1e5;
ll dp[N_MAX+1] = {0};

int main(int argc, char** argv) {
  int N, M;
  cin >> N >> M;

  vi Broken(N+1);
  for (int i=0; i<M; i++) {
    int A;
    cin >> A; // 1-indexed
    Broken[A] = 1;
  }

  dp[0] = 1;
  dp[1] = Broken[1] ? 0 : 1;

  for (int i=2; i<=N; i++) {
    if (Broken[i]) continue;

    dp[i] = (dp[i-1] + dp[i-2])%MOD;
  }

  cout << dp[N] << endl;

  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pull = pair<ull, ll>;
using pis = pair<int, string>;
#define all(x) (x).begin(), (x).end()
#define INF 1000000000
#define LLINF 10000000000000000ll
#define MOD 1000000007LL


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  //cout << fixed << setprecision(15)

  string n;
  cin >> n;
  int s = 0;
  for (int i = 0; i < n.size(); i++) s+=(n[i]-'0');
  cout << ((s%9==0) ? "Yes" : "No") << endl;
}


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

int main(){
  int X,N;
  cin>>X>>N;
  vector<int> p(N);
  for(int i=0;i<N;i++){
    cin>>p.at(i);
  }

  int ans=-1;
  for(int i=0;i<=101;i++){
    bool flag=true;
    for(int j=0;j<N;j++){
      if(i==p.at(j)){
        flag=false;
      }
    }
    if(!flag){
      continue;
    }
    if(abs(i-X)<abs(ans-X)){
      ans=i;
    }
  }

  cout<<ans<<endl;

}


Measured memory_bytes: 3624
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <list>
#include <string>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip> // setprecisionを使用するのに必要
using namespace std;
#define REPD(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) REPD(i, 0, n)
typedef long long ll;
#define fin(ans) cout << (ans) << '\n'
/*

*/
int main()
{
    int N,K;
    cin >> N >> K;
    double p = 0;
    double temp;
    for(int i = 1; i <= N; i++){
        temp = i;
        double ptemp = 1;
        while(temp < K){
            temp *= 2;
            ptemp *= 0.5;
        }
        p += ptemp;
    }
    p /= N;
    cout << fixed << setprecision(15) << p << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <vector>

using namespace std;

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

	vector<int> a(n, 0);
	for (int i = 0; i < n; ++i)
		cin >> skipws >> a[i];

	int min = 1000000;
	int max = -1000000;
	int64_t sum = 0;

	for (int i = 0; i < n; ++i)
	{
		if (a[i] < min)
			min = a[i];

		if (a[i] > max)
			max = a[i];

		sum += a[i];
	}

	cout << min << " " << max << " " << sum << endl;

	return 0;
}

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

using ll=long long;
const ll MOD=1e9+7;

ll prime(ll n){
  bool flag=true;
  if (n==1)
    flag=false;
  else if (n%2==0)
    flag=false;
  else {
    for (ll i=3;i<=sqrt(n);i+=2){
      if (n%i==0)
        flag=false;
    }
  }
  return flag;
}


int main() {
  ll N;
  cin >> N;
  
  vector<ll> vp(1,2);
  for (ll i=3;i<=1e3;i+=2){
    if(prime(i))
      vp.push_back(i);
  }
  vector<ll> vpn(vp.size(),0);
  
  for (ll j=1;j<=N;j++){
    for (ll i=0;i<vp.size();i++){
      ll n=j;
      while(n%vp.at(i)==0){
        n=n/vp.at(i);
        vpn.at(i)++;
      }
      if (n==1)
        break;
    }
  }
  ll ans=1;
  for (ll i=0;i<vpn.size();i++){
    if(vpn.at(i)>0)
      ans=ans*(vpn.at(i)+1)%MOD;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define REP3(i,x,n) for(int i=x; i>(n); i--)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    ll L,N;
    cin >> N >> L;
    priority_queue<string,vector<string>,greater<string>> wordlist;
    
    string s,ans="";
    for (ll i = 0; i < N; i++)
    {
        cin >> s;
        wordlist.push(s);
    }
    
    while (!wordlist.empty())
    {
        ans += wordlist.top();
        wordlist.pop();
    }
    
    cout << ans << endl;
   
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define int long long
signed main()
{
    IOS
    int n,k; cin>>n>>k;
    cout<<n-k+1<<endl;
    return 0;
}

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

#define endl '\n'
#define ll long long
#define rint register int

#define re register
#define pb(x) push_back(x);
#define ce(x) cout << x << '\n';

using db = long double;
using pll = pair < ll, ll >;
#define scan(a, n) 		for(int i = 0; i < n; i++)cin >> a[i];

#define rep(i,x,n,inc) for(i=x ; i<n ; i+=inc)
#define repr(i,x,n,inc) for( i=x ; i>n ; i+=inc)
#define all(a)      (a).begin(),(a).end()
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))

#define mp(a,b) make_pair(a,b)
#define ff first
#define ss second
#define hell 1000000007
#define infl LLONG_MAX

#define Foxen(i,s) for (i=s.begin(); i!=s.end(); i++)
#define Fill(s,v) memset(s,v,sizeof(s))
#define cout_p(x, p) cout << fixed << setprecision((p)) << x << endl     //print with precision

#define tc(tt) \
    ll tt;    \
    cin >> tt; \
    for (ll _tt = 0; _tt < tt; _tt++) // testcase 

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll t, i, x, j, y, 	z, k, n;
	cin >> n >> k;
	ll a[n], b[n + 1];
	scan(a, n);

	rep(j, 0, k, 1) {
		memset(b, 0, sizeof(b));
		rep(i, 0, n, 1) {
			ll mi = max(0LL, i - a[i]), mx = min(n - 1, i + a[i]);
			b[mi]++;
			b[mx + 1]--;
		}
		bool br = true;
		rep(i, 1, n, 1) {
			b[i] += b[i - 1];
			br = br && (a[i] == b[i]);
		}

		rep(i, 0, n, 1)	{
			if (a[i] != b[i])	br = false;
			a[i] = b[i];
		}

		if (br)	break;
	}

	rep(i, 0, n, 1)	cout << a[i] << " ";
}


Measured memory_bytes: 6724
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		boolean first = true;
		
		while (true) {
			final int price = sc.nextInt();

			if (price == 0) {
				break;
			}
			
			if(first){
				first = !first;
			}else{
				System.out.println();
			}

			int[] coins = new int[4];

			for (int i = 0; i < 4; i++) {
				coins[i] = sc.nextInt();
			}

			int min = Integer.MAX_VALUE;
			int m_i = 0;
			int m_j = 0;
			int m_k = 0;
			int m_l = 0;

			for (int i = 0; i <= coins[0]; i++) {
				for (int j = 0; j <= coins[1]; j++) {
					for (int k = 0; k <= coins[2]; k++) {
						for (int l = 0; l <= coins[3]; l++) {
							final int sum = i * 10 + j * 50 + k * 100 + l * 500;

							if (price > sum) {
								continue;
							}

							final int diff = sum - price;
							int n_l = diff / 500;
							int n_k = (diff - n_l * 500) / 100;
							int n_j = (diff - n_l * 500 - n_k * 100) / 50;
							int n_i = (diff - n_l * 500 - n_k * 100 - n_j * 50) / 10;
							
							int len = (coins[3] - l + n_l) + (coins[2] - k + n_k) + (coins[1] - j + n_j) + (coins[0] - i + n_i);
							if (len < min) {
								m_i = i;
								m_j = j;
								m_k = k;
								m_l = l;
								min = len;
							}
						}
					}
				}
			}

			if (m_i != 0) {
				System.out.println("10 " + m_i);
			}
			if (m_j != 0) {
				System.out.println("50 " + m_j);
			}
			if (m_k != 0) {
				System.out.println("100 " + m_k);
			}
			if (m_l != 0) {
				System.out.println("500 " + m_l);
			}
		}

	}
}

Measured memory_bytes: 34676
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int dp[N];

void solve() {
    int n, k;
    cin>>n>>k;
    for(int i = k; i >= 1; i--) {
        int cnt = 0;
        int sub = 0;
        for(int j = i; j <= k; j += i) {
            cnt++;
            if(j != i) sub = add(sub, dp[j]);
        }
        dp[i] = power(cnt, n);
        dp[i] = add(dp[i], -sub);
    }
    int ans = 0;
    rep(i, 1, k) {
        //cout<<i<<" "<<dp[i]<<endl;
        ans = add(ans, mul(i, dp[i]));
    }
    cout<<ans;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    int t = 1;
    //cin>>t;
    while(t--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 4364
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define LEN 1000001

int main(){
    vector<int> A(LEN, 0);
    cin >> A[1];
    
    int i = 2;
    while(1){
        if(A[i-1]%2 == 0){
            A[i] = A[i-1]/2;
        }else{
            A[i] = 3*A[i-1] + 1;
        }
        for(int j = 1; j < i; j++){
            if(A[j] == A[i]){
                cout << i << endl;
                return 0;
            }
        }
        i++;
    }

	return 0;
}

Measured memory_bytes: 4096
// solve by circulational list
#include <iostream>
#include <cstdlib>
using namespace std;

struct node{
	int value;
	struct node *next;
};

int main(){
	int n, m;
	struct node *now;
	struct node *list;
	while (cin >> n >> m) {
		if (n == 0 && m == 0) {
			break;
		}
		// make list
		list = (struct node*) malloc(sizeof(struct node));
		now = list;
		for (int i = 1; i < n; i++) {
			now->next = (struct node*) malloc(sizeof(struct node));
			now->value = i;
			now = now->next;
		}
		now->next = list;
		now->value = n;
		// delete
		while (now != now->next) {
			for (int i = 0; i < m-1; i++) {
				now = now->next;
			}
			//cout << "del: " << now->next->value << endl;
			now->next = now->next->next;
		}
		// output
		cout << now->value << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define ANS cout << ans << endl
#define RETURN(x)    \
  cout << x << endl; \
  return 0
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll 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);
  return (ret);
}

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

signed main() {
  init();
  string a, b;
  cin >> a >> b;

  string c = a + b;
  ll cc = stoi(c);
  ll sq = sqrt(cc);

  if (sq * sq == cc) {
    COUT("Yes");
  } else {
    COUT("No");
  }
  return 0;
}

Measured memory_bytes: 3644
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    
    if(x >= 30) {
    	System.out.println("Yes");
    }else {
    	System.out.println("No");
    }
}
}    

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

using namespace std;

#define MAX 100005
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;

const ll MOD = 1000003;

ll st[4 * MAX];
ll lazy[4 * MAX];


void addLazy(ll n, ll b, ll e, ll v) {
	lazy[n] = lazy[n] + v;
	st[n] = st[n] + (v * ( e - b+ 1) );
}

void push(ll n, ll b, ll e) {
	if (b == e)return;

	ll m = (b + e) >> 1;

	addLazy(2 * n, b, m, lazy[n]);
	addLazy(2 * n + 1, m + 1, e, lazy[n]);

	lazy[n] = 0;
}

void update(ll n, ll b, ll e, ll i, ll j, ll v) {
	if (b >= i && e <= j) {
		addLazy(n, b, e, v);
	}
	else if (b > j || e < i) return;
	else {
		push(n, b, e);
		ll m = (b + e) >> 1;
		if (j <= m) {
			update(2 * n, b, m, i, j, v);
		}
		else if (i > m) {
			update(2 * n + 1, m + 1, e, i, j, v);
		}
		else {
			update(2 * n, b, m, i, j, v);
			update(2 * n + 1, m + 1, e, i, j, v);
		}

		st[n] = (st[2 * n] + st[2 * n + 1]);
	}
}

ll query(ll n, ll b, ll e, ll i,ll j){
 
 if(e < i || b > j)
  return 0;
 
 if(b >= i && e <= j)
  return st[n];
  
  push(n,b,e);
  
  ll m = (b + e) >> 1;
  
  ll l = query(2*n,b,m,i,j);
  
  ll r = query(2*n + 1,m + 1,e,i,j);
  
  return l + r;
 
}

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

 ll N,Q;
 
 cin >> N >> Q;
 
 ll a,b,c,d;
 
 while(Q--){
  
  cin >> a >> b >> c;
  
  if(!a){
   
   cin >> d;
   
   update(1,1,N,b,c,d);
  }
  else{
   
   cout << query(1,1,N,b,c) << endl;
  }
 }

	return 0;
}




Measured memory_bytes: 7292
import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {
        try(final Scanner scanner = new Scanner(System.in);) {

        final int first = scanner.nextInt();
        final int second = scanner.nextInt();
        if (first % 2 == 0 || second % 2 == 0) {
            System.out.println("Even");
        } else {
            System.out.println("Odd");
        }
        }
    }
}

Measured memory_bytes: 23892
s = input()
n = len(s)
mae = 0
ushiro = n - 1
ans = 0

while mae != ushiro:
    if s[mae] == s[ushiro]:
        mae += 1
        ushiro -= 1
        if mae == ushiro + 1:
            break
    elif s[mae] != s[ushiro]:
        if s[mae] == "x":
            mae += 1
            ans += 1
        elif s[ushiro] == "x":
            ushiro -= 1
            ans += 1
        else:
            print(-1)
            exit()

print(ans)

Measured memory_bytes: 3316
#include <map>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>

using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
typedef long long ll;

int as[200000+10];
int bs[200000+10];
int tas[200000+10];
int tbs[200000+10];

int main(void) {
  int n;
  scanf("%d", &n);
  REP(i, n) {
    scanf("%d", &as[i]);
  }
  REP(i, n) {
    scanf("%d", &bs[i]);
  }
  
  int res = 0;
  REP(d, 29) {
    int mask = (1 << (d+1)) - 1;
    int target = 1 << d;
    REP(i, n) {
      tas[i] = as[i] & mask;
      tbs[i] = bs[i] & mask;
    }
    sort(tbs, tbs + n);
    ll cur = 0;
    REP(i, n) {
      int x1 = lower_bound(tbs, tbs + n, 2*target-tas[i]) - lower_bound(tbs, tbs + n, 1*target-tas[i]);
      int x2 = lower_bound(tbs, tbs + n, 4*target-tas[i]) - lower_bound(tbs, tbs + n, 3*target-tas[i]);
      cur += x1;
      cur += x2;
    }
    if(cur % 2 == 1) {
      res |= 1 << d;
    }
  }
  printf("%d\n", res);

  return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <chrono>
#include <string>
#include <bitset>
#include <cassert>
#include <queue>
#include <memory>

//#pragma comment(linker, "/STACK:16777216")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,abm,mmx,avx,avx2,popcnt,tune=native")

using namespace std;

//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define ll long long
#define ull unsigned long long
//#define double long double
//#define int ll
//#define int ull
//#define int short
//#define int unsigned short
//#define int unsigned int
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define hash hash228
#define get get228
const int SZ = 1e3 + 4;
const double EPS = 1e-7;
const int mod = 998244353;
const int hashpow = 127;
const int inf = 2e9;

#define kek cout << "kek"

int k;

void read() {
    cin >> k;
}

int x[] = {0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

void solve() {
    cout << x[k];
}

signed main() {

#ifdef __LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif

//    int t;
//    cin >> t;
//    for (int i = 0; i < t; ++i) {
    read();
    solve();
//    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 100005
#define NIL -1
struct Node{
int p;//存储父节点的序号
int l;//存储子节点的序号
int r;//存储兄弟节点的序号
};
Node T[MAX];
int n,D[MAX];
void print(int u){
cout<<"node "<<u<<": ";
cout<<"parent = "<<T[u].p<<",";
cout<<" depth = "<<D[u]<<", ";
if (T[u].p==NIL) cout<<"root, ";
else if (T[u].l == NIL) cout<<"leaf, ";
else cout<<"internal node, ";
cout<<"[";
for (int i=0, c = T[u].l; c!=NIL;i++, c=T[c].r){
if (i) cout<<",";
if(i!=0) cout<<" ";
cout<<c;
}
cout<<"]"<<endl;
}
int rec(int u,int p){
    D[u]=p;
    if(T[u].r!=NIL) rec(T[u].r,p);
    if(T[u].l!=NIL) rec(T[u].l,p+1);
}

int main(){
    int i,j,d,v,c,l,r;
    cin>>n;
    for(i=0;i<n;i++) {
    T[i].p =T[i].l=T[i].r=NIL;
    }
    for(i=0;i<n;i++){
    cin>>v>>d;
    for(j=0;j<d;j++){
    cin>>c;
    if(j==0) T[v].l=c;//输入子节点第一个
    else T[l].r=c;//输入子节点其他位
    l=c;
    T[c].p=v;//传递到子节点
    }
    }
    for(i=0;i<n;i++){
    if(T[i].p==NIL) r=i;//找到根节点，方便递归
    }
    rec(r,0);
    for(i=0;i<n;i++) print(i);
    return 0;
}



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

int main(){
  string S;
  cin >>S;
  int start;
  int end;
  for (int i=0;i<S.length();i++){
    if(S.at(i)=='A'){
      start=i;
      break;
    }
  }
  for (int i=S.length()-1;i>0;i--){
    if(S.at(i)=='Z'){
      end=i;
      break;
    }
  }
  
  cout<<end-start+1<<endl;

  return 0;
}

    
    

Measured memory_bytes: 640
#define _USE_MATH_DEFINES
 
#include <bits/stdc++.h>
 
using namespace std;
 
using ll = long long;
using ld = long double;
 
constexpr ll MOD = 1000000007;

#ifndef ONLINE_JUDGE
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " (" << x.first << " : " << x.second << ")" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "["; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "(" << obj.first << ", " << obj.second << ")"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print_sim_py(void) {cout << endl;}
template <class Head> void print_sim_py(Head&& head) {cout << head;print_sim_py();}
template <class Head, class... Tail> void print_sim_py(Head&& head, Tail&&... tail) {cout << head << " ";print_sim_py(forward<Tail>(tail)...);}
 
#define print(...) print_sim_py(__VA_ARGS__);
#else
#define print(...);
#endif


int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
 
    string ans = "Yes";
    ll d,t,s;

    cin >> d >> t >> s;

    if(t*s<d)
        ans = "No";
    
    cout << ans << endl;
 
    return 0;
}



Measured memory_bytes: 3648
from collections import*
from heapq import*
(n,m),a,*q=[[*map(int,o.split())]for o in open(0)]
t=[-1]*n
def r(x):
 while t[x]>=0:x=t[x]
 return x
def u(x,y):
 x,y=r(x),r(y)
 if x!=y:
  if t[x]>t[y]:x,y=y,x
  t[x]+=t[y];t[y]=x
d=defaultdict(list)
for x,y in q:u(x,y)
i=c=0;b=[];k=(n+~m)*2
for v in a:d[r(i)]+=v,;i+=1
print(k<1and'0'or k>n and'Impossible'or exec("for r,p in d.items():p.sort();c+=p.pop(0);b+=p;k-=1")or c+sum(sorted(b)[:k]))

Measured memory_bytes: 35468
n = int(input())
A = list(map(int, input().split()))

ans = 0

length = len(A)
before = A[0]
for num in range(1, length):
    if before > A[num]:
        diff = before - A[num]
        ans += diff
        A[num] = before
    before = A[num]

print(ans)


Measured memory_bytes: 32244
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
int main(){
	int a,b;scanf("%d%d",&a,&b);
	if(a==1)a+=13;
	if(b==1)b+=13;
	if(a>b)printf("Alice\n");
	else if(a<b)printf("Bob\n");else printf("Draw\n");
}

Measured memory_bytes: 128
import sys

input = sys.stdin.readline
N, K, Q = map(int, input().split())
scores = [K-Q]*N
for _ in range(Q):
    a = int(input()) - 1
    scores[a] += 1
for score in scores:
    if score > 0:
        print('Yes')
    else:
        print('No')



Measured memory_bytes: 75664
A,B=map(int,input().split(' '))
ans=0
def button(A,B,ans):
  if A>B:
    ans+=A
    A-=1
  else:
    ans+=B
    B-=1
  return A,B,ans

A,B,ans=button(A,B,ans)
A,B,ans=button(A,B,ans)
print(ans)

Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int[] output = new int[n];
        
        // to: 隣接リスト
        List<Integer>[] to = new List[n];
        for (int i = 0; i < n; i++) {
            to[i] = new ArrayList<Integer>();
        }
        for (int i = 0; i < n - 1; i++) {
            int s = sc.nextInt() - 1;
            int t = sc.nextInt() - 1;
            to[s].add(t);
            output[i+1] = t;
        }
        
        
        int[] ans = new int[n];
        int max = -1;
        // 頂点0から順に、親から子へ初期値を配り最終値を求める
        Queue<int[]> que = new ArrayDeque<int[]>();
        que.add(new int[]{0, 0});
        while (!que.isEmpty()) {
            int[] cur = que.poll();
            int p = cur[0];
            int color = cur[1];
            
            int now = 1;
            for (Integer q : to[p]) {
                if (now == color) {
                    now++;
                }
                que.add(new int[]{q, now});
                ans[q] = now;
                max = Math.max(max, now);
                now++;
            }
        }
        
        System.out.println(max);
        for (int i = 1; i < n; i++) {
            System.out.println(ans[output[i]]);
        }
    }
}

Measured memory_bytes: 98256
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]
for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
#print(a, b)
j = m
for i in range(n+1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)

Measured memory_bytes: 47984
#include<stdio.h>

int main(void)
{
	int i,n,m,x,a,l=0,r=0;
	scanf("%d%d%d",&n,&m,&x);
	for(i=0;i<m;i++){
		scanf("%d",&a);
		if(a<x)
			l++;
		if(a>x)
			r++;
	}
	if(r>=l)
		printf("%d",l);
	else
		printf("%d",r);
	return 0;
}

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

int main(){
	int N,M,cnt=0,max_cnt=0;
	cin>>N;
	vector<string> B(N);
	for (int i = 0; i < N; i++) {
		cin>>B.at(i);
	}
	cin>>M;
	vector<string> R(M);
	for (int i = 0; i < M; i++) {
		cin>>R.at(i);
	}
	for(int i = 0; i < N; i++) {
		for(int j = 0; j < N; j++) {
			if(B.at(i)==B.at(j))
				cnt++;
		}
		for(int j = 0; j < M; j++) {
			if(B.at(i)==R.at(j))
				cnt--;
		}
      if(max_cnt<cnt)
          max_cnt=cnt;
      cnt=0;
	}
	cout << max_cnt << endl;
}

Measured memory_bytes: 256
#include<cstring>
#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<complex>
#include<sstream>
#include<climits>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 1000;
int N;
int T[MAX_N], A[MAX_N];

int main() {
  cin >> N;
  rep(i,N) cin >> T[i] >> A[i];

  ll t = 1, a = 1;
  ll ans = 0;
  for (int i = 0; i < N; ++i) {
   ll k = max((t+(T[i]-1))/T[i], (a+(A[i]-1))/A[i]); 
   t = k*T[i]; a = k*A[i];
   ans = (T[i]+A[i])*k;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,a,b) for(ll i=a;i<=b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define endl "\n"
#define deb(x) cerr << #x << "=" << x << endl
#define debb(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define mod ((ll)1e9+7)
#define N ((ll)1e4)
#define pb push_back
#define in insert
#define F first
#define S second
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define PI 3.1415926535897932384626
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define speed ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define test ll t; cin>>t; while(t--)
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
ll dr[] = { -1, 1, 0, 0};
ll dc[] = {0, 0, 1, -1};

/*Functions*/
ll gcd(ll a, ll b);
ll exp(ll x, ll y, ll p);
ll exp(ll x, ll y);
void InverseofNumber();
void InverseofFactorial();
void factorial();
ll Binomial(ll n, ll R);


ll factorialNumInverse[N + 1];
ll naturalNumInverse[N + 1];
ll fact[N + 1];

void fileIO() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
ll dp[10000001];
int main() {
    clock_t start, end;
    start = clock();
    speed
    // InverseofNumber(),InverseofFactorial(),factorial();
    fileIO();
    ll n; cin >> n;
    fill(dp, dp + n + 1, 2);
    for (ll i = 2; i <= n / 2; i++) {
        for (ll j = i * 2; j <= n; j += i) {
            dp[j]++;
        }
    }
    dp[1] = 1;
    ll ans = 0;
    for (ll i = 1; i <= n; i++) {
        ans +=  i * dp[i];
    }
    cout << ans;




    end = clock();
    double timeTaken = double(end - start) * 1000 / double(CLOCKS_PER_SEC);
    deb(timeTaken);

    return 0;
}



/*All Functions*/
ll gcd(ll a, ll b) {
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll exp(ll x, ll y, ll p) {
    ll res = 1;
    while (y) {
        if (y % 2)
            res = (res * x % p) % p;
        x = (x * x) % p;
        y /= 2;
    }
    return res;
}
ll exp(ll x, ll y) {
    ll res = 1;
    while (y) {
        if (y % 2)
            res = (res * x ) ;
        x = (x * x) ;
        y /= 2;
    }
    return res;
}
void InverseofNumber() {
    naturalNumInverse[0] = naturalNumInverse[1] = 1;
    for (ll i = 2; i <= N; i++)
        naturalNumInverse[i] = naturalNumInverse[mod % i] * (mod - mod / i) % mod;
}
void InverseofFactorial() {
    factorialNumInverse[0] = factorialNumInverse[1] = 1;
    for (ll i = 2; i <= N; i++)
        factorialNumInverse[i] = (naturalNumInverse[i] * factorialNumInverse[i - 1]) % mod;
}
void factorial() {
    fact[0] = 1;
    for (ll i = 1; i <= N; i++)
        fact[i] = (fact[i - 1] * i) % mod;
}
ll Binomial(ll n, ll R) {
    ll ans = ((fact[n] * factorialNumInverse[R]) % mod * (factorialNumInverse[n - R]) % mod) % mod;
    return ans;
}

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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            var impS = Console.ReadLine();
            int cntR = 0;
            int cntB = 0;
            for (int i = 0; N > i; i++) 
            {
                if(impS[i]=='R')
                {
                    cntR += 1;
                }
                else
                {
                    cntB += 1;
                }
            }
            if(cntR>cntB)
            {
                Console.Write("Yes");
            }
            else
            {
                Console.Write("No");
            }
            //System.Threading.Thread.Sleep(1000);
        }
    }
}


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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

#define INF 100000000
#define MOD 1000000007
#define writeln(n) cout<<n<<endl
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
//vector<tuple<long long, long long, long long>>vec;

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

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

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

const int inf=100000000;

llong pownew(llong m, llong n) {
        if (n == 0) { return 1; }
        if (n % 2 == 0) { return pow(m*m, n/2); }
        return pow(m, n-1) * m;
    }

bool isprime(int p) {
    if (p == 1) return false;
    for (int i = 2; i < p; i++) {
        if (p%i == 0) return false;
    }
    return true;
}


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
       string s;
    cin>>s;
    int k=s.size();
    int a,b; a=0; b=0;
    for(int i=0 ; i<s.size(); i++)
    {
        if(s[i]=='o') ++a;
        else if(s[i]=='x') ++b;
    }

    if(15-k+a>=8) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return  0;
}


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

int main() {
  string x;
  cin >> x;

  if (x == "Sunny" ) {
    cout << "Cloudy" << endl;
  }
  
  else if (x == "Cloudy" ) {
    cout << "Rainy" << endl;
  }
  
  else if (x == "Rainy" ) {
    cout << "Sunny" << endl; 
  }

}


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

int main()
{
    string s;
    cin >> s;

    int chgCnt = 0;
    for (int i = 0; i < s.length() / 2; i++)
    {
        if (s[i] != s[s.length() - i-1])
        {
            chgCnt++;
        }
    }
    
    cout << chgCnt;
    return 0;

}


Measured memory_bytes: 256
"use strict"
function main(arg) {
    let s = arg.trim().split("\n")
    s.shift()
    let data = {}
    for (let i = 0; i < s.length; i++) {
        data[s[i]] = 1
    }
    console.log(Object.keys(data).length)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

using namespace std;

#define REPI(x) for(int i=0;i<x;i++)
#define REPJ(x) for(int j=0;j<x;j++)
#define SCANFD(x) scanf("%d",&x)

int main(){
    int N;
    int a[100001];
    int res=0,button=1;

    scanf("%d",&N);
    for(int i=1;i<=N;i++){
        scanf("%d",&a[i]);
    }

    while(res<N){
        button = a[button];
        res++;
        if(button == 2)
            break;
    }
    if(res==N)
        res=-1;

    printf("%d\n",res);
    return 0;
}


Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
signed main() {
	int n;
	while (cin >> n) {
		int ans = 0;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				for (int x = 0; x < 10; x++) {
					for (int y = 0; y < 10; y++) {
						if (i + j + x + y == n) {
							ans++;
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 3048
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define printfdouble(x) printf("%.12f\n",(x))
#define MOD 1000000007
#define itn int
#define enld endl
#define ednl endl
#define icn cin
#define stirng string
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
using Graph = vector<vector<int>>;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b){if(b<a){a=b; return 1;} return 0;}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int D,G; cin >> D >> G;
    int p[15],c[15];
    rep(i,0,D) cin >> p[i] >> c[i];
    int ans = 1000000;
    rep(i,0,(1<<D)){
        int num = 0;
        ll score = 0;
        rep(j,0,D){
            if(i & (1<<j)){
                num += p[j];
                score += 100 * (j+1) * p[j] + c[j];
            }
        }
        if(score >= G){
            chmin(ans,num);
        }else{
            int pmax = 0;
            for(int j=0;j<D;j++){
                if(i & (1 << j)) continue;
                pmax = j;
            }
            if(score + 100*(pmax+1)*(p[pmax]-1) >= G){
                int t = ((G-score)+(100*(pmax+1))-1)/(100*(pmax+1));
                chmin(ans, num+t);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n,m;
int a[1010];

int main(){
	while(1){
		cin>>n>>m;
		if(n==0&&m==0)break;
		for(int i=0;i<n;i++)
			cin>>a[i];
		int ans=-1;
		for(int i=0;i<n-1;i++){
			for(int j=i+1;j<n;j++){
				if(a[i]+a[j]<=m&&a[i]+a[j]>ans){
					ans=a[i]+a[j];
				}
			}
		}
		if(ans==-1)cout<<"NONE"<<endl;
		else cout<<ans<<endl;
	}
	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vint;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SZ(x) (int)(x).size()
#define SYAMU(ary) memset(ary,0,sizeof(ary))
#define dbg(x) cout<<#x<<": "<<(x)<<"\n"
#define pb push_back
#define eb emplace_back
#define mp make_pair

int n,l;
vector<string> v;

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

    string ans = "";
    rep(i,n) {
        string s; cin >> s;
        v.pb(s);
    }
    sort(ALL(v));
    for(auto& i : v) {
        ans += i;
    }

    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256
#include <string>
#include <iostream>
#include <stack>
#include <queue> // priority_queue も入ってる
#include <set>   // 要素数は size() で取得 multisetもある
#include <map>
#include <array> // sizeはコンパイル時定数で固定
#include <vector>
#include <numeric>   // accumulate, gcd
#include <algorithm> // count_ifに必要
#include <iomanip>   // cout << setprecision(15) << x で小数の出力精度を指定
#include <tuple>
#include <utility> //pair
#include <cmath>

using namespace std;
// 問題が起こるまでintは使用禁止2020-04-13
using ll = long long;

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

template <class InputIterator, class T>
bool contains_itr(InputIterator iterator, const T &value)
{
    if (find(iterator.begin(), iterator.end(), value) == iterator.end())
        return false;
    else
        return true;
}

template <class T>
bool contains_set(set<T> st, const T &value)
{
    if (st.find(value) == st.end())
    {
        return false;
    }
    else
    {
        return true;
    }
}

template <class InputIterator>
auto sum(InputIterator iterator)
{
    return accumulate(iterator.begin(), iterator.end(), 0);
}

// endは排他的(exclusive)なので注意
vector<ll> range(ll begin, ll end)
{
    vector<ll> result;
    for (ll i = begin; i < end; ++i)
    {
        result.push_back(i);
    }
    return result;
}

// =========ここまでテンプレ============

int main()
{
    string s, t;
    cin >> s >> t;
    ll result = 0;
    rep(i, s.size())
    {
        if (s[i] != t[i])
        {
            ++result;
        }
    }
    cout << result << endl;
}

Measured memory_bytes: 3516