akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, f, n) for (int i = (f); i < (n); i++)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
ll const INF = 1LL << 60;
ll const MAX_L = 100000;

int main() {
    ll X, t;
    cin >> X >> t;

    if (X < t)
        cout << "0" << endl;
    else
        cout << X - t << endl;

    return 0;
}

Measured memory_bytes: 256
//abc155_c.cpp
//Sat Apr  4 20:49:25 2020

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007

using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	map<string,int> mp;
	int m = 0;
	for (int i=0;i<n;i++){
		string s;
		cin >> s;
		auto itr = mp.find(s);
		if (itr != mp.end()){
			mp[s]++;
		}else {
			mp[s] = 1;
		}
		m = max(m,mp[s]);
	}

	vector<string> ans;
	for (auto itr = mp.begin();itr!=mp.end();itr++){
		if (itr->second==m){
			cout << itr->first << endl;
		}
	}


//	printf("%.4f\n",ans);
}

Measured memory_bytes: 27136
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <stdio.h>
#include <queue>
#include <cmath>
#include <utility>
#include <map>

using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);++i)



int main() {
	int A, B;
	cin >> A >> B;
	string S;
	cin >> S;
	if (S[0] == '-') {
		cout << "No";
		return 0;
	}
	int i;
	for (i=0;i<A ; i++) {
		if (S[i] == '-' ) {
			cout << "No";
			return 0;
		}
	}
	if (S[A] != '-') {
		cout << "No";
		return 0;
	}
	for (i=A+1;i<A+B+1; i++) {
		if (S[i] == '-') {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
	return 0;
}

Measured memory_bytes: 256
//#include<bhaai.h>
#include<bits/stdc++.h>
using namespace std;
#define to int64_t
#define mo 1000000007
#define fr(a,e) for(int i=a;i<=e;i++)
#define yah_faster_baby ios_base::sync_with_stdio(0);cin.tie(0);
 
to a,b,m,x[100005],y[100005],p[100005][3];
//vector <int> v[100005];
char s[100005];
int main()
 {  yah_faster_baby
    cin>>a>>b>>m;
    to min1=10000000000,min2=10000000000;
    fr(0,a-1)
    {cin>>x[i];min1=min(min1,x[i]);}
    fr(0,b-1)
    {cin>>y[i];min2=min(min2,y[i]);}
    fr(0,m-1)
    cin>>p[i][0]>>p[i][1]>>p[i][2];
    to ans=min1+min2;
    fr(0,m-1)
    ans=min(ans,x[p[i][0]-1]+y[p[i][1]-1]-p[i][2]);
    cout<<ans;
	return 0;
}
 

Measured memory_bytes: 4224
package main

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

var sc = bufio.NewScanner(os.Stdin)

// 一行の文字列を読み込む
func nextLine() string {
	sc.Scan()
	return sc.Text()
}

// 数値（INT）を読み込む
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {
	s := nextLine()

	result := "Yes"
	for pos, char := range s {
		if (pos+1)%2 == 0 && char == 'R' {
			result = "No"
		} else if (pos+1)%2 == 1 && char == 'L' {
			result = "No"
		}
	}
	fmt.Println(result)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

signed main() {
    string s;
    cin >> s;
    if(s[s.size() - 1] != 's'){
        cout << s << "s" << endl;
    }else{
        cout << s << "es" <<endl;
    }
    return 0;
}

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = sc.nextInt();
            }
        }
        boolean ans = true;
        for (int i = 0; i < 2; i++) {
            if (c[0][i] - c[0][i + 1] != c[1][i] - c[1][i + 1]) {
                ans = false;
                break;
            }
            if (c[1][i] - c[1][i + 1] != c[2][i] - c[2][i + 1]) {
                ans = false;
                break;
            }
        }
        if (ans == true) {
            for (int i = 0; i < 2; i++) {
                if (c[i][0] - c[i + 1][0] != c[i][1] - c[i + 1][1]) {
                    ans = false;
                    break;
                }
                if (c[i][1] - c[i + 1][1] != c[i][2] - c[i + 1][2]) {
                    ans = false;
                    break;
                }
            }
        }
        if (ans == true) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 23124
#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int a, n, m;
    cin >> a >> n >> m;
    int ans = 0;
    for(long long i = a; pow(i, n) <= m; i++){
        long long score = 1;
        for(int j = 0; j < n; j++){
            score *= i;
        }
        if(score == 0) continue;
        long long num = i - a;
        while(score){
            num -= (score % 10);
            score /= 10;
        }
        ans += !num;
    }
    cout << ans << "\n";
}


Measured memory_bytes: 3280
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		long cnt = 0;
		long sum = 0;
		boolean flag = false;
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("W")) {
				cnt++;
				if(flag) {
					sum = sum + (i - cnt + 1);
				}
			} else {
				flag = true;
			}
		}
		
		if(flag) {
			System.out.println(sum);
		} else {
			System.out.println(0);
		}
	}
}


