akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alp = "abcdefghijklmnopqrstuvwxyz";
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
void neg() {cout << -1 << endl;}

int main() {
  int n;
  cin >> n;
  vector<vector<int>> topback(10, vector<int>(10, 0));
  for (int i = 1; i <= n; i++) {
    int a = to_string(i).front() - '0', b = to_string(i).back() - '0';
    topback.at(a).at(b)++;
  }
  ll cnt = 0;
  for (int i = 1; i < 10; i++) {
    for (int j = 1; j < 10; j++) {
      cnt += topback.at(i).at(j) * topback.at(j).at(i);
    }
  }
  cout << cnt << endl;
}

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

using namespace std;

int main(){
  int n, m;
  std::cin >> n >> m;

  vector<int> k(n);
  vector<vector<int> > a(n, vector<int>(0));
  for(int i=0; i<n; i++){
    std::cin >> k[i];
    vector<int> a_temp;
    for(int j=0; j<k[i]; j++){
      int temp;
      std::cin >> temp;
      a_temp.push_back(temp-1);
    }
    a[i] = a_temp;
  }

  vector<int> ansbox(m,0);
  for(int i=0; i<n; i++){
    for(int j=0; j<k[i]; j++){
      ansbox[a[i][j]] += 1;
    }
  }
  int ans = 0;
  for(int i=0; i<ansbox.size(); i++){
    if(ansbox[i] == n){
      ans += 1;
    }
  }
  std::cout << ans << '\n';
  return 0;
}


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

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int board[25][25];
int w,h;
int step;
void dfs(int x,int y,int k){
  if(k >=11){
    return;
  }
  for(int i = 0;i <4;i++){
    bool flag = true;
    int nx = x;
    int ny = y;
    if(board[ny+dy[i]][nx+dx[i]] ==1){
      continue;
    }
    while(1){
      if(nx<1||ny<1 ||nx>w||ny>h){
	flag =false;
	break;
      }
      if(board[ny][nx] ==3){
	step =min(step,k+1);
	return;
      }
      if(board[ny][nx] ==1){
	break;
      }
      nx +=dx[i];
      ny +=dy[i];
    }
    if(flag){
      board[ny][nx] = 0;
      dfs(nx-dx[i],ny-dy[i],k+1);
      board[ny][nx] = 1;
    }
  }
}
  
  
   


int main()
{
  while(cin>>w>>h,w||h){
    step =11;
    for(int i = 1;i <=h;i++){
      for(int j = 1;j <=w;j++){
	cin >>board[i][j];
      }
    }
    for(int i = 1;i <=h;i++){
      for(int j = 1;j <=w;j++){
	if(board[i][j] ==2){
	  int sx = j;
	  int sy = i;
	  dfs(sx,sy,0);
	}
      }
    }
    if(step >=11){
      step = -1;
    }
    cout <<step<<endl;

  }
  return 0;
}

Measured memory_bytes: 1156
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int A[200010];
int cnt[200010];
int main()
{
	int N;
	ll K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) cin >> A[i];
	vector<int> loop;
	int p;
	cnt[1]++;
	loop.push_back(1);
	int j = 0;
	while (true) {
		loop.push_back(A[j]);
		if (cnt[A[j]] == 1) {
			p = A[j];
			break;
		}
		j = A[j] - 1;
		cnt[j + 1]++;
		//cout << j << endl;
	}
	int c = 0, m = 0;
	bool find = false;
	vector<int> ans;
	for (int i = 0; i < loop.size(); i++) {
		if (i == K) {
			cout << loop[i] << endl;
			return 0;
		}
		if (loop[i] == p) {
			if (find) {
				break;
			}
			else {
				find = true;
			}
		}
		if (find) {
			ans.push_back(loop[i]);
			c++;
		}
		else m++;
	}
	K -= m;
	K = K % c;
	//cout << c << " " << K << endl;
	cout << ans[K] << endl;
}

Measured memory_bytes: 6700
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;

int main ()
{
  int N;
  cin >> N;
  long a[10001];
  int res = 0;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    int c = 0;
    while(tmp % 2 == 0) {
      tmp = tmp / 2;
      c++;
    }
    res += c;
  }
  printf("%d\n", res);
}


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

#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define INF ((1LL<<62)-(1LL<<31))


