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

int main(){
  map<int,int> cnt;
  map<int,int> flg;
  char str[128];
  set<int> num1;
  set<int> num2;
  while(gets(str)){
    if(str[0] == '\0') break;
    int idx = 0;
    int tmp = 0;
    while(str[idx] != ','){
      tmp *= 10;
      tmp += str[idx] - '0';
      idx++;
    }
    num1.insert(tmp);
    cnt[tmp]++;
  }
  string s;
  while(cin >> s){
    int idx = 0;
    int tmp = 0;
    while(s[idx] != ','){
      tmp *= 10;
      tmp += s[idx] - '0';
      idx++;
    }
    num2.insert(tmp);
    cnt[tmp]++;
  }
  for(set<int>::iterator itr = num1.begin();itr != num1.end();++itr) flg[*itr]++;
  for(set<int>::iterator itr = num2.begin();itr != num2.end();++itr) {
    if(flg[*itr] == 1){
      cout << *itr << " " << cnt[*itr] << endl;
    }
  }
}

Measured memory_bytes: 1188
N = int(input())
B = [int(input()) for i in range(N)]
A = [0]
A.extend(B)
past = [1]
next_l = 1
#if not 2 in A:
#  print(-1)
#  exit(0)
for i in range(N):
  next_l = A[next_l]
  #if next_l in past or next_l > N:
  #  print(-1)
  #  exit(0)
  if next_l == 2:
    print(len(past))
    exit(0)
  past.append(next_l)
print(-1)


Measured memory_bytes: 8624
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

vector<pair<int, int> > mass;
//vector<ll> mass;

ll H, W, zero = 0, ans[10];
int N, A, B;

int main() {
	cin >> H >> W >> N;
	for (int i = 0; i < N; i++) {
		cin >> A >> B;
		for (int j = A - 1; j <= A + 1; j++) {
			for (int k = B - 1; k <= B + 1; k++) {
				pair<int, int> p(j, k);
				mass.push_back(p);
//				mass.push_back(j*H+k);
			}
		}
	}
	sort(mass.begin(), mass.end());
	for (int i = 0; i < mass.size(); i++) {
		if (mass[i].first > 1 && mass[i].first < H && mass[i].second > 1 && mass[i].second < W) {
//		if (mass[i]/H > 1 && mass[i]/H < H && mass[i]%H > 1 && mass[i]%H < W) {
			int j = 0;
			pair<int, int> p(mass[i]);
//			ll p = mass[i];

			zero++;
			while (true) {
				if (p == mass[i]) {
					j++;
					i++;
				} else {
					ans[j]++;
					i--;
					break;
				}
			}
		}
	}
	ans[0] = (H - 2) * (W - 2) - zero;
	for (int i = 0; i < 10; i++) {
		cout << ans[i] << endl;
	}
}

Measured memory_bytes: 8556
import math
X = int(input())
number = 2
while (1):
    flag = 1
    for i in range(2, int(math.sqrt(number))+1):
        # print(i)
        if number % i == 0:
            flag = 0
            break
    if flag == 1:
        if number >= X:
            print(number)
            break
    number += 1


Measured memory_bytes: 3060
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }



int a, b, c, d;

int main() {
    while (cin >> a >> b >> c >> d) {
        int to = a + b + c + d;
        int m = to/60;
        int s = to%60;
        
        cout << m << endl;
        cout << s << endl;
    }
    return 0;
}


Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

template <typename T>
class SegTree {
  int n;                       // 葉の数
  vector<T> data;              // データを格納するvector
  T def;                       // 初期値かつ単位元
  function<T(T, T)> operation; // 区間クエリで使う処理
  function<T(T, T)> update;    // 点更新で使う処理

  // 区間[a, b)の総和。ノードk=[l, r)に着目している。
  T _query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return def; // 交差しない
    if (a <= l && r <= b)
      return data[k]; // a,l,r,bの順で完全に含まれる
    else {
      T c1 = _query(a, b, 2 * k + 1, l, (l + r) / 2); // 左の子
      T c2 = _query(a, b, 2 * k + 2, (l + r) / 2, r); // 右の子
      return operation(c1, c2);
    }
  }

public:
  /**
   * コンストラクタ
   * @param _n 必要サイズ
   * @param _def 初期値かつ単位元
   * @param _operation クエリ関数
   * @param _update 更新関数
   */
  SegTree(size_t _n, T _def, function<T(T, T)> _operation, function<T(T, T)> _update)
  : def(_def), operation(_operation), update(_update) {
    n = 1;
    while (n < _n) {
      n *= 2;
    }
    data = vector<T>(2 * n - 1, def);
  }

  /**
   * [a, b)の区間クエリを実行
   * @param a 左端
   * @param b 右端
   * @return クエリの結果
   */
  T query(int a, int b) {
    return _query(a, b, 0, 0, n);
  }

  /**
   * 場所i(0-indexed)の値をxで更新
   * @param i
   * @param x
   */
  void change(int i, T x) {
    i += n - 1;
    data[i] = update(data[i], x);
    while (i > 0) {
      i = (i - 1) / 2;
      data[i] = operation(data[i * 2 + 1], data[i * 2 + 2]);
    }
  }

  T operator[](int i) {
    return data[i + n - 1];
  }
};