Measured memory_bytes: 38156
def check(offset, words)
  h = {}
  border = words.size / 2.0
  words.each do |w|
    v = h[w]
    h[w] = c = v ? v + 1 : 1
    if c > border
      s = offset + 1
      e = s + 2
      return "#{s} #{e}"
    end
  end
  nil 
end   
      
words = gets.chomp.split('')
(words.size - 3).times do |i|
  parts = words[i, 3]
  result = check(i, parts)
  if result
    puts result
    exit
  end
end
if words.size == 2 && words[0] == words[1]
  puts "1 2"
  exit
end
puts "-1 -1"


Measured memory_bytes: 12284
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        var line = Console.ReadLine();
        var num_array = line.Split(' ').Select(s => int.Parse(s)).ToArray();
        var a = num_array[0];
        var b = num_array[1];
        var c = num_array[2];
        
        var count = 0;
        
        for(int i = a; i <= b; i++){
            if(c % i == 0){
                count++;
            }
        }
        
        Console.WriteLine(count);
        
    }
}



Measured memory_bytes: 20464
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
#define fr first
#define sc second
#define f(i, L, R) for (int i = L; i < R; i++)
#define F(i, t) for (typeof(t.begin()) i = t.begin(); i != t.end(); i++)
void solve()
{
    ll n, k;
    cin >> n >> k;
    vector<ll> Data(n), dp(n);
    for (ll i = 0; i < n; i++)
        cin >> Data[i];
    dp[n - 1] = 0;
    dp[n - 2] = abs(Data[n - 1] - Data[n - 2]);
    for (ll i = n - 3; i >= 0; i--)
    {
        ll Min = LONG_MAX;
        for (ll j = i + 1; j < min(n, i + k + 1); j++)
            Min = min(Min, abs(Data[i] - Data[j]) + dp[j]);
        dp[i] = Min;
    }
    // for (auto x : dp)
        // cout << x << ' ';
    // cout << endl;
    cout << dp[0] << endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll T = 1;
    while (T--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 4784
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
using namespace std;

int solve(int n, vector<string> const & s) {
    int cnt = 0;
    REP (a, n) {
        REP (y, n) REP (x, n) {
            if (s[(y + a) % n][x] != s[(x + a) % n][y]) {
                goto asymmetric;
            }
        }
        cnt += n;
asymmetric: ;
    }
    return cnt;
}

int main() {
    int n; cin >> n;
    vector<string> s(n);
    REP (i, n) cin >> s[i];
    cout << solve(n, s) << endl;
    return 0;
}


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

struct N {
    atcoder::modint998244353 v, b;
};
N op(N l, N r) { return {l.v + r.v, l.b + r.b}; }
N e() { return {0, 0}; }
N app(int l, N r) { return {l ? l * r.b : r.v, r.b}; }
int comp(int l, int r) { return l ? l : r; }
int id() { return 0; }
int main() {
    int n, q;
    cin >> n >> q;
    atcoder::lazy_segtree<N, op, e, int, app, comp, id> t(n);
    N x = {1, 1};
    for(int i = n; i--;)
        t.set(i, x), x.v = x.b *= 10;
    for(int i = 0; i < q; i++) {
        int l, r, d;
        cin >> l >> r >> d;
        t.apply(l - 1, r, d);
        cout << t.all_prod().v.val() << '\n';
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

    ll N; cin >> N;

    ll ans = 0;
    ll NN = N;

    for (ll p = 2;;p++){
        ll cnt = 1;
        while(N%p == 0){
            //cout << p << endl;
            bool f = false;
            for (int i = 0;i < cnt;i++){
                if(N%p == 0){
                    N /= p;
                }else{
                    f = true;
                    break;
                }
            }
            if(f) break;
            cnt++;
            ans++;
        }
        if(p*p > N) break;
    }

    if(N != 1) ans ++;
    cout << ans << endl;

    return 0;

}

Measured memory_bytes: 3652
import java.util.*;
import java.io.*;

public class Main {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 32768);
    static PrintWriter out = new PrintWriter(System.out);
    static StringTokenizer t;

    static String sn() {
        while (t == null || !t.hasMoreTokens()) {
            try {
                t = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return t.nextToken();
    }

    static int ni() {
        return Integer.parseInt(sn());
    }

    static long nlo() {
        return Long.parseLong(sn());
    }

    public static void main(String args[]) {
        int t = 1;//ni();
        while (t-- > 0) {
            solve();
        }
        out.close();
    }

    static long mod = 998244353;

    static long pro(long a, long b) {
        return (a % mod * b % mod) % mod;
    }

    static long add(long a, long b) {
        return (a + b) % mod;
    }

    static int maxn = 200005;


    static void solve() {
        int n = ni();
        int x = ni();
        int l[] = new int[n];
        for (int i = 0; i < n; i++)
            l[i] = ni();
        int d = 0, cnt = 0;
        if (d <= x)
            cnt += 1;
        for (int i = 1; i <= n; i++) {
            d = d + l[i - 1];
            if (d <= x)
                cnt += 1;
        }
        out.println(cnt);
    }
}

Measured memory_bytes: 23124
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

struct UnionFind {
	vector<int> v;
	UnionFind(int n) : v(n) { for (int i = 0; i < n; i++) v[i] = i; }
	int  find(int x) { return v[x] == x ? x : v[x] = find(v[x]); }
	void unite(int x, int y) { v[find(x)] = find(y); }
};

int main() {
	int m, n;
	cin >> m >> n;
	vector<vector<pair<int, int>>> skills(m, vector<pair<int, int>>(n, pair<int, int>(0, 100)));
	REP(i, m) {
		int a;
		cin >> a;
		REP(j, a) {
			int b;
			string c;
			int d;
			cin >> b >> c >> d;
			b--;
			if (c == "<=") {
				skills[i][b] = { skills[i][b].first,min(skills[i][b].second,d) };
			}
			else {
				skills[i][b] = { max(skills[i][b].first,d),skills[i][b].second };
			}
		}
	}
	vi point(n, 100);
	vb get(m, false);
	bool change = false;

	do {
		REP(i, n)
			point[i] = 100;
		change = false;
		REP(i, m) {
			if (!get[i]) {
				REP(j, n) {
					point[j] = min(point[j], skills[i][j].second);
				}
			}
		}
		REP(i, m) {
			if (!get[i]) {
				bool clear = true;
				REP(j, n) {
					if (skills[i][j].first <= point[j] && point[j] <= skills[i][j].second) {

					}
					else {
						clear = false;
						break;
					}
				}
				if (clear) {
					get[i] = true;
					change = true;
				}
			}
		}
	} while (change);
	string ans = "Yes";
	REP(i, m)
		if (!get[i]) {
			ans = "No";
			break;
		}
	cout << ans << endl;
}

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

int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main(){
  int N, A, B;
  cin >> N >> A >> B;
  int total = 0;
  for (int i=0; i<=N; i++){
    int sum=findSumOfDigits(i);
    if (A<=sum && sum<=B) total += i;
  }
  cout << total << endl;
}


Measured memory_bytes: 256
# coding : utf-8

A, B = list(map(int, input().split()))


_list = list(range(A, B+1))
count = 0
buff = 0
for elm in _list:
    buff = 0
    m = str(elm)
    _len = len(m) - 1
    for i in range(3):
        if m[i] == m[4-i]:
            buff += 1
    if buff >= 3:
        count += 1



print(count)
        


Measured memory_bytes: 6516
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != '1') {
                    out.println(s.charAt(i));
                    return;
                }

                if (i + 1 == k) {
                    out.println(1);
                    return;
                }
            }
        }

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    }
}