ll n;
int main(){
	scanf("%lld",&n);
	ll f=0;
	rep(i,0,n){
		char s[99];
		scanf("%s",s);
		if(s[0]=='Y')f=1;
	}
	puts(f?"Four":"Three");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(long long i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t) while(t--)
#define c(n); cin>>n;
#define p(n) cout<<n;
#define pl(n) cout<<n<<endl;
#define ps(n); cout<<n<<" ";
#define F first
#define S second
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define ull unsigned long long
#define vll vector<ll>
#define vii vector<ii>
#define mkp make_pair
#define ld long double
#define arrin(a,n) f(i,0,n){cin>>a[i];}
#define arrout(a,n) f(i,0,n){cout<<a[i]<<" ";}
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define PI (2*acos(0))
const long long N = 1e6+5;
vll visit,dist,taken;
vector<vll> adj;
vector<vii> adj2;
priority_queue<ii,vector<ii>, greater<ii> > pq;
ll bit[N]={0};
ll siz;
ll res = 0;
ll lcm(ll a,ll b){return (a * b) / __gcd(a,b);}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll power(ll a,ll b){if(b == 0)return 1;if(b == 1)return a;ll ans = power(a,b/2) % MOD;ans *= ans;ans %= MOD;if(b % 2 == 1)ans *= a;return ans%MOD;}
ll inverse(ll x){x%=MOD;return power(x,MOD-2);}
void BITup(ll k, ll x){while(k <= siz){bit[k]+=x;k += k & -k;}}
ll BITq(ll k){ll s=0;while(k>=1){s+=bit[k];k -= k &-k;}return s;}
struct node{ll lazy,val;}seg[4000000];
struct point{ll x,y;};
void dfs(ll v){visit[v] = 1;for(auto x:adj2[v]){if(!visit[x.F])dfs(x.F);}}
void bfs(ll s){visit[s] = 1;queue<ll>q;q.push(s);while(!q.empty()){ll u = q.front();q.pop();for(auto x:adj[u]){if(!visit[x])q.push(x);}}}
void dijkstra(ll s){pq.push(ii(0,s));dist[s] = 0;while(!pq.empty()){ii f = pq.top();pq.pop();ll w = f.F;ll u = f.S;if(w > dist[u]){continue;}for(auto v:adj2[u]){if(dist[u] + v.S < dist[v.F]){dist[v.F] = dist[u] + v.S;pq.push(ii(dist[v.F],v.F));}}}}
void prim(ll edge) {taken[edge] = 1;for(auto v:adj2[edge]) {if (taken[v.first]==0)pq.push(ii(v.second, v.first));}}
ll mst(ll s){taken.assign(N, 0);prim(s);ll cost = 0;while(!pq.empty()){ii front = pq.top();pq.pop();ll w = front.first;ll u = front.second;if(taken[u]==0)cost += w;prim(u);}return cost;}
void YESNO(ll a){if(!!a){pl("YES");}else{pl("NO");}}
void filesin(void){freopen("input.txt","r",stdin);}
void filesout(void){freopen("output.txt","w",stdout);}
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///AtCoder Beginner Contest 159
int main(void){
    fastio;
    ll n,m;
    c(n);
    c(m);
    ll ans = n * (n-1) / 2;
    ans += m * (m-1) / 2;
    pl(ans);
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<bitset>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int H,N,A[100001],sum=0;
	scan(H>>N);
	rep(i,N){
		scan(A[i]);
		sum+=A[i];
	}
	if(sum>=H) prin("Yes");
	else prin("No");
	return 0;
}


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

string to_string(string s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifndef ONLINE_JUDGE
#define show(...) cerr << "[" << #__VA_ARGS__ << "] :", debug_out(__VA_ARGS__)
#else
#define show(...) 42
#endif


#define f first
#define s second
#define endl "\n"
#define pb push_back
#define  oo 0x3f3f3f3f
#define limit 1000000007
#define int long long int
#define mod(x,m) ((x%m+m)%m)
#define ll long long
#define all(v) v.begin(),v.end()
#define max3(x,y,z) max(x,max(y,z))
#define min3(x,y,z) min(x,min(y,z))
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repb(i,a,b) for(int i=(a);i>=(b);i--)
#define fastio std::ios::sync_with_stdio(false)
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define input_from_file  freopen("input.txt", "r", stdin);

vector<vector<int>> tt;
int dp[100005][2];

void dfs(int root,int par){
  dp[root][0] = 1;
  dp[root][1] = 1;
  for(auto i : tt[root])
   if(i != par){
     dfs(i,root);
     dp[root][0] = (dp[root][0]*dp[i][1])%limit;
     dp[root][1] = (dp[root][1]*(dp[i][0]+dp[i][1]))%limit;
   }
}

signed main(){
 //input_from_file;
 int n; cin>>n;
 tt.resize(n+1);
 memset(dp,0,sizeof dp);
 for(int i=1;i<n;i++){
   int x,y; cin>>x>>y;
   tt[x].push_back(y);
   tt[y].push_back(x);
 }
 dfs(1,0);
 cout<<(dp[1][0]+dp[1][1])%limit<<endl;
}


Measured memory_bytes: 14208
#include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
const ll MAX = 5e5;
const ll inf = 1e12 + 10;
ll a[MAX];vector<ll> table; ll n; 

void update(ll i,ll d){
	while(i<=MAX){
		table[i] += d;
		i += i&(-i);
	}
}

ll sum(ll i){
	ll res = 0;

	while(i > 0){
		res += table[i];
		i -= i&(-i);
	}

	return res;
}

bool chck(ll x){
	table.resize(MAX);
	ll s[MAX]={0};
	for(ll i=1;i<=n;i++){
		ll t = 1;
		if(x > a[i]) t = -1;
		s[i] += s[i-1] + t; 
	}

	ll res = 0;

	for(ll i=1;i<=n;i++){
		if(s[i] >= 0) res++;
		s[i] += 1e5 + 10;
	}

	for(ll i=1;i<=n;i++){
		res += sum(s[i]);
		update(s[i],1);
	}
    table.clear();
	ll tot = (n*(n+1))/4;
	if(res >= tot) return true;
	return false;

}

int main()
{
	cin>>n;
	ll l=inf,r=0;
	for(ll i=1;i<=n;i++) {cin>>a[i]; l=min(l,a[i]); r=max(r,a[i]);}
	ll ans	= r;

	while(l<=r){
		ll mid = (r+l)/2;

		if(chck(mid)){
			ans = mid;
			l = mid+1;
		}
		else r = mid-1;
	}	

	cout<<ans;
}

Measured memory_bytes: 8832
using System;
using CompLib.Util;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int x = sc.NextInt();
        int y = sc.NextInt();
        int z = sc.NextInt();
        Console.WriteLine($"{z} {x} {y}");
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

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

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

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

            return _line[_index++];
        }

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

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

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

Measured memory_bytes: 13268
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

typedef long double ld;
typedef long long ll;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1.0);

