akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
const int MOD = 1000000007;

int main()
{
  int N;
  cin >> N;
  cout << (N*800 - (N/15)*200) << endl;
  return 0;
}



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

ll rui(ll a,ll b){
    ll ans=1;
    while(b>0){
        if(b&1) ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

ll comb(ll a,ll b){
    ll ans=1;
    for(ll i=a;i>a-b;i--){
        ans=ans*i%mod;
    }
    for(ll i=1;i<=b;i++){
        ans=(ans*rui(i,mod-2))%mod;
    }
    return ans;
}

int main() {
  ll x,y; cin>>x>>y;
  if((x+y)%3 != 0) {
    cout<<0;
    return 0;
  }
  ll m = (2*x-y)/3;
  ll n = (2*y-x)/3;
  if(m<0 || n<0) {
    cout<<0;
    return 0;
  }
  cout<<comb(n+m,n)%mod;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#define maxn 100005
using namespace std;
int cnt,head[maxn],flag[maxn];
struct fdfdfd{int next,to,w;}e[maxn<<1];
void addedge(int u,int v,int w){e[++cnt].to=v; e[cnt].w=w; e[cnt].next=head[u]; head[u]=cnt;}
void dfs(int u,int pre,int op)
{
	flag[u]=op;
	for(int i=head[u];i;i=e[i].next)
	{
		int v=e[i].to,w=e[i].w;
		if(v==pre) continue;
		dfs(v,u,w&1?op^1:op);
	}
}
int main()
{
	int n; scanf("%d",&n);
	for(int i=1,u,v,w;i<n;++i) scanf("%d%d%d",&u,&v,&w),addedge(u,v,w),addedge(v,u,w);
	dfs(1,0,0);
	for(int i=1;i<=n;++i) printf("%d\n",flag[i]);
}

Measured memory_bytes: 8900
# from collections import deque

INF = float('inf')

h,w = map(int, input().split())

point_list = []
for i in range(w*h):
    point_list.append([w*h]*w*h)
maze = []

Q = []

for i in range(h):
    tmp = list(input())
    maze.append(tmp)

for s_y in range(h):
    for s_x in range(w):
        if maze[s_y][s_x] == "#":
            continue
        check = []
        Q.append((s_y,s_x))
        check.append((s_y,s_x))
        point_list[s_x+s_y*w][s_x+s_y*w] = 0
        while Q:
            y, x = Q.pop(0)
            if y == 0:
                pass
            elif maze[y-1][x]=="#":
                pass
            else:
                point_list[s_x+s_y*w][x+(y-1)*w] = min(point_list[s_x+s_y*w][x+(y-1)*w],point_list[s_x+s_y*w][x+y*w]+1)
                if (y-1,x) in check:
                    pass
                else:
                    check.append((y-1,x))
                    Q.append((y-1,x))
                    

            if y == h-1 :
                pass
            elif maze[y+1][x]=="#":
                pass
            else:
                point_list[s_x+s_y*w][x+(y+1)*w] = min(point_list[s_x+s_y*w][x+(y+1)*w],point_list[s_x+s_y*w][x+y*w]+1)
                if (y+1,x) in check:
                    pass
                else:
                    check.append((y+1,x))
                    Q.append((y+1,x))
                    

            if x==0:
                pass
            elif maze[y][x-1]=="#":
                pass
            else:
                point_list[s_x+s_y*w][(x-1)+y*w] = min(point_list[s_x+s_y*w][(x-1)+y*w],point_list[s_x+s_y*w][x+y*w]+1)
                if (y,x-1) in check:
                    pass
                else:
                    check.append((y,x-1))
                    Q.append((y,x-1))
                    

            if x==w-1:
                pass
            elif maze[y][x+1]=="#":
                pass
            else:
                point_list[s_x+s_y*w][(x+1)+y*w] = min(point_list[s_x+s_y*w][(x+1)+y*w],point_list[s_x+s_y*w][x+y*w]+1)
                if (y,x+1) in check:
                    pass
                else:
                    check.append((y,x+1))
                    Q.append((y,x+1))
                    
max_list = []
for i in range(w*h):
    tmp = set(point_list[i])
    if min(tmp)==w*h:
        continue
    if w*h in tmp:
        tmp.remove(w*h)
    max_list.append(max(tmp))

ans = max(max_list)
print(ans)

Measured memory_bytes: 85612
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {
	public static void main(String[] args) {
		print();
	}

	private static void print() {
		List<String> list = new ArrayList<>();
		StringBuilder sb = new StringBuilder();


		try {
			 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str = br.readLine();

			while (str != null) {
				String[] nums = str.split("", 0);
				int numsLength = nums.length;
				for(int iNums = 0; iNums <= numsLength - 1; iNums++){
					list.add(nums[iNums]);
				}

				Collections.reverse(list);
				int listLength = list.size();
				for(int j = 0; j <= listLength -1; j++){
					sb.append(list.get(j));
				}

				System.out.println(sb);
				str = br.readLine();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 24196
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int x = in.nextInt();
		int y = in.nextInt();
		
		int answer = x + y/2;
		
		System.out.println(answer);
		in.close();
	}

}


Measured memory_bytes: 21844
package main

import "fmt"


func main() {
	var n int
	fmt.Scan(&n)
	firstPlaceNum := n % 10
	switch firstPlaceNum {
	case 2,4,5,7,9:
		fmt.Println("hon")
	case 0,1,6,8:
		fmt.Println("pon")
	case 3:
		fmt.Println("bon")
	}
}


Measured memory_bytes: 1756
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <string>

using namespace std;

void solve();

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

void solve() {
    while(1) {
        int n,m;
        cin >> n >> m;
        if(n == 0 && m == 0) break;
        int d[n],v[n];
        for(int i = 0; i < n; i++) {
            cin >> d[i] >> v[i];
        }
        int sum = 0;
        for(int i = 1; i <= m; i++) {
            int ma = 0;
            for(int j = 0; j < n; j++) {
                if(d[j] == i) ma = max(ma,v[j]);
            }
            sum += ma;
        }
        cout << sum << endl;
    }
}

Measured memory_bytes: 3128
#include<bits/stdc++.h>
using namespace std;
 
#define f(i,x,n) for(i=x;i<n;i++)
#define fr(i,x,n) for(i=x;i>=n;i--)
#define pu push_back           
#define pp pop_back
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SP(x) fixed<<setprecision(x)
#define IOS() ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const long long MOD=1e9+7;
const long double PI = acos(-1);
const long long INF=INT_MAX;
const long long LINF=LLONG_MAX;
const long long N=2e5+1;
 
typedef long long ll;
typedef long double ld;
 
void test_case()
{
    ll n,i,j;
    cin>>n;
    map<string,ll> m;
    f(i,0,n)
    {
        string s;
        cin>>s;
        m[s]++;
    }
    vector<string> v;
    ll mx=0;
    for(auto u : m)
    {
        mx=max(mx,u.S);
    }
    for(auto u : m)
    {
        if(u.S==mx)
            v.pu(u.F);
    }
    sort(all(v));
    f(i,0,v.size())
    {
        cout<<v[i]<<'\n';
    }
           

}
int main()
{
    IOS();
    
    int tc=1;
    while(tc--)
        test_case();
    return 0;
}

Measured memory_bytes: 25584
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    n = intin()

    for i in range(20):
        diff = n - 7 * i
        if diff >= 0 and diff % 4 == 0:
            print('Yes')
            return

    print('No')


if __name__ == '__main__':
    main()


Measured memory_bytes: 3540
N, K = gets.split(" ").map(&:to_i)
sunuke = Array.new(N, 1)
K.times do |i|
    d = gets
    ary = gets.split(" ").map(&:to_i)
    ary.each do |b|
        if sunuke[b - 1] == 1
            sunuke[b - 1] = 0
        end
    end
end

puts sunuke.count(1)


Measured memory_bytes: 14376
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999


vector<pii> solve(pii data,int d){
    vector<pii> ret;
    int y=data.first, x=data.second;
    d %= (y+x);
    
    pii a,b;
    if(d<=x){
        a = pii(y,d);
        b = pii(y,x-d);
    }else{
        d-=x;
        a = pii(d,x);
        b = pii(y-d,x);
    }
    if(a.first*a.second<b.first*b.second)ret.pb(a),ret.pb(b);
    else ret.pb(b),ret.pb(a);
    return ret;
}


int main(){
    int n,w,h;
    while(cin>>n>>w>>h&&(n||w||h)){
        vector<pii> cut;
        rep(i,n){
            int a,b;
            cin>>a>>b;
            a--;
            cut.pb(pii(a,b));
        }
        
        vector<pii> data;
        data.pb(pii(h,w));
        rep(i,n){
            pii tur = data[cut[i].first];
            data.erase(data.begin()+cut[i].first);
            
            vector<pii> res = solve(tur,cut[i].second);
            
            rep(j,2)data.pb(res[j]);
        }
        vector<int> num;
        rep(i,data.size()){
            num.pb(data[i].first*data[i].second);
        }
        sort(all(num));
        rep(i,num.size()){
            if(i!=0)cout<<" ";
            cout<<num[i];
        }
        cout<<endl;
    }
}

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

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

main() {
  // (sum a_i) : (sum b_i) == m_a : m_b
  // sum (a_i * m_b - b_i * m_a) = 0
  int64_t n, m_a, m_b;
  cin >> n >> m_a >> m_b;

  vector<pair<int64_t, int64_t>> items(n);
  for (auto&& t : items) {
    int64_t a, b, c;
    cin >> a >> b >> c;

    t.first = a * m_b - b * m_a;
    t.second = c;
  }

  constexpr auto kOffset = 10000L;
  vector<vector<int64_t>> dp(
      n + 1, vector<int64_t>(20000, numeric_limits<int32_t>::max()));
  for (auto i : irange(0L, n)) {
    for (auto j : irange(0L, 20000L)) {
      if (j - items[i].first >= 0) {
        dp[i + 1][j] =
            min(dp[i][j], dp[i][j - items[i].first] + items[i].second);
      } else {
        dp[i + 1][j] = dp[i][j];
      }
    }
    dp[i + 1][items[i].first + kOffset] =
        min(dp[i + 1][items[i].first + kOffset], items[i].second);
  }

  if (dp.back()[kOffset] >= numeric_limits<int32_t>::max() / 2) {
    cout << -1 << endl;
  } else {
    cout << dp.back()[kOffset] << endl;
  }
}

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

int main() {
  
  int N,X,T;
  cin >> N >> X >> T;
  
  if(N%X == 0){
    
    cout << N/X*T <<endl;
  }
   else{
     
     cout << N/X*T+T << endl;
   }
  
}


Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 999999999;
const int MOD = 1e9 + 7;
const double pi = 3.141592653589793238;

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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << (a*b) / (gcd(a, b)*gcd(a, b))*c << endl;
}



Measured memory_bytes: 3124
#include <cstdio>
#include <utility>
#include <algorithm>

using namespace std;

typedef pair<int, int> P;

const int MAX_N = 100000;
const int MAX_V = 1000000000;

int N;
int X[MAX_N];
int L[MAX_N];

void input() {
    scanf("%d", &N);
    for (int i=0; i<N; ++i) {
        scanf("%d%d", X+i, L+i);
    }
}

P ps[MAX_N];

int solve() {
    for (int i=0; i<N; ++i) {
        ps[i] = P(X[i] + L[i], X[i] - L[i]);
    }
    sort(ps, ps+N);
    int cur = -MAX_V;
    int ans = 0;
    for (int i=0; i<N; ++i) {
        if (cur<=ps[i].second) {
            ans++;
            cur = ps[i].first;
        }
    }
    return ans;
}

int main() {
    input();
    int ans = solve();
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 1664
s=input()
t=input()

slen=len(s)
tlen=len(t)
ans=tlen

for i in range(slen-tlen+1):
    tempans=0
    for j in range(tlen):
        if t[j]!=s[j+i]:
            tempans+=1
    ans=min(ans,tempans)
print(ans)

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

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int n, k;
    scan(n, k);
    bool ok = (n + 1) / 2 >= k;
    auto ans = ok ? "YES" : "NO";
    writeln(ans);
}







void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


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

int A, B, Q;
long long s[100100], t[100100];
long long x;
int st[100100], ts[100100];
const long long INF = 1000000000000;

int main() {
    cin >> A >> B >> Q;
    for (int i=1; i<=A; ++i) cin >> s[i];
    for (int i=1; i<=B; ++i) cin >> t[i];

    s[0] = -INF;
    s[A+1] = INF;
    t[0] = -INF;
    t[B+1] = INF;
    for (int i=0; i<Q; ++i) {
        int wes[2], wet[2];
        cin >> x;
        wes[1] = lower_bound(s, s+A+2, x) - s;
        wes[0] = wes[1] - 1;
        wet[1] = lower_bound(t, t+B+2, x) - t;
        wet[0] = wet[1] - 1;
        long long ans = INF;
        for (int j=0; j<2; ++j) {
            for (int k=0; k<2; ++k) {
                ans = min(ans, abs(x - s[wes[j]]) + abs(t[wet[k]] - s[wes[j]]));
            }
        }
        for (int j=0; j<2; ++j) {
            for (int k=0; k<2; ++k) {
                ans = min(ans, abs(x - t[wet[j]]) + abs(s[wes[k]] - t[wet[j]]));
            }
        }

        cout << ans << endl;
    }

    return 0;
}

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

using namespace std;

vector<int> get_primes(int n) {
    vector<bool> is_prime(n + 1, true);
    vector<int> primes;
    for (int i = 2; i <= n; ++i) {
        if (is_prime[i]) {
            primes.push_back(i);
            for (int j = 2*i; j <= n; j += i) {
                is_prime[j] = false;
            }
        }
    }
    return primes;
}

vector<pair<int, int>> fact_fac(int n) {
    vector<int> primes = get_primes(n);
    vector<pair<int, int>> fact;
    for (int prime : primes) {
        int count = 0;
        for (int i = 1; i <= n; ++i) {
            int j = i;
            while (j % prime == 0) {
                ++count;
                j /= prime;
            }
        }
        fact.push_back(make_pair(prime, count));
    }
    return fact;
}

int f1(int n) {
    // 75 = 74+1
    vector<pair<int, int>> fact = fact_fac(n);
    int c = 0;
    for (auto p : fact) {
        c += p.second >= 74;
    }
    return c;
}

int f2(int n) {
    // 3 * 25 = (2+1) * (24+1)
    vector<pair<int, int>> fact = fact_fac(n);
    int c = 0, d = 0;
    for (auto p : fact) {
        c += p.second >= 24;
        d += p.second >= 2;
    }
    return c * (d-1);
}

int f3(int n) {
    // 5 * 15 = (4+1) * (14+1)
    vector<pair<int, int>> fact = fact_fac(n);
    int c = 0, d = 0;
    for (auto p : fact) {
        c += p.second >= 14;
        d += p.second >= 4;
    }
    return c * (d-1);
}

int f4(int n) {
    // 3 * 5 * 5 = (2+1) * (4+1) * (4+1)
    vector<pair<int, int>> fact = fact_fac(n);
    int c = 0, d = 0;
    for (auto p : fact) {
        c += p.second >= 4;
        d += p.second >= 2;
    }
    return (c * (c-1)/2) * (d-2);
}

// 75 = 3 * 5^2 has 6 divisors: 1, 3, 5, 15, 25, 75
// 75
// 3 * 25
// 3 * 5 * 5
// 5 * 15

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << f1(n) + f2(n) + f3(n) + f4(n) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	int k; string s; cin>>k>>s;
	if(s.size() <=k){
		cout<<s<<endl; return 0;
	}
	cout<<s.substr(0,k)<<"..."<<endl;
	return 0;
}

Measured memory_bytes: 3628
#include <iostream>
using namespace std;
int main(){

   int a,b,c;
   int output;
   output=0;
   cin>>a>>b>>c;
   for(int i=a;i<=b;i++){
	   if(c%i==0){
		   output+=1;
	   }
   }
   cout<<output<<endl;

	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define int LL
using namespace std;
#define PII pair<int, int>
#define VI vector<int>
#define VPII vector<PII>
#define LL long long
#define LD long double
#define f first
#define s second
#define MP make_pair
#define PB push_back
#define endl '\n'
#define ALL(c) (c).begin(), (c).end()
#define SIZ(c) (int)(c).size()
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, b, e) for(int i = (b); i <= (int)(e); ++i)
#define FORD(i, b, e) for(int i = (b); i >= (int)(e); --i)

#define sim template<class n
sim, class s> ostream & operator << (ostream &p, pair<n, s> x)
{return p << "<" << x.f << ", " << x.s << ">";}
sim> auto operator << (ostream &p, n y) ->
typename enable_if<!is_same<n, string>::value, decltype(y.begin(), p)>::type 
{int o = 0; p << "{"; for(auto c: y) {if(o++) p << ", "; p << c;} return p << "}";}
void dor() {cerr << endl;}
sim, class...s> void dor(n p, s...y) {cerr << p << " "; dor(y...);}
sim, class s> void mini(n &p, s y) {if(p>y) p = y;}
sim, class s> void maxi(n &p, s y) {if(p<y) p = y;}
#ifdef DEB
#define debug(...) dor(__FUNCTION__, ":", __LINE__, ": ", __VA_ARGS__)
#else
#define debug(...)
#endif 

#define I(x) #x " =", (x), " "
#define A(a, i) #a "[" #i " =", i, "] =", a[i], " "

map<PII, int> M;
int mod = 1e9+7;

const int MXN = 2e5+5;
int pot2[MXN];

int32_t main()
  {
  ios_base::sync_with_stdio(0); 
  int n;
  cin >> n;
  pot2[0] = 1;
  FOR(i, 1, n)pot2[i] = pot2[i-1] * 2 % mod;

  int zero = 0;
  REP(i, n)
    {
    int x, y;
    cin >> x >> y;

    if(x == 0 && y == 0)
      {
      zero++;
      continue;
      }

    int g = __gcd(abs(x), abs(y));

    x /= g;
    y /= g;
    if(x < 0){x *= -1; y *= -1;}
    if(x == 0){y = 1;}

    M[{x, y}]++;
    }

  LL res = 1;
  for(auto i: M)
    {
    PII druga = MP(i.f.s, -i.f.f);
    if(druga.f < 0)
      {
      druga.f *= -1;
      druga.s *= -1;
      }
    if(druga.f == 0)druga.s = 1;

    if(MP(i.f.f, i.f.s) < druga || M.count(druga) == 0)
      {
      int ways1 = i.s;
      int ways2 = 0;
      if(M.count(druga))ways2 = M[druga];

      debug(i.f, druga, ways1, ways2);

      res = res * (pot2[ways1] + pot2[ways2]-1) % mod;
      }
    }
  cout << (res - 1 + mod + zero) % mod << endl;
  }


Measured memory_bytes: 17548
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		
		int N =in.nextInt();
		
		for(int i = 1;i<=9;i++) {
			for(int j = 1;j<=9;j++) {
				if((i * j) == N) {
					System.out.println("Yes");
					return;
				}
			}
			
		}
		
		System.out.println("No");

	}

}


Measured memory_bytes: 26980
# YYMM
o1 = False

# MMYY
o2 = False

# AMBIGUOUS
o3 = False

s = input()
s1 = s[:2]
s2 = s[2:]

if int(s1) <= 12 and int(s1) > 0:
    if int(s2) <= 12 and int(s2) > 0:
        o3 = True
    else:
        o2 = True

if int(s2) <= 12 and int(s2) > 0:
    if int(s1) <= 12 and int(s1) > 0:
        pass
    else:
        o1 = True

if o1 is True:
    print("YYMM")
elif o2 is True:
    print("MMYY")
elif o3 is True:
    print("AMBIGUOUS")
else :
    print("NA")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int N, M, X, Y;
  cin >> N >> M >> X >> Y;
  vector<int> vecA(N);
  vector<int> vecB(M);
  rep(i, N) {
    cin >> vecA.at(i);
  }
  rep(i, M) {
    cin >> vecB.at(i);
  }
  sort(vecA.begin(), vecA.end());
  sort(vecB.begin(), vecB.end());
  reverse(vecA.begin(), vecA.end());
  if(vecA.at(0) >= vecB.at(0)) {
    cout << "War" << endl;
    
  }
  else if(X < vecB.at(0) && vecA.at(0) < Y){ 
    cout << "No War" << endl;
  }
  else {
    cout << "War" << endl;
  }
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define arep(i, x, n) for (int i = int(x); i < (int)(n); i++)
#define rep(i, n) for (long long i = 0; i < n; ++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9 + 7
using ll = long long;

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

    vector<ll> v(n);
    rep(i, n){
        cin >> v.at(i);
    }

    sort(v.begin(), v.end());

    int itemNum = v[n/2] - v[n/2-1];
    
    cout << itemNum << endl;
}