Measured memory_bytes: 21460
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.bigint, std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
T lcm(T)(T x, T y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998_244_353;
//long mod = 1_000_003;
void moda(T)(ref T x, T y) { x = (x + y) % mod; }
void mods(T)(ref T x, T y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(T)(ref T x, T y) { x = (x * y) % mod; }
void modpow(T)(ref T x, T y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }
void modd(T)(ref T x, T y) { y.modpow(mod - 2); x.modm(y); }

void main()
{
	auto X = RD;
	auto K = RD;
	auto D = RD;

	long ans;
	if (abs(X) / D >= K)
	{
		ans = abs(X) - D * K;
	}
	else
	{
		auto cnt = abs(X) / D;
		auto y = abs(X) - D * cnt;
		auto rem = K - cnt;
		if (rem % 2)
			ans = abs(y - D);
		else
			ans = y;
	}

	writeln(ans);
	stdout.flush;
	debug readln;
}

Measured memory_bytes: 2752
s = list(map(int, input()))

left = s[0]*10 + s[1]
right = s[2]*10 + s[3]

isMonthL = False
isMonthR = False

if 0 < left and left < 13:
    isMonthL = True

if 0 < right and right < 13:
    isMonthR = True

if isMonthR and isMonthL:
    print("AMBIGUOUS")
elif isMonthL and not isMonthR:
    print("MMYY")
elif not isMonthL and isMonthR:
    print("YYMM")
else:
    print("NA")


Measured memory_bytes: 3060
//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;
typedef string::const_iterator State;

int dy[5] = { 0,0,1,-1,0 };
int dx[5] = { 1,-1,0,0 ,0 };


int main(void) {
	
	int n;
	int count = 0;
	


	cin >> n;
	FOR(i, 105, n) {
		if (i == 105 || i == 135 || i == 165 || i == 189 || i == 195) {
			count++;
		}
	}

	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#define fore(i,x,y) for(long long i=x;i<y;i++)
typedef long long ll;
using namespace std;
int main()
{
	string o,e;
	cin>>o>>e;
	for(int i=0;i<o.size();i++){
			cout << o[i];
			if(o.size()!=e.size()&&i==o.size()-1)break;
			cout << e[i];
	}
	cout << endl;
}

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
//https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae
 
using namespace std;
typedef long long ll;


int main()
{
    ll N, M, X, Y;
    cin >> N >> M >> X >> Y;
    ll* x = new ll[N];
    ll* y = new ll[M];
    for(ll i = 0; i < N; i ++){
        cin >> x[i];
    }
    for(ll i = 0; i < M; i ++){
        cin >> y[i];
    }

    sort(x, x + N);
    sort(y, y + M);
    int maxX = max(X, x[N - 1]);
    int minY = min(Y, y[0]);
    if(maxX < minY){
        cout << "No War" << endl;
    }
    else{
        cout << "War" << endl;
    }
}

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


Measured memory_bytes: 768
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        int N = int.Parse(input[0]);
        int K = int.Parse(input[1]);
        string S = Console.ReadLine();

        var conti = new List<int>();
        if (S.Substring(0, 1) == "0") conti.Add(0);
        string f = S.Substring(0, 1);
        int cnt = 1;

        for (int i = 1; i < N; i++)
        {
            if (f == S.Substring(i, 1))
                cnt++;
            else
            {
                conti.Add(cnt);
                f = S.Substring(i, 1);
                cnt = 1;
            }
        }
        conti.Add(cnt);

        if (conti.Count() % 2 == 0)
            conti.Add(0);

        int m = conti.Count() / 2;
        if (K > m) K = m;


        int sum = 0;
        var slist = new List<int>();
        for (int i = 1; i <= m - K + 1; i++)
        {
            int stt = 2 * i - 2;
            int end = stt + K * 2;

            if (sum == 0)
            {
                for (int j = stt; j <= end; j++)
                    sum += conti[j];
            }
            else
            {
                sum -= conti[stt - 2] + conti[stt - 1];
                sum += conti[end - 1] + conti[end];
            }
            slist.Add(sum);
        }
        slist.Sort();
        slist.Reverse();
        Console.WriteLine(slist[0]);
    }
}

Measured memory_bytes: 17424
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
c = 0
for i in range(n):
    for j in range(1,int((n-i-1)/2)+1):
        if len(set([s[i],s[i+j],s[i+j+j]])) == 3:
            c += 1
print((r*g*b) - c)

Measured memory_bytes: 73880
def f(n,aa):
    if sum(aa)==0:
        return "Yes"
    if n%3>0:
        return "No"
    sa=set(aa)
    if len(sa)>3 or len(sa)<2:
        return "No"
    n3 = n / 3
    if len(sa)==3:
        for sak in sa:
            if aa.count(sak)!=n3:
                return "No"
        sa = list(sa)
    elif len(sa)==2:
        for sak in sa:
            if sak!=0:
                k=sak
        if 0 not in sa:
            return "No"
        if aa.count(0)!=n3:
            return "No"
        if aa.count(k)!=n3*2:
            return "No"
        sa=[0,k,k]

    for i in range(3):
        if sa[i - 1] != sa[i - 2] ^ sa[i]:
            break
    else:
        return "Yes"
    return "No"

n=int(input())
aa=list(map(int,input().split()))
print(f(n,aa))


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

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n, k, q;
    cin >> n >> k >> q;
    vector<int> a(q);
    rep(i, q) {
        cin >> a[i];
    }
    vector<int> st(n, k - q);
    rep(i, q)  {
        st[a[i] - 1]++;
    }
    rep(i, n) {
        if(st[i] > 0) {
            cout << "Yes" << "\n";
        }
        if(st[i] <= 0) {
            cout << "No" << "\n";
        }
    }

    return 0;
}


