akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
class Program{
    static void Main(string[] args){
    const int MOD = 2019;
    var vals = Console.ReadLine().Split().Select(x => int.Parse(x)).ToList();
    int L=vals[0];
    int R=vals[1];
    long ans=2020;
    if(L%MOD<R%MOD&&(R-L)<MOD){
        for(int i=L%MOD;i<R%MOD;i++){
           for(int j=i+1;j<=R%MOD;j++){
            long tmp=i*j%MOD;
            ans=Math.Min(tmp,ans);
        }
        }
    }
    else {ans=0;}
    Console.WriteLine(ans);
    }
}

Measured memory_bytes: 13268
#include <iostream>
#include <cstdio>
using namespace std;
//菱形
bool rhombus(int a, int b, int c) {
    return(a == b && (a < c < a + b));
}
//長方形
bool rectangle(int a, int b, int c) {
    return(a != b && (a*a + b*b == c*c));
}
int main(void) {
    int a, b, c;
    int ans1 = 0, ans2 = 0;
    while(scanf("%d,%d,%d", &a, &b, &c) != EOF) {
        if(rectangle(a, b, c)) ans1++;
        else if(rhombus(a, b, c)) ans2++;
    }
    cout << ans1 << endl << ans2 << endl;
    return(0);
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (ll i=0; i<(n); ++i)
typedef long long ll;
bool debug=false;
string yes = "Yes";
string no = "No";
ll mod = 1000000007;
int main(){
  ll n; cin >> n;
  vector<vector<pair<ll,ll>>> vec(n);
  rep(i,n-1){
    ll u,v,w; cin >> u >> v >> w;
    vec[u-1].push_back(pair<ll,ll>(v-1,w));
    vec[v-1].push_back(pair<ll,ll>(u-1,w));
  }
  vector<ll> col(n, 0);
  auto dfs = [&](auto dfs, ll prev, ll cur, ll dist)-> void{
    if(dist%2==1) col[cur]=1;
    vector<pair<ll,ll>> vp = vec[cur];
    for(auto p: vp){
      ll point = p.first;
      ll len = p.second;
      if(point==prev) continue;
      dfs(dfs, cur, point, (dist+len));
    }
  };
  dfs(dfs, -1, 0, 0);
  for(auto e:col){
    cout << e << endl;
  }
  return 0;
}

Measured memory_bytes: 12544
import java.util.Arrays;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();

		int[] c = {a + b, a - b, a * b};

		Arrays.sort(c);

		System.out.println(c[2]);
	}
}

Measured memory_bytes: 21972
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
const int maxn=(int)1e5+10;
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
struct node{
	int to,nxt;
}ed[maxn<<1];
int head[maxn],cnt;
void addedge(int u,int v){
	ed[cnt].to=v;
	ed[cnt].nxt=head[u];
	head[u]=cnt++;
}
int st[maxn],d[maxn],c[maxn],mark[maxn],dis[maxn],col[maxn];
vector<int>vx;
int main()
{
	int n,m;
	memset(head,-1,sizeof(head));
	memset(mark,-1,sizeof(mark));
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		int u,v;
		u=read(),v=read();
		addedge(u,v);
		addedge(v,u);
	}
	int q;
	scanf("%d",&q);
	for(int i=1;i<=q;i++){
		st[i]=read();d[i]=read();c[i]=read();
	}
	for(int i=q;i>=1;i--){
		if(d[i]<=mark[st[i]])continue;
		queue<int>q;
		q.push(st[i]);
		while(!q.empty()){
			int u=q.front();q.pop();
			if(dis[u]+mark[u]>=d[i])continue;
			if(col[u]==0)col[u]=c[i];	
			mark[u]=d[i]-dis[u];
			for(int j=head[u];~j;j=ed[j].nxt){
				int v=ed[j].to;
				if(dis[v]==0&&v!=st[i]&&dis[u]<d[i]){
					dis[v]=dis[u]+1;
					vx.push_back(v);
					q.push(v);
				}
			}
		}
		for(int j=0;j<vx.size();j++)dis[vx[j]]=0;
		vx.clear();
	}
	for(int i=1;i<=n;i++)printf("%d\n",col[i]);
	return 0;
}

