akhauriyash/Code-Regression huggingface dataset:
import java.util.Map.Entry;
import java.io.*;
import java.util.*;

public class Main {
	static long[] P = new long[51];
	static long[] L = new long[51];
	
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		int D = sc.nextInt();
		String ans = "Christmas";
		for(int i = 25-D; i > 0; i--) ans += " Eve";
		System.out.println(ans);
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}


Measured memory_bytes: 20436
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 100000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double PI = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;


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

	ll n;
	cin >> n;
	vi a(n), b(n), c(n), d(n), big(n), small(n);
	int ans = 0;
	rep(i, n) {
		cin >> a[i];
		cin >> b[i];
		big[i] = 0;
	}
	rep(i, n) {
		cin >> c[i];
		cin >> d[i];
		small[i] = 0;
		rep(j, n) {
			if (a[j] < c[i] && b[j] < d[i]) {
				small[i]++;
				big[j]++;
			}
		}
	}
	while (1) {
		int k = -1;
		int cnt = 101;
		rep(i, n) {
			if (small[i] <= 0) continue;
			if (small[i] < cnt) {
				k = i;
				cnt = small[i];
			}
		}
		if (cnt > 100) break;
		small[k] = 0;
		cnt = 0;
		int x = -1, cnt1 = 101;
		rep(j, n) {
			if (big[j] <= 0) continue;
			if (a[j] < c[k] && b[j] < d[k]) {
				big[j]--;
				if (big[j] < cnt1) {
					cnt1 = big[j];
					x = j;
				}
				cnt++;
			}
		}
		if (cnt > 0)ans++;
		if (x >= 0) {
			big[x] = 0;
			rep(i, n) {
				if (a[x] < c[i] && b[x] < d[i])small[i]--;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main
{
	public static void main(String arg[])
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext())
		{
			int obj = sc.nextInt();
			if(obj==0)
				return;
			int n= sc.nextInt();
			int count=0;
			for(int i=0; i<n; i++)
				count += -(sc.nextInt()-sc.nextInt());
			if(count >= obj)
				System.out.println("OK");
			else
				System.out.println(obj-count);
		}
	}

}

Measured memory_bytes: 12000
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF (1 << 29) * 2
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

ll euclid(ll a, ll b)
{
  ll temp;

  if (a < b)
  {
    temp = a;
    a = b;
    b = temp;
  }
  if (b < 1)
    exit(1);
  if (a % b == 0)
    return b;
  return euclid(b, a % b);
}

ll distance[100005];
int main()
{
  ll x, n, a, flag, ans;
  scanf("%lld%lld", &n, &x);
  for (int i = 0; i < n; i++)
  {
    scanf("%lld", &a);
    distance[i] = llabs(a - x);
  }
  sortdown(distance, n);
  ll hoge = n == 1 ? distance[0] : euclid(distance[0], distance[1]);
  for (int i = 2; i < n; i++)
  {
    hoge = euclid(hoge, distance[i]);
  }
  printf("%lld\n", hoge);
  return 0;
}

Measured memory_bytes: 1788
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<LL> VL;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;

int const MAX_N = 100009;

int par[MAX_N];
int sz[MAX_N];

void init(int n) {
	rep(i, n) { par[i] = i; sz[i] = 1; }
}
int root(int x) {
	return (par[x] == x) ? (x) : (par[x] = root(par[x]));
}
bool same(int x, int y) {
	return root(x) == root(y);
}
LL getsize(int x) {
	return (LL)sz[root(x)];
}
void unite(int x, int y) {
	x = root(x), y = root(y);
	if (x == y)return;

	par[y] = x;
	sz[x] += sz[y];
}

void parprint(int n) {
	rep(i, n) {
		printf("%d(%d, %d) ", i, par[i], sz[i]);
	}
	puts("\n");
}

LL aaa(int x) { return (LL)x * (x - 1) / 2; }

int main() {
	int n, m; cin >> n >> m;
	VI a(m), b(m); rep(i, m) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
	}

	init(n);
	vector<LL> print(m); print[m - 1] = aaa(n);

	for (int i = m - 1; i >= 1; i--) {
		if (!same(a[i], b[i])) {
			LL be1 = getsize(a[i]), be2 = getsize(b[i]);
			unite(a[i], b[i]);
			LL af = getsize(a[i]);

			//printf("unite(%d, %d) -> size(%lld, %lld)\n", a[i], b[i], be1, be2);
			//parprint(n);

			print[i - 1] = print[i] - be1 * be2;
		}
		else {
			print[i - 1] = print[i];
		}
	}
	rep(i, m)cout << print[i] << endl;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	ll n,k; cin>>n>>k;
	vl a(n);
	rep(i,0,n) cin>>a[i];
	rep(q,0,k){
		vl b(n+1);
		rep(i,0,n){
			ll s=max((ll)0,(i-a[i]));
			ll t=min(i+a[i]+1,n);
			b[s]++; b[t]--;
		}
		rep(i,1,n+1) b[i]+=b[i-1];
		b.pop_back();
		if(a==b) break;
		a=b;
	}
	rep(i,0,n) cout<<a[i]<<" ";
	
	return 0;
}

