akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
using namespace std;

using ll = long long;

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; }
template<class T> inline void dump(vector<T> v) { for (auto& x : v) cerr << x << " "; cerr << endl; }
template<class T> inline void dump(vector<pair<T, T>> v) { for (auto& p : v) cerr << p.first << " " << p.second << endl; }
template<class T> inline void dump(vector<vector<T>> vv) { for (auto& v : vv) {for (auto& x : v) cerr << x << " "; cerr << endl;} }

constexpr int INF = 1e9+5;
constexpr long long INFLL = 1LL<<60;
constexpr double eps = (1e-9);

void recursive_comb(int *indexes, int s, int rest, std::function<void(int *)> f) {
  if (rest == 0) {
    f(indexes);
  } else {
    if (s < 0) return;
    recursive_comb(indexes, s - 1, rest, f);
    indexes[rest - 1] = s;
    recursive_comb(indexes, s - 1, rest - 1, f);
  }
}

// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k, std::function<void(int *)> f) {
  int indexes[k];
  recursive_comb(indexes, n - 1, k, f);
}

ll calc_cost(const vector<ll>& a, const vector<int>& t) {
  ll ans = 0;
  ll m = 0;
  auto it = t.begin();
  for (int i = 0; i < a.size(); i++) {
    if (i == *it) {
      if (a[i] <= m) {
        ans += (m+1) - a[i];
        m = m + 1;
      } else {
        m = a[i];
      }
      it++;
    } else {
      m = max(m, a[i]);
    }
  }
  return ans;
}

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

  int n, k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  ll ans = INFLL;

  foreach_comb(n, k, [&](int* indexes) {
    vector<int> t;
    for (int i = 0; i < k; i++) t.push_back(indexes[i]);
    sort(t.begin(), t.end());
    chmin(ans, calc_cost(a, t));
  });

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define next Next
#define last Last
#define int long long
const int N=1e6+5;
int n,k,m,a[N];
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
	int ret=0,f=0;char c=gc();
	while(!isdigit(c)){if(c=='-')f=1;c=gc();}
	while(isdigit(c)){ret=ret*10+c-48;c=gc();}
	if(f)return -ret;return ret;
}
signed main()
{
	n=read();k=read();m=read();
	for(int i=1;i<=m;i++)
		a[read()]++;
	for(int i=1;i<=n;i++)
		if(k+a[i]-m>0)puts("Yes");
		else puts("No");
}

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

using namespace std;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)
typedef long long ll;
typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 2147483647;
const ll INFL = 9223372036854775807;
const ll mod = 1000000007;


int main() {
	string s;
	cin >> s;
	int ans = 0;
	REP(i, 4) {
		if (s[i] == '2')ans++;
	}
	cout << ans << endl;
	return 0;
}

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