Measured memory_bytes: 4032
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <queue>
#include <bitset>
#include <stack>

typedef long long ll;
typedef std::vector< int > VI;

const double EPS = 1e-10;
const double PI  = acos(-1);
const ll     INF = 1 << 30;

// i 文字目までが作成可能か
bool dp[100007];

int main(int argc, char* argv[])
{
  std::string s;
  std::cin >> s;

  std::vector< std::string > ope(4, "");
  ope[0] = "dream";
  ope[1] = "dreamer";
  ope[2] = "erase";
  ope[3] = "eraser";

  dp[0] = true;
  ll n = s.size();
  for (ll i = 0; i <= n; i++) {
    for (ll j = 0; j < 4; j++) {
      if (i-(ll)ope[j].size() >= 0) {
	if (dp[i-ope[j].size()] &&
	    ope[j] == s.substr(i-ope[j].size(), ope[j].size())) {
	  dp[i] = true;
	}
      }
    }
  }

  std::cout << (dp[n] ? "YES" : "NO") << std::endl;
  return 0;
}


Measured memory_bytes: 512
#include<stdio.h>
int main(void){
  int N,K,i,j,t,sum=0;
  int l[50];
  scanf("%d %d",&N,&K);
  for(i=0;i<N;i++){
    scanf("%d",&l[i]);
  }
  for(i=0;i<N-1;i++){
    for(j=i+1;j<N;j++){
      if(l[i]<l[j]){
        t=l[i];
        l[i]=l[j];
        l[j]=t;
      }
    }
  }
  for(i=0;i<K;i++){
    sum+=l[i];
  }
  printf("%d\n",sum);
  return 0;
}