Measured memory_bytes: 6428
#include<stdio.h>
int main()
{
    long long int i,m,n,s,a[200000],w;
    while(~scanf("%lld %lld",&n,&m))
    {
        s=0;
        for(i=0;i<n;i++)
            scanf("%lld",&a[i]);
        for(i=0;i<n-1;i++)
        {
            if(a[i]+a[i+1]>m)
            {
                 w=a[i]+a[i+1]-m;
                 s=s+w;
                 a[i+1]=a[i+1]-w;
                 if(a[i+1]<0)
                    a[i+1]=0;
            }
        }
        printf("%lld\n",s);
    }
    return 0;
}


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

int main() {
    int n, k, d, x, ans=0;
    cin >> n >> k;
    vector<int> a(n, 0);
    for(int i=0; i<k; i++){
        cin >> d;
        for(int j=0; j<d; j++){
            cin >> x;
            x--;
            a[x]++;
        }
    }
    for(int i=0; i<n; i++){
        if(a[i]==0) ans++;
    }
    cout << ans;
}

Measured memory_bytes: 3624
import itertools

N = int(input())
P_ar = list(map(int,input().split()))
Q_ar = list(map(int,input().split()))

List = list(map(list,list(itertools.permutations(range(N)))))

for i in range(N):
  P_ar[i]-=1
  Q_ar[i]-=1

a=-1
b=-1

for i in range(len(List)):
  if List[i]==P_ar:
    a=i
    break

for i in range(len(List)):
  if List[i]==Q_ar:
    b=i
    break

print(abs(a-b))

Measured memory_bytes: 15092
#include <set>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <limits>
using namespace std;
static int imin = std::numeric_limits<int>::min();
static int imax = std::numeric_limits<int>::max();
#define ll long long
#define rep(i, n) for(int i = 0; i<n; ++i)
#define rep1(i, n) for(int i = 1; i<n; ++i)
#define debug(x) cout << #x << ":" << x << "\n";
template<class T>
std::ostream& operator << (std::ostream& os, std::vector<T>& vec){
  std::size_t n = vec.size();
  if(n == 0){
    return os;
  }
  for(int i = 0; i<n - 1; ++i){
    os << vec[i] << " ";
  }
  os << vec[n - 1];
  os << std::endl;
  return os;
}

template <class T>
auto mkVec(unsigned int x){
  return std::vector<int>(x);
}

template <class T>
auto mkVec2(unsigned int x, unsigned int y){
  return std::vector<std::vector<T>>(x, std::vector<T>(y));
}

template <class T>
auto mkVec3(unsigned int x, unsigned int y, unsigned int z){
  return std::vector<std::vector<std::vector<T>>>(x, std::vector<std::vector<T>>(y, std::vector<T>(z)));
}

// 113C
// #ifndef BOOST_TEST_MAIN
// int main(int const argc, char const** argv){
//   int N, M;
//   cin >> N >> M;
//   vector<ll> P;
//   vector<ll> Y;
//   auto X = mkVec2<ll>(N + 1, 0);
//   rep(i, M){
//     ll p, y;
//     cin >> p >> y;
//     P.push_back(p);
//     Y.push_back(y);
//     X[p].push_back(y);
//   }
//   rep(i, N + 1){
//     sort(X[i].begin(), X[i].end());
//   }
//   rep(i, M) {
//     ll y;
//     rep(j, N + 1){
//       auto x = find(X[j].begin(), X[j].end(), Y[i]);
//       if(x != X[j].end()){
//         y = x - X[j].begin();
//         break;
//       }
//     }
//     printf("%06lld%06lld\n", P[i], y + 1);
//   }

// }
// #endif

#ifndef BOOST_TEST_MAIN
int main(int const argc, char const** argv){
  ll N;
  vector<ll> X, Y, H;

  cin >> N;
  rep(i, N){
    ll x, y, h;
    cin >> x;
    cin >> y;
    cin >> h;
    X.push_back(x);
    Y.push_back(y);
    H.push_back(h);
  }

  rep(x, 101)
    rep(y, 101){
    int iter;
    while(H[iter] == 0){iter++;}
    ll top = H[iter] + abs(x - X[iter]) + abs(y - Y[iter]);

    rep(n, N){
      if(H[n] != 0 && H[n] + abs(x - X[n]) + abs(y - Y[n]) != top){
        break;
      }
      if(H[n] == 0 && abs(x - X[n]) + abs(y - Y[n]) < top){
        break;
      }

      if(n == N - 1){
        cout << x <<  " " << y << " " << top;
        return 0;
      }      
    }
  }
  
}
#endif


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