void precalc() {
}

const int maxn = (int) 2e5 + 10;
int n;

int vs[2];

vector<vector<int> > es[2];

int read() {
  if (scanf("%d", &n) < 1) {
    return 0;
  }
  scanf("%d%d", vs, vs + 1);
  --vs[0], --vs[1];

  for (int it = 0; it < 2; ++it) {
    es[it] = vector<vector<int> >(n);
    for (int i = 0; i < n - 1; ++i) {
      int s, t;
      scanf("%d%d", &s, &t);
      --s, --t;
      es[it][s].pb(t), es[it][t].pb(s);
    }
  }
  return 1;
}

int pr[maxn];
int used[maxn];

int res;

vector<int> st;
int l;

void dfs(int v, int v1, int pass) {
  assert(v1 == st[l] && v == st.back());
  assert(v != v1);
  used[v] = 1;
  res = max(res, 2 * (sz(st) - l - 1 + pass));

  for (int nv : es[0][v]) {
    if (used[nv]) {
      continue;
    }
    int s = v, t = nv;
    int x = -1;
    bool ok = 0;
    if (pr[s] == pr[t]) {
      ok = 1;
      x = pr[s];
    }
    for (int it = 0; !ok && it < 2; ++it) {
      if (pr[s] == t) {
        ok = 1;
        x = -1;
      } else {
        if (pr[s] != -1 && pr[pr[s]] == t) {
          ok = 1;
          x = pr[s];
        }
      }
      swap(s, t);
    }

    if (!ok) {
      res = -1;
      break;
    }

    if (x == v1 || nv == v1) {
      continue;
    }
    int vs[3] = {v, x, nv};
    int k = 3;
    if (x == -1) {
      vs[1] = vs[2];
      --k;
    }
    int cnt = 0;
    while (cnt < k && vs[cnt] == st[sz(st) - cnt - 1]) {
      ++cnt;
    }
    assert(cnt);
    st.resize(sz(st) - cnt + 1);

    for (int i = cnt; i < k; ++i) {
      st.pb(vs[i]);
    }

    ++l;
    if (l + 1 < sz(st)) {
      dfs(st.back(), st[l], pass + 1);
      if (res == -1) {
        break;
      }
    }
    --l;

    st.resize(sz(st) - (k - cnt));
    for (int i = cnt - 2; i >= 0; --i) {
      st.pb(vs[i]);
    }
  }
}