Measured memory_bytes: 5496
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
    int N; cin >> N;
    vector<LLONG> As(N); for (auto &Ai : As) cin >> Ai;
    sort(As.begin(), As.end());
    if (N % 2 == 1) // N = 2m + 1 のとき
    {
        int m = (N - 1) / 2;
        // p1>=p2<=p3>=... となる場合，大きい方から(m+1)個を奇数番に置き，
        // 小さい方からm個を偶数番に置けばよい
        LLONG ans1 = 0;
        for (int i = 0; i < m - 1; ++i)
        {
            ans1 += As[N - 1 - i] * 2;
        }
        ans1 += As[N - m - 1] + As[N - m];  // 両端は１度ずつ
        for (int i = 0; i < m; ++i)
        {
            ans1 -= As[i] * 2;
        }
        // p1<=p2>=p3>=... となる場合，大きい方からm個を奇数番に置き，
        // 小さい方から(m+1)個を偶数番に置けばよい
        LLONG ans2 = 0;
        for (int i = 0; i < m; ++i)
        {
            ans2 += As[N - 1 - i] * 2;
        }
        for (int i = 0; i < m - 1; ++i)
        {
            ans2 -= As[i] * 2;
        }
        ans2 -= As[m - 1] + As[m];  // 両端は１度ずつ
        cout << max(ans1, ans2) << endl;
    }
    else // N = 2m のとき
    {
        int m = N / 2;
        // p1>=p2<=p3>=... となる場合，大きい方からm個を奇数番に置き，
        // 小さい方からm個を偶数番に置けばよい
        LLONG ans1 = 0;
        for (int i = 0; i < m - 1; ++i)
        {
            ans1 += As[N - 1 - i] * 2;
        }
        ans1 += As[N - m];  // 先頭は１度だけ
        for (int i = 0; i < m - 1; ++i)
        {
            ans1 -= As[i] * 2;
        }
        ans1 -= As[m - 1];  // 最後尾は１度だけ
        // p1<=p2>=p3>=... となる場合，大きい方からm個を奇数番に置き，
        // 小さい方からm個を偶数番に置けばよい
        LLONG ans2 = 0;
        for (int i = 0; i < m - 1; ++i)
        {
            ans2 += As[N - 1 - i] * 2;
        }
        ans2 += As[N - m];  // 最後尾は１度だけ
        for (int i = 0; i < m - 1; ++i)
        {
            ans2 -= As[i] * 2;
        }
        ans2 -= As[m - 1];  // 先頭は１度だけ
        cout << max(ans1, ans2) << endl;
    }
}


Measured memory_bytes: 1024
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
 

//result = Math.pow(num1, num3)
//StringBuffer str = new StringBuffer(hoge1);
//String hoge2 = str.reverse().toString();
//map.containsKey(A)
//Map<String, Integer> map = new HashMap<String, Integer>(n);
//ArrayList<String> cc = new ArrayList<>(n);
//Collections.sort(list);
//Array.sort(list);
//Arrays.asList(c).contains("a")

public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	//static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	
	
	public static void main(String[] args) {
	int a=sc.nextInt();
	int b=sc.nextInt();
	List<String> cc=new ArrayList<String>(2);
	String tmp1="";
	String tmp2="";
		for(int i=0;i<a;i++) {
			tmp1=tmp1+b;
		}
	
		for(int i=0;i<b;i++) {
			tmp2=tmp2+a;
		}
      cc.add(tmp1);
      cc.add(tmp2);
		Collections.sort(cc);
		p(cc.get(0));
	
 }
}


Measured memory_bytes: 22612
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    int[][] P;
    int[] A;
    int N,M,Q;

    public Main(){
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        M = scanner.nextInt();
        Q = scanner.nextInt();

        P = new int[Q][4];
        for (int i = 0; i < Q; i++) {
            P[i][0] = scanner.nextInt()-1;
            P[i][1] = scanner.nextInt()-1;
            P[i][2] = scanner.nextInt();
            P[i][3] = scanner.nextInt();
        }

        A = new int[N+1];
        Arrays.fill(A, 1);
        A[N] = M;

        System.out.println(search(N-1));
    }

    int search(int index){
        if(index < 0){
            int points = 0;
            for (int i = 0; i < Q; i++) {
                if (A[P[i][1]] - A[P[i][0]] == P[i][2]) points += P[i][3];
            }
            return points;
        }
      
        if(A[index] > A[index+1]) return 0;

        int V1, V2;
        A[index] += 1;
        V1 = search(index);
        A[index] -= 1;
        V2 = search(index-1);

        return Math.max(V1, V2);
    }

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


Measured memory_bytes: 37492
#include <iostream>
#include <stdio.h>
#include <cctype>
using namespace std;

char changeType(char s)
{
	if(islower(s) != 0)			return toupper(s);
	else if(isupper(s) != 0)	return tolower(s);
	else						return s;
}

int main(void)
{
	char str;

	while(1) {
		str = getchar();

		if(str == '\n')	break;
		str = changeType(str);

		putchar(str);
	}

	cout << endl;

	return 0;
}

Measured memory_bytes: 1108
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
int main() {
    long long A,B,C;
    cin>>A>>B;
    C=A*B;
    cout<<C<<endl;
    return 0;
}

Measured memory_bytes: 3636
N = gets.to_i
A = Array.new(N){gets.split.map &:to_i}
DP = [[0,0,0]]

N.times do |i|
    n = i + 1
    DP[n] = [0,0,0]
    3.times do |j|
        k = (j + 1) % 3
        l = (j + 2) % 3
        DP[n][j] = A[i][j] + [DP[i][k], DP[i][l]].max
    end
end

p DP[N].max

Measured memory_bytes: 15996
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
using namespace std;

#define ll long long int