constexpr ll big = (1LL << 31) - 1;

signed main() {
  ll n, q;
  cin >> n >> q;
  SegTree<ll> segTree(n, big, [](auto const a, auto const b) { return min(a, b); }, [](auto const a, auto const b) { return b; });
  repr(i, q, 0) {
    ll c, x, y;
    cin >> c >> x >> y;
    if (c == 0) {
      segTree.change(x,y);
    } else {
      cout << segTree.query(x, y + 1) << endl;
    }
  }
}


Measured memory_bytes: 4932
#include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vector<ll> > vvl;
typedef vector<vector<P> > vvp;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int n;
  cin >> n;
  vector<ll>a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(),a.end());
  
  ll x=a[n-1];
  ll ab=INF;
  ll y ;
  rep(i,n-1){
    if((abs(a[i]-(x+1)/2)<ab)){
      y=a[i];
      ab=abs(a[i]-(x+1)/2);
    }
  }
  cout << x << " " << y  << endl;
  return 0;     
}


Measured memory_bytes: 1024
package main

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

var (
	N, M  int
	words = make(map[string]int)
)

func main() {
	readVariables()
	answer := 0
	for _, v := range words {
		answer = MaxInt(v, answer)
	}
	fmt.Println(answer)
}

func readVariables() {
	N = nextInt()
	for i := 0; i < N; i++ {
		words[nextStr()]++
	}
	M = nextInt()
	for i := 0; i < M; i++ {
		words[nextStr()]--
	}
}

/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}

func nextStr() string {
	if !scanner.Scan() {
		panic("No more token.")
	}
	return scanner.Text()
}

// MinInt returns minimum argument
func MinInt(x, y int) int {
	if x < y {
		return x
	} else {
		return y
	}
}

//MaxInt returns maximum argument
func MaxInt(x, y int) int {
	if x < y {
		return y
	} else {
		return x
	}
}

//AbsInt returns |x| for x
func AbsInt(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//ModPow calculates integer power with modulo operation
//if modulo <= 1, it powers w/o module operation
//if base < 0, return value might be negative too.
func ModPow(base, exponent, modulo int) (result int) {
	result = 1
	for exponent > 0 {
		if exponent%2 == 1 {
			result *= base
			if modulo > 1 {
				result %= modulo
			}
		}
		base *= base
		if modulo > 1 {
			base %= modulo
		}
		exponent /= 2
	}
	return
}

//Gcd
func Gcd(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = gcd(result, vals[i])
	}
	return
}

func gcd(x, y int) int {
	x, y = AbsInt(x), AbsInt(y)
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

//Lcm
func Lcm(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = lcm(result, vals[i])
	}
	return
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}


Measured memory_bytes: 640
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if(n == 25){
      System.out.println("Christmas");
    }else if(n == 24){
      System.out.println("Christmas Eve");
    }else if(n == 23){
      System.out.println("Christmas Eve Eve");
    }else if(n == 22){
      System.out.println("Christmas Eve Eve Eve");
    }
  }
}


Measured memory_bytes: 21204
use std::io::*;

fn read<T: std::str::FromStr>() -> T {
    let stdin = stdin();
    let mut buf = String::new();
	stdin.lock().read_line(&mut buf);
	buf.trim().parse().ok().unwrap()
}