bool dfs2(int v, int p, int need) {
  pr[v] = p;
  bool res = 0;
  if (need == v) {
    st.clear();
    res = 1;
  }
  for (int u : es[1][v]) {
    if (u == p) {
      continue;
    }
    if (dfs2(u, v, need)) {
      res = 1;
    }
  }

  if (res) {
    st.pb(v);
  }

  return res;
}

void solve() {
  for (int i = 0; i < n; ++i) {
    used[i] = 0;
  }

  assert(dfs2(vs[0], -1, vs[1]));

  res = 0;
  dfs(vs[0], vs[1], 0);
  printf("%d\n", res);
}

int main() {
  precalc();
#ifdef LOCAL
  freopen(TASK ".out", "w", stdout);
  assert(freopen(TASK ".in", "r", stdin));
#endif

  while (1) {
    if (!read()) {
      break;
    }
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 39032
#include <stdio.h>

int main()
{
  int n;
  int ret;
  int ans;

  ret = scanf("%d", &n);
  if (!ret)
    return 0;

  ans = 1000 - n % 1000;
  if (ans == 1000)
    ans = 0;

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

Measured memory_bytes: 1724
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
#include<bitset>
using namespace std;

int main() {

	long long N;
	cin >> N;
	N--;

	string alp = "abcdefghijklmnopqrstuvwxyz";

	long long ival = 0;
	long long dval = 26;
	long long fval = 25;
	while (N > fval) {
		dval *= 26;
		fval += dval;
		ival += 1;
	}

	string ans = "";

	long long ind;
	N -= fval / 26;
	for (long long i = ival; i >= 0; i--) {
		ind = N / pow(26, i);
		N -= ind * pow(26, i); 
		ans += alp.substr(ind, 1);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4108
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    private const long INF = 1000000007;
    public static void Main()
    {
        int n = IntRead();
        HashSet<string> hs = new HashSet<string>();
        string s = Console.ReadLine();
        hs.Add(s);
        char c = s[s.Length - 1];
        for (int i = 1; i < n; i++)
        {
            s = Console.ReadLine();
            if (hs.Contains(s) || s[0] != c) {
                Console.WriteLine("No");
                return;
            }
            hs.Add(s);
            c = s[s.Length - 1];
        }
        Console.WriteLine("Yes");
    }
}

public class Atcoder
{
    public static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static long LCM(long a, long b)
    {
        long c = a * b;
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static string ToConvertBit(int N, int e)
    {
        string ret = "";
        int r = 0;
        while (N != 0)
        {
            r = N % e;
            ret += r.ToString();
            N -= r;
            N /= e;
        }
        ret = StrReverce(ret);
        return ret;
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static long LongRead()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] LongLine()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }
    public static int[] IntLine()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
}


Measured memory_bytes: 13396
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;

void swap(int a,int b) {
	int tmp = a;
	a = b;
	b = tmp;
}

int main(void) {
	ll w,h;
	cin >> h>>w;

	if (h==1 ||w==1) {
		cout << 1;
		return 0;
	}
	
	cout << (w*h+1)/2 << endl;
	

	return 0;
}

Measured memory_bytes: 3608
import std.algorithm;
import std.container;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.traits;


class UnionFind {
private:
  uint[] rank;
  uint[] par;
  uint size;

public:
  this(uint size) {
    rank = repeat(0u).take(size).array;
    par = iota(size).array;
    this.size = size;
  }

  uint length() {
    return size;
  }

  uint getRoot(uint n) {
    return par[n] = (par[n] == n ? n : getRoot(par[n]));
  }

  bool unite(uint n1, uint n2) {
    n1 = getRoot(n1);
    n2 = getRoot(n2);
    if (n1 == n2) return false;
    
    bool t = rank[n1] < rank[n2];
    par[t ? n1 : n2] = t ? n2 : n1;
    if (rank[n1] == rank[n2]) rank[n1]++;
    return true;
  }

  bool haveSameRoot(uint n1, uint n2) {
    return getRoot(n1) == getRoot(n2);
  }

  uint countRoots() {
    uint roots = 0;
    par.each!((i, v){ if (getRoot(v) == i) roots++; });
    return roots;
  }
}

unittest {
  auto uf = new UnionFind!5;
  uf.unite(0, 1);
  uf.unite(0, 2);
  uf.unite(3, 4);
  assert(uf.length == 5);
  assert(uf.haveSameRoot(1, 2));
  assert(uf.haveSameRoot(4, 3));
  assert(!uf.haveSameRoot(1, 4));
  assert(uf.countRoots == 2);
}


void main() {
  auto nm = readln.chomp.split.to!(uint[]);
  auto n = nm[0];
  auto m = nm[1];

  auto uf = new UnionFind(n);
  iota(m).each!((_){
    auto xyz = readln.chomp.split.to!(uint[]);
    uf.unite(xyz[0] - 1, xyz[1] - 1);
  });

  uf.countRoots.writeln;
}



Measured memory_bytes: 4092
// Author : Sarthak Kapoor
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define rep(i,n) for(int i=0;i<n;++i)
#define repa(i,a,n) for(int i=a;i<n;++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define repba(i,b,a) for(int i=b;i>=a;--i)
#define repab(i,a,b) for(int i=a;i<b;++i)
#define ll long long
#define pi pair<int,int> 
#define pii pair<pi,int>
#define ull unsigned long long
#define vi vector<int>
#define viip vector<pair<int,pair<int,int> > > 
#define mp make_pair
#define vip vector<pair<int,int> >
#define pb push_back 
#define fi first
#define sec second
#define all(v) v.begin(),v.end()
#define s(v) v.size()
ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());//use rng()%n for numbers in range [0,n-1]
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll fastexp(ll x,ll a){
    ll res = 1;
    while(a>0){
        if(a&1){
            res = (res*x)%mod;
        }
        a=a>>1;
        x=(x*x)%mod;
    }
    return res;
}
ll inverse(ll n){
    return fastexp(n,mod-2);
}
template <typename T>
void add(T &a, T b){
	a += b;
	if(a >= mod)a -= mod;
}
template <typename T>
void sub(T &a, T b){
	a -= b;
	if(a < 0)a += mod;
}
template <typename T>
void mul(T &a, T b){
	a *= b;
	if(a >= mod)a %= mod;
}
const int N = 12;
const int maxn = 1e3 + 2;
ll dp[(1<<N)][maxn];
int a[maxn];
ll val[maxn];
int b[maxn];
const ll inf = 1e15;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,m;
	cin>>n>>m;
	rep(i,(1<<n)){
		rep(j,m){
			dp[i][j] = inf;
		}
	}
	rep(j,m){
		dp[0][j] = 0;
	}
	rep(i,m){
		cin>>a[i]>>b[i];
		int mask = 0;
		rep(j,b[i]){
			int c;
			cin>>c;
			c--;
			mask += (1<<c);
		}
		val[i] = mask;
	}
	rep(i,m){
		rep(mask,(1<<n)){
			int sub = 0;
			rep(j,n){
				if(mask & (1<<j)){
					if(!(val[i] & (1<<j))){
						sub += (1<<j);
					}
				}
			}
			if(i)dp[mask][i] = min(dp[mask][i-1],dp[sub][i-1]+a[i]);
			else if(sub == 0){
				dp[mask][i] = min((ll)a[i],dp[mask][i]);
			}
		}
	}
	if(dp[(1<<n)-1][m-1] == inf){
		dp[(1<<n)-1][m-1] = -1;
	}
	cout<<dp[(1<<n)-1][m-1];
	return 0;
}

Measured memory_bytes: 35632
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        List<String> list = new ArrayList<>();

        boolean isDifferentChar = true;
        for (int i = 0; i < s.length(); i++) {
            String obj = new String(new char[]{s.charAt(i)});
            if (list.contains(obj)) {
                isDifferentChar = false;
                break;
            }

            list.add(obj);
        }

        System.out.println(isDifferentChar ? "yes" : "no");
    }
}