int main()
{
    int n, m, X, Y;
    int x[100], y[100];
    int zs, ze;
    cin >> n >> m >> X >> Y;
    for (int i = 0; i < n; i++)
        cin >> x[i];
    for (int i = 0; i < m; i++)
        cin >> y[i];
    sort(x, x + n);
    sort(y, y + m);
    if (x[n - 1] <= y[0])
    {
        zs = x[n - 1] + 1;
        ze = y[0];
        for (int i = zs; i <= ze; i++)
        {
            if (i > X && i <= Y)
            {
                cout << "No War" << endl;
                return 0;
            }
        }
        cout << "War" << endl;
    }
    else
    {
        cout << "War" << endl;
    }
}


Measured memory_bytes: 256
// ※※※ 解答不能 ※※※
// 正答者の解答を勉強する.
// pekempey氏.
// https://atcoder.jp/contests/abc137/submissions/6816685
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)

using namespace std;
using ll = long long;

int MOD;

class mint{
    int n;
public:
    mint(int n_ = 0) : n(n_) {}
    explicit operator int() { return n; }
    friend mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
    friend mint operator+(mint a, mint b) { int x = a.n + b.n; return x - (x >= MOD) * MOD; }
    friend mint operator-(mint a, mint b) { int x = a.n - b.n; return x + (x < 0) * MOD; }
    friend mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
    friend mint &operator+=(mint &a, mint b) { return a = a + b; }
    friend mint &operator-=(mint &a, mint b) { return a = a - b; }
    friend mint &operator*=(mint &a, mint b) { return a = a * b; }
    friend bool operator==(mint a, mint b) { return a.n == b.n; }
    friend bool operator!=(mint a, mint b) { return a.n != b.n; }
    friend istream &operator>>(istream &i, mint &a) { return i >> a.n; }
    friend ostream &operator<<(ostream &o, mint a) { return o << a.n; }
};

mint modinv(mint n){
    int a = (int)n;
    int b = MOD;
    int s = 1;
    int t = 0;
    while(b != 0){
        int q = a / b;
        a -= q * b;
        s -= q * t;
        swap(a, b);
        swap(s, t);
    }
    if(s < 0) s += MOD;
    return s;
}

vector<mint> prod(vector<mint> a, vector<mint> b){
    const int n = a.size();
    const int m = b.size();
    vector<mint> ans(n + m - 1);
    rep(i, n) rep(j, m) ans[i + j] += a[i] * b[j];
    return ans;
}

// a / (x - b)
vector<mint> quot(vector<mint> a, mint b){
    const int n = a.size();
    vector<mint> ans(n - 1);
    for(int i = n - 1; i >= 1; i--){
        ans[i - 1] = a[i];
        a[i - 1] += a[i] * b;
    }
    return ans;
}

int main(){
    
    scanf("%d", &MOD);
    int N = MOD;
    vector<mint> a(N); rep(i, N) scanf("%d", &a[i]);
    vector<mint> b(N);
    vector<mint> f(1);
    f[0] = 1;
    rep(i, N) f = prod(f, vector<mint>{-mint(i), 1});
    rep(i, N){
        mint p = 1;
        rep(j, N) if (i != j) p *= mint(i) - mint(j);
        p = a[i] * modinv(p);
        // (x-0) ... (x-N+1)
        auto g = quot(f, i);
        rep(j, N) b[j] += p * g[j];
    }
    rep(i, N) printf("%d ", b[i]);
    return 0;
    
}

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

int main() {
    int n; cin >> n;
    vector<int> vec(n);
    rep(i,n) {
        cin >> vec.at(i);
    }
    vector<int> vec_2 = vec;
    sort(vec_2.begin(), vec_2.end(), std::greater<int>());
    rep(i, n){
        if(vec.at(i) != vec_2.at(0)) cout << vec_2.at(0) << endl;
        else{
            cout << vec_2.at(1) << endl;
        }
    }

    return 0;
}



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

using namespace std;

long long INF=1e15;

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

    while(1){
        int n,r;
        cin>>n>>r;
        if(n+r==0)break;

        vector<int> a(n);
        for(int i=0;i<n;i++)a[i]=n-i;

        for(int i=0;i<r;i++){
            int p,c;
            cin>>p>>c;
            vector<int> b(p);
            for(int j=0;j<p-1;j++)b[j]=a[j];
            for(int j=0;j<c;j++)a[j]=a[p+j-1];
            for(int j=c;j<c+p-1;j++)a[j]=b[j-c];
        }
        cout<<a[0]<<endl;
    }
}


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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

constexpr int64 P = 1000000007;