fn main() {
    let s = read::<usize>();
    let ans = s%2 + s/10%2 + s/100;
    println!("{}",ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <string>
using namespace std;
int main(){
    string s;
    bool pd=false;
    cin>>s;
    for(int i=0;i<s.length();i++)
        if(s[i]=='C') pd=true;
        else if(s[i]=='F'&&pd) {cout<<"Yes"<<endl;return 0;}
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */

int main() {
  
  int n; cin >> n;
  vector<int> h(n);
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  vector<int> dp(n, 0);
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (h[i] <= h[i - 1]) {
      dp[i] = dp[i - 1] + 1;
    }
    ans = max(ans, dp[i]);
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
  int n,tmp;
  cin>>n;
  int elem[n];
  int cnt=0;
  //入力
  for(int i=0;i<n;i++){
    cin>>elem[i];
  }

  for(int i=0;i<n; ++i){
    int temp=i;
    for(int j=i;j<n;++j){
      if(elem[j]<elem[temp])temp=j;
    }
    if(i!=temp){
    cnt++;
    tmp=elem[i];
    elem[i]=elem[temp];
    elem[temp]=tmp;
    }
  }
  for(int i=0;i<n;i++){
    cout<<elem[i];
    if(i!=n-1)cout<<" ";
    else cout<<endl;
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <algorithm>
#include <stdio.h>
#include <math.h>
using namespace std;

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)

typedef long long ll;
typedef pair<int,int> P;
typedef pair<P,int> PP;

struct edge {
	int to,cost;
	edge(int t,int c):to(t),cost(c) {}
};

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

ll mypow(ll x,ll n,ll m) {	//xのn乗をmで割った余り
	if(n==0) return 1;
	if(n%2==0) return mypow(x*x%m,n/2,m);
	else return x*mypow(x,n-1,m)%m;
}

//-----------------------------------------------------------------------------

string s;

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

	cin>>s;
	if((!(s.size()&1))^(s[0]==s[s.size()-1])) cout<<"Second"<<endl;
	else cout<<"First"<<endl;

	return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b;
  cin>>a>>b;
  if(a<6)
    cout<<"0"<<endl;
 else if(a<13)
   	cout<<b/2<<endl;
 else
   	cout<<b<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#include<vector>
#define endl "\n"
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
using namespace std;

int main(){
	int a,b;
	cin>>a>>b;
	int arr[4]={};
	arr[0]=-1;
	arr[a]++;
	arr[b]++;
	int ans=0;
	for(int i=0;i<4;i++){
		if(arr[i]==0)
		{
			ans=i;
			break;
		}
	}
	cout<<ans;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
  string s;
  cin >> s;
  ll ans = 0;
  for (int bit = 0; bit < (1 << s.size()); bit++) {
    ll x = 0;
    for (int i = 0; i < s.size(); i++) {
      if (bit & (1 << i))
        x = x * 10 + (s[i] - '0');
      else {
        ans += x;
        x = 0;
      }
    }
    ans += x;
  }
  cout << ans << endl;
  return 0;
}

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

namespace ABC116A
{
    class Program
    {
        static void Main(string[] args)
        {
            int ab, bc, ca, n ;
            var word = Console.ReadLine().Split(' ');
            ab = int.Parse(word[0]);
            bc = int.Parse(word[1]);
            ca = int.Parse(word[2]);

            n = ab * bc / 2;

            Console.WriteLine(n);

            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}

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

    vector<ll> five;
    ll k;
    rep(i, 5){
        ll inp; cin >> inp;
        five.pb(inp);
    }
    cin >> k;

    sort(all(five));

    if(five[4] - five[0] > k) cout << ":(";
    else cout << "Yay!" << endl;



    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


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

using namespace std;

int main(){

    ios::sync_with_stdio(false);

    int N, D, X, aux;

    cin >> N >> D >> X;

    for(int i = 0; i < N; ++i){
        cin >> aux;
        X += (D - 1) / aux + 1;
    }

    cout << X;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
  using namespace std;
using namespace __gnu_pbds;
  #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define double long double
  #define all(v) v.begin(),v.end()
  #define rep(i,a,b) for(int i = a; i <=b; i++)
  #define rep2(i,a,b) for(int i = a; i>=b; i--)
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define db long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const double PI = acos(-1);
  const int N = 200005;
  int mod = 1e9 + 7;
     

    
int32_t main()
{



    

     int n;
     cin >> n;
     if(n%2 == 0)
     {  
      n/=2;
      int ans = 0;

      int j = 5;

      while((n/j) != 0)
      {
        ans += n/j;
        n/=j;
      }
      cout << ans;
     }
     else
     {
      cout << 0;
     }
   return 0;
}       

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

int main()
{
    int N;
    cin >> N;
    vector<tuple<string, int, int>> sp(N);
    for (int i = 0; i < N; i++)
    {
        int p;
        string s;
        cin >> s >> p;
        sp.at(i) = make_tuple(s, -p, i + 1);
    }
    sort(sp.begin(), sp.end());
    for (tuple<string, int, int> t : sp)
    {
        string s;
        int p, n;
        tie(s, p, n) = t;
        cout << n << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int64_t H, W; cin >> H >> W;
  if(H==1 || W==1){
    cout << 1 << endl;
    return 0;
  }
  cout << (H*W+1)/2 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
constexpr char targets[5]{ 'M' - 'A', 'A' - 'A', 'R' - 'A', 'C' - 'A', 'H' - 'A'};
int main() {
	int n;
	std::cin >> n;
	std::string name;
	int chars[26]{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
	for (auto i = 0; i < n; ++i) {
		std::cin >> name;
		++chars[name[0] - 'A'];
	}
	unsigned long long int res = 0;
	for (auto i = 0; i < 5; ++i) {
		for (auto j = i + 1; j < 5; ++j) {
			for (auto k = j + 1; k < 5; ++k) {
				res += chars[targets[i]] * chars[targets[j]] * chars[targets[k]];
			}
		}
	}
	std::cout << res << std::endl;
}

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

int main() {
    int n,m;
    cin>>n>>m;
    int a[100][100]={0},b[100]={0},c[100]={0};
    for(int i=0;i<n;i++) {
        for(int j=0;j<m;j++) {
            cin>>a[i][j];
        }
    }
    for(int i=0;i<m;i++) {
        cin>>b[i];
    }
    for(int i=0;i<n;i++) {
        for(int j=0;j<m;j++) {
            c[i]+=a[i][j]*b[j];
        }
    }
    for(int i=0;i<n;i++) {
        cout<<c[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 3128
#include <iostream>
#include <sstream>

using namespace std;

int main() {
	string str;
	stringstream ss;
	stringstream rgbs;
	getline(cin, str);
	ss << str;
	string color;
	while (getline(ss, str, ' ')) {
		rgbs << str;
	}
	int num;
	rgbs >> num;
	if (num % 4 == 0) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}

	return 0;
}

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

using namespace std;
int main() {
    int h, w;
    cin >> h >> w;
    string s[h];
    for(int i=0; i<h; i++) cin >> s[i];
    for(int i=0; i<h; i++) cout << s[i] << endl << s[i] << endl;
    return 0;
}

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

int main() {
    int h, n; cin >> h >> n;
    constexpr int INF = 1e9 + 6;
    // dp[j] : 鯛力をjにするときの最小
    vector<int> dp(h + 1, INF);
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        int a, b; cin >> a >> b;
        for (int j = 0; j < h + 1; j++) {
            if (j - a >= 0) dp[j] = min(dp[j], dp[j - a] + b);
        }
        for (int j = 0; j <= a; j++) {
            dp[h] = min(dp[h], dp[h - j] + b);
        }
    }
    cout << dp[h] << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s;
  cin>>s;
  ll fg=0,sum=0;
  int si=s.size();
  vint a(si,0);
  vint b(si,0);
  rep(i,si){
    if(s[i]=='<'){
      fg++;
      a[i]=fg;
    }
    else{
      fg=0;
    }
  }
  fg=0;
  for(int i=si-1;i>=0;i--){
    if(s[i]=='>'){
      fg++;
      b[i]=fg;
    }
    else{
      fg=0;
    }
  }
  sum+=b[0];
  REP(i,1,si){
    sum+=max(a[i-1],b[i]);
  }
  sum+=a[si-1];
  cout<<sum<<'\n';
  return(0);
}


Measured memory_bytes: 4764
s = gets.chomp

ss = s.each_char.with_object("a" => 0, "b" => 0, "c" => 0) do |c, h|
  h[c] += 1
end

n = (s.length - 1) / 3
if ss.values.all? { |c| [n, n + 1].include?(c) }
  puts "YES"
else
  puts "NO"
end


Measured memory_bytes: 3836
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

N = gets_i
a_list, b_list = [], []
N.times do |i|
  a_list[i], b_list[i] = gets_i_list
end

a_list.sort!
b_list.sort!

if N.even?
  i1, i2 = N/2 - 1, N/2
  a1, b1 = a_list[i1], b_list[i1]
  a2, b2 = a_list[i2], b_list[i2]
  puts (b1 + b2) - (a1 + a2) + 1
else
  i1 = N/2
  a1, b1 = a_list[i1], b_list[i1]
  puts b1 - a1 + 1
end

Measured memory_bytes: 20092
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define MN 2000005
using namespace std;
int n,a[MN];
long long ans;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	int l=1,r=0,tmp=0;
	while(r<=n){
		while(((tmp&a[r+1])==0)&&r+1<=n)tmp|=a[++r];
		ans+=r-l+1;
		while(((tmp^a[l])&a[r+1])!=0&&l<=n)tmp^=a[l++],ans+=r-l+1;tmp^=a[l++]^a[++r];
	}while(l<=n)ans+=n-l+1,l++;
	printf("%lld\n",ans);
}

Measured memory_bytes: 896
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int len = s.length();
        StringBuilder t = new StringBuilder();
        for(int i = 0; i < len; i++){
            t.append("x");
        }
        System.out.println(t);
    }
}


Measured memory_bytes: 21972
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#define ll long long
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<ll> a(n);
    vector<ll> s(n+1,0);
    for(int i=0;i<n;i++){
        cin>>a[i];
        s[i+1]=s[i]+a[i];
    }
    ll min=10000000000;
    for(int i=1;i<n;i++){
        ll temp=abs(2*s[i]-s.back());
        if(min>temp) min=temp;
    }
    cout<<min<<endl;
    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define fore(x,a,b) for(int x=a, qwerty=b; x<qwerty; x++)
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) ((int)(a).size())
#define pb push_back
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define fst first
#define snd second
#define mset(a,v) memset((a),(v),sizeof(a))
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
using namespace std;
typedef long long ll;
const int N=105;
int n,a[N],v[N],w;
ll dp[N][100100];
ll f(int i, int w){
	if(i==n)return 0;
	ll &r=dp[i][w];
	if(r!=-1)return r;
	r=f(i+1,w);
	if(a[i]<=w)r=max(r,v[i]+f(i+1,w-a[i]));
	return r;
}
int main(){FIN;
	cin>>n>>w;
	fore(i,0,n)cin>>a[i]>>v[i];
	memset(dp,-1,sizeof dp);
	cout<<f(0,w)<<"\n";
}

Measured memory_bytes: 82432
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;


template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}
 
template<class T,class U>
void chmin(T& a,U b){
	if(b<a)
		a=b;
}


//vector<pair<int,int>> pairs;  pairs[i] = make_pair(value, value);
//sort(a.begin(),a+index_number);

//cin>>  cout<<'\n'

/*
vector<int> vec(100,-1);全ての値に-1をセット
vector<std::vector<int>> vec{{ 1, 2, 3 },{ 4, 5, 6 }};
vec.size() vec[i].size()
vec.emplace_back(20);追加
*/

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    vector<int> t(3,101);
    cin >> t[0] >> t[1] >> t[2];

    sort(t.begin(),t.end());
    cout << t[0]+t[1]<<endl;

    return 0;
}

Measured memory_bytes: 256
A,B,H,M=map(int,input().split())
import math

m=360*M/60
h=360*H/12+30*M/60

if m>=h:
    p=m-h

else:

    p=h-m


if p==0:
    print(abs(A-B))

else:

    l=math.radians(p)

    ans=(A**2+B**2-2*A*B*math.cos(l))**(1/2)

    print(ans)


Measured memory_bytes: 9512
sticks = Hash.new(0)

gets
gets.split.each {|a| sticks[a.to_i] += 1}

selected = sticks.select {|length, num| num >= 2}
             .sort_by {|length, num| -length}.take(2)
s = selected.size
result = if s >= 1 && selected[0][1] >= 4
           selected[0][0] ** 2
         elsif s >= 2 && selected[0][1] >= 2 && selected[1][1] >= 2
           selected[0][0] * selected[1][0]
         else
           0
         end
         
puts result

Measured memory_bytes: 15752
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#define LL long long
using namespace std;
LL C[3010][3010],S[3010][3010];
LL n,p;
void pre()
{
	for(LL i=0;i<=3001;i++)
	{
		C[i][0]=1;
		for(LL j=1;j<=i;j++) C[i][j]=(C[i-1][j]+C[i-1][j-1])%p;
	}
	S[0][0]=1;
	for(LL i=1;i<=3001;i++)
	{
		S[i][1]=1;
		for(LL j=2;j<=i;j++) S[i][j]=(S[i-1][j]*j%p+S[i-1][j-1])%p;
	}
}
LL pow(LL a,LL b,LL mod)
{
	LL ans=1;
	while(b)
	{
		if(b&1) ans=ans*a%mod;
		a=a*a%mod;b>>=1;
	}
	return ans;
}
int main()
{
	LL ans=0;scanf("%lld %lld",&n,&p);
	pre();
	for(LL i=0;i<=n;i++)
	{
		LL s=C[n][i]*pow(2,pow(2,n-i,p-1),p)%p;
		LL tot=0;
		for(LL j=0;j<=i;j++) tot=(tot+pow(2,(n-i)*j%(p-1),p)*S[i+1][j+1]%p)%p;
		ans=(ans+(i&1?-1:1)*s%p*tot%p)%p;
	}
	printf("%lld",(ans+p)%p);
}

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

int main()
{
    long long N, A, B;

    cin >> N >> A >> B;

    if ((B - A) % 2 == 0)
    {
        cout << (B - A) / 2 << endl;
    }

    else
    {
        long long move = min(A - 1, N - B);

        cout << move + 1ll + (B - A - 1) / 2 << endl;
    }
}


Measured memory_bytes: 256
// Girunga magar dubara zarror uthunga... 
#include<bits/stdc++.h>
#define ll long long int

using namespace std;

const ll sz=100005;

ll n,ar[sz],k,cache[sz];
// ASLI TOP DOWN #KHUD_SE
ll dp(ll pos)
{
    if(pos<1)
        return 1e9;
    if(pos==1)
        return 0;

    ll &ans=cache[pos];
    if(ans!=-1)
        return ans;
	
	ll mini=1e13;
	
	for(ll i=pos-1;i>=1 and i>=pos-k;i--)
	{
		mini=min(mini,abs(ar[i]-ar[pos])+dp(i));
	}
	ans=mini;
	
    return ans;
}

int main()
{
    memset(cache,-1,sizeof cache);
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
    {
        cin>>ar[i];
    }
    cout<<dp(n);
}

Measured memory_bytes: 6528
#include<stdio.h>
int main(void)
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a == b){
        printf("%d",c);
    }
    else if(a == c){
        printf("%d",b);
    }
    else{
        printf("%d",a);
    }
    return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N, K, cnt[int(2e5+5)];
vector <int> ans;

int main(){
  cin >> N >> K;
  for (int i = 0; i < N; i++){
    int A; cin >> A;
    cnt[A]++;
  }

  for (int i = 0; i <= 2e5; i++){
    if (cnt[i] == 0) continue;
    ans.push_back(cnt[i]);
  }
  sort(ans.begin(), ans.end(), greater<int>());

  int sum = 0;
  for (int i = K; i < ans.size(); i++){
    sum += ans[i];
  }
  cout << sum << endl;


  return 0;
}


Measured memory_bytes: 4924
# input
A, B, C, D, E, F = map(int, input().split())

temp = 0
ans1, ans2 = 100 * A, 0

for i in range(31):
    for j in range(31):
        for k in range(101):
            for l in range(101):
                w = 100 * A * i + 100 * B * j
                s = C * k + D * l
                if w == 0:
                    break
                if s > E * (A * i + B * j):
                    break
                if w + s > F:
                    break
                if s / (w + s) > temp:
                    temp = s / (w + s)
                    ans1 = w + s
                    ans2 = s

print(ans1, ans2)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		for(int i = 0; i < s.length() - 1; i++)
			if(s.charAt(i) == s.charAt(i + 1)) {
				System.out.println("Bad");
				return;
			}
		System.out.println("Good");
	}
}


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

#define WHITE 0
#define BLACK 1
#define inf 2001

int main(){
  int n, mincost, sum=0;
  int A[101][101]={}, color[101], d[101], pi[101];
  int i, j, u, v;

  scanf("%d", &n);
  if(n < 0 || 100 < n)
    exit(1);

  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      scanf("%d", &A[i][j]);
      if(A[i][j] != -1 && (A[i][j] < 0 || 2000 < A[i][j]))
	exit(2);
    }
  }

  for(i = 0; i < n; i++){
    d[i] = inf;
    pi[i] = -1;
    color[i] = WHITE;
  }
  d[0] = 0;

  while(1){
    mincost = inf;
    for(i = 0; i < n; i++){
      if((color[i] != BLACK) && (d[i] < mincost)){
	  mincost = d[i];
	  u = i;
      }
    }
    if(mincost == inf)
      break;
    color[u] = BLACK;
    for(v = 0; v < n; v++){
      if((color[v] != BLACK) && (A[u][v] != -1) && (A[u][v] < d[v])){
	pi[v] = u;
	d[v] = A[u][v];
      }
    }
  }

  for(i = 0; i < n; i++)
    sum += d[i];
  
  printf("%d\n", sum);

  return 0;
}