typedef long long ll;

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

    ll n,a,b,minsum,maxsum;
    cin >> n >> a >> b;
    minsum = a * (n-1) + b;
    maxsum = a + b * (n-1);
    cout << max(maxsum - minsum + 1 , 0LL) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define pw(b,p)         pow(b,p) + 0.1
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int arr1[20];
int arr2[20];
vector<int> adj[100005];
vector<int> sz(100005);
int ans = 0;

void dfs(int v, int par = 0)
{
    sz[v] = 1;
    for (auto x : adj[v])
    {
        if (x == par) continue;
        dfs(x, v);
        sz[v] += sz[x];
    }
    if (sz[v] % 2 == 0) ans++;
}

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

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

    int ans = 0;
    for (int i = 1; i <= n; i++)
    {
        if (i & 1 && a[i] & 1)
            ans++;
    }

    cout << ans << endl;

}

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

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


int main(){

  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 0;
  ll r = n-1;
  ll l = 0;
  while(r > l){
    if (s[l] == 'R'){
      l++;
    }
    if (s[r] == 'W'){
      r--;
    }

    if (s[l] == 'W' && s[r] == 'R'){
      ans++;
      l++; r--;
    }

  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3744
#include<stdio.h>
int main(){

  int i,b,a[30]={0};

  for(i=0;i<28;i++){
    scanf("%d",&b);
    a[b-1]=1;
  }

  for(i=0;i<30;i++){
    if(a[i]==0){
      printf("%d\n",i+1);
    }
  }

  return 0;
}

Measured memory_bytes: 596
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[]a = new int[n];
   
    for(int i=0; i<n; i++) {
    	a[i] = sc.nextInt();
    	    }
    Arrays.sort(a);
    int cou = 0;
    for(int i=0; i<n-1; i++) {
    	if(a[i] == a[i+1]) {
    		cou++;
    	}
    }
    if(cou == 0) {
    	System.out.println("YES ");
    }else {
    	System.out.println("NO ");
    }  
      }
}


Measured memory_bytes: 61512
using System;
using System.Collections.Generic;

namespace _0031
{
    class Program
    {
        readonly static int MaxWeight = 1023;

        static void Main(string[] args)
        {
            var measuredWeights = ReadData();
            WriteUsedWeights(measuredWeights);
        }

        /// <summary>
        /// データを読み込む
        /// </summary>
        /// <returns>読み込んだ入力群</returns>
        static List<int> ReadData()
        {
            var measuredWeights = new List<int>();

            while (true)
            {
                var input = Console.ReadLine();
                if (string.IsNullOrEmpty(input))
                {
                    break;
                }
                measuredWeights.Add(int.Parse(input));
            }
            return measuredWeights;
        }

        /// <summary>
        /// 使用するおもりをそれぞれ出力する
        /// </summary>
        /// <param name="measuredWeights">測るおもり群</param>
        static void WriteUsedWeights(List<int> measuredWeights)
        {
            foreach (var measuredWeight in measuredWeights)
            {
                int usedWeight = 0x01;
                string answer = "";
                while (usedWeight <= MaxWeight)
                {
                    if ((measuredWeight & usedWeight) != 0)
                    {
                        if (answer == "")
                        {
                            answer += usedWeight;
                        }
                        else
                        {
                            answer += " " + usedWeight;
                        }
                    }
                    usedWeight <<= 1;
                }
                Console.WriteLine(answer);
            }
        }
    }
}

Measured memory_bytes: 7664
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; }                            /* 1,2,3,4.. */
int des(const void *a, const void *b) { return *(int *)b - *(int *)a; }                            /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; }                     /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

int main(void)
{
  int a, b;
  scanf("%d %d", &a, &b);

  int ans = max(a - 2 * b, 0);
  printf("%d\n", ans);
  return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<int> p(n);

    for (int i = 0;i < n;i++){
        cin >> p.at(i);
    }

    sort(p.begin(),p.end());
    int sum = 0;
    for (int i = 0;i < n;i++){
        sum += p.at(i);
    }

    cout << sum - (p.at(n-1)/2) << endl;
}

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()


LL Gcd(LL a, LL b) {
  if (a < b) {
    return Gcd(b,a);
  }
  if (b == 0) {
    return a;
  }
  else {
    return Gcd(b,a%b);
  }
}

LL Lcm(LL a, LL b) {
  LL abd = Gcd(a,b);
  LL x = a / abd, y = b / abd;
  
  return x*y*abd;
}