struct FiniteField {
 private:
  int64 x;
  static inline int64 Normalize(int64 x) {
    if (0 <= x && x < P) return x; x %= P; if (x < 0) x += P; return x;
  }
 public:
  FiniteField(int64 x) : x(Normalize(x)) {}
  FiniteField() : x(0) {}
  int64 Value() const { return x; }
  inline FiniteField operator+(FiniteField o) const {
    FiniteField r(*this); r += o; return r;
  }
  inline FiniteField operator-(FiniteField o) const {
    FiniteField r(*this); r -= o; return r;
  }
  inline FiniteField operator* (FiniteField o) const {
    FiniteField r(*this); r *= o; return r;
  }
  inline FiniteField operator/ (FiniteField o) const {
    FiniteField r(*this); r /= o; return r;
  }
  inline void operator+= (FiniteField o) { x = (x + o.x) % P; }
  inline void operator-= (FiniteField o) { x = (x + P - o.x) % P; }
  inline void operator*= (FiniteField o) { x = (x * o.x) % P; }
  void operator/=(FiniteField o) {
    int64 p = P - 2; while (p) { if (p % 2) { *this *= o; } o *= o; p /= 2; }
  }
};

FiniteField Power(FiniteField x, int p) {
  if (p < 0) return FiniteField(1) / Power(x, -p);
  FiniteField value = 1;
  while (p) {
    if (p % 2) value *= x;
    x *= x;
    p /= 2;
  }
  return value;
}

ostream& operator<<(ostream& s, const FiniteField& v) { s << v.Value(); return s; }

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

  int n, k;
  cin >> n >> k;

  vector<int> ds;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ds.push_back(i);
      if (i != n / i) ds.push_back(n / i);
    }
  }
  sort(ds.begin(), ds.end());

  int m = ds.size();
  vector<FiniteField> cs(m);
  FiniteField ans = 0;
  for (int i = 0; i < m; i++) {
    int d = ds[i];
    FiniteField c = Power(FiniteField(k), (d + 1) / 2);
    for (int j = 0; j < i; j++) {
      if (ds[i] % ds[j] == 0) {
        c -= cs[j];
      }
    }
    cs[i] = c;
    
    if (d % 2 == 0) d /= 2;
    ans += c * d;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.compareTo("2019/04/30") < 1) {
			System.out.println("Heisei");
		} 
        else {
			System.out.println("TBD");
		}
	}
}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
#define int  long long
#define tc(t)  int t; cin>>t; while(t--)
#define f(n)    for(int i=0;i<n;i++)
#define endl   "\n"







int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   int n;
   cin>>n;
   n=n-1;
   cout<<n*(n+1)/2<<endl;






}

Measured memory_bytes: 3628
import java.io.*;
import java.io.IOException;
import java.util.*;

@SuppressWarnings({"rawtypes", "unchecked"})
class Main {
    final static int INF = 1 << 28;
    final static long LNF = 1L << 60;
    final static double EPS = 1e-9;
    final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;

    static final long MOD = 1_000_000_007;

    public static void main(String[] args) throws Exception {
        final MyScanner sc = new MyScanner();
        // Failed to jpredict input format
        int N = sc.nextInt();
        
        boolean approve = true;
        for (int i = 0; i < N; i++) {
            int h = sc.nextInt();
            if(h % 2 == 0) {
                if (h % 5 != 0 && h % 3 != 0) {
                    approve = false;
                    break;
                }
            }
        }
        if(approve) System.out.println("APPROVED");
        else System.out.println("DENIED");

    }




    static class MyScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
 
        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String next() {
            return nn();
        }

        String nextLine() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }
 
        char nextChar() {
            return nn().charAt(0);
        }
 
        int nextInt() {
            return Integer.parseInt(nn());
        }
 
        long nextLong() {
            return Long.parseLong(nn());
        }
 
        double nextDouble() {
            return Double.parseDouble(nn());
        }
 
        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
 
        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
    }

}


Measured memory_bytes: 23252
n = gets.to_i
ary = gets.chomp.split.map(&:to_i)
ans = []
(1..n).each do |i|
  t = i
  low = 0
  high = 0
  low = ary[0..i-1]
  high = ary[i..-1]
  ans << (low.inject(:+).to_i - high.inject(:+).to_i).abs
end
puts ans.min

Measured memory_bytes: 1788
import sys
input = sys.stdin.readline

def main():
    W, H, N = map(int, input().split())
    l, r = 0, W
    d, u = 0, H
    for i in range(N):
        x, y, a = map(int, input().split())
        if a == 2:
            r = min(r, x)
        elif a == 1:
            l = max(l, x)
        elif a == 4:
            u = min(u, y)
        else:
            d = max(d, y)
    
    if r-l <= 0 or u-d <= 0:
        print(0)
    else:
        print((r-l) * (u-d))


if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<math.h>
using namespace std;

long long int abss(long long int a)
{
if(a >= 0)
return a;
else
return -a;
}