Measured memory_bytes: 648
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        int C = scan.nextInt();
        int K = scan.nextInt();
        if (K <= A) {
            System.out.println(K);
            return;
        }
        if (K <= A + B) {
            System.out.println(A);
            return;
        }
        int diff = K - A - B;
        System.out.println(A - diff);
    }
}


Measured memory_bytes: 35748
#include<stdio.h>

int main(void)
{
  int n;
  int num[4];
  int count=0;
  scanf("%d",&n);
  for(int i=0;i<4;i++){
    num[i]=n%10;
    n/=10;
  }



  for(int i=0;i<2;i++){
    if(num[i]==num[i+1]&&num[i+1]==num[i+2]){
      puts("Yes");
      return 0;
    }
  }
  puts("No");
  return 0;
}


Measured memory_bytes: 128
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;

#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<usize>();
    let (n, k) = (line[0], line[1]);

    let a = read_as_vec::<usize>();

    println!("{}", (n-2)/(k-1)+1);
}


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

int main(void) {
    long long int X;
    scanf("%lld", &X);
    long long int a, b;
    for(a = 0; a < 1000; a++) {
        for(b = -a; b < a; b++) {
            if((a*a*a*a*a - b*b*b*b*b) == X) {
                printf("%lld %lld\n", a, b);
                break;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 2148
from functools import reduce

# 2数の最大公約数
def gcd(a, b):
    return a if b == 0 else gcd(b, a%b)

# リストの最大公約数
def gcd_list(nums):
    return reduce(gcd, nums)

# 入力
n = int(input())
a = list(map(int, input().split()))

#a[i]より前方要素の最大公約数を保持
l = [0 for _ in range(n)]
l[0] = 0
for i in range(1, n):
    l[i] = gcd(l[i-1], a[i-1])
# print(l)

#a[i]より後方要素の最大公約数を保持
r = [0 for _ in range(n)]
r[n-1] = 0
for i in reversed(range(n-1)):
    r[i] = gcd(r[i+1], a[i+1])
# print(r)

# a[i]を除いた最大公約数を計算
ans = 0
for i in range(n):
    ans = max(ans, gcd(l[i],r[i]))

# 出力
print(ans)


Measured memory_bytes: 14704
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#pragma GCC optimize ("trapv")
using namespace std;

#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define DEBUG 1
#define cerr if (DEBUG) cerr
#define test cerr << "hi\n";

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand(l, r) uniform_int_distribution<long long>(l, r)(rng)
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> OST;

#define INF 0x3f3f3f3f3f3f3f3f
#define MAXN 500005
//#define MOD 998244353LL
#define MOD 1000000007LL

long long T[MAXN];

void add(int x, int v) {
    for (++x; x < MAXN; x += x&-x) {
        T[x] += v;
    }
}

long long sum(int x) {
    long long ans = 0;
    for (++x; x; x -= x&-x) {
        ans += T[x];
    }
    return ans;
}

void solve() {
    int n, q;
    cin >> n >> q;
    for (int i = 0, x; i < n; i++) {
        cin >> x;
        add(i, x);
    }
    while (q--) {
        int t;
        cin >> t;
        if (t == 0) {
            int p, x;
            cin >> p >> x;
            add(p, x);
        }
        if (t == 1) {
            int l, r;
            cin >> l >> r;
            cout << sum(r-1) - sum(l-1) << '\n';
        }
    }
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    auto start_time = clock();
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t = 1;
//    cin >> t;
    for (int no = 1; no <= t; no++) {
//        cout << "Case #" << no << ": ";
        solve();
    }

#ifdef LOCAL
    cerr << "TIME ELAPSED: " << double(clock() - start_time) / CLOCKS_PER_SEC << '\n';
#endif
}

Measured memory_bytes: 8256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<ll, ll> P;



int main(){
    double L;
    cin >> L;
    printf("%.10f\n", (L/3.0) * (L/3.0) * (L/3.0));

    return 0;
}


Measured memory_bytes: 256
A, B = map(int, input().split())
S = list((input()))
x = False
y = False
cnt = 0
if S[A] == '-':
    S.pop(A)
    x = True
for i in range(A + B):
        if S[i].isdecimal():
            cnt += 1
if cnt == A + B:
    y = True
if x and y == True:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

const string YES = "Yes";
const string NO = "No";

void solve(ll N, vector<ll> L) {
  ll ma = *max_element(ALL(L));
  bool pred = accumulate(ALL(L),0ll) > 2*ma;
  cout << (pred ? YES : NO) << endl;
}

int main() {
  ll N;
  cin >> N;
  vector<ll> L(N);
  for (int i = 0; i < N; i++) {
    cin >> L[i];
  }
  solve(N, move(L));
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int arr[3];
  int temp;
  for(int i = 0; i<3; i++)
    {
      scanf("%d", &arr[i]);
    }
  while(1)
    {
      if(arr[0]>arr[1])
	{
	  temp = arr[1];
	  arr[1] = arr[0];
	  arr[0] = temp;
	}
      else if(arr[1]> arr[2])
	{
	  temp = arr[2];
	  arr[2] = arr[1];
	  arr[1] = temp;
	}
      else
	{
	  break;
	}
    }
  printf("%d %d %d\n", arr[0], arr[1], arr[2]);
  return 0;
}



Measured memory_bytes: 2140
a,b=map(int,input().split())
l=list(range(a,b+1))
le=0
ans=0
for i in l:
    i=str(i)
    count=0
    for j in range(len(i)//2):
        if i[j]==i[len(i)-1-j]:
            count+=1
            if count==len(i)//2:
                ans+=1
        else:
            count=0
            break
print(ans)

Measured memory_bytes: 6516
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <unordered_set>
//#define local
#ifdef local
#include "dbg-macro/dbg.h"
#endif
#define ll long long
#define ull unsigned long long
#define pi (acos(-1))
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (unsigned long long i = 0; i < (unsigned long long)(n); ++i)
#define vec std::vector
using namespace std;
std::vector<unsigned ll> genprimevec(const unsigned ll N);
int main()
{
	int d,t,s;cin>>d>>t>>s;
	if(d>s*t){cout<<"No"<<endl;}
	else{cout<<"Yes"<<endl;}
    return 0;
}

ll extgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1, y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return d;
}


std::vector<unsigned ll> genprimevec(const unsigned ll N)
{
    std::vector<bool> is_prime(N + 1);
    for (unsigned ll i = 0; i <= N; i++) { is_prime[i] = true; }
    std::vector<unsigned ll> P;
    for (unsigned ll i = 2; i <= N; i++)
    {
        if (is_prime[i])
        {
            for (unsigned ll j = 2 * i; j <= N; j += i) { is_prime[j] = false; }
            P.emplace_back(i);
        }
    }
    return P;
}


Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <list>
#include <deque>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
#define dump(a) cout << (a) << endl;
typedef long long ll;
ll mod = 1e9+7;

int main() {
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    vector<int> a;
    for( int i = 0; i < n; i++ ) {
        if( s[i] == t[i] ) a.push_back( 1 );
        else {
            a.push_back( 2 );
            i++;
        }
    }
    // for( int i = 0; i < (int)a.size(); i++ ) cout << a[i] << endl;
    ll res = ( a[0] == 1 ) ? 3 : 6;
    for( int i = 0; i < (int)a.size()-1; i++ ) {
        if( a[i] == 1 ) res *= 2;
        else if( a[i] == 2 && a[i+1] == 2 ) res *= 3;
        res %= mod; 
    }
    dump( res );
    return 0;  
}

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

signed main()
{
   int N; cin>>N;
   vector<int> p(N);
   for(int i=0;i<N;i++){
      cin>>p[i]; p[i]--;
   }

   const int K=50000;
   vector<int> a(N),b(N);
   for(int i=0;i<N;i++){
      a[i]=K*(i+1);
      b[i]=K*(N-i);
   }

   for(int i=0;i<N;i++){
      b[p[i]]-=(N-i-1);
   }

   for(int i=0;i<N;i++) cout<<a[i]<<' '; cout<<endl;
   for(int i=0;i<N;i++) cout<<b[i]<<' '; cout<<endl;
}


Measured memory_bytes: 1152
#include<iostream>
#include<numeric>
#include<set>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long li;
#define yn(i) ((i)?"Yes":"No")
#define chmin(a,b) (a>(b)?a=(b),1:0)
#define abs(n) max((n),-(n))
#define dist(a,b) max((a)-(b),(b)-(a))
#define chmax(a,b) (a<(b)?a=(b),1:0)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define MOD 1000000000
#define rep(i,n) for(int i=0;i<(n);i++)

#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

// Container コンテナ型, map以外
template< template<class ...> class Ctn,class T>
std::ostream& operator<<(std::ostream& os,const set<T>& v){
  // ここでストリームに obj を書き込みます。
  auto itr=v.begin();
  while(itr!=v.end()){
    if(itr!=v.begin())cout << " ";
    cout << *(itr++);
  }
  return os;
}




string key="keyence";

void add(char m,string s,set<string> st){
  int n=s.size();
  rep(i,n){
    if(s[i]!=m) continue;
    string t;
    repa(j,i,n){
      t.push_back(s[j]);
      st.insert(t);
    }
  }
}

int main(){
  string s,t; cin >>s >>t;
  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  reverse(t.begin(),t.end());
  print(yn(s<t));
}





Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    ll n;
    cin >> n;
    vector<ll> a(3*n);
    rep(i, 0, 3*n) cin >> a[i];
    sort(a.begin(), a.end(), greater<ll>());
    ll ans = 0;
    for(int i = 1; i < 2*n; i+=2) ans += a[i];
    cout << ans << endl;
}

Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#define NMAX 100000
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n";
#define scan(arg) cin>>arg;
using namespace std;
int n,m;
int b[40];
int main(){
	scan(n);scan(m);
	rep(i,n){
		int k;
		scan(k);
		rep(j,k){
			int a;
			scan(a);
			b[a]++;
		}
	}
	int ans=0;
	rep1(i,m){
		if(b[i]==n) ans++;
	}
	prin(ans);
	return 0;
}


Measured memory_bytes: 256
// Undone
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
using namespace std;
int H, W;
int grid[100][100];
signed main() {
  cin >> H >> W;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> grid[i][j];
    }
  }
  
  int ans = INF;
  for (int x = 0; x < H; x++) {
    for (int y = 0; y < W; y++) {
      int temp = 0;
      for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
          if (y == j) continue;
          if (x == i) break;
          temp += min(abs(x-i), abs(y-j))*grid[i][j];
        }
      }
      ans = min(temp, ans);
    }
  }
  cout << ans << endl;
}