Measured memory_bytes: 128
use std::io::{stdin, Read};
use std::str::FromStr;

// https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

/*
#[allow(dead_code)]
fn main() {}
*/
#[allow(dead_code)]
fn main() {
    fn make_set(n: usize) -> Vec<Vec<usize>> {
        let width = 1 << n;
        let mut result_set = vec![];
        for bits in 0..width {
            let mut row = vec![];
            for i in 0..n {
                if bits >> i & 1 == 1 {
                    row.push(i)
                }
            }
            result_set.push(row)
        }
        result_set
    }

    let s = read::<String>();
    let s = s
        .chars()
        .into_iter()
        .map(|c| c.to_digit(10).unwrap())
        .map(|x| x as i32)
        .collect::<Vec<_>>();

    let op_pos = make_set(s.len() - 1);

    for pos in op_pos {
        let mut op = vec![-1 as i32; 4];
        for p in pos {
            op[p] = 1;
        }

        if s[0] + s[1] * op[0] + s[2] * op[1] + s[3] * op[2] == 7 {
            let os = op
                .into_iter()
                .map(|c| if c < 0 { "-" } else { "+" })
                .collect::<Vec<_>>();
            println!(
                "{}{}{}{}{}{}{}=7",
                s[0], os[0], s[1], os[1], s[2], os[2], s[3]
            );
            use std::process::exit;
            exit(0)
        }
    }
}


Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
int main() {
	double n;
	cin >> n;
	for(double i=0;i<50000;i++) {
		if (n<=i*1.08&&i*1.08<n+1) {
			cout << i << endl;
			return 0;
		}
	}
	cout << ":(" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
double a[1009],sum[200009];

int main(){
  int n,k;
  cin>>n>>k;
  for(int i=1;i<1009;i++){
    a[i]=a[i-1]+i;
  }
  for(int i=0;i<n;i++){
    int p;
    cin>>p;
    sum[i+1]=sum[i]+a[p]/(double)p;
    //cout<<a[p]/(double)p<<endl;
  }
  double ans=0;
  for(int i=1;i<=n-k+1;i++){
    ans=max(ans,sum[i+k-1]-sum[i-1]);
  }
  printf("%.10f\n",ans);
}
  


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;

int main() {
    int N; cin >> N;
    int odd = 0;
    int four = 0;
    for (int i = 0; i < N; i++) {
        int x; scanf("%d", &x);
        if (x % 2 == 1) odd++;
        if (x % 4 == 0) four++;
    }


    if (odd + four == N) {
        if (odd <= four + 1) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        if (odd == four) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
let () = Scanf.scanf "%d\n" @@ fun n ->
  let cs = Array.make n 0 in
  for i = 2 to n do
    Scanf.scanf "%d " @@ fun a ->
      cs.(a - 1) <- 1 + cs.(a - 1)
  done;
  Array.iter (Printf.printf "%d\n") cs


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

int main() {
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> A;
  for (int i = 0, a; i < N && cin >> a; i++) A.push_back({a, 1});
  for (int i = 0, b, c; i < M && cin >> b >> c; i++) A.push_back({c, b});

  sort(A.rbegin(), A.rend());

  long long ans = 0;
  for (int i = 0, j = 0; i < N; i++) {
    if (A.at(j).second) ans += A.at(j).first, A.at(j).second--;
    else j++, i--;
  }
  cout << ans << "\n";
}

Measured memory_bytes: 2420
def main():
    s = input()

    a_index = []
    z_index = []

    for i, ss in enumerate(s):
        if ss == 'A':
            a_index.append(i)
        elif ss == 'Z':
            z_index.append(i)
    print(max(z_index)-min(a_index)+1)


if __name__ == "__main__":
    main()


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

bool ok(int a, int b, int c) { return a < b + c && b < a + c && c < a + b; }

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

    int n;
    cin >> n;
    int cnt[1010] = {};
    while (n--)
    {
        int a;
        cin >> a;
        cnt[a]++;
    }
    int ans = 0;
    rep(i, 1010) ans += (cnt[i] * (cnt[i] - 1) * (cnt[i] - 2)) / 6;
    rep(i, 1010) Rep(j, i + 1, 1010)
    {
        if (ok(i, i, j))
            ans += cnt[i] * (cnt[i] - 1) / 2 * cnt[j];
        if (ok(i, j, j))
            ans += cnt[i] * cnt[j] * (cnt[j] - 1) / 2;
    }
    rep(i, 1010) Rep(j, i + 1, 1010) Rep(k, j + 1, 1010) if (ok(i, j, k)) ans += cnt[i] * cnt[j] * cnt[k];
    cout << ans << endl;
}

Measured memory_bytes: 256
def is_prime(n):
    for i in range(2, n):
        if n % i == 0:
            return False
    return True

primes = []
for i in range(2,50): # prime > 50 never appear twice
    if is_prime(i):
        primes.append(i)

def make_zeroed():
    return [0] * len(primes)

factorized = []
factorized.append(make_zeroed())
for i in range(2, 101):
    lst = make_zeroed()
    for k, p in enumerate(primes):
        if i < p:
            break
        while i % p == 0:
            lst[k] += 1
            i = i // p
    factorized.append(lst)

sum_factorized = []
for i in range(1,101):
    lst = make_zeroed()
    for j in range(0, i):
        for k, f in enumerate(factorized[j]):
            lst[k] += f
    sum_factorized.append(lst)

def fact(n):
    a = 1
    for i in range(1,n+1):
        a *= i
    return a

def nCr(n,r):
    if r > n:
        return 0
    return fact(n) // fact(r) // fact(n - r)

def getelems(n):
    lst = sum_factorized[n-1]
    elems = {}
    elems[3] = len([x for x in lst if x >= 2])
    elems[5] = len([x for x in lst if x >= 4])
    elems[15] = len([x for x in lst if x >= 14])
    elems[25] = len([x for x in lst if x >= 24])
    elems[75] = len([x for x in lst if x >= 74])
    return elems

def solve(n):
    elems = getelems(n)
    ans = 0
    # 3 * 5 * 5
    ans += nCr(elems[5], 2) * nCr(elems[3] - 2, 1)
    # 5 * 15
    ans += nCr(elems[15], 1) * nCr(elems[5] - 1, 1)
    # 3 * 25
    ans += nCr(elems[25], 1) * nCr(elems[3] - 1, 1)
    # 75
    ans += nCr(elems[75], 1)
    return ans

answers = {}
for i in range(1,101):
    answers[i] = solve(i)

print(answers[int(input())])


Measured memory_bytes: 3192
package main

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

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

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

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

func main() {
	x := nextInt()

	q, r := x/100, x%100
	if r <= 5*q {
		fmt.Println(1)
	} else {
		fmt.Println(0)
	}
}


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

int main(){
  int n;
  cin>>n;
  if(n%2==0){cout<<n/2<<endl;}
  else{cout<<n/2+1<<endl;}


}

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

using namespace std;

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

int main() {
	string str;
	cin >> str;
	
	int cnt = 0;
	FOR(i, 1, str.size()) if (str[i] != str[i - 1]) cnt++;
	cout << cnt << endl;
	return 0;
}

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin >> n;
	string s, t, ans;
	cin >> s >> t;
	
	for(int i = 0; i < n; i++) {
		ans.push_back(s[i]);
		ans.push_back(t[i]);
	}
	
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);(i)++)
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);(i)--)
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);(i)--)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }

struct edge {
    int from, to; ll cost;
    edge(int s, int t, ll w = 0) : from(s), to(t), cost(w) {}
};

int main() {
    init();
    
    int n; cin >> n;
    VL l(n); cin >> l;

    SORT(l);
    ll ans = 0;

    FOR(i, 0, n)FOR(j, i + 1, n) {
        ans += lower_bound(all(l), l[i] + l[j]) - l.begin() - 1 - j;
    }

    cout << ans << "\n";
    /*
    int n, m; ll l; cin >> n >> m >> l;

    vector<vector<edge>> g(n);
    FOR(i, 0, m) {
        int a, b; ll c;
        cin >> a >> b >> c;
        a--, b--;
        g[a].emplace_back(a, b, c);
        g[b].emplace_back(b, a, c);
    }

    vector<VL> dis(n, VL(n, LLINF));

    int q; cin >> q;
    FOR(i, 0, q) {
        int s, t; cin >> s >> t;
        s--, t--;
    }
    */
}


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

using namespace std;

const int INF = 100000000;

typedef pair<int, int> P;

int R, C, sy = 0, sx = 0, gy, gx;
char c[50][50];
int d[50][50];

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

int bfs() {
  queue<P> que;
  for (int i = 0; i < R; i++)
    for (int j = 0; j < C; j++) d[i][j] = INF;
  que.push(P(sy, sx));
  d[sy][sx] = 0;

  while (que.size()) {
    P p = que.front();
    //cout << "que:" << p.first << p.second << endl;
    que.pop();
    if (p.first == gy && p.second == gx) break;
    for (int i = 0; i < 4; i++){
      int ny = p.first + dy[i], nx = p.second + dx[i];
      if(0 <= ny && ny < R && 0 <= nx && nx < C && c[ny][nx] != '#' && d[ny][nx] == INF) {
        que.push(P(ny, nx));
        d[ny][nx] = d[p.first][p.second] + 1;
      }
    }
  }
  return d[gy][gx];
}

