akhauriyash/Code-Regression huggingface dataset:
/*    ####################  */
/*   # I_LOVE_THUY_LINH #  */
/*  ####################  */
#include <bits/stdc++.h>
#define ll long long
#define db double
#define ld long double
#define ii pair<int,int>
#define pb push_back
#define vi vector<int>
#define vii vector<ii>
#define matrix vector<vector<ll>>
#define fir first
#define sec second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define uni(a) (a).erase(unique(all(a)),(a).end())
#define sz(a) int((a).size())
#define ms(s,val) memset(s,val,sizeof(s))
#define bitcount(n) __builtin_popcountll(n)
#define getbit(s,k) ((s >> k)&1)
#define turnbit(s,k) (s | (1<<k))
#define offbit(s,k) (s & ~(1<<k))
#define flipbit(s,k) (s ^ (1<<k))
#define prec(n) fixed<<setprecision(n)
#define sqr(x) (ll)(x)*(ll)(x)
#define lcm(a,b) ((ll)a/__gcd((ll)a,(ll)b)*(ll)(b))
#define gcd(a,b) __gcd(a,b)
using namespace std;
const int INF = int(1e9);

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int &i: a) cin >> i;
    sort(all(a));
    uni(a);
    if (a.size() == n) cout << "YES";
    else cout << "NO";
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
#include <algorithm>
#include <iomanip>
using namespace std;

int main(){
  int N, block = 0, ans = 0, check;
  cin >> N ;
  ans += (N / 500) * 1000 ;
  N %= 500 ;
  ans += (N / 5) * 5 ;
  cout << ans << endl ;
  return 0 ;
}  

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n    = Integer.parseInt(scanner.nextLine());
		char[] t = scanner.nextLine().toCharArray();
		int ans = 0;
		int rcn = 0;
		int wcn = 0;

		for(int i = 0; i < n; i++) {

			if(t[i] == 'R'){

				rcn++;
			}
		}

		for(int i = 0; i < rcn; i++) {

			if(t[i] == 'W') {

				wcn++;
			}
		}



		System.out.println(wcn);
	}

}


Measured memory_bytes: 42096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
const ll INF = 1LL << 60;
#define mod 2019

vector<ll> cnt(2019);

int main() {
    string S; cin >> S;
    int N = S.length();
    
    cnt[0] = 1;
    ll p = 1;
    ll now = 0;
    for (int i = N - 1; i >= 0; i--) {
        now = (now + (S[i] - '0') * p) % mod;
        cnt[now]++;
        p = (p * 10) % mod;
    }
    
    ll ans = 0;
    for (int i = 0; i < 2019; i++) {
        ll n = cnt[i];
        ans += n * (n - 1) / 2;
    }

    cout << ans << endl;
    return 0;
}

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

int main(void){
  int a,b;
  cin >> a >> b;
  if(a >= 13)cout << b << endl;
  else if(a >= 6)cout << b / 2 << endl;
  else cout << 0 << endl;
  return 0;
}

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

int main(void) {
  int N, M;
  cin >> N >> M;
  vector<long> ret(8, 0);
  vector<vector<long> > v(8);
  for (int i = 0; i < N; i++) {
    long x, y, z;
    cin >> x >> y >> z;

    v[0].push_back(  x + y + z);
    v[1].push_back(  x + y - z);
    v[2].push_back(  x - y + z);
    v[3].push_back(  x - y - z);
    v[4].push_back(- x + y + z);
    v[5].push_back(- x + y - z);
    v[6].push_back(- x - y + z);
    v[7].push_back(- x - y - z);
  }

  for (int i = 0; i < 8; i++) {
    vector<long> v2 = v[i];
    sort(v2.begin(), v2.end(), greater<long>());
    for (int j = 0; j < M; j++) {
      ret[i] += v2[j];
    }
  }
  sort(ret.begin(), ret.end(), greater<long>());
  cout << ret[0];
}


Measured memory_bytes: 384
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define sz(x) (int)(x).size()
typedef vector<int> vi;
// #define ll long long 
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e9+7;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=2*1e5+2;
bool prime(int x)
{
	for(int i=2;i*i<=x;i++)
	{
		if(x%i==0) return false;
	}
	return true;
}
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int x;
	cin>>x;
	for(int i=x;;i++)
	{
		if(prime(i))
		{
			cout<<i;
			return 0;
		}
	}
}  
// I never lose. I either win or I learn

Measured memory_bytes: 256
program division_or_substraction
  implicit none
  integer(8) :: n, r, k, x = 2_8
  read(*,*) n
  if (n == 2_8) then
    write(*,'(i0)') 1
    stop
  end if
  r = sqrt(real(n,8)+0.5d0)
  do k = 2_8, r
    if (mod(n,k) /= 0_8) then
      if (mod(n-1_8,k) == 0_8) then
        x = x+1_8
        if (k*k /= n-1_8) x = x+1_8
      end if
    else
      if (ok(n,k)) x = x+1_8
    end if
  end do
  write(*,'(i0)') x
contains
  logical function ok(n,k)
    integer(8), intent(in) :: n, k
    integer(8) :: m
    m = n
    do while (m >= k)
      if (mod(m,k) == 0) then
        m = m/k
      else
        m = mod(m,k)
      end if
    end do
    ok = m == 1
  end
end program division_or_substraction

Measured memory_bytes: 384
from collections import Counter
N=int(input())
v=list(map(int,input().split()))