Measured memory_bytes: 3132
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func max32(a, b int32) int32 {
	if a > b {
		return a
	}
	return b
}

var dp [][]int32
var maxL int

func makeTbl(N int, v, w []int) {
	N = min(N, len(v))
	dp = make([][]int32, N+1)
	for n := 0; n <= N; n++ {
		dp[n] = make([]int32, maxL+1)
	}
	// out(v, w, N)

	for n := 1; n < N; n++ {
		prev := n / 2
		// out("cur", n, "prev", prev)
		for i := 0; i <= maxL; i++ {
			if w[n] <= i {
				dp[n][i] = max32(dp[prev][i], dp[prev][i-w[n]]+int32(v[n]))
			} else {
				dp[n][i] = dp[prev][i]
			}
		}
		// out(n, dp[n][:10])
	}
}

func calc(s, L int, v, w []int) int {
	N := len(v)
	n := 1 << uint(N)
	ret := 0
L0:
	for i := 0; i < n; i++ {
		sumw := 0
		sumv := 0
		for j := 0; j < N; j++ {
			if (i>>j)%2 == 1 {
				sumw += w[j]
				sumv += v[j]
			}
			if sumw > L {
				continue L0
			}
		}
		// out(strconv.FormatInt(int64(i), 2), sumw, sumv, L)
		rest := L - sumw
		sumv += int(dp[s][rest])
		ret = max(ret, sumv)
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	v := make([]int, N+1)
	w := make([]int, N+1)
	for i := 1; i <= N; i++ {
		v[i], w[i] = getInt(), getInt()
	}

	Q := getInt()
	AV := make([]int, Q)
	AL := make([]int, Q)

	for i := 0; i < Q; i++ {
		AV[i], AL[i] = getInt(), getInt()
		maxL = max(maxL, AL[i])
	}

	const lv = 2048
	makeTbl(lv, v, w)

	val := make([]int, 18)
	weight := make([]int, 18)

	wb := bufio.NewWriter(os.Stdout)
	defer wb.Flush()
	for i := 0; i < Q; i++ {
		L := AL[i]
		V := AV[i]
		// out(V, L, dp[V][:L])
		if V < lv {
			fmt.Fprintln(wb, dp[V][L])
			continue
		}
		idx := 0
		for V >= lv {
			val[idx] = v[V]
			weight[idx] = w[V]
			V /= 2
			idx++
		}
		// out(val, weight, V, L)
		ret := calc(V, L, val[:idx], weight[:idx])
		fmt.Fprintln(wb, ret)
	}
}


Measured memory_bytes: 839432