int main() {
  int A, B;
  cin >> A >> B;
  cout << 6-A-B << endl;
  return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc131/tasks/abc131_b

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define INF (1e9)
#define MOD (1000000007)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOREACH(x, a) for (auto &(x) : (a))
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
// int gcd(long a, long b) { return b ? gcd(b, a % b) : a; }
// int lcm(long a, long b) { return a * b / gcd(a, b); }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, l, r, ans = 0;
    cin >> n >> l;
    r = l + n - 1;
    //左端が正
    if (l > 0) {
        ans = ((l + 1) + r) * (n - 1) / 2;
    } else if (r < 0) {
        ans = (l + r - 1) * (n - 1) / 2;
    } else {
        ans = (l + r) * n / 2;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
typedef complex<double> P;

const double eps = 1e-5;
vector<P> ps(3);
double R;

double eval(P p) {
  double sum = 0;
  for(int i = 0; i < ps.size(); ++i)
    sum += abs(R-abs(p-ps[i]));
  return sum;
}

P getBestP(P o, double r) {
  double s = 200;
  double mini = 1e100;
  P bestP;
  double begin = -r;
  double end = r;
  for(int i = 0; i < s; ++i) {
    for(int j = 0; j < s; ++j) {
      P v(begin + j/s*(end-begin), begin + i/s*(end-begin));
      P p = o+v;
      double tmp = eval(p);
      if(tmp < mini) {
	mini = tmp;
	bestP = p;
      }
    }
  }
  return bestP;
}

int main() {
  int Tc;
  cin >> Tc;
  for(int tc = 0; tc < Tc; ++tc) {
    for(int i = 0; i < ps.size(); ++i) cin >> ps[i].real() >> ps[i].imag();
    R = abs(ps[1]-ps[2])/abs(sin(arg(ps[1]-ps[0])-arg(ps[2]-ps[0])))/2.0;
    P res(0,0);
    for(double r = 100.0; r > eps; r *= 0.1) {
      res = getBestP(res, r);
    }
    printf("%.3f %.3f %.3f\n", res.real(), res.imag(), R);
  }
  return 0;
}

Measured memory_bytes: 1316
n = int(input())
a = list(map(int, input().split()))
l = [0] * (n + 1)
for i in range(n):
    l[a[i]] = l[a[i]] + 1
m = 0
for i in range(n + 1):
    m += int(l[i] * (l[i] - 1) / 2)
for i in range(n):
    ans = m - (l[a[i]] - 1)
    print(ans)


Measured memory_bytes: 24996
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include <iomanip>
#include<deque>
#include<stack>
#include<set>
#include <numeric>

using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int INF = 111111111;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;４近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:８近傍 9:(0,0)を含む
const int DIV = 1000000007; //10^9 + 7
const double PI = 3.14159265358979323846264338327950288;


int main() {

	//==================================
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	//==================================

	int K, N;
	cin >> N >> K;
	vector<int> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
		
	vector<int> minIdx;
	minIdx.emplace_back(0);

	for (int i = 0; i < N; i++) {
		if (A[minIdx[0]] > A[i]) {
			minIdx.erase(minIdx.begin(), minIdx.end());
			minIdx.emplace_back(i);
		}
		else if (A[minIdx[0]] == A[i]) {
			minIdx.emplace_back(i);
		}
	}

	vector<bool> done(N);
	for (int i = 0; i < N; i++) {
		done[i] = false;
	}
	for (int i = 0; i < minIdx.size(); i++) {
		done[minIdx[i]] = true;
	}
	
	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (!done[i]) {
			bool nothing = true;

			for (int j = 0; j < K && i + j < N; j++) {
				if (done[i + j]) {
					nothing = false;
					break;
				}
			}

			if (nothing) {
				for (int j = 0; j < K-1 && i + j < N; j++) {
					done[i + j] = true;
				}

				ans++;
			}
			else {
				for (int j = 0; j < K && i + j < N; j++) {
					done[i + j] = true;
				}

				ans++;

			}
			
		}
	}


	cout << ans;




}	


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

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

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

struct BinaryIndexedTree {
private:
    int n,b;
    vector<int> bit;
public:
    BinaryIndexedTree(int n_) {
        n = n_+10;
        b = 1;
        while (b < n) b <<= 1;
        b >>= 1;
        bit = vector<int>(n,0);
    }

    void add(int a,int w) {
        a++;
        for (int x = a;x < n;x += x&-x) bit[x] += w;
    }

    int sum(int a) {
        a++;
        int ret = 0;
        for (int x = a;x > 0;x -= x&-x) ret += bit[x];
        return ret;
    }

    void update(int a,int w) {
        // a++;
        int v = w-sum(a)+sum(a-1);
        add(a,v);
    }

    int lower_bound(int w) {
        if (w <= 0) return 0;
        int x = 0;
        for (int k = b;k > 0;k /= 2) {
            if (x+k < n && bit[x+k] < w) {
                w -= bit[x+k];
                x += k;
            }
        }
        return x;
    }
};

struct query {
    int l,r,i;
    bool operator<(const query& a) const {
        return r < a.r;
    }
};

int main() {
    int n,q;
    cin >> n >> q;
    vector<int> c(n);
    BinaryIndexedTree bit(n);
    vector<query> a(q);
    vector<int> ans(q),b(n,-1);
    for (int i = 0;i < n;++i) cin >> c[i],c[i]--;
    for (int i = 0;i < q;++i) {
        cin >> a[i].l >> a[i].r;
        a[i].i = i;
    }
    sort(a.begin(),a.end());
    int j = 0;
    for (int i = 0;i < n;++i) {
        if (b[c[i]] >= 0) bit.add(b[c[i]],-1);
        bit.add(i+1,1);
        b[c[i]] = i+1;
        while (j < q && a[j].r <= i+1) {
            ans[a[j].i] = bit.sum(a[j].r)-bit.sum(a[j].l-1);
            j++;
        }
    }
    for (int i = 0;i < q;++i) cout << ans[i] << newl;
}

Measured memory_bytes: 17400
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int N = 3e5 + 7;
int32_t main(){
    IOS;
    int n, d;
    cin  >> n >> d;
    int ans = 0;
    while(n--){
        int x,y;
        cin >> x >>y;
        if(((x*x) + (y*y)) <= (d*d)) ans++;
    }
    cout << ans << endl;
}



Measured memory_bytes: 3644
#include <iostream>

using namespace std;

int main(){
	int X, ans;
	bool stopflag = false;
	cin >> X;
	while (!stopflag){
		stopflag = true;
		for (int i = 2; i<X; i++){
			if (X%i == 0) {
				X++;
				stopflag = false;
				break;
			}
		}
		ans = X;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
R,C = map(int,input().split())

table =[[0]*(C+1) for i in range(R+1)]

for row in range(R):
    work = list(map(int,input().split()))
    for col in range(C):
        table[row][col] = work[col]

for row in range(R):
    for col in range(C):
        table[row][C] += table[row][col]

for col in range(C+1):
    for row in range(R):
        table[R][col] += table[row][col]

for row in range(0,R+1):
    print("%d"%(table[row][0]),end="")
    for col in range(1,C+1):
        print(" %d"%(table[row][col]),end = "")
    print()




Measured memory_bytes: 6208
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define sd(a) scanf("%d", &a)
#define sd2(a,b) scanf("%d%d", &a, &b)
#define sd3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sld(a) scanf("%lld", &a)
#define sld2(a,b) scanf("%lld%lld", &a, &b)
#define sld3(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define pd(a) printf("%d", a)
#define pld(a) printf("%lld", a)
#define sp printf(" ")
#define nl printf("\n")
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define clr(a, val) memset((a), (val), sizeof(a))
#define pb push_back
#define endl "\n"
#define mp(a, b) make_pair(a, b)
#define pii pair<int, int>
#define xx first
#define yy second
#define mx 100001
int main()
{
	int a,b,c;sd3(a,b,c);
	if(a==b)
		pd(c);
	else if(b==c)
		pd(a);
	else
		pd(b);
	nl;
}

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

int f[120000];

int main() {
    for(int i = 1;i <= 100;i ++) {
        for(int j = 1;j <= 100;j ++) {
            for(int k = 1;k <= 100;k ++) {
                f[i*i+j*j+k*k+i*j+i*k+j*k] ++;
            }
        }
    }
    int n;
    cin >> n;
    for(int i = 1;i <= n;i ++) printf("%d\n", f[i]);
    return 0;
}

Measured memory_bytes: 3924
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

LL heights[110];

LL steps(LL l, LL r, LL h) {
	if(l > r)	return 0;
	LL min = l;
	rep(i, l, r+1) {
		if(heights[i] < heights[min])	min = i;
	}
	VLL minimas;
	rep(i, l, r+1)	if(heights[i] == heights[min])	minimas.push_back(i);
	minimas.push_back(r+1);
	LL ans = heights[min] - h;
	LL prev = l;
	rep(it, minimas.begin(), minimas.end()) {
		ans += steps(prev, *it-1, heights[min]);
		prev = *it+1;
	}
	return ans;
}

int main() {
	sll(n);
	rep(i, 0, n)	heights[i] = scanLong();
	pll(steps(0, n-1, 0)); nl;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define in(x, l, r) (ll)(l) <= (x) && (x) < (ll)(r)

int main() {
    int N, M;
    cin >> N >> M;
    dsu d(N);
    rep(i,0,M) {
        int A, B;
        cin >> A >> B;
        d.merge(A-1,B-1);
    }
    cout << d.groups().size() - 1 << endl;
}

Measured memory_bytes: 8856
import java.util.*;

class Main {
    public static void main(String[] args) {
        String line = new Scanner(System.in).nextLine();
        int sum = 0;
        for (int i = 0; i < line.length(); i++) {
            if (line.charAt(i) == '1') {
                sum++;
            }
        }
        System.out.println(sum);
    }
}


Measured memory_bytes: 21844
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <iostream>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
double a[1050];
int main(){
    int n;
    s(n)
    for(int i = 0; i < n; i ++){
        slf(a[i])
    }
    sort(a,a+n);

    for(int i = 1; i < n; i ++){
        a[i] = (a[i-1]+a[i])/2.0;
    }
    plf(a[n-1]) pn

    return 0;
}


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

#define ll long long
#define REP(x,n) for(int x=0;x<n;x++)

// vector 操作  vector<int> data(10,5) 10が5個　data(10) 要素数10
// v.size(), v.empty(), v.insert(itr,値), v.erase(itr) (first,last),
// sort(itr), find(all(x),値),reverse(itr),accumulate(itr,0) 積算,
//v.swap
// stringも同じ itrがただの数字になる
// s.substr(n,m)n番目以降m文字取り出す　erase(n,m)も  s.find
#define vei vector<int> 
#define velli vector<long long int> 
#define pb(x) push_back(x) // 末尾にxを加える
#define pb2 pop_back() // 末尾削除
#define all(x) (x).begin(),(x).end() //イテレーター
#define be(x) (x).begin()

using namespace std;

int main (){

    int n,m;
    cin >> n >> m;
    if(n==m) {
        cout << "Yes" << endl;
    }
    else {
    cout << "No"<< endl;
    }

}

Measured memory_bytes: 256
n = int(input())
v = list(map(int, input().split()))

v_s = sorted(v)

for i in range(len(v_s)-1):
    v_s[i+1] = (v_s[i] + v_s[i+1]) / 2
    v_s[i] = 0

print(sum(v_s))

Measured memory_bytes: 3060
#include<stdio.h>

int main(){
  int h[10000], w[10000], i, j, k = 0;
  while(1){
    scanf("%d %d", &h[k], &w[k]);
    if(h[k] == 0 && w[k] == 0)
      break;
    k++;
  }

  k = 0;
  while(1){
    if(h[k] == 0 && w[k] == 0)
      break;
    for(i = 1; i <= h[k]; i++){
      for(j = 1; j <= w[k]; j++){
        if(i == 1 || i == h[k] || j == 1 || j == w[k])
          printf("#");
        else
          printf(".");
      }
      printf("\n");
    }
    printf("\n");
    k++;
  }

  return 0;
}



Measured memory_bytes: 2052
from collections import deque
N=int(input())
ab=list(list(map(int,input().split()))for _ in range(N-1))
c=list(map(int,input().split()))
c.sort(reverse=True)
graph=[[] for _ in range(N+1)]
for a,b in ab:
    graph[a].append(b)
    graph[b].append(a)
queue=deque([1])
ans=[[] for _ in range(N+1)]
sumans=-c[0]
c=deque(c)
while len(queue)>0:
    x=queue.popleft()
    y=c.popleft()
    ans[x].append(y)
    sumans+=y
    for i in graph[x]:
        if ans[i]==[]:
            queue.append(i)
print(sumans)
for j in ans[1:]:
    print(*j,end=' ')


Measured memory_bytes: 8448
#include <bits/stdc++.h>
#define mod 1000000007
#define ull unsigned ll
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi acos(-1)
#define nu 100
#define INF 100000000000
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#define F(i,a,n) for(ll i=a;i<n;i++)
#define B(i,a,n) for(ll i=n-1;i>=a;i--)

#define tc int t;cin>>t;while(t--)
#define tcf ll t;cin>>t;for(int w=1;w<=t;w++)

using namespace std;

ll binpow(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
        {
            res *= a;
        }
        a *= a;
        b >>= 1;
    }
    return res;
}
void dex(int a)
{
    if (a == 1)
        cout << "1\n";
    else if (a == -1)
        cout << "-1\n";
    else if (a == 0)
        cout << "0\n";
    else if (a == 2)
        cout << "YES\n";
    else if (a == 3)
        cout << "NO\n";
}


int main()
{

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

    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ll ct = 0;
    bool flag = false;
    tc{

        ll x, y;
        cin >> x >> y;
        if (x == y)
        {
            ct++;
            if (ct >= 3)
            {
                flag = true;
            }
        }
        else
        {
            ct = 0;
        }

    }
    if (flag)
    {
        cout << "Yes\n";
    }
    else
    {
        cout << "No\n";
    }

    return 0;

}

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

using namespace std;

int main(){

    int N;
    string S;

    cin >> N >> S;

    if(N % 2){
        cout << "No" << endl;
        return 0;
    }

    string T1, T2;

    T1 = S.substr(0,N/2);
    T2 = S.substr(N/2);

    if(T1.compare(T2)){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }

    return 0;
}

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

int main(){

	while(true){
		int n;
		cin >> n;
		
		if(n==0)
			break;
		
		char c[100];
		for(int i=0; i<n; i++){
			cin >> c[i];
		}
		
		int cnt[26] = {0};
		
		for(int i=0; i<n; i++){
			cnt[(int)(c[i]-'A')]++;
		
			int max1 = -1;
			int max2 = -1;
		
			for(int j=0; j<26; j++){
				if(cnt[j]>max1){
					max2 = max1;
					max1 = cnt[j];
				}
				else if(cnt[j]>max2){
					max2 =cnt[j];
				}
			}

			if(max1-max2>n-(i+1)){
				for(int j=0; j<26; j++){
					if(cnt[j]==max1){
						cout << (char)(j+'A') << ' ';
						break;
					}
				}
				cout << (i+1) << endl;
				break;
			}	
			
			if(i==n-1){
				cout << "TIE" << endl;
				break;
			}
		}
	}
		
	return 0;
}
			

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


int main() {
	int n;
	cin >> n;
	vector<int> s(n);
	for(int i=0; i<n; i++){
		cin >> s.at(i);
	}

	long long res=0;
	int sum = 0;
	int right = 0;


	for(int left=0; left<n; left++){
		while(right<n && (sum^s.at(right)) == (sum+s.at(right))){
			sum += s.at(right);
			right++;
		}
		res += right-left;
		if(left == right) right++;
		else{
			sum -= s.at(left);
		}
	}
	cout << res << endl;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {

  int H,N;cin>>H>>N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  
  int sum=0;  
  for(int i=0;i<N;i++){
    sum+=vec.at(i);
  }
  
  if(sum>=H){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,ll>
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 100009;
ll i,n,ans;
string a,b,c;
set<char> s;
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n>>a>>b>>c;
    rep(i,0,n){
        s.clear();
        s.insert(a[i]);
        s.insert(b[i]);
        s.insert(c[i]);
        ans += s.size() - 1;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

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

    long l = sc.nextInt();
    long r = sc.nextInt();
    
    long ans = 2019;
    LABEL:for (long i = l; i < r; i++) {
      for (long j = l + 1; j <= r; j++) {
        ans = Math.min(ans, (i * j) % 2019);
        if (ans == 0) break LABEL;
      }
    }
    
    System.out.println(ans);
  }
}


Measured memory_bytes: 21844
def resolve():
    import sys
    input = sys.stdin.readline
    # row = [int(x) for x in input().rstrip().split(" ")]
    # n = int(input().rstrip())
    s = input().rstrip()
    chars = set()
    for c in s:
        if c in chars:
            print("no")
            return
        else:
            chars.add(c)

    print("yes")




if __name__ == "__main__":
    resolve()


Measured memory_bytes: 61824
use proconio::input;

fn main() {
    input! {
        n: usize,
        p: usize,
    }

    let sqrt = (p as f64).sqrt().ceil() as usize;

    let mut ans = 1;
    let mut rem = p;
    for i in 2..=sqrt {
        let mut count = 0;
        while rem > 0 {
            if rem % i != 0 {
                break;
            } 
            rem /= i;
            count += 1;
        }
        if count >= n {
            ans *= i.pow((count / n) as u32);
        }
    }

    if n == 1 {
        ans = p;
    }

    println!("{}", ans);
}


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

char s[100];
int n;
int f[100][30];
int ans[30];

int main(){
	scanf("%d",&n);
	for ( int i= 0; i < n; i++){
		scanf("%s",&s);
		int m = strlen(s);
		for ( int j = 0; j < m; j++ ){
			f[i][s[j]-'a']++;
		}
	}	
	
	for ( int i = 0; i < 26; i++ ){
		ans[i] = f[0][i];
	}
	for ( int i =1 ; i < n; i++){
		for ( int j = 0; j < 26; j++) ans[j] = min(ans[j],f[i][j]);
	}
	
	for ( int i = 0; i < 26; i++){
		while ( ans[i] > 0 ){
			printf("%c",i+'a');
			ans[i]--;
		}
	}
	puts("");
	return 0;
}

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

using namespace std;
using ll = long long;

const int N = (int)1e6 + 5;

int main() {
  ios :: sync_with_stdio(0);
  cin.tie(0);
  int x, y;
  cin >> x >> y;
  for (int i = 0; i <= x; ++i) {
    for (int j = 0; j <= x; ++j) {
      if (i + j == x && i * 2 + j * 4 == y) {
        cout << "Yes";
        return 0;
      }
    }
  }
  cout << "No";
  return 0;
}

Measured memory_bytes: 3640
s = gets.chomp
n = s.size

ilr = [] # [1, 1, 2], [3, 1, 1]
i = 0
while i < n
  cnt = 0
  while s[i] == "R" && i < n
    cnt += 1
    i += 1
  end
  rl = i - 1
  r = cnt
  cnt = 0
  while s[i] == "L" && i < n
    cnt += 1
    i += 1
  end
  ilr << [rl, cnt, r]
end

res = Array.new(n, 0)
ilr.each do |i, l, r|
  res[i] = l / 2 + (r + 1) / 2
  res[i + 1] = r / 2 + (l + 1) / 2
end
puts res.join(" ")

Measured memory_bytes: 19060
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,f[20][20],dp[(1<<17)+5],dp2[(1<<17)+5],p[(1<<17)+5],pi,pas,tt;
pair <long long, long long> z[(1<<17)+5];
void rec(long long q, long long w){
    if(q>pi){
            if(w==0) return;
        if(dp[b]<dp[b-w]+dp2[w]) dp[b]=dp[b-w]+dp2[w];
        return;
    }
    rec(q+1,w);
    rec(q+1,w+(1<<p[q]));
}
int main(){
    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>>a;
    for(b=1; b<=a; b++){
        for(c=1; c<=a; c++) cin>>f[b][c];
    }
    pi=0;
    for(b=1; b<(1<<(a+1)); b++){
        pi=0;
        if(b%2==1) continue;
        for(c=1; c<=a; c++){
            if((b&(1<<c))!=0){
                pi++;
                p[pi]=c;
            }
        }
        for(c=1; c<pi; c++){
            for(d=c+1; d<=pi; d++){
                dp2[b]+=f[p[c]][p[d]];
            }
        }
    }
    e=0;
    for(b=1; b<(1<<(a+1)); b++){
        d=0;
        if(b%2==1) continue;
    e++;
        for(c=1; c<=a; c++){
            if((b&(1<<c))!=0){
                d++;
            }
        }
        z[e].first=d;
        z[e].second=b;
    }
    sort(z+1,z+e+1);
    for(b=1; b<(1<<(a+1)); b++){
            e=b;
        b=z[b].second;
        pi=0;
        for(c=1; c<=a; c++){
            if((b&(1<<c))!=0){
                pi++;
                p[pi]=c;
            }
        }
        rec(1,0);
        if(pas<dp[b]) pas=dp[b];
        b=e;
    }
    cout<<pas;
    return 0;
}


Measured memory_bytes: 4352
#include<string>
#include <iostream>
#include<vector>
#define T long long

int main(void){
	T n,m;
	std::cin >>n>>m;
	for(int i=0;i<m;i++){
		T tmp;
		std::cin>>tmp;
		n-=tmp;
	}
	if(n<0){
		std::cout<<(-1)<<std::endl;
	}else{
		std::cout<<n<<std::endl;
	}
}


Measured memory_bytes: 3636
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Main main = new Main();

		try (Scanner scan = new Scanner(System.in)) {
			main.changingACharchter(scan);
		}
	}

	private void changingACharchter(Scanner scan) {
		scan.nextInt();
		int k = scan.nextInt();
		char[] s = scan.next().toCharArray();

		s[k - 1] = Character.toLowerCase(s[k - 1]);
		System.out.println(new String(s));

	}

}


Measured memory_bytes: 21716
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate#,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys

setrecursionlimit(10**6)
input=stdin.readline

n=int(input().rstrip())
info=[]
num=[]
ans=0
for _ in range(n):
    a=int(input().rstrip())
    num.append(a)
    x=[tuple(map(int,input().split())) for _ in range(a)]
    info.append(x)
for i in range(2**n):
    s=bin(i)[2:].zfill(n)
    now=s.count("1")
    check=[bool(int(ii)) for ii in s]
    ch=True
    for j in range(n):
        if (not ch) or (not check[j]): continue
        for k in range(num[j]):
            if check[info[j][k][0]-1]!=bool(info[j][k][1]):
                ch=False
                break
    if ch:
        ans=max(ans,now)
print(ans)

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

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

	ll x;
	cin >> x;

	ll ans = x / 11 * 2;
	x -= ans / 2 * 11;
	if(0 < x && x <= 6) ans++;
	else if(7 <= x && x <= 11) ans += 2;
	cout << ans << endl;
}

Measured memory_bytes: 256