Measured memory_bytes: 21716
def solve():
  S = input()
  if S[0]=='R' and S[1]=='R' and S[2]=='R':
    return 3
  if S.count('R')==2:
    if S[1]!='R':
      return 1
    return 2
  if S.count('R')==1:
    return 1
  return 0
print(solve())

Measured memory_bytes: 9004
n = int(input())
h_list = list(map(int, input().split()))

counter = 0
length = 0

for i in range(len(h_list)):
    if i == len(h_list) - 1:
        if counter >= length:
            length = counter
    else:
        if h_list[i] >= h_list[i + 1]:
            counter += 1
        else:
            if counter >= length:
                length = counter
            counter = 0

print(length)

Measured memory_bytes: 15020
#pragma region head
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define test(s) \
  if (!(s))     \
    cout << "Line " << __LINE__ << ": [" << #s << "] is false" << endl;
#define int long long
typedef long long ll;
#define double long double
typedef double ld;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1.0);

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
#pragma endregion

signed main() {
  int L, R, d;
  cin >> L >> R >> d;

  int ans = R / d - (L - 1) / d;
  cout << ans << endl;
}

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

int a[100005];

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

    for (int i = 0; i < s.length() - 1; i++) {
        if (s[i] == 'R' && s[i + 1] == 'L') {
            int lb = i, rb = i + 1;
            while (lb - 1 >= 0 && s[lb - 1] == 'R')
                lb--;
            while (rb + 1 < s.length() && s[rb + 1] == 'L')
                rb++;
            int lc = i - lb + 1, rc = rb - (i + 1) + 1;
            int mx = (max(lc, rc) & (~1)) + 4;

            stack<int> sl, sr;
            for (int i = 0; i < lc; i++)
                sl.push(1);
            for (int i = 0; i < rc; i++)
                sr.push(1);

            for (int i = 0; i < mx; i++) {
                int a = sl.top();
                sl.pop();
                int b = sl.empty() ? 0 : sl.top();
                if (sl.size())
                    sl.pop();
                int c = sr.top();
                sr.pop();
                int d = sr.empty() ? 0 : sr.top();
                if (sr.size())
                    sr.pop();
                sl.push(b + c);
                sr.push(a + d);
            }

            a[i]     = sl.top();
            a[i + 1] = sr.top();
        }
    }
    for (int i = 0; i < s.length(); i++)
        cout << a[i] << " ";
    cout << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[200],b[200],c[200];
	int n;
	scanf("%d",&n);
	scanf("%s",a);
	if(n%2!=0)
	{
		printf("No\n");
	}
	else
	{
		for(int i=0;i<(n/2);i++)
		{
			b[i]=a[i];
		}
		int sum=0;
		for(int i=(n/2);i<n;i++)
		{
			c[sum]=a[i];
			sum++;
		}
		int tag=0;
		for(int i=0;i<(n/2);i++)
		{
			if(c[i]==b[i])
			{
				tag++;
			}
		}
		if(tag==(n/2))
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    while (true) {
      int m = sc.nextInt();
      if (m == 0) {
        break;
      }
      int min = sc.nextInt();
      int max = sc.nextInt();
      int[] p = new int[m];
      for (int i = 0; i < m; i++) {
        p[i] = sc.nextInt();
      }
      solve(m, min, max, p);
    }
  }
  public static void solve(int m, int min, int max, int[] p) {
    int diff = 0;
    int si = 0;
    for (int i = min - 1; i < max; i++) {
      int d = p[i] - p[i + 1];
      if (diff <= d) {
        si = i;
        diff = d;
      }
    }
    System.out.println(si + 1);
  }
}