int main(){
  cin >> R >> C;
  gy = R - 1, gx = C - 1;
  int i, j;
  int white = 0;
  for(i = 0; i < R; i++) {
    for (j = 0; j < C; j++) {
      cin >> c[i][j];
      if(c[i][j] == '.') white++;
    }
  }
  if(bfs() == INF) cout << -1 << endl;
  else cout << white - bfs() - 1 << endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef set<int> si;

const int SIZE = 100 + 10;

int sch[SIZE][10] = {0};
int pro[SIZE][11] = {0};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    int res = -(1 << 30);
    for (int i = 0; i < n; i++)
        for (int j = 0; j < 10; j++)
            cin >> sch[i][j];
    for (int i = 0; i < n; i++)
        for (int j = 0; j < 11; j++)
            cin >> pro[i][j];

    for (int b = 1; b < (1 << 10); b++)
    {
        int cc = 0;
        for (int i = 0; i < n; i++)
        {
            int c = 0;
            for (int j = 0; j < 10; j++)
                if ((b >> j & 1) && sch[i][j])
                    c++;
            cc += pro[i][c];
        }
        res = max(cc, res);
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

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

	int n;
  cin>>n;
  vp in(n);
  rep(i,n){
    int a;cin>>a;
    in[i]={a,i+1};
  }
  sort(all(in));
  rep(i,n)cout<<in[i].second<<" ";cout<<endl;
}


Measured memory_bytes: 2432
#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool comp1(pair<int,int> &a,pair<int,int> &b)
{
    return a.second>b.second;
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll h;
    cin>>h;
    ll q=log2(h);
    ll p=pow(2,q+1)-1;
    cout<<p;
}

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

#define N 100

int top,stack[N];

void push(int x){
  ++top;
  stack[top] = x;
}

int pop(){
  top--;
  return stack[top+1];
}

int main(){
  int x,y;
  char s[100];

  top = 0;
  
  while(scanf("%s",s) != EOF){
    if(s[0]=='+'){
      x = pop();
      y = pop();
      push(x+y);
    }
    else if(s[0]=='-'){
      x = pop();
      y = pop();
      push(y-x);
    }
    else if(s[0]=='*'){
      x = pop();
      y = pop();
      push(x*y);
    }
    else push(atoi(s));
  }
  
  printf("%d\n",pop());
  
  return 0;
}

  



Measured memory_bytes: 2108
import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import java.lang.*;

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 = sc.nextInt();

        int[] arr = {a,b,c};
        Arrays.sort(arr);

        System.out.println(arr[2]-arr[0]);
    }
}