list_odd=v[1::2]
list_even=v[0::2]

cnt_odd=Counter(list_odd)
cnt_even=Counter(list_even)

cnt_odd_sorted=sorted(cnt_odd.items(),reverse=True,key=lambda x:x[1])
cnt_even_sorted=sorted(cnt_even.items(),reverse=True,key=lambda x:x[1])

if cnt_odd_sorted[0][0]!=cnt_even_sorted[0][0]:
    ans=len(list_odd)-cnt_odd_sorted[0][1]
    ans+=len(list_even)-cnt_even_sorted[0][1]

else:
    if len(cnt_odd)==1 and len(cnt_even)==1:
        ans=len(list_even)
    elif len(cnt_odd)==1:
        ans=len(list_even)-cnt_even_sorted[1][1]
    elif len(cnt_even)==1:
        ans=len(list_odd)-cnt_odd_sorted[1][1]
    else:
        ans1=len(list_even)-cnt_even_sorted[1][1]
        ans1+=len(list_odd)-cnt_odd_sorted[0][1]

        ans2=len(list_odd)-cnt_odd_sorted[1][1]
        ans2+=len(list_even)-cnt_even_sorted[0][1]
        ans=min(ans1,ans2)

print(ans)

Measured memory_bytes: 27872
i = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(i[k-1])

Measured memory_bytes: 3064
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        //long start = System.currentTimeMillis();
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int count = 0;
        int max = 0;
        for (int i = 0;i<3;++i)
        {
            String ss = s.substring(i,i+1);
            if (ss.equals("R")) ++count;
            else
            {
                max = Math.max(count,max);
                count = 0;
            }
        }
        max = Math.max(count,max);
        System.out.println(max);
        sc.close();
//        long end = System.currentTimeMillis();
//        System.err.println((end-start)+"ms");
    }
}

Measured memory_bytes: 35512
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<numeric>
#include<utility>
#include<unordered_map> //hash map
#include<cmath>

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

#define INF 10000007

typedef  long long ll;

using namespace std;

ll gcd(ll a,ll b){
    if (b==0)return a;
    return gcd(b,a%b);
}

ll deg(int i){
  ll ret = 1;
  while(i != 0){
    if(i/10 == 0){
      break;
    }
    i/=10;
  }
  return i;
}

void solve(){
  double r;
  cin >> r;
  cout << 3.1415*r*2 << endl;
}


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


Measured memory_bytes: 3796
#include <array>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
using namespace std;


typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define PB push


#define MOD 1000000007LL
#define EPS 1e-10

struct UnionFind
{
  vector< int > data;

  UnionFind(int sz)
  {
    data.assign(sz, -1);
  }