Measured memory_bytes: 3988
#include <cstdio>
void floydwarshall(int a[10][10])
{
	for(int k=0;k<10;k++)
	{
		for(int i=0;i<10;i++)
		{
			for(int j=0;j<10;j++){
				if(k==i || k==j || i==j)
					continue;
				else{
					if(a[i][j] > a[i][k] + a[k][j])
						a[i][j] = a[i][k] + a[k][j];
				}
			}
		}
	}
}
int main()
{
	int h,w; scanf("%d%d",&h,&w);
	int a[10][10];
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			scanf("%d",&a[i][j]);
		}
	}
	int f[10]={0},x;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			scanf("%d",&x);
			if(x!=-1) f[x]+=1;
		}
	}
	floydwarshall(a);
	int sum = 0;
	for(int i=2;i<10;i++){
		sum += f[i]*a[i][1];
	}
	sum += f[0]*a[0][1];
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main() {
	while(1) {
		int n, m;
		cin >> n >> m;
		if((n == 0)&&(m == 0)) {
			break;
		} else {
			vector<int> arr(m, 0);
			int total = 0;
			for(int i = 0; i < n; i++) {
				int d, v;
				cin >> d >> v;
				d--;
				if(arr[d] < v) {
					total -= arr[d];
					arr[d] = v;
					total += arr[d];
				}
			}
			cout << total << endl;

		}
	}
	return 0;
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
int main(void) {
    int n;
    while(~scanf("%d", &n)) {
        bool flag = 0;
        while(n) {
            int t = n % 10;
            if(t == 9) {
                flag = true;
                break;
            }
            n /= 10;
        }
        puts(flag ? "Yes" : "No");
    }
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<cmath>
#include<queue>
#include<limits>
#include<cassert>
#include<set>
#include<tuple>
#include<map>
#include<string.h>
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define None cout<<"None"<<endl
typedef long long ll;
using namespace std;

int main() {
	int H,W; cin >> H >> W;
	string a[H];
	string s = "##";
	for (int i = 0; i < H; ++i) {
		cin >> a[i];
		a[i] = '#' + a[i] + '#';
	}
	for (int i = 0; i < W; ++i) s += '#';
	cout << s << endl;
	for (int i = 0; i < H; ++i) {
		cout << a[i] << endl;
	}
	cout << s << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
char c[125],s[100001],t[100001];
main(){
	c['b']='d',c['d']='b',c['p']='q',c['q']='p';
	scanf("%s",s);
	int l=strlen(s);
	for(int i=0;i<l;++i)t[l-i]=c[s[i]];
	for(int i=0;i<l;++i)
		if(s[i]!=t[i+1])
			return puts("No"),0;
	puts("Yes");
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<int,int>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

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

ll kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}

ll sum(ll l,ll r){
    return(l+r)*(r-l+1)/2;
}

int main(){
ll n,k;
cin>>n>>k;
ll a=1000000007;
ll ans=0;
for(int i=k;i<=n+1;i++){
    ll l=sum(0,i-1),r=sum(n-i+1,n);
    ans+=(r-l+1);
    ans%=a;
}
cout<<ans<<endl;
return 0;
}



Measured memory_bytes: 3600
from itertools import accumulate
n,m = map(int,input().split())
gates = [0]*(n+1)
for i in range(m):
    l,r  = map(int,input().split())
    gates[l-1] += 1
    gates[r] -= 1
gates = list(accumulate(gates))
#print(gates)
ans = gates.count(m)
print(ans)

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

namespace AtCoder.Abc
{
    //https://atcoder.jp/contests/abc141/tasks/abc141_a
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 整数配列の入力
            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

            var a = new long[] {
                1,
                3,
                5,
                7,
                8,
                10,
                12,
            };

            var b = new long[] {
                4, 6, 9, 11
            };
            var c = new long[] {
                2,
            };

            if (a.Contains(inputLongArray[0]) && a.Contains(inputLongArray[1])){

                Console.WriteLine("Yes");
            } else if (b.Contains(inputLongArray[0]) && b.Contains(inputLongArray[1])){

                Console.WriteLine("Yes");
            } else if (c.Contains(inputLongArray[0]) && c.Contains(inputLongArray[1])){

                Console.WriteLine("Yes");
            } else {
                Console.WriteLine("No");

            }

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 13396
// -*- coding:utf-8-unix -*-

use proconio::input;

use num_traits::{pow, One};
use std::ops::{Add, Div, Mul, Sub};

const MODULUS: usize = 1000000007;

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

    // prepare a table of factorials
    let mut fac_vec: Vec<ModP> = Vec::new();
    let mut fac_inv_vec: Vec<ModP> = Vec::new();
    fac_vec.push(ModP(1));
    fac_inv_vec.push(ModP(1));
    for i in 1..(n + 1) {
        fac_vec.push(ModP(i) * fac_vec[i - 1]);
        fac_inv_vec.push(ModP(1) / fac_vec[i]);
    }
    let fac_vec = fac_vec;
    let fac_inv_vec = fac_inv_vec;

    // normalize k
    if k >= n {
        k = n - 1;
    }
    let k = k;

    let mut total = ModP(0);
    for i in 0..(k + 1) {
        let thispart = fac_vec[n]
            * fac_inv_vec[i]
            * fac_inv_vec[n - i]
            * fac_vec[n - 1]
            * fac_inv_vec[n - i - 1]
            * fac_inv_vec[i];
        total = total + thispart;
    }

    println!("{}", total.0);
}

#[derive(Clone, Copy, PartialEq, Debug)]
struct ModP(usize);

impl One for ModP {
    fn one() -> Self {
        return ModP(1);
    }
}
impl Add for ModP {
    type Output = Self;
    fn add(self, rhs: Self) -> Self {
        return ModP((self.0 + rhs.0) % MODULUS);
    }
}
impl Sub for ModP {
    type Output = Self;
    fn sub(self, rhs: Self) -> Self {
        return ModP((self.0 + MODULUS - rhs.0) % MODULUS);
    }
}
impl Mul for ModP {
    type Output = Self;
    fn mul(self, rhs: Self) -> Self {
        return ModP((self.0 * rhs.0) % MODULUS);
    }
}
impl Div for ModP {
    type Output = Self;
    fn div(self, rhs: Self) -> Self {
        if rhs.0 == 0 {
            panic!("Tried to divide by ModP(0)!");
        }
        let rhs_inv = pow(rhs, MODULUS - 2);
        return self * rhs_inv;
    }
}


Measured memory_bytes: 5312
#include <iostream>
#include <cmath>
#include <unordered_set>
using namespace std;
const double eps = 1e-6;
const int N = 2e5 + 5;
typedef long long ll;
char s[N];
int n;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    cin >> (s+1);
    int l = 1,r = n,ans = 0;
    while(l < r) {
        while(l < r && s[l] == 'R') l++;
        while(r > l && s[r] == 'W') r--;
        if(l != r) {
            ans++;
            swap(s[l], s[r]);
            l++;r--;
        }
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 3476
require 'prime'

input = STDIN.read.chomp.split(" ")

N = input[0].to_i
P = input[1].to_i
d = Prime.prime_division(P)

primes = []

if d.length == 0 
  puts 1
elsif N == 1
  puts P
else
  d.sort_by{|r| r[0]}.reverse.each{|r|
    if r[1] >= N
      for j in 1..(r[1] / N)
        primes.push(r[0])
      end
    end
  }
  puts primes.reduce(1){|a, b| a * b}
end

Measured memory_bytes: 2300
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    ll a,b,x,f=0;
    cin>>a>>b>>x;
    ll n=b/x;
    ll m=(a)/x;
    if(a%x==0)
        f=1;
    cout<<(n-m)+f<<endl;

    return 0;
}


Measured memory_bytes: 3664
#include<bits/stdc++.h>
#define LL long long
using namespace std;
static const LL INF = 1LL<<60LL;
typedef pair<int,int> pii;

char Map[1010][1010];

LL J[1010][1010],O[1010][1010],I[1010][1010];
LL m,n,k;
LL a,b,c,d;
LL res_J,res_O,res_I;

int main(){
    cin>>m>>n;
    cin>>k;
    for(int y=1;y<=m;++y){
        for(int x=1;x<=n;++x){
            cin>>Map[y][x];
            if(Map[y][x]=='J'){
                J[y][x]++;
            }
            if(Map[y][x]=='O'){
                O[y][x]++;
            }
            if(Map[y][x]=='I'){
                I[y][x]++;
            }
            J[y][x]+=J[y][x-1];
            O[y][x]+=O[y][x-1];
            I[y][x]+=I[y][x-1];
        }
    }
    for(int i=0;i<k;++i){
        cin>>a>>b>>c>>d;
        int Min=min(a,c);
        int Max=max(a,c);
        for(int y=Min;y<=Max;++y){
            res_J+=J[y][d]-J[y][b-1];
            res_O+=O[y][d]-O[y][b-1];
            res_I+=I[y][d]-I[y][b-1];
        }
        cout<<res_J<<" "<<res_O<<" "<<res_I<<endl;
        res_J=0;
        res_O=0;
        res_I=0;
    }
    return 0;
}

Measured memory_bytes: 26036
#include <iostream>
int main(){
 
    int n = 0,a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
    std::cin >> n >> a >> b >> c >> d;
    
    e = (a-1+n)/a*b;
    f = (c-1+n)/c*d;
    
    if(e > f){
        
     std::cout << f << std::endl;
        
    }else{
     
        std::cout << e << std::endl;
        
    }
    
}


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


/* エイリアス */
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define endl '\n'

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace


/* 関数マクロ */
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; ++i)
#define rep3(i, n, m) for (ll i = n; i >= m; --i)
#define all(v) v.begin(), v.end()
#define si(v) int(v.size())
#define UNIQUE(v) sort(all(v)), v.erase(unique(all(v)),v.end())


/* 定数 */
const ll mod = 1e9 + 7;
const ll infll = (1LL << 62) - 1;
const ll inf = (1LL << 30) - 1;


/* その他 */
template<class S, class T> inline bool chmax(S &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class S, class T> inline bool chmin(S &a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;


signed main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  
  string s; cin >> s;
  int cnt = 0;

  rep(i, si(s)) if (s[i] == '2') ++cnt;
  cout << cnt << endl;
}

Measured memory_bytes: 3572
function div(y, x){
    return Math.floor(y/x);
}
function readInt(str){
    return parseInt(str, 10);
}
function range(begin, end){
    if(begin > end) return range(end, begin).reverse();
    const ans=[];
    for(let i=begin; i<=end; i++){
        ans.push(i);
    }
    return ans;
}
function solve(A,B,K){
    let count=0;
    for(const d of range(100, 1)){
        if(A%d==0 && B%d==0){
            count++;
            if(count==K)return d;
        }
    }
    return 1000000000000;
}
function Main(raw) {
    const input = raw.split("\n");
    const [A,B,K] = input[0].split(" ").map(readInt);
    
    //出力
    console.log("%d", solve(A,B,K));
}

//DO NOT EDIT
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  

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

using namespace std;

typedef long long LL;
#define N 2200

const LL mod=924844033;
LL n,m,ans,fac[N],ifac[N],f[N][N],g[N];

void upd(LL &x,LL y){x=(x+y%mod+mod)%mod;}

void trans(LL len){
	for (LL i=n;~i;--i)
		for (LL j=1;j<=len&&j<=i;++j)
			upd(g[i],g[i-j]*f[len][j]);
}

LL inv(LL x){return x==1?1:(mod-mod/x)*inv(mod%x)%mod;}

LL C(LL x,LL y){return x<y||y<0?0:fac[x]*ifac[y]%mod*ifac[x-y]%mod;}

int main(){
	scanf("%lld%lld",&n,&m);
	fac[0]=1; for (LL i=1;i<=n;++i) fac[i]=fac[i-1]*i%mod;
	ifac[n]=inv(fac[n]); for (LL i=n-1;~i;--i) ifac[i]=ifac[i+1]*(i+1)%mod;
	f[0][0]=1;
	for (LL i=1;i<=n;++i)
		for (LL j=0;j<=i;++j)
			f[i][j]=(f[i-1][j]+(i>1&&j>0?f[i-2][j-1]:0))%mod;
	g[0]=1;
	for (LL i=1;i<=m;++i){
		LL len=(n-i)/m+1;
		trans(len); trans(len);
	}
	for (LL i=0;i<=n;++i)
		upd(ans,g[i]*fac[n-i]*
		(i&1?-1:1));
	printf("%lld\n",ans);
	
	return 0;
}
			

Measured memory_bytes: 33536
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL << 30)
#define LLINF (1LL << 60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int a[20], acnt[2], aa[20], b[20], bcnt[2], p[20], c[20], ccnt[2];
signed main(void) {
  int n, m;
  cin >> n >> m;
  REP(i, n) {
    cin >> a[i];
		aa[i] = a[i];
    acnt[a[i]]++;
  }
  REP(i, m) cin >> p[i];

	int cnt = 0, t1 = 0, t2 = 1;
  REP(i, m) {
    REP(j, p[i]) {
			//cout << cnt << " " << t1 << " " << t2 << endl;
      b[cnt] = t1;
      c[cnt] = t2;
      cnt++;
      bcnt[t1]++;
      ccnt[t2]++;
    }
    swap(t1, t2);
  }

	//REP(i, n) cout << b[i] << " "; cout << endl;
	//REP(i, n) cout << c[i] << " "; cout << endl;

  int ret1 = INF;
  if (bcnt[0] == acnt[0] && bcnt[1] == acnt[1]) {
		ret1 = 0;
    REP(i, n) {
      if (aa[i] != b[i]) {
        int idx = i;
        while (aa[idx] == aa[i])
          idx++;
        for (int j = idx; j > i; --j) {
          swap(aa[j], aa[j - 1]);
          ret1++;
        }
      }
    }
  }

	int ret2 = INF;
	if (ccnt[0] == acnt[0] && ccnt[1] == acnt[1]) {
		ret2 = 0;
    REP(i, n) {
      if (a[i] != c[i]) {
        int idx = i;
        while (a[idx] == a[i])
          idx++;
        for (int j = idx; j > i; --j) {
          swap(a[j], a[j - 1]);
          ret2++;
        }
      }
    }
  }
	//REP(i, n) cout << aa[i] << " "; cout << endl;
	//REP(i, n) cout << a[i] << " "; cout << endl;

	//cout << ret1 << " " << ret2 << endl;
	cout << min(ret1, ret2) << endl;

  return 0;
}

Measured memory_bytes: 3088
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]


N, M = map(int, input().split())
H = [int(i) for i in input().split()]
AB = [list(map(int, input().split())) for i in range(M)]
#s={AB[0][0]}
A = [0]*N
ans = 0
#print(H)


for i in range(M):
    #s.add(AB[i][0])
    #s.add(AB[i][1])
    #print(AB[i][0]-1, AB[i][1]-1)
    #print(H[AB[i][0]-1], H[AB[i][1]-1])
    if(H[AB[i][0]-1]==H[AB[i][1]-1]):
        A[AB[i][0]-1] =-1
        A[AB[i][1]-1] =-1
    elif(H[AB[i][0]-1]<H[AB[i][1]-1]):
        A[AB[i][0]-1] =-1
    else:
        A[AB[i][1]-1] =-1

#print(A)
#print(s)
ans = A.count(0)
#ans += N-len(s)


print(ans)


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

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: u32,
        b: u32,
    }
    if a >= 13 {
        println!("{}", b);
    } else if 6 <= a && a <= 12 {
        println!("{}", b / 2);
    } else {
        println!("0");
    }
}