Measured memory_bytes: 35624
line = require('fs').readFileSync('/dev/stdin', 'ascii').split(/\r\n|\r|\n/);

for (i in line) {
	if (line[i] === '-1 -1 -1') break;
	mfr = line[i].split(' ').map(Number);
	judge(mfr);
}


function judge(mfr) {
	var m = mfr[0], f = mfr[1], r = mfr[2], mpf = m + f;
	if (m === -1 || f === -1) console.log('F');
	else if (mpf >= 80) console.log('A');
	else if (mpf >= 65) console.log('B');
	else if (mpf >= 50) console.log('C');
	else if (mpf < 30) console.log('F');
	else if (r >= 50) console.log('C');
	else console.log('D');
}

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

const int A=0,G=1,C=2,T=3;
long long dp[111][4][4][4];
int main()
{
    int n;
    cin>>n;
    int mod=1000000007;
    dp[0][T][T][T]=1;
    for(int i=0 ; i<n ; ++i)
    {
        for(int j=0 ; j<4 ; ++j)
        {
            for(int k=0 ; k<4 ; ++k)
            {
                for(int l=0 ; l<4 ; ++l)
                {
                    for(int m=0 ; m<4 ; ++m)
                    {
                        if(k==A && l==G && m==C)
                            continue;
                        if(k==G && l==A && m==C)
                            continue;
                        if(k==A && l==C && m==G)
                            continue;
                        if(j==A && l==G && m==C)
                            continue;
                        if(j==A && k==G && m==C)
                            continue;
                        (dp[i+1][k][l][m] += dp[i][j][k][l]) %= mod;
                    }
                }
            }
        }
    }
    long long ans=0;
    for(int i=0 ; i<4 ; ++i)
    {
        for(int j=0 ; j<4 ; ++j)
        {
            for(int k=0 ; k<4 ; ++k)
            {
                ans += dp[n][i][j][k];
            }
        }
    }
    cout<<ans%mod<<endl;
    return 0;
}


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

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

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