Measured memory_bytes: 56144
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt();
		int N = sc.nextInt();
		if(N % 100 == 0) {
			N += 1;
		}
		int Num = N * (int)Math.pow(100, D);
		System.out.println(Num);
	}
}

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

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






int main()
{

	cin >> N;

	if(N/10 == 9 || N%10 == 9)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;





}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
#define ld long double
#define X first
#define Y second
#define pb push_back
#define max_el(x) max_element(x.begin(),x.end())-x.begin()
#define min_el(x) min_element(x.begin(),x.end())-x.begin()
#define mp make_pair
#define endl '\n'
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
// DONT USE MEMSET, USE VECTORS

void solve(){
	int n;
	string s;
	cin>>n;
	cin>>s;
	int ans = 0;
	int cur = 0;
	for(int i=0;i<n;i++){
		cur += (s[i] == 'I');
		cur -= (s[i] == 'D');
		ans = max(ans,cur);
	}
	cout<<ans<<endl;
}

int main(){
	fastread;
	int t = 1;
	// cin>>t;
	for(int i=1;i<=t;i++){
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

def main(n):
    mi=1000
    ma=0
    su=0
    for i in range(n):
        num = int(raw_input())
        su += num
        ma = max(ma, num)
        mi = min(mi, num)
    su -= ma + mi
    print su/(n-2)

while 1:
    n = int(raw_input())
    if n==0:
        break
    main(n)
    

Measured memory_bytes: 4220
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)


A, B, C, D = map(int, input().split())
s1 = B - (B // C + B // D - B // lcm(C, D))
s2 = A-1 - ((A-1) // C + (A-1) // D - (A-1) // lcm(C, D))
ans = s1 - s2
print(ans)

Measured memory_bytes: 5048
#include <bits/stdc++.h>
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrepi(i,a,b) for(int i=((int)(b)-1);i>=(a);--i)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) rrepi(i,0,n)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ZERO(x) memset(x,0,sizeof(x))
#define MINUS(x) memset(x,-1,sizeof(x))
#define UNIQUE(x) (x).erase(unique(ALL(x)), (x).end())
#define TOUPPER(x) transform(ALL(x), (x).begin(), ::toupper)
#define TOLOWER(x) transform(ALL(x), (x).begin(), ::tolower)
#define debug(var)  do{std::cout << #var << " : "; view(var);}while(0)
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){for(const auto& v : vv){ view(v); } }
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void viewarr(T arr[], int n) { for(int i = 0; i < n; ++i) std::cout << arr[i] << " "; std::cout << std::endl; }
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; }
ll qp(ll a,ll b){ll ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
ll qp(ll a,ll b,ll mo){ll ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const int INF = 1e9;
const ll INFL = 1e18;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5;

int main() {
    string s; cin >> s;
    cout << (s == "ABC" ? "ARC" : "ABC") << endl;
    return 0;
}


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

#define f first
#define s second
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define px pair<db, db>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define input(a) for (auto& el : a) cin >> el;
#define output(a) cout << '!'; for (auto& el : a) cout << el << ' '; cout << '\n'; cout.flush();
#define sz(el) int(el.size())
#define sq(a) ((a) * (a))
#define xll bitset<128>
#define xmin(a,b) a = min(a, b)
#define xmax(a,b) a = max(a, b)
#define sun(a) sort(all(a)); a.resize(unique(all(a)) - a.begin());
/**/  /// extra
//#define forn(i,n) for (int i = 0; i < n; ++i)
//#define rforn(i,n) for (int i = n - 1; i >= 0; --i)
#define bn '\n'
#define vi vector<int>
#define vii vector<vi>
#define vl vector<ll>
#define vll vector<vl>
//#define G vector<vector<pii>>
#define GVE vector<vector<edge>>
#define usi unordered_set<int>
#define usp set<pii>
/**/

using namespace std;

const int INF = 1'000'000'017;
const ll LLINF = 1'000'000'000'000'000'017LL;
const ld inf = 1.0 / 0.0;
const ld eps = 1e-9;
const int MOD = 998244353;

//mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

//uniform_int_distribution<int> uid(l, r); [l, r]
//int x = uid(rng);

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

    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < n; ++i) {
        cout << s[i] << t[i];
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

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

    char c;
    cin >> c;

    bool v(false);

    switch (c)
    {
        case 'a':
        {
            v = true;
            break;
        }
        case 'e':
        {
            v = true;
            break;
        }
        case 'i':
        {
            v = true;
            break;
        }
        case 'o':
        { 
            v = true;
            break;
        }
        case 'u':
        {
            v = true;
            break;
        }
        default:
            break;
    }

    if (v)
        cout << "vowel" << endl;
    else
        cout << "consonant" << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n,i,sum=0,ave,max=0,min=1000;
        int[] s;

        s=new int[100];

        while(true){
            n=scan.nextInt();
            if(n==0){
                break;
            }

            for(i=0;i<n;i++){
                s[i]=scan.nextInt();
                sum+=s[i];

                if(s[i]>max){
                    max=s[i];
                }
                if(s[i]<min){
                    min=s[i];
                }
            }

                ave=(sum-max-min)/(n-2);
                System.out.println(ave);

                max=0;
                min=1000;
                sum=0;
        }

    }
}