bool is_prime(int n)
{

    if(n==2)
        return true;
    if(n%2==0)
        return false;
    for(int i=3;i<=sqrt(n);i+=2)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
#define ll long long
#define loop(n) for(int i=0;i<n;i++)

int main()
{
    int n;
    cin>>n;
    int a[n];
    loop(n)cin>>a[i];
    sort(a,a+n);
    double x=a[0];
    for(int i=1;i<n;i++)
    {
        x+=a[i];
        x/=2;
    }
    cout<<x;
}



Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <queue>
#include <algorithm>
using namespace std;
const int nmax=100005;
struct coin
{
    int x,y,z;
}v[nmax];
priority_queue<int> pq;
int X,Y,Z,n,i;
long long pref[nmax],suf[nmax];
long long ans;
bool dif(coin unu,coin doi)
{
    return (unu.y-unu.x<doi.y-doi.x);
}
int main()
{
    //freopen("data.in","r",stdin);
    ios_base::sync_with_stdio(false);
    cin>>X>>Y>>Z;
    n=X+Y+Z;
    for(i=1;i<=n;i++)
    {
        cin>>v[i].x>>v[i].y>>v[i].z;
    }
    sort(v+1,v+n+1,dif);
    for(i=1;i<=n;i++)
    {
        pq.push(v[i].z-v[i].x);
        pref[i]=1LL*pref[i-1]+v[i].x;
        if(i>X)
        {
            pref[i]+=1LL*pq.top();
            pq.pop();
        }
    }
    while(!pq.empty()) pq.pop();
    for(i=n;i>=1;i--)
    {
        pq.push(v[i].z-v[i].y);
        suf[i]=1LL*suf[i+1]+v[i].y;
        if(i<=n-Y)
        {
            suf[i]+=1LL*pq.top();
            pq.pop();
        }
    }
    for(i=X;i<=X+Z;i++)
        ans=max(ans,pref[i]+suf[i+1]);
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3448
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/*
    s.find_by_order(k) ---> returns iterator to the element at index(from 0) k
    s.order_of_key(val) ---> number of elements that are strictly smaller than the given value
*/
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long int> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvl;
typedef pair<int, int> pii;
typedef pair<long long int, long long int> pll;
typedef vector<pair<int, int>> vii;
typedef vector<pair<long long int, long long int>> vll;
#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test() long long int tc; cin >> tc; cin.ignore(); while(tc--) 
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define MOD 1000000007
#define SMOD 998244353
#define HASH 18014398241046527
#define pq priority_queue
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sp " "
#define inp(a) ll a;cin>>a;cin.ignore()
#define inps(a,b) ll a,b;cin>>a>>b;cin.ignore()
#define out(a) cout<<SP(20)<<a<<'\n'
#define outs(a,b) cout<<SP(20)<<a<<" "<<b<<'\n'
#define ins insert
#define er erase
#define lb lower_bound
#define ub upper_bound
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define inpa(a,n) ll a[n]; for(int i=0; i<n; i++){cin>>a[i];}
#define inpv(a,n) vl a; for(int i=0; i<n; i++){inp(x);a.pb(x);}
#define outa(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<'\n';
#define outv(v) for(auto i:v){cout<<i<<" ";}cout<<'\n';
set<char> vow = {'a','e','i','o','u','A','E','I','O','U'};
ll xpow(ll n, ll m){if(m==0){return 1;}else{ll x = xpow(n, m/2);if(m&1){return x*x*n;}else{return x*x;}}}
ll xmod(ll a, ll m){return (((a%m)+m)%m);}
ll xmodpow(ll n, ll m, ll y){if(m==0){return 1;}else{ll x = xmodpow(n, m/2, y);if(m&1){return xmod((xmod((xmod(x,y)*xmod(x,y)),y)*xmod(n,y)),y);}else{return xmod((xmod(x,y)*xmod(x,y)),y);}}}
template <typename T>
ll SIZEOF(T a){return (ll)a.size();}
ll xlcm(ll a, ll b){return (a/__gcd(a, b))*b;}

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


const int N = 100005;

vl g[N];

bool vis[N];

ll n, m;

void dfs(ll i){
    vis[i] = 1;
    for(auto j:g[i]){
        if(!vis[j]){
            dfs(j);
        }
    }
}

void SOLVE(){
    cin >> n >> m;
    for(ll i=1; i<=m; i++){
        inps(u, v);
        g[u].pb(v);
        g[v].pb(u);
    }
    ll cnt = 0;
    for(ll i=1; i<=n; i++){
        if(!vis[i]){
            dfs(i);
            cnt++;
        }
    }
    cout << cnt-1 << endl;
}

int main() {
	fastIO();
	// #ifndef ONLINE_JUDGE
    //     freopen("i.txt", "r", stdin);
    //     freopen("o.txt", "w", stdout);
	// #endif

    ll TC = 1;
    // cin >> TC;
    for(ll tc1=1; tc1<=TC; tc1++){
        // cout << "Case #" << tc1 << ": ";
        SOLVE();
    }
    printclock;
}

Measured memory_bytes: 10564
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){

	cout << fixed << setprecision(8);
	double l;

	cin>> l;

	cout << (l / 3.0)*(l / 3.0)*(l / 3.0) << endl;

}


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

using namespace std;

int main(int argc, const char *argv[])
{
  int h, n;
  cin >> h >> n;

  int sum = 0;
  for (int i = 0; i < n; i++) {
    int n;
    cin >> n;
    sum += n;
  }

  if (h <= sum) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <utility>

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

signed main()
{
    int k, t;
    cin >> k >> t;
    
    int ma = 0;
    rep(i, t){
        int a;
        cin >> a;
        ma = max(ma, a);
    }
    
    cout << max(0, ma - (k-ma) - 1) << endl;
}


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

int main(){
    std::unordered_map<ll, int> cnt;
    ll N;
    cin >> N;
    rep(i, N) {
        ll a;
        cin >> a;
        cnt[a]++;
    }
    if(cnt.size() == N) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 8520
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int co,n;
  cin>>co>>n;
  vector<int>in1;
  vector<int>in2;
  rep(i,n){
    string s;
    int in;
    cin>>s>>in;
    if(s=="D")in1.pb(in);
  }
  cin>>n;
  rep(i,n){
    string s;
    int in;
    cin>>s>>in;
    if(s=="DD")in2.pb(in);
  }
  sort(all(in1));
  sort(all(in2));
  int maxi=0;  
  for(int i=0;i*2<=co;i++){
    int sum=0;
    rep(j,i)if(in2.size()&&in2.size()-1-j<1e8&&(in2.size()-1-j>=0))sum+=in2[in2.size()-1-j];
    for(int j=0;j<co-i*2;j++)if(in1.size()&&in1.size()-1-j<1e8&&(in1.size()-1-j>=0))sum+=in1[in1.size()-1-j];
    maxi=max(maxi,sum);
  }
  cout<<maxi<<endl;
}

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

ll f(ll r) {
    if (r == 1) return 1;
    return 2 * f(r/2) + 1;
}

int main() {
    ll h;
    cin >> h;
    cout << f(h) << endl;
}

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

int w, h;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
string f[51];

void solve(int x , int y , char c ){
	for(int i=0 ; i<4 ; i++ ){
		int mx = x + dx[i];
		int my = y + dy[i];
		if( mx < 0 || mx >= w || my < 0 || my >= h ) continue;
		
		if( f[my][mx] == '.' ){
			f[my][mx] = ( c == 'W' )? 'w' : 'b' ;
			solve( mx , my , c );
		}else if( (c == 'B' && f[my][mx] == 'w') || (c == 'W' && f[my][mx] == 'b') ){
			f[my][mx] = '?';
			solve( mx , my , c );
		}
	}
}

void debug(){
	cout << "debug : " << endl;
	for(int y=0 ; y < h ; y++ ){
		for(int x=0 ; x < w ; x++ ){
			cout << f[y][x];
		}
		cout << endl;
	}
	cout << endl;
}

int main(){
	while( cin >> w >> h , w || h ){
		int white=0, black=0;
		for(int i=0 ; i < h ; i++ ){
			cin >> f[i];
		}
		for(int y=0 ; y < h ; y++ ){
			for(int x=0 ; x < w ; x++ ){
				if( f[y][x] == 'W' || f[y][x] == 'B' ){
					solve( x , y , f[y][x] );
				}
			}
		}
		//debug();
		for(int y=0 ; y < h ; y++ ){
			for(int x=0 ; x < w ; x++ ){
				if( f[y][x] == 'b' ){
					black++;
				}else if( f[y][x] == 'w' ){
					white++;
				}
			}
		}
		cout << black << " " << white << endl;
	}
}

Measured memory_bytes: 0
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef map<char,int> mci;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vii;
#define sz(v) v.size()
const int INF = 1e9 + 1273;
void solve(){
    int m,d; cin>>m>>d;
    int ans=0;
    for(int i = 2; i <= d/10; i++){
        for(int j = 2; j <= 9; j++){
            if(i==d/10 && j>d%10) continue;
            if(i*j<=m) ans++;
        }
    }
    cout<<ans;
}
int main(){
    int T=1;        //! COMMENT IF THERE IS NO TEST CASES
    //cin>>T;             
    for(int i = 0; i < T; i++) solve(); 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int, int>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define FILLINF(a) memset(a, 0x3f, sizeof(a))
#define POW(n) (1LL << (n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i, a, b) ((a) <= (i) && (i) <= (b))
using namespace std;
template <typename T> inline bool CHMIN(T& a, T b) { if(a > b) { a = b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a, T b) { if(a < b) { a = b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(begin(a), end(a)); }
template <typename T> inline void REV(T& a) { reverse(begin(a), end(a)); }
template <typename T> inline void UNI(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <typename S, typename T> inline T LB(S& v, T a) { return *lower_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int LBP(S& v, T a) { return lower_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> inline T UB(S& v, T a) { return *upper_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int UBP(S& v, T a) { return upper_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> ostream& operator << (ostream& os, const pair<S, T>& p) { os << p.first << " " << p.second; return os; }
template <typename S, typename T> istream& operator >> (istream& is, pair<S, T>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator >> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T& t, const V& v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T& t, const V& v) { for(auto &e : t) fill_v(e, v); }
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const lint MOD = 1000000007;



void _main() {
    string S;
    cin >> S;
    cout << (S[2] == S[3] && S[4] == S[5] ? "Yes" : "No") << endl;
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("output.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

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

int dp[128][128][1024];
int n;
int P[128];

void init() {
  for(int i = 0; i < 128; ++i) {
    for(int j = 0; j < 128; ++j) {
      for(int k = 0; k < 1024; ++k) {
        dp[i][j][k] = -1;
      }
    }
  }
}

int main() {
  for(;;) {
    init();
    scanf("%d", &n);
    if( n == 0 ) break;
    for(int i = 0; i < n; ++i) {
      scanf("%d", &P[i]);
    }
    dp[0][0][0] = 0;
    for(int i = 0; i < n; ++i) {
      for(int j = 0; j < n; ++j) {
        for(int k = 0; k < 1024; ++k) {
          if( dp[i][j][k] == -1 ) continue;
          // step 1
          dp[i+1][j][k] = std::max(dp[i+1][j][k], dp[i][j][k]);
          // step 2
          int count_1000 = (P[i] + 999) / 1000;
          int rem = dp[i][j][k] + count_1000 * 1000 - P[i];
          int& next = dp[i+1][j + (rem>=500 ? 1 : 0)][k + count_1000];
          next = std::max(next, rem>=500 ? rem - 500 : rem);
        }
      }
    }
    for(int i = 0; i < 6; ++i) {
      for(int j = 0; j < 6; ++j) {
        for(int k = 0; k < 6; ++k) {
          //printf("(i, j, k) = (%d, %d, %d) : %d\n", i, j, k, dp[i][j][k]);
        }
      }
    }
    int res = (1 << 28);
    int max = -1;
    for(int j = n; j >= 0; --j) {
      for(int k = 0; k < 1024; ++k) {
        if( dp[n][j][k] == -1 ) continue;
        int cost = k * 1000 - 500 * j - dp[n][j][k];
        res = std::min(res, cost);
      }
      if( res != (1 << 28) ) {
        max = j;
        break;
      }
    }
    printf("%d %d\n", max, res);
  }
         
        

  return 0;
}

Measured memory_bytes: 68748
r1 = list(map(int, input().split(' ')))
r2 = list(map(int, input().split(' ')))
r3 = list(map(int, input().split(' ')))
card = [r1, r2, r3]
card_after = card

N = int(input())

b_list = []

for _ in range(N):
	b_list.append(int(input()))

for b in b_list:
	for i, row in enumerate(card):
		for j, A in enumerate(row):
			if A == b:
				card_after[i][j] = True

card = card_after
bingo = False

# horiontal
if card[0][0] == card[0][1] == card[0][2] or card[1][0] == card[1][1] == card[1][2] or card[2][0] == card[2][1] == card[2][2]:
	bingo = True

# vertical
if card[0][0] == card[1][0] == card[2][0] or card[0][1] == card[1][1] == card[2][1] or card[0][2] == card[1][2] == card[2][2]:
	bingo = True

# diagonal
if card[0][0] == card[1][1] == card[2][2] or card[2][0] == card[1][1] == card[2][0]:
	bingo = True

if bingo:
	print('Yes')
else:
	print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

int main(){
    ll D;
    cin >> D;
    vector<ll> c(26);
    rep(i,26){
        cin >> c[i];
    }
    vector<vector<ll>> s(D,vector<ll>(26));
    rep(i,D){
        rep(j,26){
            cin >> s[i][j];
        }
    }
    vector<ll> t(D);
    /*rep(i,D){
        cin >> t[i];
        t[i]--;
    }*/
    vector<ll> memo(26,-1);
    ll score = 0;
    rep(i,D){
        //score += s[i][t[i]];
        //memo[t[i]] = i;
        ll M = 0;
        rep(j,26){
            if(M < s[i][j]){
                t[i] = j+1;
                M = s[i][j];
            }
        }
        //cout << score << endl;
    }
    ll cur = 0;
    rep(i,D){
        cout << ((cur%26)+1) << endl;
        cur++;
    }
}


Measured memory_bytes: 3748
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>

using namespace std;
int  a[10];

int main(){

	for (int i = 0; i < 20; i++)cin >> a[i];
	sort(a, a + 10);
	sort(a + 11, a + 20);
	int b = (a[7] + a[8] + a[9]);
	int c = (a[17] + a[18] + a[19]);
	cout << b << " " << c << endl;

	return 0;
}

Measured memory_bytes: 3076
#include<stdio.h>
#include <bits/stdc++.h>
#include<stdbool.h>
#include<math.h>
#include<string.h>
#define ll long long
#define db double
#define sz 500000005
using namespace std;

/*ll a[100005];
char str[1000005];

ll min(ll a, ll b)
{
    return a<b?a:b;
}*/


int main()
{
    ll x, i, j, t, tmp=0, flg1=0, flg2=1, sum=0, ans, one, zero, a, b, c;
    db n, m, k;
    scanf("%I64d", &a);
    printf("%I64d\n", a+(a*a)+(a*a*a));
    return 0;
}


Measured memory_bytes: 3820
// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);
#define _GLIBCXX_DEBUG//only for debugging
#include <bits/stdc++.h>
#include <chrono>
#include <ext/rope>
#define VALHALLA ios_base::sync_with_stdio(false);cin.tie(0);cout<<fixed<<setprecision(13);
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define debug(x) std::cerr << #x << ": " << (x) << '\n';
#define sz(x) (int)x.size()
#define fast(map_name) map_name.reserve(1024);map_name.max_load_factor(0.25);
using namespace std;
using namespace __gnu_cxx;
typedef long long int ll;
typedef pair<int,int> ii;
typedef complex<double> point;
const double epsilon=1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/* VARIABLE DECLARATION START */


/*  FUCNTION TEMPLATE STARTS  HERE */

double dot(point a,point b){ return (conj(a)*b).real() ; }
double cross(point a,point b){ return (conj(a)*b).imag() ; }
double dist(point a, point b){ return abs(a-b); }
struct neal {
static uint64_t splitmix64(uint64_t x)
 {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const
 {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
}
};
struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return (size_t) x.first * 37U + (size_t) x.second;
  }
};
bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}
inline ll exp(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

inline bool comp(double a,double b)
{
  return (fabs(a-b)<epsilon);
}
ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}

/*  FUCNTION TEMPLATE ENDS HERE */
int main()
{
   VALHALLA
   int a,b,c;
   vector<int> v(3);
   for(int i=0;i<3;++i)cin>>v[i];
    vector<int> v1{5,5,7};
   if(is_permutation(all(v1),v.begin()))
   {
    cout<<"YES"<<endl;
   }
   else
    cout<<"NO"<<endl;
   
   
   


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, t) for(int i = 0; i < t; i++)
#define INF (1 << 30)

int main()
{
    string w;
    cin >> w;
    string letters;
    REP(i, w.size()) if (letters.find(w[i]) == string::npos) letters += w[i];

    int letter_count[26] = {0};

    REP(i, letters.size())
    {
        REP(j, w.size())
            if (letters[i] == w[j]) letter_count[w.c_str()[j] - 'a']++;
    }

    REP(i, 26)
    {
        if (letter_count[i] % 2 != 0)
        {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0) 
#define setbit0(n, i) ((n) & (~(1LL << (i)))) 
#define setbit1(n, i) ((n) | (1LL << (i))) 
#define togglebit(n, i) ((n) ^ (1LL << (i))) 
#define lastone(n) ((n) & (-(n))) 
char gap = 32;
template<typename T> 
ostream& operator<<(ostream &os, const vector<T> &v) { 
    os << '{'; 
    for (const auto &x : v) os << gap << x;
        return os << '}'; 
}
template<typename A, typename B> 
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long 
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    vector<ll> data;
    ll i, j, k, l, n, m;
    cin >> n;
    for (i = 1; i <= n;i++){
        cin >> k;
        data.pb(k);
    }
    sort(data.begin(), data.end());
    ll sum = data[n-1];
    ll finpos = n - 2;
    ll cnt = 1;
    for (i = n-3; i >=0 ;i--){
        sum += data[finpos];
        cnt++;
        if(cnt>2){
            cnt = 1;
            finpos--;
        }
        ///cout << sum << "\n";
    }
    cout << sum << "\n";
    return 0;
}

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

#define ll long long
#define ld double
#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define sc(a) scanf("%lld",&a);
#define sd(a) scanf("%lf",&a);
#define test() ll tt;cin>>tt;for(ll testcase=1;testcase<=tt;testcase++)
#define all(v) v.begin(),v.end()
#define vivek_ghosh ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX 1000055
#define mod 1000000007
#define ff first
#define ss second
const int INF=0x3f3f3f3f;

ll power(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return power((x*x)%M,n/2,M);
    else
        return (x*power((x*x)%M,(n-1)/2,M))%M;
}

ll modinv(ll a,ll m)
{
    ll g =__gcd(a, m);
    ll res=power(a, m-2, m);
    return res;
}

vb prime(MAX,true);
vl prm;
void sieve()
{
	prime[0] = prime[1] = false;
	for(ll p=2;p*p<MAX;p++)
	{
		if(prime[p])
		{
			for(ll i=p*p;i<MAX;i+=p)
				prime[i] = false;
		}
	}
	for(ll p=2;p<MAX;p++)
	{
		if(prime[p])
			prm.pb(p);
	}
}

ll n,m,t,i,j,k,q,x,y,ans=0,cnt=0,sum=0,mx=-1,mn=INT_MAX;
string s;


int main()
{
	vivek_ghosh;
	
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	
	ll lcm = (c*d)/(__gcd(c,d));
	
	ans = (b/c) - ((a-1)/c) + (b/d) - ((a-1)/d) - (b/lcm) + ((a-1)/lcm);
	
	n = (b-a+1);
	ans = n - ans;
	cout<<ans<<endl;
	
	return 0;
}




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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> as(n);
    for(int i=0; i<n; i++) cin >> as.at(i);

    vector<int> bs;
    for(int i=n-1; i>=0; i-=2) bs.push_back(as.at(i));

    if(n%2) for(int i=1; i<n; i+=2) bs.push_back(as.at(i));
    else for(int i=0; i<n; i+=2) bs.push_back(as.at(i));

    for(int i=0; i<n; i++)
    {
        if(i!=n-1) cout << bs.at(i) << ' ';
        else cout << bs.at(i) << '\n';
    }

    return 0;
}


Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll = long long;
using P = pair<int,int>;
int main(void) {
    int a, b, c; cin >> a >> b >> c;
    string ans;
    if(b-a == c-b) ans = "YES";
    else ans = "NO";
    cout << ans;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include<iomanip>

using namespace std;
int main (){
    int n;
    cin >>n;
    int kai1 =1;
    int kai2=kai1;
    double x[20],y[20];
    double ave;
    double sum=0;

    for (int i=0;i<n;i++){
        cin >> x[i] >> y[i];
        if(i!=0){
            kai1*=i;
        }
    }
    kai2=kai1/(n-1);
    kai1*=n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            double k=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
            k=k*kai2*(n-1);
            sum+=k;
        }
    }
    cout<<fixed<<setprecision(10);
    ave=sum/kai1;
    cout << ave <<endl;
    

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int SZ = 105;
char str[3][SZ];
int main(void){
	int n; scanf("%d",&n);
	for(int i=0;i<3;i++) scanf("%s",str[i]);
	int ans = 0;
	for(int i=0;i<n;i++){
		if(str[0][i]==str[1][i] && str[1][i]==str[2][i]) continue;
		else if((str[0][i]==str[1][i]) || (str[0][i]==str[2][i]) || str[1][i]==str[2][i]) ans++;
		else ans+=2;
	}
	printf("%d",ans);
	return 0;
}

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

ll gcd(ll a,ll b);
ll lcm(ll a,ll b)
{
    return a / gcd(a,b) * b;
}
ll gcd(ll a,ll b)
{
    if (b==0) return a;
    else
        return gcd(b, a % b);
}
ll res,x;
int main()
{
    int n;
    scanf("%d",&n);

    scanf("%lld",&res);
    for (int i=2;i<=n;i++)
    {
        scanf("%lld",&x);
        res= lcm(res,x);
    }
    printf("%lld\n",res);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
	int N;
	stack<int> st;
	while( cin >> N )
	{
		if( N == 0 ){
			cout << st.top() << endl;
			st.pop();
			continue;
		}
		st.emplace( N );
	}
	return 0;
}

Measured memory_bytes: 3172
#include <iostream>
#include <iomanip>
#include <cmath>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/container/static_vector.hpp>
#include <boost/utility/string_ref.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>

template <class... Args>
struct tuple_input_impl;
template <std::size_t i, std::size_t... tail>
struct tuple_input_impl<std::index_sequence<i, tail...>>
{
    template <class... Args>
    static void f(std::tuple<Args...>& x)
    {
        std::cin >> std::get<i>(x);
        tuple_input_impl<std::index_sequence<tail...>>::f(x);
    }
};
template <>
struct tuple_input_impl<std::index_sequence<>>
{
    static void f(...) {}
};

template <class... Args>
std::istream& operator>>(std::istream& in, std::tuple<Args...>& x)
{
    tuple_input_impl<std::index_sequence_for<Args...>>::f(x);
    return in;
}
template <class T1, class T2>
std::istream& operator>>(std::istream& in, std::pair<T1, T2>& x) { return in >> x.first >> x.second; }

template <class T>
T read()
{
    T res;
    std::cin >> res;
    return res;
}
template <class T>
std::vector<T> read(std::size_t n)
{
    std::vector<T> res(n);
    for (std::size_t i = 0; i < n; ++i) std::cin >> res[i];
    return res;
}

template <class T>
void out_impl(T&& v) { std::cout << std::forward<T>(v); }
template <class T, class... Args>
void out_impl(T&& v, Args&&... args)
{
    std::cout << std::forward<T>(v) << ' ';
    out_impl(std::forward<Args>(args)...);
}
template <class... Args>
void out(Args&&... args)
{
    out_impl(std::forward<Args>(args)...);
    std::cout << '\n';
}
template <class... Args>
void out_noreturn(Args&&... args) { out_impl(std::forward<Args>(args)...); }

template <class T>
void print(const T& container)
{
    bool first = true;
    for (auto&& x : container) {
        if (!first) std::cout << ' ';
        std::cout << x;
        first = false;
    }
    std::cout << '\n';
}

void prog()
{
    auto n = read<int>();
    long double res = 0;
    for (auto i : boost::irange(0, n)) {
        long double x;
        std::string u;
        std::cin >> x >> u;
        if (u == "BTC") {
            x *= 380000;
        }
        res += x;
    }
    out(res);
}

int main()
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    prog();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#define endl  "\n"
#define ll long long
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cin.exceptions(cin.failbit);cout.tie(NULL);
using namespace std;
bool isPrime(int n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i += 6)
    {
        if ((n % i == 0) || (n % (i + 2) == 0))
            return false;
    }
    return true;
}
int32_t main()
{
	int n;
	cin >> n;
	int a[n],b[n],c[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i] >> b[i] >> c[i];
	}
	int dp[n][3];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<3;j++)
		dp[i][j]=0;
	}
	dp[0][0]=a[0];
	dp[0][1]=b[0];
	dp[0][2]=c[0];
	for(int i=1;i<n;i++)
	{
		dp[i][0]=max(a[i]+dp[i-1][1],a[i]+dp[i-1][2]);
		dp[i][1]=max(b[i]+dp[i-1][0],b[i]+dp[i-1][2]);
		dp[i][2]=max(c[i]+dp[i-1][0],c[i]+dp[i-1][1]);
	}
	cout << max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
	
}


Measured memory_bytes: 4992
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include<list>
#include<map>
#include<utility>
#include<tuple>
#include<numeric>
#include<set>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(a) (a).begin(),a.end()
using namespace std;

int main()
{
	int n, m;
	cin >> n;
	vector<string> a;
	vector<string> b;
	rep(i, n) {
		string x;
		cin >> x;
		a.push_back(x);
	}
	cin >> m;
	rep(i, m) {
		string y;
		cin >> y;
		b.push_back(y);
	}
	int max = 0;
	int cnt;
	rep(i, n) {
		cnt = 0;
		rep(j, n) {
			if (a[i] == a[j])cnt++;
		}
		rep(j, m) {
			if (a[i] == b[j])cnt--;
		}
		if (cnt > max)max = cnt;
	}
	cout << max << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int long long
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n,m,x; cin >> n >> m >> x;
    int a,sum1 = 0,sum2 = 0;
    rep(i,m){
        cin >> a;
        if(a < x) sum1++;
        else sum2++;
    }
    OUT(min(sum1,sum2));

    return 0;
}

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

const int MAXN = (1<<20);

int n, k;
int p[MAXN];
bool taken[MAXN];
vector<int> ans;

int main(){
	scanf("%d %d", &n, &k);
	if(k >= (1<<n)){
		// Impossible
		printf("-1\n");
		return 0;
	}
	// TODO: Speclai case kl n < 2

	if(n == 0){
		printf("0 0\n");
		return 0;
	}
	if(n == 1){
		if(k == 0)
			printf("0 0 1 1\n");
		else{
			printf("-1\n");
		}
		return 0;
	}
	if(k == 0){
		for(int i = 0; i < (1<<n); ++i){
			if(i)
				printf(" ");
			printf("%d %d", i, i);
		}
		printf("\n");
		return 0;
	}

	for(int i = 0; i < (1<<n); ++i){
		// CAri pasangan
		p[i] = i^k;
	}
	int i = 0, j = 1, rem = (1<<n);
	while(rem > 0){
		// Cari i yg kosong
		while(taken[i]){
			i++;
		}
		j = max(j, i+1);
		while(taken[j] || p[i] == j){
			j++;
		}
		taken[j] = taken[p[j]] = taken[i] = taken[p[i]] = true;
		ans.push_back(i);
		ans.push_back(p[i]);
		ans.push_back(j);
		ans.push_back(p[j]);
		ans.push_back(p[i]);
		ans.push_back(i);
		ans.push_back(p[j]);
		ans.push_back(j);
		rem -= 4;
	}
	for(int i = 0; i < ans.size(); ++i){
		if(i)
			printf(" ");
		printf("%d", ans[i]);
	}
}

Measured memory_bytes: 3572
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N,A,B,cnt,ans;
    cnt = 0;
    ans = 0;
    cin >> N >> A >> B;
    
    for (int i = 1; i <= N; i++){
        ans = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
        if (A <= ans && ans <= B){
            //cout << " iii" << endl;
            cnt = cnt + i;
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
#include <map>
#include <cstdlib>
#include <limits.h>

using namespace std;

int main() {
    
    int N,M;
    
    long long dist_min;
    int dist_min_index;
    
    vector< pair<long long,long long> > student;
    vector< pair<long long,long long> > check_point;
    
    vector<int> ans;
    
    cin >> N;
    cin >> M;
    
    
    for ( int i = 0; i < N; i++ ) {
        long long a, b;
        cin >> a;
        cin >> b;
        student.push_back( make_pair( a, b ) );
    }
    
    for ( int i = 0; i < M; i++ ) {
        long long c,d;
        cin >> c;
        cin >> d;
        check_point.push_back( make_pair( c, d ) );
    }
    
    for ( int i = 0; i < N; i++ ) {
        
        dist_min = LLONG_MAX;
        
        for ( int j = 0; j < M; j++ ) {
            long long dist;
            dist = abs( student[i].first - check_point[j].first ) + abs( student[i].second - check_point[j].second );
            
            if ( dist_min > dist ) {
                dist_min = dist;
                dist_min_index = j;
            }
        }
        
        ans.push_back( dist_min_index + 1 );
    }
    
    for ( int i = 0; i < ans.size(); i++ ) {
        cout << ans[i] << endl;
    }
    
    
    return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
      String C = sc.next();
      char c = C.charAt(0);
      int i = 0;
      char[] alpha = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',  'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
      while(true){
        if(alpha[i]==c){
          System.out.println(alpha[i+1]);
          break;
        }else{
          i++;
        }
      }
  }
}


Measured memory_bytes: 22740
#include"bits/stdc++.h"
using namespace std;
using ll = int64_t;

int main() {
    ll N;
    cin >> N;
    if (N == 1) {
        cout << "First" << endl;
        return 0;
    }
    vector<vector<ll>> edges(N);
    for (ll i = 0; i < N - 1; i++) {
        ll a, b;
        cin >> a >> b;
        a--; b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }

    struct Element {
        ll cost, node;
        bool operator<(const Element& rhs) const {
            return cost > rhs.cost;
        }
    };    
    
    vector<ll> cost1(N, INT_MAX);

    {
        priority_queue<Element> pq;

        cost1[0] = 0;
        pq.push({ 0, 0 });
        while (!pq.empty()) {
            auto t = pq.top();
            pq.pop();

            for (auto next : edges[t.node]) {
                if (t.cost + 1 < cost1[next]) {
                    cost1[next] = t.cost + 1;
                    pq.push({ t.cost + 1, next });
                }
            }
        }
    }

    ll max_cost = 0, max_index = -1;
    for (ll i = 0; i < N; i++) {
        if (cost1[i] > max_cost) {
            max_cost = cost1[i];
            max_index = i;
        }
    }

    vector<ll> cost2(N, INT_MAX);

    {
        priority_queue<Element> pq;

        cost2[max_index] = 0;
        pq.push({ 0, max_index });
        while (!pq.empty()) {
            auto t = pq.top();
            pq.pop();

            for (auto next : edges[t.node]) {
                if (t.cost + 1 < cost2[next]) {
                    cost2[next] = t.cost + 1;
                    pq.push({ t.cost + 1, next });
                }
            }
        }
    }

    ll diameter = *max_element(cost2.begin(), cost2.end());
    cout << (diameter % 3 == 1 ? "Second" : "First") << endl;
}

Measured memory_bytes: 23732
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#define ll long long
#define INF 1e+18
#define MOD 998244353
using namespace std;

int main(){
    int N;
    cin >> N;
    
    int num=1;
    int ans=0;
    int temp;
    cin >> temp;
    
    for(int i=1; i<N; i++){
        int a;
        cin >> a;
        
        if(a==temp){
            num++;
        }else{
            ans+=num/2;
            num=1;
            temp=a;
        }
    }
    ans+=num/2;
    cout<<ans<<endl;
    return 0;
}


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

using namespace std;

int main() {
  string S;
  int point, len;
  
  cin >> S;
  
  len = S.length();
  point = 0;
  
  for(int i = 0; i < len; i++){
    if(S[i] != S[len -1 - i]){
      point++;
    }
  }
  cout << point/2 << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

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

typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef map<int, string> mis;
typedef pair<int, ii> edge;


#define sc(x)  scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(v) (int)v.size()
#define rsz(v) v.resize
#define clr(v) v.clear()
#define rev(v) reverse(all(v))
#define lop(i,end) for(int i=0; i<end; i++)
#define rlop(i,start) for(int i=start-1; i>=0; i--)
#define loop(i,start,end) for(int i=start; i<end; i++)
#define rloop(i,start,end) for(int i=start-1; i>=end; i--)
#define PB push_back
#define pb pop_back
#define mP make_pair
#define f first
#define s second

const ll OO = (4e18) + 9;
const int MOD = (1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);

//enum dir { r, d, l, u };
int dx[] = { 0, 1, 0,-1 };
int dy[] = { 1, 0,-1, 0 };

//enum diR { d, r, u, l , dr, ur, dl, ul };
int dX[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dY[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiou"; //and sometimes "aeiouy"

int dcmp(ld d1, ld d2) { return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1; } //Compare Double Numbers
ll gcd(ll x, ll y) { return !y ? x : gcd(y, x%y); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
//convert index from 2D matrix to 1D array. (Zero-indexed)
int ord(int r, int c, int nCol) { return (nCol*r) + c + 1; }
//convert index from 1D array to 2D matrix . (One-indexed)
ii rord(int n, int nCol) {
	int r = n%nCol, c = n / nCol;
	if (n%nCol == 0) c--, r = nCol;
	return ii(r, c);
}

ll poww(ll num, ll p, ll md = MOD) {
	num %= md;
	ll ret = 1;
	while (p > 0) {
		if (p & 1) ret = (ret * num) % md;
		num = (num * num) % md;
		p >>= 1;
	}
	return ret;
}

ll nCr(ll n, ll r) {
	if (n < r)
		return 0;
	if (r == 0)
		return 1;
	return n * nCr(n - 1, r - 1) / r;
}

const int N = 22;
int dp[N][1 << N], n;
int can[N][N];
int solve(int idx, int msk) {
	if (idx == n) return msk == (1 << n) - 1;
	int& ret = dp[idx][msk];
	if (~ret) return ret;
	ret = 0;
	lop(i, n) {
		if (!can[idx][i] || (1<<i & msk)) continue;
		ret = (ret + solve(idx + 1, msk | (1 << i)) % MOD) % MOD;
	}
	return ret;
}

int main()
{
#ifndef ONLINE_JUDGE

#else
	//freopen("pyramid.in", "r", stdin);
#endif
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	lop(i, n) lop(j, n) cin >> can[i][j];
	mem(dp, -1);
	cout << solve(0, 0) << endl;


	return 0;
}


Measured memory_bytes: 360704
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 100005;
int par[MAX_N],weight[MAX_N],size[MAX_N];

void init()
{
	rep(i,MAX_N)
	{
		par[i] = i;
		weight[i] = 0;
		size[i] = 1;
	}
}

int root(int x)
{
	if (par[x] == x) return x;
	int r = root(par[x]);
	weight[x] += weight[par[x]];
	return par[x] = r;
}

int getweight(int x)
{
	root(x);
	return weight[x];
}

int diff(int x, int y)
{
	return getweight(y) - getweight(x);
}

void merge(int x, int y, int w)
{
	w += getweight(x);
	w -= getweight(y);
	x = root(x);
	y = root(y);
	if (x == y) return;
	if (size[x] < size[y]) 
	{
		swap(x,y);
		w *= -1;
	}
	if (size[x] == size[y]) size[x]++;
	par[y] = x;
	weight[y] = w;
}

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

int main()
{
	init();
	int N,M;
	cin >> N >> M;
	rep(i,M)
	{
		int L,R,D;
		cin >> L >> R >> D;
		if (same(L,R) && diff(L,R) != D)
		{
			cout << "No" << endl;
			return 0;
		}
		else
		{
			merge(L,R,D);
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
int N,a[300000];
long long l[100001],r[100001],s;
main(){
	scanf("%d",&N);
	for(int i=0;i<3*N;++i)scanf("%d",a+i);
	{
		std::priority_queue<long long>p;
		s=0;
		for(int i=0;i<N;++i){
			p.push(-a[i]);
			s+=a[i];
		}
		l[0]=s;
		for(int i=N;i<2*N;++i){
			p.push(-a[i]);
			s+=a[i];
			l[i+1-N]=s-=-p.top();
			p.pop();
		}
	}
	{
		std::priority_queue<long long>p;
		s=0;
		for(int i=3*N-1;i>=2*N;--i){
			p.push(a[i]);
			s+=a[i];
		}
		r[N]=s;
		for(int i=2*N-1;i>=N;--i){
			p.push(a[i]);
			s+=a[i];
			r[i-N]=s-=p.top();
			p.pop();
		}
	}
	long long x=-1e15;
	for(int i=0;i<=N;++i){
		x=std::max(x,l[i]-r[i]);
	}
	printf("%lld\n",x);
}


Measured memory_bytes: 4840
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

int main(int argc, char *argv[])
{
	int i, input;
	int n, k;
	vector<int> hi;
	int res;
	cin >> n >> k;

    for (i = 0; i < n; i++) {
		cin >> input;
		hi.push_back(input);
	}
	
	sort(hi.begin(), hi.end());

	res = hi[k - 1] - hi[0];
	for (i = 1; i <= n - k; i++) {
	    if ((hi[i + k - 1] - hi[i]) < res) 
			res = hi[i + k - 1] - hi[i];
	}

	cout << res << endl;
	
	return 0;
}


Measured memory_bytes: 892
A, B, C = map(int, input().split())

first_rest = A%B
if first_rest == C:
    print("YES")
    
else:
    i = 2
    while(1):
        if (A*i)%B == C:
            print("YES")
            break
        else:
            if (A*i)%B == first_rest:
                print("NO")
                break
            else:
                i += 1

Measured memory_bytes: 2940
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
string s1,s2;
int s=0;
int main()
{
	cin>>s1>>s2;
	for(int i=0;i<3;i++)
	{
		if(s1[i]==s2[i])
		s++;
	}
	cout<<s;
}


Measured memory_bytes: 256