  bool unite(int x, int y)
  {
    x = find(x), y = find(y);
    if(x == y) return(false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return(true);
  }

  int find(int k)
  {
    if(data[k] < 0) return(k);
    return(data[k] = find(data[k]));
  }

  int size(int k)
  {
    return(-data[find(k)]);
  }

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

string op(int sign)
{
    return sign == 0 ? "+" : "-";
}

int main()
{
    int N;
    cin >> N;
    vector<vector<int> > F(N);
    REP(i, N) F[i].resize(10);
    REP(i, N) REP(j, 10) cin >> F[i][j];
    vector<vector<int> > P(N);
    REP(i, N) P[i].resize(11);
    REP(i, N) REP(j, 11) cin >> P[i][j];
    LL ans = -1000000000000; // -10^12 <= =10^7 * 100
    for(int timeBits = 1; timeBits < 1024; ++timeBits)
    {
        LL score = 0;

        REP(store, N)
        {
            int matchNum = 0;
            REP(time, 10)
            {
                bool myOpen = (timeBits & (1 << time)) != 0;
                bool opOpen = F[store][time] == 1;
                if (myOpen && opOpen)
                {
                    ++matchNum;
                }
            }

            score += P[store][matchNum];
        }

        ans = max(ans, score);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n,i,s,b;
	long long a,m;
	scanf("%d",&n);
	s=0;
	m=1000*1000*1000;
	for(i=1;i<=n;i++){
		scanf("%d",&a);
		if(a>s){
			s=a;
		}
		if(a<m){
			m=a;
		}
	}
	b=s-m;
	printf("%d\n",b);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int L,Q,n,a[100005],dp[100005][30];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    scanf("%d%d",&L,&Q);
    for(int i=1;i<=n;i++)
    {
    	int id=upper_bound(a+1,a+1+n,a[i]+L)-a-1;
    	if(a[i]+L>=a[n])
            dp[i][0]=n;
        else
            dp[i][0]=id;
	}
	for(int i=1;i<=20;i++)
        for(int j=1;j<=n;j++)
            dp[j][i]=dp[dp[j][i-1]][i-1];
    while(Q--)
    {
    	int L,R;
    	scanf("%d%d",&L,&R);
    	if(R<L)
    		swap(L,R);
    	long long ans=0;
    	for(int i=20;i>=0;i--)
    		if(dp[L][i]<R)
    		{
    			ans+=(1ll<<i);
    			L=dp[L][i];
			}
		printf("%lld\n",ans+1);
	}
	return 0;
}

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

using namespace std;

typedef long long i64;

i64 f(i64 b, i64 n) {
    i64 s=0;
    while (n) {
        s += n % b;
        n /= b;
    }
    return s;
}

int main(void) {
    i64 n, s;
    cin >> n >> s;

    if (n == s) {
        cout << n+1 << endl;
        return 0;
    }

    i64 ub=sqrt(n);
    i64 b;
    for (b=2; b<=ub; b++)
        if (f(b, n) == s) {
            cout << b << endl;
            return 0;
        }

    i64 p;
    for (p=ub+1; --p;) {
        b = (n-s)/p + 1;
        if (b < 2) continue;
        if (f(b, n) == s) {
            cout << b << endl;
            return 0;
        }
    }
    cout << "-1\n";
    return 0;
}


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

using namespace std;

int main() {
    while (true) {
        char buf[1<<10];
        scanf("%s", buf);
        string s(buf);
        if (s == "0") return 0;

        int dsum=0;
        for (char c: s)
            dsum += c-'0';

        printf("%d\n", dsum);
    }
}

Measured memory_bytes: 2784
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>
using namespace std;

/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()

/*---  Type ---*/
typedef long long ll;

/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// Util
int max(int a, int b, int c) {return max(a, max(b, c));}
int min(int a, int b, int c) {return min(a, min(b, c));}
ll max(ll x, ll y) {return x > y ? x : y;}
ll min(ll x, ll y) {return x < y ? x : y;}
ll max(ll a, ll b, ll c) {return max(a, max(b, c));}
ll min(ll a, ll b, ll c) {return min(a, min(b, c));}

// How to use 「map」
/*
  - 宣言
    map<{key_type}, {value_type}> salary;
  - 要素の挿入
    salary["Alice"] = 1000;
  - 要素の取得 O(logn)
    salary.at("Alice");
  - 要素の削除
    salary.erase("Alice");
  - キー検索
    salary.find("Alice"); -> true
    salary.find("Bob");   -> false
  - イテレーション
    for(auto& [key, value] : salary) {...}
 */
// -------------------------------------


// How to use 「lower_bound」, 「upper_bound」
/*
  vector<int> a = {1, 2, 3, 4, 5};
  auto iter1 = lower_bound(all(a), 3);  <- 第二引数「以上」の最小イテレータが返る
  auto iter2 = upper_bound(all(a), 3);  <- 第二引数「より大きい」最小のイテレータが返る
 */
// -------------------------------------


// How to use 「struct sort」
/*
  struct Person {
    string name;
    int age;

    Person(string _name, int _age) {
      name = _name;
      age = _age;
    }

    bool operator<(const Person &another) const {
      return age < another.age;
    }
  };

  vector<Person> people;
  people.pb(Person("Alice", 20));
  people.pb(Person("Bob", 19));
  people.pb(Person("John", 40));
  people.pb(Person("Chris", 30));
  sort(all(people));
 */
 // -------------------------------------

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



int main() {
  string s;

  cin >> s;

  for (int i=0; i<s.length(); i++) {
    cout << "x";
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define popcnt(a) __builtin_popcount(a)
#define FastIO() ios::sync_with_stdio(false), cin.tie(0);
#define IO() freopen("palindrome.in","rw",stdin)
#define error(args...)                       \
{                                            \
    cerr<<"LINE "<<__LINE__;                 \
    string _s = #args;                       \
    replace(_s.begin(), _s.end(), ',', ' '); \
    stringstream _ss(_s);                    \
    istream_iterator<string> _it(_ss);       \
    err(_it, args);                          \
    cerr<<endl;                              \
}
void err(istream_iterator<string> it)
{
} 
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
  cerr<<' '<< *it << " = " << a ;
  err(++it, args...);
} 
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 1e6+9, M = (1<<31), OO = 0x3f3f3f3f;
int arr[N];
int main()
{
  int n;
  scanf("%d",&n);
  for(int i=1;i<=n;++i)
  {
    int x;
    scanf("%d",&x);
    arr[x]=i;
  }
  for(int i=1;i<=n;++i) printf("%d%c",arr[i]," \n"[i==n]);
  #ifdef _LOCAL_DEFINE
  cerr << (double)clock() * 1.0 / CLOCKS_PER_SEC << endl;
  #endif
  return 0; 
}

Measured memory_bytes: 1152
s = input()
s = list(s)
 
q=int(input())
front=[]
back=[]
hantei = True
for _ in range(q):
    t = input().split()
    if t[0] == '1':
        hantei = not hantei
    else:
        if hantei:
            if t[1] == '1':
                front.append(t[2])
            else:
                back.append(t[2])
        else:
            if t[1] == '2':
                front.append(t[2])
            else:
                back.append(t[2])

if hantei:
    front.reverse()
    ans = front + s + back 
else:
    back.reverse()
    s.reverse()
    ans = back + s + front
print(''.join(map(str,ans)))

Measured memory_bytes: 99348
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    ll n;
    cin >> n;
    ll a[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    ll anstop = 0;
    ll ansbot = 0;
    if (n % 2 == 1) {
        ll tmp = a[n / 2];
        for (int i = 0; i < n / 2; i++) {
            anstop += abs(a[i] - tmp);
            tmp = a[i];
            anstop += abs(a[n - 1 - i] - tmp);
            tmp = a[n - 1 - i];
        }
        tmp = a[n / 2];
        for (int i = 0; i < n / 2; i++) {
            ansbot += abs(a[n - 1 - i] - tmp);
            tmp = a[n - 1 - i];
            ansbot += abs(a[i] - tmp);
            tmp = a[i];
        }
    } else {
        ll tmp = a[n / 2];
        for (int i = 0; i < (n - 2) / 2; i++) {
            anstop += abs(a[i] - tmp);
            tmp = a[i];
            anstop += abs(a[n - 1 - i] - tmp);
            tmp = a[n - 1 - i];
        }
        anstop += abs(a[n / 2 - 1] - tmp);
        tmp = a[n / 2 - 1];
        for (int i = 0; i < (n - 2) / 2; i++) {
            ansbot += abs(a[n - 1 - i] - tmp);
            tmp = a[n - 1 - i];
            ansbot += abs(a[i] - tmp);
            tmp = a[i];
        }
        ansbot += abs(a[n / 2] - tmp);
    }
    ll ans = max(anstop, ansbot);
    cout << ans << endl;
}


Measured memory_bytes: 1024
# 0114

def gcd(a, b):
	if b == 0: return a
	return gcd(b, a % b)

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

def times(a, m):
	c = 1
	x = a * 1 % m
	while x != 1:
		x = a * x % m
		c += 1
	return c

while True:
	x, y, z = 1, 1, 1
	c1, c2 ,c3 = 0, 0, 0
	a1, m1, a2, m2, a3, m3 = map(int, input().split())
	
	if sum([a1, m1, a2, m2, a3, m3]) == 0:
		break

	c1 = times(a1, m1)
	c2 = times(a2, m2)
	c3 = times(a3, m3)

	print(int(lcm(c1, lcm(c2, c3))))

Measured memory_bytes: 6736
#include <iostream>
#include <vector>
#include <algorithm>

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

using namespace std;

typedef vector<long long int> V;

vector<vector<long long int> > xyz;
int n, m, x2, y2, z2;

bool comp(const V &a, const V &b){
	return (a[0]*x2+a[1]*y2+a[2]*z2 > b[0]*x2+b[1]*y2+b[2]*z2);
}

int main(){
	const int diff[10] = {1, -1, 1, -1, -1, -1, 1, 1, 1, -1};
	long long int input, ans, finalans, po;

	cin >> n >> m;
	xyz = vector<vector<long long int> > (n);
	ans = 0;
	finalans = 0;

	REP(i,n){
		REP(l,3){
			cin >> input;
			xyz[i].push_back(input);
		}
	}

	REP(i,8){
		ans = 0;
		x2 = diff[i];
		y2 = diff[i+1];
		z2 = diff[i+2];
		sort(xyz.begin(), xyz.end(), comp);
		REP(l,3){
			po = 0;
			REP(k,m){
				po += xyz[k][l];
			}
			ans += abs(po);
		}
		if (ans>finalans) finalans = ans;
	}

	cout << finalans << endl;

	return 0;
}


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

int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(n % 2 != 0){
        cout << "No" << endl;
    }
    else{
        bool t = true;
        for(int i = 0; i < n/2; i++){
            if(s.at(i) != s.at((n/2)+i)){
                t = false;
            }
        }
        if(t == true){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }
}

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


#define file "file"
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef complex<double> point;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define DEBUG 0
#define dout if(DEBUG) cout


void solve(){
    string s;
    cin >> s;
    cout << "ABC" << s;
}

int main() {
    #ifdef NASTYA
        assert(freopen("input.txt", "r", stdin)); assert(freopen("output.txt", "w", stdout));
    #else
    // assert(freopen(file".in", "r", stdin)); assert(freopen(file".out", "w", stdout));
    #endif
    int t = 1;
    while(t--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft

def main():
    pi = 3.141592653589793
    r = int(input())
    print(2 * pi * r)

main()

Measured memory_bytes: 9404
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
#define loop(i,a,n) for (int i = (a); (i) < (n); ++ (i))
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF (int)1e9
#define MOD 0
//#define int ll
using namespace std;
typedef vector<int> vi;

signed main(){
    int a,b,c;
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b >> c;
    if(a*c <= b) cout << c << endl;
    else cout << b/a << endl;
    return 0;
}
   

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    int num1 = sc.nextInt();
    int num2 = sc.nextInt();
    int num3 = sc.nextInt();
    int Train= num1*num2;
    if(Train>=num3){
      System.out.println(num3);
    }else{
      System.out.println(Train);
    }
  }
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	string str;
	ll k;
	while(cin >> str >> k){
	int n = str.size();
	bool f = false;
	for(int i = 0; i < n - 1; i++){
		if(str[i] != str[i+1]){
			f = true;
			break;
		}
	}
	ll ans = 0;
	if(!f){		//如果全一样 
		ans = k * n / 2;
		printf("%lld\n",ans);
	}
	else{
		//找出一个串里面的连续，和两个串里面的，加减一下
		ll ans2 = 0;
		int m = 1;
		for(int i = 0; i < n; i++){	
			if(str[i] == str[i+1])
				m++;	
			else if(i != 0 && str[i] == str[i-1]){
				ans += m / 2;
				m = 1;
			}
		}
		n += n;  str += str;  m = 1;
		for(int i = 0; i < n; i++){	
			if(str[i] == str[i+1])
				m++;	
			else if(i != 0 && str[i] == str[i-1]){
				ans2 += m / 2;
				m = 1;
			}
		}
		ans =  ans + (ans2 - ans) * (k - 1);
		printf("%lld\n",ans);
	}
	
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int lli;
#define optimize ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define forn(i,n) for(int i = 0; i<n; i++)
#define forab(i,a,b) for(int i = a; i<b; i++)
#define forll(i,a,b) for(lli i = a; i<b; i++)
#define mp make_pair
#define pb emplace_back
#define sortv(v) sort(v.begin(), v.end())
#define debug(x) cout<<#x<<" : "<<x<<endl
#define all(x) x.begin(),x.end()
const int mod1 = 1000000007;
const int mod2 = 998244353;

int main()
{
	optimize
	#ifndef ONLINE_JUDGE
	freopen("inputf.in", "r", stdin);
    freopen("outputf.in", "w", stdout);
	#endif

	string s;
	cin>>s;

	int x = s[0] == 'R'?1:0;
	int y = s[1] == 'R'?1:0;
	int z = s[2] == 'R'?1:0;

	int ans = 0;
	if(x)
	{
		ans++;
		if(y)
		{
			ans++;
			if(z) ans++;
		}
	}
	else if(y)
	{
		ans++;
		if(z)
			ans++;
	}
	else if(z)
		ans++;
	    

	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 3568
import sys

def main():
    input = sys.stdin.readline
    S = int(input())

    x1 = 0
    y1 = 0
    x2 = 10**9

    if S % x2 == 0:
        y2 = 0
        x3 = 0
        y3 = S // x2
    else:
        y2 = 1
        y3 = S // 10**9 + 1
        x3 = 10**9 * y3 - S

    print('{} {} {} {} {} {}'.format(x1, y1, x2, y2, x3, y3))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C,D;
  cin>>A>>B>>C>>D;
  if(A+B==C+D)cout<<"Balanced"<<endl;
  else if(A+B>C+D)cout<<"Left"<<endl;
  else cout<<"Right"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//*******************
// Mahmoud Magdy    *
//*******************
#define ll long long
#define endl "\n"

void fast()
{
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}
inline int D()
{
    int m ;
    cin>>m;
    return m ;
}
inline ll lD()
{
    ll m ;
    cin>>m;
    return m ;
}
inline double dD()
{
    double m ;
    cin>>m;
    return m ;
}
ll arr[1000006];
map<int,int>fr;
int main()
{
int n=D();
for(int i=0;i<n;++i){
    cin>>arr[i];
    fr[arr[i]]++;
}
set<int>st;
vector<int>v;
for(int i=0;i<n;++i)
{
    if(!(st.count(arr[i])))
    {
        v.push_back(arr[i]);
        st.insert(arr[i]);
    }
}
int c=0;
for(int i=0;i<v.size();++i){
    if(fr[v[i]]%2)
        c++;
}
cout<<c<<endl;
}



Measured memory_bytes: 10744
n,a_start,b_start,a_goal,b_goal = map(int,input().split())
s = input()

no_rock_double = True
for i in range(a_start, max(b_goal,a_goal)):
    if i+1 < n:
        if s[i] == '#' and s[i+1] == '#':
            no_rock_double = False
can_switch = False
if a_goal > b_goal:
    for i in range(b_start-1, b_goal):
        if s[i - 1:i + 2] == "...":
            can_switch = True
    if no_rock_double and can_switch:
        print('Yes')
    else:
        print('No')
else:
    if no_rock_double:
        print('Yes')
    else:
        print('No')



Measured memory_bytes: 9500
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
typedef long long ll;
using namespace std;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main()
{
    ll N;
    cin >> N;
    ll A[N];
    for(int i = 0; i < N; i++) cin >> A[i];
    ll res = A[0];
    for(int i = 0; i < N; i++)
    {
        res = GCD(res,A[i]);
    }
    cout << res << endl;
}

Measured memory_bytes: 1272
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define PW(x) (1LL<<(x))
#define SZ(x) ((ll)(x).size())

#define pb emplace_back
#define fi first
#define se second
using ll = long long;
using P = pair<ll ,ll>;
using Tu = tuple<ll, ll, ll>;
const ll INFLL = 1LL<<60LL;
const ll INF = 1LL<<60LL;
const ll MOD = 1e9+7;



using ld = long double;

template<class T> T &chmin( T &a , const T &b ){ return a = min(a,b); }
template<class T> T &chmax( T &a , const T &b ){ return a = max(a,b); }
template<class T> void UNIQUE(vector<T> &a){ a.erase(unique(a.begin(), a.end()), a.end()); }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll in(){long long int x; assert(scanf("%lld", &x) == 1); return x;}
ld fin(){double x; assert(scanf("%lf", &x) == 1); return x;}
char yuyushiki[1000010]; string stin(){assert(scanf("%s", yuyushiki) == 1); return yuyushiki;}

vector<ll> dy{-1, 0, 1, 0};
vector<ll> dx{0, -1, 0, 1};
vector<char> dc{'D', 'L', 'U', 'R'};


int main(){
  bool ok = true;
  bool ki = false;
  ll N;
  cin >> N;
  vector<P> v(N);
  for(int i=0;i<N;i++){
    ll y, x;
    cin >> x >> y;
    v[i] = P(y, x);
  }
  for(int i=1;i<N;i++)
    ok &= (v[0].first + v[0].second + INF) % 2 == (v[i].first + v[i].second + INF) % 2;
  ki = (v[0].first + v[0].second + INF) % 2;
  if(!ok)
    cout << -1 << endl;
  else{
    vector<ll> m;
    if(!ki)
      m.push_back(1);
    for(ll i=0;i<35;i++)
      m.push_back(1LL << i);
    reverse(m.begin(), m.end());
    cout << m.size() << endl;
    for(int i=0;i<m.size();i++){
      cout << m[i];
      if(i == m.size() - 1)
	cout << endl;
      else
	cout << " ";
    }
    for(int i=0;i<N;i++){
      ll y, x;
      tie(y, x) = v[i];
      ll bestarg;
      ll besty, bestx;
      for(int j=0;j<m.size();j++){
	ll bestscore = INF;
	for(int k=0;k<4;k++){
	  ll ny, nx;
	  ny = dy[k] * m[j];
	  nx = dx[k] * m[j];
	  ll score = abs(y - ny) + abs(x - nx);
	  if(score < bestscore){
	    bestarg = k;
	    bestx = x - nx;
	    besty = y - ny;
	    bestscore = score;
	  }
	}
	cout << dc[bestarg];
	//cout << y << "y -> " << besty << " " << x << "x->" << bestx << endl;
	x = bestx; y = besty;
      }
      cout << endl;
      assert(y == 0 && x == 0);
    }
  }
}
/*
  ############
###################
#######o#############
######o#o############
#####o#o#o###########
####o#o#o#o##########
#######o############
#####################
#####################
#####################
#####################
 */



Measured memory_bytes: 256
n,m = map(int,input().split())
c = []

#n x m の行列を読み込む
A = [[int(i) for i in input().split()]for j in range(n)]

#m x 1 の行列を読み込む
b = [int(input()) for i in range(m)]
for i in range(n):
    ci = 0
    for j in range(m):
         ci += A[i][j] * b[j]
    c.append(ci)

for i in range(n):
    print(c[i])



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

using namespace std;
#define FOR(i,n) for(int i = 0; i < n; i++)
#define sz(c) ((int)c.size())

using ll = long long;

int n;
const int M  =int( 1e8 + 7);
const int MOD = int(1e9 + 9);
const int C = 200000;
int s[C];
ll h[200000 + 10], Mtbl[C + 1];
void init() {
	h[0] = 0;
	FOR(i, C) h[i + 1] = (h[i] * M + s[i]) % MOD;
	Mtbl[0] = 1;
	FOR(i, n) Mtbl[i + 1] = Mtbl[i] * M % MOD;
}

struct X {
	ll hash; int len;
	X() : hash(0), len(0) {}
	X(ll hash, int len) : hash(hash), len(len) {
		this->hash = (this->hash % MOD + MOD) % MOD;
	}
};

X substr(int l, int r) {
	return X(h[r] - h[l] * Mtbl[r - l], r - l);
}

int main() {
	scanf("%d", &n);
	FOR(i, n) scanf("%d", s + i);
	init();

	int ans_ = -1;
	for (int ans = n; ans >= 1; ans--) {
		if (n % ans != 0) continue;
		int len = n / ans;
		X a = substr(0, len);
		bool ok = true;
		for (int i = 0; i < n; i += len) {
			X b = substr(i, i + len);
			if (a.hash != b.hash) {
				ok = false;
				break;
			}
		}
		if (ok) {
			ans_ = ans;
			break;
		}
	}

	cout << ans_ << endl;

}

Measured memory_bytes: 7148
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int w = Integer.parseInt(scan.next());
		int h = Integer.parseInt(scan.next());
		int x = Integer.parseInt(scan.next());
		int y = Integer.parseInt(scan.next());
		int r = Integer.parseInt(scan.next());
		System.out.println((((r <= x && x <= (w - r)) && (r <= y && y <= (h - r))) ? "Yes" : "No"));
		scan.close();
	}
}


Measured memory_bytes: 26336
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N = INT()
S = input()

ans = 0

count_S = {
    "R": [0] * N,
    "G": [0] * N,
    "B": [0] * N,
}

count_S[S[-1]][-1] = 1
for i in reversed(range(N-1)):
    count_S["R"][i] = count_S["R"][i+1]
    count_S["B"][i] = count_S["B"][i+1]
    count_S["G"][i] = count_S["G"][i+1]
    count_S[S[i]][i] += 1


# for i in range(0, N-2):
#     for k in range(i+2, N):
#         if S[i]==S[k]:
#             continue
#         for j in range(i+1, k):
#             # print(S[i], S[j], S[k])
#             if j-i!=k-j and S[i]!=S[j] and S[j]!=S[k]:
#                 ans += 1


for i in range(0, N-3):
    for j in range(i+1, N-1):
        if S[i] == S[j]:
            continue
        for c in "RGB":
            if S[i] != c and S[j] != c:
                last_color = c
        ans += count_S[last_color][j+1]
        if j+j-i <= N-1 and S[j+j-i] == last_color:
            ans -= 1

print(ans)

Measured memory_bytes: 68796
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::{i32, i64, u32, u64, usize, f64};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};

fn main() {
    input!{
        n: usize,
        k: usize,
        ps: [i32; n],
    }
    println!("{}", ps.windows(k).scan((0, 0), |state, w| {
        if state.0 == 0 {
            *state = (w.iter().sum::<i32>() + k as i32, w[0]);
            Some(state.0)
        } else {
            *state = (state.0 - state.1 + w[k - 1], w[0]);
            Some(state.0)
        }
    }).max().unwrap() as f64 * 0.5);
}


Measured memory_bytes: 6396
#include <cstdio>
int gcd(int a, int b){
	return b?gcd(b,a%b):a;
}
int main(){
	int a,b;
	while(~scanf("%d%d",&a,&b))
		printf("%d %d\n",gcd(a,b),a/gcd(a,b)*b);
}

Measured memory_bytes: 0
n = gets.chomp.to_i

s = []

while n != 0
  if n.even?
    s << 0
    n /= -2
  else
    s << 1
    n -= 1
    n /= -2
  end
end
if s.empty?
  puts "0"
else
  puts s.join("").reverse
end

Measured memory_bytes: 1788
#include<iostream>
const int N=100001;
using namespace std;
main(){
    int n,x[N],y[N],t[N];
    cin>>n;
    for(int i=1;i<=n;i++) cin>>t[i]>>x[i]>>y[i];
    for(int i=1;i<=n;i++)
        if(x[i]+y[i]>t[i]||(t[i]-x[i]-y[i])%2!=0){cout<<"No"; return 0;}   
        cout<<"Yes";
}

Measured memory_bytes: 1408
let (a, b, c) = Scanf.sscanf (read_line ()) "%d %d %d" @@ fun a b c -> (a, b, c)

let () = print_endline @@ if c - a - b > 0 && (4 * a * b) < (c - a - b) * (c - a - b) then "Yes" else "No"

Measured memory_bytes: 4480
#include <iostream>
using namespace std;
int gcd(int a, int b) {
    return (a % b ? gcd(b, a % b) : b);
}
int main() {
    int N, A[100000], l[100000], r[100000];
    cin >> N;
    for (int i = 0; i < N; i++) cin >> A[i];
    l[0] = A[0]; r[0] = A[N-1];
    for (int i = 1; i < N; i++) {
        l[i] = gcd(l[i-1], A[i]);
        r[i] = gcd(r[i-1], A[N-i-1]);
    }
    
    int max = 0;
    for (int i = 0; i < N; i++) {
        if (i == 0) {
            if (r[N-2] > max) max = r[N-2];
        }
        else if (i == N - 1) {
            if(l[N-2] > max) max = l[N-2];
        }
        else if (gcd(l[i-1], r[N-i-2]) > max) max = gcd(l[i-1], r[N-i-2]);
    }
    cout << max << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ll long long
#define all(_v) _v.begin(), _v.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pvllvll pair <vector <ll>, vector <ll> >
#define ld long double
#define veci vector <int>
#define vecll vector <ll>


const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const double PI = 3.1415926535897932384626433832795;
const double eps = 1e-9;
const int MOD1 = 1e9 + 7;
const int MOD2 = 998244353;

const int MAXN = 2e5 + 10;
int n, k;
veci s;
int dp[MAXN];
int p[MAXN];
bool was[MAXN];
pii ed[15];

void solve() {
    cin >> n >> k;
    for(int i = 1; i <= k; ++i) cin >> ed[i].f >> ed[i].s;
    dp[1] = p[1] = 1;
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= k; ++j) {
            int r = max(0, i - ed[j].f), l = max(0, i - ed[j].s);
            dp[i] = (dp[i] + (p[r] - p[max(l - 1, 0)] + MOD2) % MOD2) % MOD2;
        }
        p[i] = (p[i - 1] + dp[i]) % MOD2;
    }
    cout << dp[n];
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int T = 1;
    ///cin >> T;
    while(T--) solve(), cout << '\n';
    return 0;
}


Measured memory_bytes: 5208
#include "bits/stdc++.h"
using namespace std;
#define long int64_t

struct Solver {
	Solver() {
		ios::sync_with_stdio( false );
	}

	void solve() {
		int N, K, S;
		cin >> N >> K >> S;

		vector<int> a( N );
		for( int i = 0; i < K; ++i ) { a[i] = S; }

		if( S == 1000000000 ) {
			for( int i = K; i < N; ++i ) { a[i] = 1; }
		}
		else {
			for( int i = K; i < N; ++i ) { a[i] = S+1; }
		}

		for( int i = 0; i < N; ++i ) {
			cout << a[i] << (i < N-1 ? ' ' : '\n');
		}
	}
};

int main() {
	Solver().solve();
	return 0;
}


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

int main(void){
    string str_s;
    string str_p;

    cin >> str_s;
    cin >> str_p;

    string ring_str = str_s;
    ring_str += str_s;

    string answer = "Yes";
    if(ring_str.find(str_p) == string::npos)
        answer = "No";
    cout << answer << endl;
}


Measured memory_bytes: 3228
N=int(input())

X=[0 for _ in range(N)]
Y=[0 for _ in range(N)]

INF=1e10
Zmax=-INF
Zmin=INF
Wmax=-INF
Wmin=INF


for n in range(N):
	X[n], Y[n] = map(int, input().split())
	z = X[n] + Y[n]
	w = X[n] - Y[n]

	Zmax = max( Zmax, z )
	Zmin = min( Zmin, z )
	Wmax = max( Wmax, w )
	Wmin = min( Wmin, w )

ans = max( abs(Zmax - Zmin), abs(Wmax - Wmin))

print(ans)




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

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

int main()
{
	int x,y,ans;
	cin >> x >> y;
	ans = x + y/2;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <tuple>
#include <functional>

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define irep(i,n) for(int  i = 0; i < n; i++)
#define irep2(i,a,n) for(int i = a; i < n; i++)
#define lrep(i,n) for(long long  i = 0; i < n; i++)
#define lrep2(i,a,n) for(long long i = a; i < n; i++)
#define in(a) cin >> a
#define out(a) cout << a << endl
typedef long long ll;

typedef std::vector<int> v_int;
typedef std::vector<std::vector<int> > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<std::vector<ll> > v2_ll;

using namespace std;

int main() 
{
    int a,b;
    cin >> a >> b;
    int odd = (a*b) % 2;

    if(odd) { 
        cout << "Odd" << endl;
    } else {
        cout << "Even" << endl;
    }
    return 0;
}
    



Measured memory_bytes: 256
PROGRAM replacing
      IMPLICIT NONE
      INTEGER,PARAMETER :: p = 16
      integer(p) :: n,q,S
      integer(p),allocatable :: a(:),b(:),c(:)
      
      integer(p) :: i, table(10**5)=0
      
      
      read*,n
      allocate( a(n) )
      read*,a
      read*,q
      allocate( b(q),c(q) )
      do i = 1,q
        read*,b(i),c(i)
      end do
      
      S = sum( a )
      do i = 1,n
        table(a(i)) = table(a(i)) + 1
      end do
      
      do i = 1,q
        S = S - table(b(i))*b(i) + c(i)*table(b(i))
        table(c(i)) = table(c(i)) + table(b(i))
        table(b(i)) = 0
        print*,S
      end do
      
      
      
      
      stop
      !debugg
      
      print'(*(x,i0))',table(1:maxval(a))
      
      
      END PROGRAM

Measured memory_bytes: 11476
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#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 VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
 
template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<endl;}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}
 
const double EPS =1e-9;
const long INF =2147483647;//32bit 2*1e+9
const long MOD =1e+9+7;
#define PI 3.14159265258979
 
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

int main(void){
	int N,K,tmp,result=0;
	map<int,int> mp;
	vector<int> ve;

	cin>>N>>K;
	REP(i,N){
		cin>>tmp;
		mp[tmp]++;
	}
	if((int)mp.size()-K<=0) print(0);
	else{
		for(auto itr =mp.begin();itr!=mp.end();itr++)
			ve.pb(itr->second);
		DVSORT(ve);
		REP(i,K)
			result+=ve[i];
		print(N-result);
	}
		
	return 0;
}


Measured memory_bytes: 10748
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(long long i = 0; i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

int main(void)
{
    ll a, b;
    cin >> a >> b;
    for(int i=1;i<=1009;i++){
        if(i*8/100==a && i*10/100==b){
            cout<<i<<endl;
            return 0;
        }
    }
    cout<<-1<<endl;
    return 0;
}

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

int main()
{
	ll n;
	cin>>n;
	ll arr[n];
	ll sum{};
	ll ans = LONG_MAX;
	for(ll i=0;i<n;i++)
	{
		cin>>arr[i];
		sum += arr[i];
	}
	ll r2{};
	for(int i=0;i<n-1;i++)
	{
		r2 += arr[i];
		ans = min(ans,abs(sum - 2*r2));
	}	
	cout<<ans;
	return 0;
}

Measured memory_bytes: 5196
S = input()
T = input()
s = []
t = []
for alp in "abcdefghijklmnopqrstuvwxyz":
  s.append(S.count(alp))
  t.append(T.count(alp))
if(sorted(s) == sorted(t)):
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3632
import sys

S = str(input().strip('\n'))

if len(S) != 3 or S == 'AAA' or S == 'BBB':
    print('No')
    sys.exit()
else:
    for Count in range(1,4):
        if S[Count-1] =='A' or \
           S[Count-1] =='B':
            pass
        else:
            print('No')
            sys.exit()

print('Yes')


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
    unsigned long long int n;
    unsigned long long int e=0;
    scanf("%lld",&n);
    for(unsigned long long int i=1;i<=n;i++){
        if(i%3!=0&&i%5!=0)e+=i;
    }
    printf("%lld",e);
    return 0;
}


Measured memory_bytes: 3816
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>

int cal_min_diff(int length, const std::string& str) {
	for (auto i = 0; i < length - 2; ++i) {
		for (auto j = 1; j < str.size() / length; ++j) {
			if (str[i] != str[j * length + i]) return 10;
		}
	}
	int min = 100;
	int max = 0;
	for (auto i = 1; i <= str.size() / length; ++i) {
		auto val = (str[i * length - 2] - '0') * 10 + str[i * length - 1] - '0';
		min = std::min(val, min);
		max = std::max(val, max);
	}
	return max - min;
}
int count_single(const std::string& str) {
	int min_single = 10;
	int max_single = 0;
	for (const auto c : str) {
		min_single = std::min(min_single, c - '0');
		max_single = std::max(max_single, c - '0');
	}
	if (str.size() <= 2) return max_single - min_single;
	int min_double = 20;
	int max_double = 0;
	for (auto i = 0; i < str.size(); ++i) {
		auto val = str[i] - '0';
		if (str[i] == '1' && ++i < str.size()) {
			val *= 10;
			val += str[i] - '0';
		}
		min_double = std::min(min_double, val);
		max_double = std::max(max_double, val);
	}
	return std::min(max_single - min_single, max_double - min_double);
}
int main() {
	std::string str; std::cin >> str;
	int min_diff = count_single(str);
	for (auto i = 2; i < str.size(); ++i) if (str.size() % i == 0) {
		min_diff = std::min(min_diff, cal_min_diff(i, str));
	}
	std::cout << min_diff << '\n';
}


Measured memory_bytes: 3340