Measured memory_bytes: 28408
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt(), M = sc.nextInt();
        int[][] route = new int[M][2];
        for(int i=0;i<M;i++){
            route[i][0] = sc.nextInt()-1;   //最後に1を足せ
            route[i][1] = sc.nextInt()-1;
        }
        int[] ans = new int[N];
        for(int i=0;i<N;i++){
            ans[i] = -1;
        }
        ans[0] = 0;
        List<Integer>[] destination = new List[N];
        for(int i=0;i<N;i++){
            destination[i] = new ArrayList<>();
        }
        for(int i=0;i<M;i++){
            destination[route[i][0]].add(route[i][1]);
            destination[route[i][1]].add(route[i][0]);
        }
        Queue<Integer> queue = new ArrayDeque<>();
        queue.add(0);
        int count = 1;
        while(!queue.isEmpty() && count < N){
            int iter = queue.poll();
            for(int i : destination[iter]){
                if(ans[i] == -1) {
                    ans[i] = iter;
                    queue.add(i);
                    count++;
                }
            }
        }
 
        boolean flag = false;
        for(int i=0;i<N;i++){
            if(ans[i] == -1){
                flag = true;
                break;
            }
        }
        if(flag){
            System.out.println("No");
        }else{
            for(int i=0;i<N;i++) {
                System.out.println(i == 0 ? "Yes" : ans[i]+1);
            }
        }
    }
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;
typedef long double ld;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int k;
    cin >> k;
    queue<ll> q;
    rep (i, 9) q.push(i + 1);
    rep (i, k - 1) {
        ll x = q.front();
        q.pop();
        if (x % 10 != 0) q.push(x * 10 + x % 10 - 1);
        q.push(x * 10 + x % 10);
        if (x % 10 != 9) q.push(x * 10 + x % 10 + 1);
    }
    cout << q.front() << endl;
    
    return 0;
}