Measured memory_bytes: 4352
import java.io.*;
import java.math.*;
import java.util.*;
import java.lang.*;

// import java.text.DecimalFormat; 
// import java.text.DecimalFormatSymbols; 
/*
 
 
 
 */

public class Main {

    public static void main(String args[] ) throws Exception {
        PrintWriter pw=new PrintWriter(System.out);
        FastScanner sc = new FastScanner();
        
        int t=1;
        //t = sc.ni();
        while(t-->0) {
        	solve(pw,sc);
        }
       
        pw.close();
    }
   
    private static void solve(PrintWriter pw, FastScanner sc) {
    	int n = sc.ni();
    	int co = 0;
    	int max= 0;
    	while(n-->0){
    		int d1 = sc.ni(),d2 = sc.ni();
    		if(d1==d2) {
    			co++;
    		} else 
    			co=0;
    		max = Math.max(max, co);
    	}
    	if(max>=3)
    		pw.print("Yes");
    	else 
    		pw.print("No");
    	
	}
   

	static <T> void deb(T x,int o){
       System.out.print(x);
       if(o==0) {
    	   System.out.println();
    	   
       }
    }
   
   
   static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		public String ne() {
			while (!st.hasMoreElements())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		public String ne(int k) {
			try {
				return br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return "Not able to read";
		}
		
		int ni() {
			return Integer.parseInt(ne());
		}
		
		long nl() {
			return Long.parseLong(ne());
		}
		
		double nd() {
			return Double.parseDouble(ne());
		}
		
	    
	}
   
}

Measured memory_bytes: 32928
package main

import "fmt"

var a, b, c int

func main() {
	fmt.Scan(&a, &b, &c)
	if c-a-b <= 0 {
		fmt.Println("No")
		return
	}

	n := c*c + (a+b)*(a+b) - 4*a*b - 2*c*(a+b)

	if n > 0 {
		fmt.Println("Yes")

	} else {

		fmt.Println("No")
	}
}


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

using namespace std;

#define ll long long
#define ull unsigned long long
#define vll vector<ll>
#define pii pair<int, int>
#define vii vector<pii>
#define vs vector<string>
#define vb vector<bool>
#define vi vector<int>
#define vd vector<double>
#define vvi vector< vector<int> >
#define vvii vector< vector< pii > >
#define ld long double
#define mapii map<int, int>
#define mapsi map<string, int>
#define erep(i, x, n) for (auto i = x; i<=(ll)(n); i++)
#define rep(i, x, n) for(auto i = x; i<(ll)(n); i++)
#define INF  LLONG_MAX
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
#define pie  acos(-1)
#define mod(n,m) ((n % m + m) % m)
#define eps (1e-8)
#define reset(n, m) memset(n, m, sizeof n)
#define endl '\n'
#define output freopen("output.txt", "w", stdout)
#define mp(x, y, z) {{x, y}, z}


int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vi vec(n);
    rep(i, 0, n) cin >> vec[i];
    vb visited(n);
    for(int i = n-1; i>=0; i-=2)
    {
        visited[i] = true;
        cout << vec[i] << " ";
    }
    rep(i, 0, n) if (!visited[i]) cout << vec[i] << " ";