int main()
{
	long long int n, num[200005], i, sum[200005], res = 9999999999;
	scanf("%lld", &n);
	memset(num, 0, sizeof(num));
	memset(sum, 0, sizeof(sum));
	for (i = 1; i <= n; i++) {
		scanf("%lld", &num[i]);
		sum[i] = sum[i - 1] + num[i];
	}
	for(i = 1;i < n; i++){
	if(abss(sum[n] - sum[i] - sum[i]) <= res)
	  res = abs(sum[n] - sum[i] - sum[i]);

	}
	printf("%lld", res);

	return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;


int main() {
  string s;
  cin >> s;
  rep(i,s.size()){
    cout << 'x';
  }
  cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF 2 << 29
#define MOD 1000000007
#define Yes(f) puts((f)? "Yes" : "No")
#define YES(f) puts((f)? "YES" : "NO")
int gcd(int a, int b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

using Graph = vector<vector<int>>;

int main(){
	int n, k; cin >> n >> k;
	int i = 0;
	for(; n; i++) n /= k;
	cout << i << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int ans = min(a, b) + min(c, d);
    cout << ans;
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

int main() {
  int n;
  cin>>n;;
  bool can=false;
  for(int i=1;i<=50000;i++){
    if(can) break;
    if(i*27/25==n){
      can=true;
      cout<<i<<endl;
    }
  }
  if(!can) cout<<":("<<endl;
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

S = input()

if S.isupper():
    print("A")
else:
    print("a")



Measured memory_bytes: 27144
#include<iostream>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<cstring>

using namespace std;
const int maxn=4e4+100;
const int inf=0x3f3f3f3f;

struct Edge{
    int next;
    int to;
    int w;
    int  c;

}G[maxn];

int inq[maxn];
int dis[maxn];
int head[maxn];
int k=0;


void adde(int v,int to,int w,int c)//加?
{
    G[k].to=to;//第k条?指向的点
    G[k].w=w;//第k条?的??
    G[k].c=c;
    G[k].next=head[v];//与第k条??同起点的上一条?的?存位置
    head[v]=k++;
}

queue<int>Q;

void spfa(int s)
{
        while(!Q.empty())Q.pop();
        memset(inq,0,sizeof(inq));
        memset(dis,inf,sizeof(dis));
        dis[s] = 0;
        inq[s] = 1;
        Q.push(s);
        while(!Q.empty())
        {
                int u = Q.front();
                Q.pop();
                inq[u]=0;
                for(int i=head[u];i!=-1;i=G[i].next)//遍?以u?起点的所有?
                {
                        int v=G[i].to;
                        if(dis[v]>dis[u]+G[i].w)
                        {
                                dis[v]=dis[u]+G[i].w;
                                if(inq[v]==0)
                                {
                                    Q.push(v);
                                    inq[v]=1;
                                }
                        }
                }
                inq[u]=0;

        }
}

int main()
{
        int n,m;
        while(scanf("%d%d",&n,&m)!=EOF)
        {
                if(n==0&m==0)
                        return 0;
                memset(head,-1,sizeof(head));

                k=0;
                for(int i=0;i<m;i++)
                {
                            int a,b,c,d;
                            scanf("%d%d%d%d",&a,&b,&c,&d);
                            adde(a,b,c,d);
                            adde(b,a,c,d);
                }
                spfa(1);
                int ans=0;
                for(int i=2;i<=n;++i)
                {
                        int mi=inf;
                        for(int j=head[i];j!=-1;j=G[j].next)
                        {
                                if(dis[G[j].to]+G[j].w==dis[i]&&G[j].c<mi)
                                        mi=G[j].c;
                        }
                        ans+=mi;
                }
                printf("%d\n",ans);
        }
        return 0;

}

Measured memory_bytes: 4360
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int  n;
int res[505][505];
void dfs(int start,int to,int index){
	if(to-start+1<=1) return;
	for(int i=start;i<to;i++)
		for(int j=i+1;j<=to;j++) res[i][j]=index;
	int mid=(start+to)>>1;
	dfs(start,mid,index+1),dfs(mid+1,to,index+1);
}
int main(){
	cin>>n;
	dfs(1,n,1);

	for(int i=1;i<n;i++)
        for(int j=i+1;j<=n;j++)
	cout<<res[i][j]<<" ";
}



Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
using Int = int64_t;
template <class T>
T gcd(T a, T b) {
    return a % b ? gcd(b, a % b) : b;
}
template <class T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}
int main() {
    Int A, B;
    cin >> A >> B;
    cout << lcm(A, B) << endl;
}


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

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}

typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

int n, res = inf;

int sum(int k) {
	int res = 0;
	while (k) res += k%10, k/= 10;
	return res;
}

int main() {
	cin >> n;
	reps(a,1,n) chmin(res, sum(a) + sum(n-a));
	cout << res;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cstdlib>

void scanData(int *array, int size) {
    for (int i = 0; i < size; ++i) {
        char buffer[100001];
        char *remain;
        scanf("%s", &buffer[0]);
        array[i] = (int)atol(buffer);
    }
}

void print_array(int *array, int size) {
    if (size == 0) return;
    printf("%d ", array[0]);
    print_array(array + 1, size - 1);
}

int count(const int *array, int size) {
    enum Arranged {
        None = -1,
        Ascending,
        Descending
    };

    int splitNum = 0;
    Arranged arranged = array[0] < array[1] ? Ascending : Descending;
    if (array[0] == array[1]) arranged = None;
    for (int i = 1; i < size - 1; ++i) {
        int f = array[i];
        int s = array[i+1];
        if (arranged == None || (arranged == Ascending && f > s) || (arranged == Descending && f < s)) {
            if (arranged != None) {
                splitNum++;
                i++;
            }
            f = array[i];
            s = array[i+1];
            arranged = f < s ? Ascending : Descending;
            if (f == s) arranged = None;
        }
    }

    return splitNum + 1;
}

int main() {
    int *array;
    int array_len;

    scanf("%d", &array_len);
    if (array_len == 1) {
        printf("1");
        return 0;
    }
    array = (int*)malloc(sizeof(int) * (size_t)array_len);

    scanData(array, array_len);
    printf("%d", count(array, array_len));

    free(array);

    return 0;
}

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

namespace Diverta2910_B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] strs = Console.ReadLine().Split();
            int r = int.Parse(strs[0]);
            int g = int.Parse(strs[1]);
            int b = int.Parse(strs[2]);
            int n = int.Parse(strs[3]);

            int _3, _2, _1;

            if (r > g && r > b)
            {
                _3 = r;

                if (g > b)
                {
                    _2 = g;
                    _1 = b;
                }
                else
                {
                    _2 = b;
                    _1 = g;
                }
            }
            else if (g > r && g > b)
            {
                _3 = g;
                if (r > b)
                {
                    _2 = r;
                    _1 = b;
                }
                else
                {
                    _2 = b;
                    _1 = r;
                }
            }
            else
            {
                _3 = b;
                if (r > g)
                {
                    _2 = r;
                    _1 = g;
                }
                else
                {
                    _2 = g;
                    _1 = r;
                }
            }

            int count = 0;

            for (int i = 0; i <= n; i += _3)
            {
                for (int j = i; j <= n; j += _2)
                {
                    if ((n - j) % _1 == 0) { ++count; }
                }

            }

            Console.WriteLine("{0}", count);
        }
    }
}


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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

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

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    ll x;
    cin>>x;
    ll i=1;
    while(i*(i-1)/2<x){
        i++;
    }
    cout<<i-1<<endl;
    



    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007;