Measured memory_bytes: 1792
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iterator>

#define ios ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
#define S second
#define F first
#define pb push_back
#define nl '\n'
#define mp make_pair
#define NL cout << '\n';
#define EX exit(0)
#define all(s) s.begin(), s.end()
#define FOR(i, start, finish, k) for(int i = start; i <= finish; i += k)

const long long MXN = 1e5 + 100;
const long long MNN = 2e3 + 10;
const long long MOD = 998244353;
const long long INF = 1e18;
const long long OO = 1e9 + 500;

typedef long long llong;
typedef unsigned long long ullong;

using namespace std;

string s;
llong k = INF, cnt[MXN], ans;

int main(){
	ios;
	cin >> s;
	llong n = s.size();
	ans = n * (n + 1) / 2;
	for(int i = 0; i < s.size(); i++){
		cnt[s[i] - '0']++;
	}
	for(int i = 0; i < s.size(); i++){
		ans -= cnt[s[i] - '0'];
		cnt[s[i] - '0']--;
	}
	cout << ans + 1;
	return 0;
}


Measured memory_bytes: 720
s = input()

flag = False
for i in range(len(s) - 1):
    if s[i] == s[i + 1]:
        flag = True
        break

if flag:
    print(i + 1, i + 2)
else:
    for i in range(len(s) - 2):
        if s[i] == s[i + 2]:
            flag = True
            break
    if flag:
        print(i + 1, i + 3)
    else:
        print(-1, -1)

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

const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

int a, b;

int main(){
    cin >> a >> b;
    cout << (a+b)/2 + (a+b)%2 << endl;
}
































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

typedef long long ll;

int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; ++i) {
		cin >> v[i];
	}
	int cnt = 0;
	for (int i = 1; i + 1 < n; ++i) {
		if ((v[i] > v[i + 1] && v[i] < v[i - 1]) || (v[i] > v[i - 1] && v[i] < v[i + 1])) {
			cnt++;
		} 
	}
	cout << cnt;
}



















Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
 
const ll INF = 1e18;
const ll MOD = 1000000007;
const ll MX = 0; //最大値
 
ll dp[MX][MX];
inline void chmax(ll& a, ll b) {
  a = max(a, b);
}
 
#define rep(i,n) for(ll i=0; i<(ll)(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define PB push_back
 
 
int main(){
    ll x,n,tmp;
    cin >> x >> n;
    set<ll> p;
    rep(i,n) {
        cin >> tmp;
        p.insert(tmp);
    }

    bool com = true;
    ll ans;
    rep(i, 100){
        ans = x-i;
        if(p.find(ans) == p.end()) break;

        ans = x+i;
        if(p.find(ans) == p.end()) break;
    }
    
    cout << ans << endl;
}

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



int main(){
  int n;
  cin >> n;
  int a[n+1] = {};
  int b[n+1] = {};
  for(int i=1;i<=n;i++){
    cin >> a[i];
  }
  for(int i=n/2+1; i<=n; i++){
    b[i]=a[i];
    //cout << i << " " << endl;
  }
  for(int i=n/2; i > 0; i--){
    for(int j=1; i*j <= n; j++){
      //if(b[i*j]){cout << i*j << "->" << i << endl;}
      b[i] = (b[i] + b[i*j])%2;
    }
    b[i] = (b[i] + a[i])%2;
  }
  int count = 0;
  for(int i=1;i<=n;i++){
    if(b[i]){
      count++;
    }
  }
  cout << count << endl;
  for(int i=1;i<=n;i++){
    if(b[i]){
      cout << i << " ";
    }
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 2432
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

void solve()
{
	ll n;
	cin>>n;
	ll ans=0;
	for(ll i=1;i<=n;++i){
		for(ll j=i;j<=n;j+=i)ans+=j;
	}
	cout<<ans;
}

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


Measured memory_bytes: 3604
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define ALL(n) begin(n),end(n)
#define IN(a, x, b) (a<=x && x<b)
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
const long long MOD = 1000000007;

int main(void){
    ll x, a,b;
    cin >> x >> a >> b;
    ll abs_a = abs(x-a);
    ll abs_b = abs(x-b);

    if(abs_a > abs_b){
        cout << "B" << endl;
    }else{
        
        cout << "A" << endl;
    }
    return 0;
}

Measured memory_bytes: 3128