int main(void){

    string str;
    cin >> str;

    int ans = 0;

    string s;
    while(cin >> s){
        if(s == "END_OF_TEXT") break;
        for(int i = 0;s[i] != '\0';i++){
            if('A' <= s[i] && s[i] <= 'Z') s[i] = char(s[i]+('a'-'A'));
        }
        if(s == str) ans++;
    }

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 3184
import java.util.Scanner;

 class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();

		if(A==B && A!=C) {
			System.out.println("Yes");
		}
		else if(B==C && A!=C) {
			System.out.println("Yes");
		}
		else if(A==C && A!=B) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}


	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

void solve(long long N, std::vector<long long> A)
{
    ll ans = 0;
    int right = 0;
    int tmpsum = 0;
    for (int left = 0; left < N; left++)
    {

        while (right < N && (tmpsum ^ A[right]) == (tmpsum + A[right]))
        {
            tmpsum += A[right];
            right++;
        }
        ans += right - left;
        if (left == right)
        {
            right++;
        }
        else
        {

            tmpsum -= A[left];
        }
    }

    cout << ans << endl;
}

int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 1792
S = list(input())
ans = [0] * len(S)
odd = 1
even = 1
branch = 1
memory = 0

for i in range(len(S)-1):
    if branch == 1:
        if S[i] == 'R' and S[i+1] == 'R':
            if i % 2 == 0:
                even += 1
            else:
                odd += 1
        else:
            branch = 0
            if i % 2 == 0:
                ans[i] += even
                ans[i+1] += odd
            else:
                ans[i] += odd
                ans[i+1] += even

            even = 0
            odd = 0
            memory = i

    else:
        if S[i] == 'L' and S[i+1] == 'L':
            if i % 2 == 0:
                odd += 1
            else:
                even += 1
        else:
            branch = 1
            if memory % 2 == 0:
                ans[memory] += even
                ans[memory+1] += odd
            else:
                ans[memory] += odd
                ans[memory+1] += even

            even = 1
            odd = 1

    if i == len(S)-2:
            if memory % 2 == 0:
                ans[memory] += even
                ans[memory+1] += odd
            else:
                ans[memory] += odd
                ans[memory+1] += even
        

for num in ans:
    print(num , end=' ')

print()



                


Measured memory_bytes: 5596
/*
	input: データセット数, データセット(3つずつ)
	output:yes || no
*/

#include<iostream>
using namespace std;

int main(){
	int N;
	cin >> N;
	
	for(int i=0; i<N; i++){
		int a,b,c;
		cin >> a >> b >> c;
		
		a*=a, b*=b, c*=c;
		if(a==b+c || b==a+c || c==a+b){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1148