struct edge {int to,costa,costb;};

signed main() {
float x;
cin>>x;
int n=x/1.08,m;
for(int i=0;i<3;i++){
    m=n*1.08;
    if(m==x){
        cout<<n;
        return 0;
    }
    n++;
}
cout<<":(";



return 0;


}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N = 2e3 + 5;
const int MOD = 998244353;
void update(int& x, int y){x += y; if(x >= MOD) x -= MOD;}
char s[N];
int C[N][N], f[N][N];
int n;
void init()
{
	C[0][0] = 1;
	for(int i = 1; i <= n; i++){
		C[i][0] = 1;
		for(int j = 1;j <= i; j++)
            C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
	}
}
int main()
{
	scanf("%s",s+1);n=strlen(s+1);
	init();
	int s1 = 0, s0 = 0;
	f[0][0] = 1;
	for(int i = 1; i <= n; i++){
		int t = s[i] - '0';
		s0 += 2 - t;
		s1 += t;
		for(int j=0;j<=min(s1,i);j++){
			if(j) update(f[i][j], f[i - 1][j - 1]);
			if(i-j <= s0) update(f[i][j], f[i - 1][j]);
		}
	}
	int ans = 0;
	for(int i = 0; i <= min(s1, n); i++)
        update(ans, (ll)f[n][i] * C[n][s1-i] % MOD);
	printf("%d", ans);
	return 0;
}


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

int main() {
	int N, K;
	cin >> N >> K;
	vector<int> cnt(N);
	for (int i = 0; i < K; i++) {
		int d;
		cin >> d;
		for (int j = 0; j < d; j++) {
			int tmp;
			cin >> tmp;
			cnt.at(tmp - 1)++;
		}
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (cnt.at(i) == 0) ans++;
	}
	cout << ans << endl;
}

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

#define ll long long int
#define pb push_back
#define RONALDO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pii pair<ll, ll>
#define ff first
#define ss second
#define mod 1000000007
#define vi vector<ll>
#define mi map<ll, ll>
#define Max(x, y, z) max(x, max(y, z))
#define Min(x, y, z) min(x, min(y, z))

//LOVE U MESSI && CRistiano !!

//INSPIRATIONAL MICHAEL PHELPS && USAIN BOLT !!

int main(){
RONALDO;
ll n,f=0;
cin >> n;
vector<pair<ll,ll>> v;
for (ll i = 0;i<n;i++)
{
    ll x,y;
    cin >> x >> y;
    v.pb({x, y});
}
for (ll i = 0;i<n-2;i++)
{
    if(v[i].first==v[i].second && v[i+1].first==v[i+1].second && v[i+2].first==v[i+2].second)
        f = 1;
}
if(f){
        cout<<"Yes\n";
    }else
        cout<<"No\n";
return 0;
}