    return 0;
}


Measured memory_bytes: 2944
def main1():
    s = input()
    s1 = s[0:len(s)//2]
    s2 = s[::-1]
    s2 = s2[0:len(s)//2]
    ans = 0

    for i  in range(len(s)//2):
        if s1[i]==s2[i]:
            continue
        else:
            ans+=1
    print(ans)



if __name__ == '__main__':
    main1()


Measured memory_bytes: 3060
import java.util.*;
 
public class Main { //クラス名はMain
    public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer Syainsu = Integer.parseInt(sc.next());
      
      //上司の社員番号
      //1番は直属の上司を持たないため-1
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<Syainsu-1; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int a[] = new int[Syainsu]; 
      for(int i=0;i<Syainsu;i++){
        a[i] = 0;
    }
      for(int i=0;i<Syainsu-1;i++){
          a[num.get(i)-1]++;
      }
      
      for(int i=0;i<Syainsu;i++){
	      System.out.println(a[i]);
      }
    }
    
}


Measured memory_bytes: 66804
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<list>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>

using namespace std;

#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define INF 11111111111111111
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<ll, ll> pll;

ll n = 0, m = 0, k = 0, ans = 0, sum = 0, cnt = 0, temp = 0;
string s;
bool flag;

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

#define MAX 10000

int main(void) {
  ll a[102][102];
  ll x, y;

  cin >> n >> m;
  n--;
  m--;

  FOR(i, 0, 50) {
	FOR(j, 0, 100) {
	  a[i][j] = 0;
	}
  }

  FOR(i, 49, 100) {
	FOR(j, 0, 100) {
	  a[i][j] = 1;
	}
  }

  x = 0;
  y = 99;
  while (m != 0) {
	a[y][x] = 0;
	x += 2;
	if (x > 99) {
	  y -= 2;
	  x = 0;
	}
	m--;
  }

  x = 0;
  y = 0;
  while (n != 0) {
	a[y][x] = 1;
	x += 2;
	if (x > 99) {
	  y += 2;
	  x = 0;
	}
	n--;
  }

  cout << "100 100" << endl;

  FOR(i, 0, 100) {
	FOR(j, 0, 100) {
	  if (a[i][j] % 2 == 1) {
		cout << ".";
	  }
	  else {
		cout << "#";
	  }
	}
	cout << endl;
  }

  return 0;
}

Measured memory_bytes: 384