Measured memory_bytes: 3592
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.StringBuilder
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val n = sc.nextInt()
    val h = Array(n) { sc.nextInt() }
    h[0]--
    for (i in 1 until n) {
        if (h[i - 1] < h[i]) {
            h[i]--
        }
        if (h[i - 1] > h[i]) {
            println("No")
            return
        }
    }
    println("Yes")
}

fun main(args: Array<String>) {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Measured memory_bytes: 46076
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
int dfs(vector<int>&f,int st,int par,vector<vector<int>>&adj){
    for(auto j:adj[st]){
        if(j!=par){
            f[st]++;
            f[st]+=dfs(f,j,st,adj);
        }
    }
    return f[st];
}
ll power(ll x, ll y, ll p)  
{  
    ll res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    cin>>n;
    ll mod=1e9+7;
    if(n<=1)cout<<0<<endl;
    else {
        ll ans=0;
        ans=power(10,n,mod);
        //cout<<ans<<endl;
        ans%=mod;
        ans-=power(9,n,mod);
        if(ans<0)ans+=mod;
        ans%=mod;
        ans-=power(9,n,mod);
        if(ans<0)ans+=mod;
        ans%=mod;
        ans+=power(8,n,mod);
        ans%=mod;
        cout<<ans<<endl;
    }
}
 

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplece_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define Edge pair< i_i, int>
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Endl endl
 
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
 
signed main()
{
    string s;
    cin >> s;
    int ans = 0;
    Rep(i, s.size()/2) {

        bool ok = true;
        rep(j, i) {
            if (s[j] != s[j+i]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            ans = max(ans, i*2);
        }
    }
    cout << ans << endl;





    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <iomanip>
using namespace std;

typedef long long ll;
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define memset(v, h) memset((v), h, sizeof(v))
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using P = pair<ll, ll>;
const int INF = 1001001001;

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

struct uf {
    vector<ll> par;
    vector<ll> sizes;

    uf(int n)
    {
        for(int i = 0; i < n; i++) {
            par.push_back(i);
            sizes.push_back(1);
        }
    }

    ll root(int x) 
    {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) 
    {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
        sizes[ry] = sizes[rx] + sizes[ry];
    }

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

    ll size(int x)
    {
        return sizes[root(x)];
    }
};

struct node
{
    public: ll x;
    public: ll y;

    node(ll xx, ll yy)
    {
        x = xx;
        y = yy;
    }
};

ll comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v[n][r];
}

ll digit(ll num)
{
    if(num < 10)
    {
        return 1;
    }

    ll d = 1;
    ll k = 10;
    while(num >= k)
    {
        d++;
        k *= 10;
    }

    return d;
}

ll digitNum(ll num, ll count)
{
    ll a = (num % (ll) pow((double) 10, (double) count));
    return a / pow(10, count - 1);
}

bool less_abs(int lhs, int rhs) {
    if(lhs < 0)
    {
        lhs *= -1;
    }
    if(rhs < 0)
    {
        rhs *= -1;
    }

    return lhs < rhs;
}

bool IsTrueBit(int bit, int index)
{
    return (bit & (1 << index));
}

int main(){
    ll n, m;
    cin >> n >> m;
    ll ans = n * (n-1) / 2;

    P p[m];
    uf u = uf(n);
    
    rep(i, m){
        ll a, b;
        cin >> a >> b;
        p[i] = P(a-1, b-1);
    }

    vector<ll> list;
    rep(i, m){
        if(i == 0)
        {
            list.push_back(ans);
            continue;
        }
        ll x = m - i;
        if(u.same(p[x].first, p[x].second))
        {
            list.push_back(ans);
            continue;
        }

        ll s = u.size(p[x].first) * u.size(p[x].second);
        u.unite(p[x].first, p[x].second);
        
        ans -= s;
        if(ans < 0)
        {
            ans = 0;
        }
        list.push_back(ans);
    }

    rep(i, m)
    {
        cout << list[m - 1 - i] << endl;
    }

    return 0;
}

Measured memory_bytes: 5356
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <map>
#include <tuple>

#define INF 100100100
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
using namespace std;

 
int main(){
    int n; cin >> n;
    vector<int> a(n);
    map<int, int> mp;
    rep(i,n){
        int x;
        cin >> x;
        mp[x]++;
    }
    int ans = 0;
    for(auto i : mp){
        if(i.second%2 != 0){
            ans++;
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 5376
H,W = map(int,input().split())
S = ["."*(W+2)]+["."+input()+"." for h in range(H)]+["."*(W+2)]

for h in range(1,H+1):
  for w in range(1,W+1):
    if S[h][w]=="#" and S[h-1][w]=="." and S[h+1][w]=="." and S[h][w-1]=="." and S[h][w+1]==".":
      print("No")
      exit()
      
print("Yes")


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

using namespace std;

int main()
{
	int n, y;
	cin >> n >> y;
	for (int i = 0; i <= n; i++)
		for (int j = 0; j <= n - i; j++)
			if (i * 10000 + j * 5000 + (n - i - j) * 1000 == y)
			{
				cout << i << " " << j << " " << n - i - j << endl;
				return 0;
			}
	cout << "-1 -1 -1" << endl;

	return 0;
}


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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

int main() {
    string s; cin >> s;
    vector<int> n(26, 0);
    for(int i = 0; i < s.size(); i++){
        int j = s[i] - 97;
        n[j]++;
    }
    for(int i = 0; i < n.size(); i++){
        if(n[i] == 0){
            char c = i + 97;
            cout << c << endl;
            return 0;
        }
    }
    cout << "None" << endl;
}


Measured memory_bytes: 512
def main():
    N = int(input())
    S = list(input().rstrip())
    vals = [0]
    for s in S:
        if s == "I":
            vals.append(vals[-1] + 1)
        else:
            vals.append(vals[-1] - 1)
    print(max(vals))


if __name__ == '__main__':
    main()


Measured memory_bytes: 61892
#include <iostream>
using namespace std;
void sumOf()
{
	int N;
	while (cin >> N)
	{
		int count = 0;
		for (int a = 0; a < 10; a++)
		{
			for (int b = 0; b < 10; b++)
			{
				for (int c = 0; c < 10; c++)
				{
					for (int d = 0; d < 10; d++)
					{
						if (a + b + c + d == N)
						{
							count++;
						}
					}
				}
			}
		}

		cout << count << endl;

	}

}
int main()
{
	sumOf();
	return 0;
}

Measured memory_bytes: 1160
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
/*ABC109_A
    let ab=read_a();
    let a:i64=ab[0];
    let b:i64=ab[1];
    let mut j=false;
    for c in 1..4{
        if a*b*(c as i64)%2==1{j=true;}
    }
    if j{println!("Yes")} else {println!("No")};
*/

//use std::collections::BTreeSet;
/*ABC109_B
    let n=read_n();
    let mut w:Vec<Vec<char>>=vec!();
    for _ in 0..n{w.push(read_s())};
    //println!("{},{:?}", n,w);
    let mut j=true;
    if w.iter().collect::<BTreeSet<_>>().len() !=n{j=false};
    for i in 0..n-1{
        if w[i][w[i].len()-1]!=w[i+1][0]{j=false};
    }
    if j{println!("Yes");} else {println!("No");}
*/

//fn abs(a:i64)->i64{if a>0{a} else {-a}}
/*ABC109_
    let nx:Vec<i64>=read_a();
    let n=nx[0] as usize;
    let x=nx[1];
    let mut a:Vec<i64>=read_a();
    let mut b:Vec<i64>=vec!();
    for i in 0..n{
        b.push(a[i as usize]-x);
    }
    fn gcd(a: i64, b: i64) -> i64 {
        if b == 0 {a} else {gcd(b, a % b)}
    }
    let mut ans=b[0];
    for i in 0..n{ans=gcd(ans,b[i]);}
    fn abs(a:i64)->i64{if a>0{a} else {-a}}
    ans=abs(ans);
    println!("{}",ans);
*/
    input!{
        h: usize,
        w: usize,
        a: [[i32; w]; h],
    }
    let mut a=a;
    let mut n:usize=0;
    let mut ans=vec![];
    for i in 0..h{
        for j in 0..w{
            if j+1<w{
                if a[i][j]%2==1{
                    n+=1; a[i][j]-=1;a[i][j+1]+=1; ans.push((i+1,j+1,i+1,j+2));
                }
            }else if i+1<h{
                if a[i][j]%2==1{
                    n+=1; a[i][j]-=1;a[i+1][j]+=1; ans.push((i+1,j+1,i+2,j+1));
                }
            }
        }
    }
    println!("{}", n);
    for (x1,y1,x2,y2) in ans{
        println!("{} {} {} {}", x1,y1,x2,y2);
    }





















}

Measured memory_bytes: 12788
MODE = "stdio"
#require 'matrix'
#include Math
line = Array.new

if(defined? MODE)
  line = STDIN.read.split("\n")
else
  tmp = '13
  insert AAA
  insert AAC
  insert AGA
  insert AGG
  insert TTT
  find AAA
  find CCC
  find CCC
  insert CCC
  find CCC
  insert T
  find TTT
  find T'.split("\n")
  tmp.each{|s|
    line << s.strip
  }
end

n = line[0].to_i
dict = {}
(1..n).each do |k|
  cmd, str = line[k].split(" ")
  if cmd == 'insert'
    dict[str] = true
  else
    if dict[str]
      puts "yes"
    else
      puts "no"
    end
  end
end

Measured memory_bytes: 120956
s = int(input())

x2 = 10**9
y2 = 1
x3 = s % (10**9) 
y3 = s // (10**9) 
if x3 > 0:
  x3 = 10**9 - s % (10**9) 
  y3 = s // (10**9) + 1
print("0 0 " + str(10**9) + " 1 " + str(x3) + " " + str(y3))

Measured memory_bytes: 61640