akhauriyash/Code-Regression huggingface dataset:
import os
import heapq
import sys,threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10**5)
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]

def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)
# Python3 function to
# calculate nCr % p
def ncr(n, r, p):
	# initialize numerator
	# and denominator
	num = den = 1
	for i in range(r):
		num = (num * (n - i)) % p
		den = (den * (i + 1)) % p
	return (num * pow(den,
			p - 2, p)) % p

# p must be a prime
# greater than n
# n, r, p = 10, 2, 13
# print("Value of nCr % p is",
# 			ncr(n, r, p))


def main():
    # n=int(input())
    mod=10**9+7
    #
    # # print(fact)
    # if n==1:
    #     print(0)
    # else:
    #     take=(ncr(n,2,mod)*ncr(n,n-2,mod)*power(10,n-2,mod))%mod
    #     print(take)
    #     # ans=0
    #     # for i in range(2,n):
    #     #     ans=(ans+power(10,n-i-1,mod))%mod
    #     # print(ans)
    n=int(input())
    dp=[0,0,0,1]
    for i in range(4,n+1):
        ans=0
        for j in range(3,i+1):
            ans+=dp[i-j]
        dp.append(1+ans)
    print(dp[n]%mod)


BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()
    #threadin.Thread(target=main).start()


Measured memory_bytes: 76024
# solution
data = str(input())
n = len(data)

c = [1] * n
for i in range(n):
  if data[i] == 'R' and data[i+1] == 'R':
    c[i+2] += c[i]
    c[i] = 0

for i in range(n-1, -1, -1):
  if data[i] == 'L' and data[i-1] == 'L':
    c[i-2] += c[i]
    c[i] = 0

print(' '.join(map(str, c)))


Measured memory_bytes: 10484
package main

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

var sc = bufio.NewScanner(os.Stdin)

func newInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {

	var n int
	sc.Split(bufio.ScanWords)
	n = newInt()

	if n == 1 {
		fmt.Println(0)
	} else {
		fmt.Println(1)
	}
}


Measured memory_bytes: 1776
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int n;
  int sa,sb;
  while(cin>>n,n){
  sa = sb = 0;
  while(n--){
    int a,b;
    cin>>a>>b;
    if(a>b){
      sa += a + b;
    }else if(a == b){
      sa += a;
      sb += b;
    }else{
      sb += a + b;
    }
  }

  cout<< sa << " " << sb << endl;
  }
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <tuple>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <random>
#include <queue>
#include <deque>
#include <iterator>
#include <map>
#include <functional>
#include <numeric>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define pb(a) push_back(a)
#define llong long long
#define INF 1145141919
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
int dy[] = { 1, 0, -1, 0 };
int dx[] = { 0, 1, 0, -1 };
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }


int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	vector<int> c(n);
	REP(i, n) {
		cin >> v[i];
	}
	REP(i, n) {
		cin >> c[i];
	}

	int ret = 0;
	REP(i, n) {
		if (v[i] > c[i]) {
			ret += v[i] - c[i];
		}
	}
	cout << ret << endl;
	return 0;
}


Measured memory_bytes: 256
// ※※※ 解答不能 ※※※
// https://img.atcoder.jp/panasonic2020/editorial.pdf
#include <bits/stdc++.h>
using namespace std;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
const int MAX = 101010;
const int K = 50000;
#define M 4000
bool ab[MAX], ac[MAX], bc[MAX];

// 文字を比較する.
// @param c1: 対象文字.
// @param c2: 比較文字.
// @return  : 比較した結果.
bool match(char c1, char c2){
    return (c1 == '?' || c2 == '?' || c1 == c2);
}

int main(){
    
    // 1. 入力情報.
    char c1[2020], c2[2020], c3[2020];
    scanf("%s %s %s", c1, c2, c3);
    string a(c1), b(c2), c(c3);
    
    // 2. 各配列の更新.
    int al = a.size(), bl = b.size(), cl = c.size();
    rep(i, al) rep(j, bl) if(!match(a[i], b[j])) ab[i - j + K] = 1;
    rep(i, al) rep(j, cl) if(!match(a[i], c[j])) ac[i - j + K] = 1;
    rep(i, bl) rep(j, cl) if(!match(b[i], c[j])) bc[i - j + K] = 1;
    
    // 3. 長さを計算.
    int ans = 123456789;
    repx(i, -M, M + 1){
        repx(j, -M, M + 1){
            if(!ab[i + K] && !ac[j + K] && !bc[j - i + K]){
                int L = min(0, min(i, j));
                int R = max(al, max(bl + i, cl + j));
                ans = min(ans, R - L);
            }
        }
    }
    
    // 4. 出力.
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 384
let to_array s =
  Str.split (Str.regexp_string " ") s
  |> List.map int_of_string
  |> Array.of_list;;

let binary_search l value =
  let rec loop left right =
    let mid = (left+right)/2 in
    if left > right then 0
    else if l.(mid) = value then 1
    else
      let (l_new, r_new) =
        if value < l.(mid) then (left, mid-1)
        else (mid+1, right)
      in
      loop l_new r_new
  in loop 0 ((Array.length l)-1)
;;

let _ = read_int () and
    s = read_line () |> to_array and
    _ = read_int () and
    t = read_line () |> to_array  in
    let count = Array.fold_left (fun x y -> x + (binary_search s y)) 0 t in
    Printf.printf "%d\n" count
;;

Measured memory_bytes: 16200
n=int(input())
x=0
A=1
B=1
C=1
mod=10**9+7
while x<n:
    A=(A*10)%mod
    B=(B*9)%mod
    C=(C*8)%mod
    x+=1
B=(B*2)%mod
print((A-B+C)%mod)

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

#define INF_LL (int64)1e18
#define INF (int64)1e9
#define REP(i, n) for(int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for(int64 i = (a); i < (b); i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using int64 = int_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

template<typename A, typename B> inline void chmin(A &a, B b) { if(a > b) a = b; }
template<typename A, typename B> inline void chmax(A &a, B b) { if(a < b) a = b; }

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
    for(auto &e:u) fill_v<T>(e,v...);
}


::std::vector<::std::int64_t> divisors(::std::int64_t x) {
    ::std::vector<::std::int64_t> res;
    for (::std::int64_t i = 1; i*i <= x; ++i) {
        if (x % i == 0) {
            res.push_back(i);
            if (i * i != x) res.push_back(x / i);
        }
    }
    ::std::sort(res.begin(), res.end());
    return res;
}


int main(void) {
    int64 Q;
    cin >> Q;
    vector<int64> ok(112345, 0);
    FOR(i, 2, ok.size()) {
        auto div = divisors(i);
        int64 now = 1;
        REP(j, div.size()-1) {
            now *= div[j];
            if (now >= i*2) {
                ok[i] = 1;
                break;
            }
        }
        ok[i] += ok[i-1];
    }
    REP(i, Q) {
        int64 N;
        cin >> N;
        cout << ok[N] << endl;
    }
}


Measured memory_bytes: 3616
n = gets
arr = gets.chomp.split.map(&:to_i)

n = 0
que = [arr]
until que.empty?
    ar = que.shift
    min = ar.min

    if min == 0
        temp = []
        ar.each{|item|
            if item == 0
                que << temp if !temp.empty?
                temp = []
            else
                temp << item
            end
        }
        que << temp if !temp.empty?
    else
        ar.map!{|item| item - min}
        que << ar
        n += min
    end
end
puts n

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
const int INF = 1e8;
using namespace std;

const int N = 1000;

struct Point{
	int x, y;
	bool operator < ( const Point &right ) const {
		return x < right.x;
	}
};
typedef pair<int,Point> pip;

int dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};
char c[N][N];
bool m[N][N];


vector<Point> bfs(int h, int w, Point p, int k){
	int dis[N][N];
	queue<Point> q;
	rep(i,N) rep(j,N) dis[i][j] = INF;

	dis[p.y][p.x] = 0;
	q.push(p);

	Point u;
	vector<Point> res;
	while(not q.empty()){
		u = q.front(); q.pop();
		res.emplace_back(u);
		rep(i,4){
			Point next;
			next.x = u.x + dx[i];
			next.y = u.y + dy[i];
			if(next.x < 0 || next.x >= w || next.y < 0 || next.y >= h) continue;
			if(dis[next.y][next.x] == INF && c[next.y][next.x] == '.' && dis[u.y][u.x] + 1 <= k){
				dis[next.y][next.x] = dis[u.y][u.x] + 1;
				q.push(next);
			}
		}
	}
	return res;
}

int bfs(int h, int w, Point p, vector<Point> s, int k){
	int dis[N][N];
	priority_queue<pip, vector<pip>, greater<pip>> q;
	rep(i,N) rep(j,N) dis[i][j] = INF;

	for(auto i : s){
		dis[i.y][i.x] = 0;
		q.push(make_pair(0,i));
	}

	while(not q.empty()){
		pip cur = q.top(); q.pop();
		Point u = cur.second;
		rep(i,4){
			Point next;
			next.x = u.x + dx[i];
			next.y = u.y + dy[i];
			if(next.x < 0 || next.x >= w || next.y < 0 || next.y >= h) continue;
			if(dis[next.y][next.x] > dis[u.y][u.x] + 1){
				dis[next.y][next.x] = dis[u.y][u.x] + 1;
				q.push(make_pair(dis[next.y][next.x], next));
			}
		}
	}

	int ans = INF;
	rep(i,h) ans = min(ans, min(dis[i][0], dis[i][w - 1]));
	rep(i,w) ans = min(ans, min(dis[0][i], dis[h - 1][i]));
	//show(ans)

	//rep(i,h){ rep(j,w){ cout << dis[i][j] << ' '; } cout << endl; }

	return (ans + k - 1) / k;
}


int main(){
	int h, w, k;
	cin >> h >> w >> k;

	Point s;
	rep(i,h){
		rep(j,w){
			cin >> c[i][j];
			if(c[i][j] == 'S') s = Point{j,i};
		}
	}
	vector<Point> tmp = bfs(h, w, s, k);
	cout << bfs(h, w, s, tmp, k) + 1 << endl;
}


Measured memory_bytes: 35688
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

#define INF 999999999
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define pb(a) push_back(a)

typedef long long ll;
using namespace std;

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 int dy[] = { 0, 0, 1, -1 };
//const int dx[] = { 1, -1, 0, 0 };
const int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
const int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };


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

	s = to_string(n);

	if (s[2] == s[0]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;

int main() {
    int n;
    cin >> n;
    int ans = 1e9;
    range (a, 1, n) {
        int b = n - a;
        string str = to_string(a) + to_string(b);
        int sum = 0;
        for (auto c : str) sum += c - '0';
        ans = min(ans, sum);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<tuple>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<vector>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, int> pli;
typedef tuple<int,int,int> t3;

const int MX = 505;
const int MM = 1000000007;

int DB[] = {2, 3, 5, 7, 11, 13, 17};
int DC[] = {8, 5, 3, 2, 2, 2, 2};

int Q;
int A[MX], B[MX], x[MX];

ll ans = 0;

void solve(ll v){
	map<int, ll> D;
	for(int i = 1; i <= Q; i++){
		if( v%A[i] == 0){
			D[B[i]] += x[i];
		}
	}
	ll tot = 0;
	for(auto e : D){
		if( e.first == 1 || e.second > 0) tot += e.second;
	}
	ans = max(ans, tot);
}

void aa(int x, ll v){
	if(x <= 6 ){
		for(int i = 0; i <= DC[x]; i++){
			aa(x+1, v);
			v *= DB[x];
		}
	}
	else solve(v);
}

int main()
{
	scanf("%d", &Q);
	for(int i = 1; i <= Q; i++) A[i] = 1;
	for(int i = 1; i <= Q; i++){
		int m;
		scanf("%d%d", &m, x+i);
		for(int j = 0; j <= 6; j++){
			while(m % DB[j] == 0){
				A[i] *= DB[j];
				m /= DB[j];
			}
			B[i] = m;
		}
	}
	aa(0, 1);
	printf("%lld\n", ans);
}


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

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n){
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  
  int alice=0,bob=0;
  for(int i=n-1;i>=0;i-=2){
    alice += v[i];
  }
  for(int i=n-2;i>=0;i-=2){
    bob += v[i];
  }
  cout << alice-bob << endl;
}

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

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	int t;
	int ans=0;
	cin >>n;
	map<int,int> mp;
	for(int i=0;i<n;++i){
		cin >>t;
		mp[t]++;
	}
	for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
		if((itr->second)-(itr->first)>0){ans+=(itr->second)-(itr->first);}
		if((itr->second)-(itr->first)<0){ans+=(itr->second);}
	}
    cout <<ans<<endl;
	return 0;
}

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

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

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

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  vi a(n), k(n);
  REP(i, n) {
    cin >> a[i] >> k[i];
  }

  int ans = 0;
  REP(i, n) {
    while(a[i] % k[i] && a[i] >= k[i]) {
      int diff = a[i] / k[i] + 1;
      a[i] -= max(1, a[i] % k[i] / diff) * diff;
    }
    if(a[i] >= k[i]) ans ^= a[i] / k[i];
  }

  cout << (ans ? "Takahashi" : "Aoki") << endl;

}
























Measured memory_bytes: 256
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static private int sample = 0;
	static private InputStream in;
	static private PrintStream out;
	static private Scanner sc;
	static {
		if(sample == 0) {
			in = System.in;
			out = System.out;
		}else {
			try {
				in = new FileInputStream(new File("sample"+sample));
				out = new PrintStream("result"+sample);
			} catch (Exception e) {
				e.printStackTrace();
				System.exit(1);
			}
		}
		sc = new Scanner(in);
	}
	static public boolean fileCompare2(String fileA, String fileB) {
		boolean bRet = false;
		try {
			bRet = Arrays.equals(Files.readAllBytes(Paths.get(fileA)), Files.readAllBytes(Paths.get(fileB)));
		} catch (IOException e) {
		}
		return bRet;
	}
	static public void exit() {
		if(sample!=0) {
			out.close();
			String sam = "sample"+sample;
			String ans = "answer"+sample;
			String res = "result"+sample;
			if(fileCompare2(ans, res)) {
				System.out.println("AC");
			}else {
				System.out.println("WA");
				try {
					System.out.println(new String(Files.readAllBytes(Paths.get(ans))));
					System.out.println(new String(Files.readAllBytes(Paths.get(res))));
					System.out.println(new String(Files.readAllBytes(Paths.get(sam))));
				} catch (IOException e) {
				}
			}
		}
		sc.close();
	}
	static public void main(String ...strings ) {
		try {
			final long L = sc.nextLong();
			final long R = sc.nextLong();
			if(R-L >= 2019) {
				out.println(0);
				return;
			}
			if((L%2019) > (R%2019)) {
				out.println(0);
				return;
			}

			long min = Long.MAX_VALUE;
			for(long i=L;i<=R-1;i++) {
				for(long j=i+1;j<=R;j++) {
					min = Math.min(min, (i*j)%2019);
				}
			}
			out.println(min);
		} finally {
			exit();
		}
	}
}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define pb push_back

int main()
{
    lli h , n , aux, sum = 0  ;
    cin >> h >> n ;

    for (int i = 0 ; i < n ; i++)
    {
        cin >> aux ;
        sum += aux ;
    }

    (sum >= h) ? cout << "Yes\n" : cout << "No\n" ;

    return 0 ;
}

Measured memory_bytes: 384
#include<stdio.h>
#include<string.h>
int main() {
	int x = 0;
	char s[5];
	scanf("%s", &s);
	for (int i = 0; i < 4; i++) {
		if (s[i] == '+') {
			x++;
		}
		else {
			x--;
		}
	}
	printf("%d\n", x);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	int h[n],i;
	for(i=0;i<n;i++)
	{
		cin>>h[i];
	}
	int dp[n];
	dp[0]=0;
	dp[1]=abs(h[0]-h[1]);
	for(i=2;i<n;i++)
	{
		dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
	}
	cout<<dp[n-1];
	return 0;
}

Measured memory_bytes: 4364
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];
        int[] B = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
            B[i] = sc.nextInt();
        }

        int[] mina = Arrays.copyOf(A, A.length);
        int[] maxa = Arrays.copyOf(B, B.length);

        Arrays.sort(mina);
        Arrays.sort(maxa);

        if (N % 2 == 0) {
            int l = mina[N/2] + mina[N/2 - 1];;
            int r = maxa[N/2] + maxa[N/2 - 1];;
            System.out.println(r - l + 1);
        } else {
            //System.out.println("odd" + maxa[N/2]);
            System.out.println(maxa[N/2] - mina[N/2] + 1);
        }
        return;
    }

}

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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

const ll mod = 1000000007;

static const ll INF = 1e15;


int main(void)	
{
	string s;
	cin >> s;
	set<char> ss;
	for (auto c : s) {
		ss.insert(c);
	}
	if (ss.size() == 1) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
	return 0;
}



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

ll calc(ll a,ll b,ll p){//a^(b) mod p   
	if(b==0)return 1;
	ll y = calc(a,b/2,p);y=(y*y)%p;
	if(b & 1) y = (y * a) % p;
	return y;
}


int main(){
	ll N,MOD=1000000007;
	cin >> N;
	vector<ll> C(N);
	for(auto &x:C) cin >> x;

	sort(C.rbegin(), C.rend());
	
	ll ans = 0;
	ll tr = calc(2,MOD-2,MOD);
	ll fn = calc(4,N-1,MOD);

	for(int i=0;i<N;i++){
		( ans += (i+2)*fn%MOD*C[i] ) %= MOD;
	}

	cout << ans << endl;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int ac=0,wa=0,tle=0,re=0;
    for(int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        if(s=="AC")  ac++;
        if(s=="WA")  wa++;
        if(s=="TLE") tle++;
        if(s=="RE")  re++;
    }
    cout<<"AC x "<<ac<<endl;
    cout<<"WA x "<<wa<<endl;
    cout<<"TLE x "<<tle<<endl;
    cout<<"RE x "<<re<<endl;
    
    return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> p(m);
  vector<string> s(m);
  rep(i, m) {
    cin >> p[i] >> s[i];
  }
  
  vector<int> q(n+1);
  vector<int> fin(n+1);
  int penalty = 0;
  int ac = 0;
  rep(i, m) {
    if (fin[p[i]]) continue;
    if (s[i] == "WA") {
      q[p[i]]++;
    } else {
      ac++;
      penalty += q[p[i]];
      fin[p[i]] = 1;
    }
  }
  cout << ac << " " << penalty << endl;
  return 0;
}

Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N, A, B;
  cin >> N >> A >> B;
  vector<int> P1, P2, P3;
  rep(i,N){
    int p;
    cin >> p;
    if(p <= A) P1.push_back(p);
    else if(p <= B) P2.push_back(p);
    else P3.push_back(p);
  }

  cout << min(P1.size(), min(P2.size(), P3.size())) << endl;
  
  return 0;
}



Measured memory_bytes: 256
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    var X = input.trim();
    var money = 100;
    var risi = 0;
    var count = 0;
    for (let i = 0; i < X; i++) {
        money = Math.floor(money * 1.01);
        if (money >= X) {
            console.log(i+1);
            i = X;
        }
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29684
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

diff=[a[i]-b[i] for i in range(n)]
diff.sort()
# print(diff)
suma=[0 for i in range(n)]
sumb=[0 for i in range(n)]
suma[0]=a[0]
sumb[0]=b[0]
for i in range(n-1):
    suma[i+1]=suma[i]+a[i+1]
    sumb[i+1]=sumb[i]+b[i+1]
if suma[n-1]>sumb[n-1]:
    point=0
    cnt=0
    for i in range(n):
        if diff[i]>=0:
            break
        point+=diff[i]
        cnt+=1
    # print(point,cnt)
    i=-1
    if point<0:
        for i in range(n):
            point+=diff[n-1-i]
            if point>=0:
                break
    print(cnt+i+1)
else:
    print(-1)


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

#define rep(i,n) for (int i=0;i<(int)n;++i)
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define ALL(x) x.begin(),x.end()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
inline void chmin(int &x, int y) { if (x > y) x = y; }


int main() {
    /*
    vi vec;
    rep(i, 10) vec.pb(rand() % 1000);
    sort(ALL(vec));
    rep(i,vec.size) cout<<vec[i]<<endl;
    */
    ll N, A, B, Amax = 0, Bmax = 0;
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> A >> B;
        if(Amax < A){
            Amax = A;
            Bmax = B;
        }
    }

    cout << Amax + Bmax << endl;
    return 0;
}

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

using namespace std;

int Month;
int Day;

char *data[] ={
 "Monday",
 "Tuesday",
 "Wednesday",
 "Thursday",
 "Friday",
 "Saturday",
 "Sunday"
};
int days[12] = {31,29,31,30,31,30,31,31,30,31,30,31};

int ans[12][31];
int d = 3;
int main()
{   
    for(int i = 0;i < 12;i++){
      for(int j = 0;j < days[i];j++){
	ans[i][j] = d%7;
	d++;
      }
    }
    while(cin >>Month>>Day){
      if(Month ==0)
	break;
    cout <<data[ans[Month-1][Day-1]]<<endl;
    }
  return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
ll power(ll a, ll b) {ll res = 1; a = a % mod; while (b) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b /= 2;} return res;}
ll invmod(ll a) {return power(a, mod - 2);}
int main(void)
{
	FIO
	int t = 1;
	// cin >> t;
	while (t--)
	{
		ll n;
		cin >> n;
		if (n == 1) cout << "0\n";
		else {
			ll ten = power(10, n);
			ll et = ( 2 * (power(9, n) % mod)) % mod;
			cout << (ten - et + power(8, n) % mod + mod) % mod << "\n";
		}
	}
	return 0;
}

Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	}
}

Measured memory_bytes: 22996
# coding=utf-8
from collections import deque

n, q = map(int, input().split())
queue = deque()
total_time = 0

for i in range(n):
    name, time = input().split()
    queue.append([name, int(time)])

while queue:
    poped = queue.popleft()
    if poped[1] > q:
        queue.append([poped[0], poped[1] - q])
        total_time += q
    else:
        total_time += poped[1]
        print(poped[0], total_time)

Measured memory_bytes: 16052
n, m = map(int, input().split())
s = [list(map(int, input().split()))[1:] for _ in range(m)]
p = list(map(int, input().split()))
ans = 0
for bit in range(1 << n):
    flag = 1
    for i in range(m):
        on_count = 0
        for switch in s[i]:
            if bit & (1 << (switch-1)):
                on_count += 1
        if (on_count % 2) != p[i]:
            flag = 0
            break
    ans += flag
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char s;
  cin >> s; // 変数sで入力を一行受け取る
  
  if (s=='a' || s=='e' || s=='i' || s=='o' || s=='u' ){
    cout << "vowel " << endl;
  }else{
    cout << "consonant " << endl;
  }
}

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int l = Integer.parseInt(sc.next());
        String[] ary = new String[n];
        for (int i = 0; i < n; i++) {
            String a = sc.next();
            ary[i] = a;
        }
        Arrays.sort(ary);
        for (String ans : ary) {
            System.out.print(ans);
        }
    }
}

Measured memory_bytes: 22228
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//System.out.println("??\???>>");
		Scanner scan = new Scanner(System.in);

		int intNum = scan.nextInt();


		System.out.println(intNum * intNum * intNum);
	}

}

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cout << (*begin) << " ";
    *begin++;
  }
  cout << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  std::cerr << head << " ";
  print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
  int val = ((a % mod) + (b % mod)) % mod;
  if (val < 0) { val += mod; }
  a = val;
}

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

const int INF = 1e18;

int N, A, B, C;
vec<int> l;

int rec(int idx, int a, int b, int c) {
  if (idx >= N) {
    if (a == 0 or b == 0 or c == 0) return INF;
    return abs(a - A) + abs(b - B) + abs(c - C);
  }

  int ret = INF;
  // A
  chmin(ret, rec(idx + 1, a + l[idx], b, c) + (a > 0 ? 10 : 0));
  // B
  chmin(ret, rec(idx + 1, a, b + l[idx], c) + (b > 0 ? 10 : 0));
  // C
  chmin(ret, rec(idx + 1, a, b, c + l[idx]) + (c > 0 ? 10 : 0));
  // No
  chmin(ret, rec(idx + 1, a, b, c));

  return ret;
}

signed main() {
  cin >> N >> A >> B >> C;
  l.resize(N);
  rep (i, N) {
    cin >> l[i];
  }

  cout << rec(0, 0, 0, 0) << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;
// const int INF=1010101010;
using Graph = vector<vector<int>>;

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

  vector<int> ans;
  vector<int> b(n + 1, 0);

  for (int i = n; i >= 1; i--) {
    int sum = 0;
    for (int j = i; j <= n; j += i) {
      sum += b[j];
    }
    if ((sum + a[i]) % 2 == 1) {
      b[i]++;
      ans.push_back(i);
    }
  }

  RSORT(ans);

  cout << ans.size() << endl;
  for (auto x : ans) cout << x << " ";
  cout << endl;
}

Measured memory_bytes: 3064
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
#define EPS 1e-9
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1LL << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;
signed main() {
	cin >> N >> K;
	vector< int > V(N);
	rep(i, N) cin >> V[i];
	vector< int > S(N + 1, 0), Sr(N + 1, 0);
	rep(i, N) S[i + 1] = S[i] + V[i];
	rep(i, N) S[i + 1] = S[i] + V[N - 1 - i];
	int ans = 0;
	for (int l = 0; l <= N; l++) {
		for (int r = 0; r <= N; r++) {
			if (l + r > min(K, N))
				break;
			vector< int > A;
			rep(i, l) A.push_back(V[i]);
			rep(i, r) A.push_back(V[N - 1 - i]);
			sort(A.begin(), A.end());
			rep(i, min((int)A.size(), K - l - r)) if (A[i] < 0) A[i] = 0;
			int tmp = 0;
			rep(i, A.size()) tmp += A[i];
			chmax(ans, tmp);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
s = list(input())
t = s[::-1]
n = len(s)
if s != t:
  print ('No')
  exit()
if n == 3:
  print('Yes')
  exit()
d = s[:int((n-1)/2)]
e = d[::-1]
#print(d,e)
r = s[int((n+3)/2-1):]
q = r[::-1]
#print(r,q)
if d != e:
  print('No')
  exit()
if r != q:
  print ('No')
  exit()
  
print('Yes')

Measured memory_bytes: 3064
# -*- coding: utf-8 -*-
# abc126/abc126_e
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))


class UnionFindNode(object):
    def __init__(self, group_id, parent=None, value=None):
        self._group_id = group_id
        self._parent = parent
        self.value = value
        self._rank = 1
    
    def __str__(self):
        template = "UnionFindNode(group_id: {}, \n\tparent: {}, value: {}, size: {})"
        return template.format(self._group_id, self._parent, self.value, self._rank)
    
    def is_root(self):
        return not self._parent
    
    def root(self):
        parent = self
        while not parent.is_root():
            parent = parent._parent
            self._parent = parent
        return parent
    
    def find(self):
        root = self.root()
        return root._group_id
    
    def rank(self):
        root = self.root()
        return root._rank

    def unite(self, unite_node):
        root = self.root()
        unite_root = unite_node.root()

        if root._group_id != unite_root._group_id:
            if root.rank() > unite_root.rank():
                unite_root._parent = root
                root._rank = max(root._rank, unite_root._rank + 1)
            else:
                root._parent = unite_root
                unite_root._rank = max(root._rank + 1, unite_root._rank)

def main():
    N, M = i2nn()
    A = [UnionFindNode(x, value=x) for x in range(N)]
    s = 0
    for i in range(M):
        x, y, z = i2nn()
        A[x-1].unite(A[y-1])
    for a in A:
        s += int(a.is_root())
    print(s)
    return

main()

Measured memory_bytes: 32884
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int GCD(long long int a, long long int b){
	long long int dummy1, dummy2, dummy;
	dummy1 = max(a, b);
	dummy2 = min(a, b);
	while(true){
		dummy = dummy1 % dummy2;
		dummy1 = dummy2;
		dummy2 = dummy;
		if(dummy == 0){
			break;
		}
	}
	return dummy1;
}

int main(){
    int T;
    cin >> T;
    for(int loop = 0; loop < T; loop++){
        long long int h, w;
        cin >> h >> w;
        long long int G = GCD(h, w);
        h /= G;
        w /= G;
        if(h == w){
            cout << 1 << " " << 0 << endl;
            continue;
        }
        if(h % 2 == 0 || w % 2 == 0){
            cout << 1 << " " << 1 << endl;
            continue;
        }
        if(h > w){
            swap(h, w);
        }
        long long int S2 = (h / 2) * (h / 2 + 1) * 2;
        long long int S1 = h * (h + 1) - S2;
        S1 += h * (w - h) / 2 - h;
        S2 += h * (w - h) / 2;
        G = GCD(S1, S2);
        cout << S1 / G << " " << S2 / G << endl;
    }
    return 0;
}


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

using namespace std;
int main(){
   int k;
   scanf("%d", &k);
   int ans = 0;
   if(k % 2 == 0){
     ans = (k / 2)* (k / 2);
   } else{
     ans = (k / 2) * ((k / 2) + 1);
   }
   printf("%d", ans);
   return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#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 int nmax = 8;
bool graph[nmax][nmax];

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);
}
int dfs(int v, ll N, bool visited[nmax])
{
    bool all_visited = true;

    for (int i = 0; i < N; i++)
    {
        if (!visited[i])
        {
            all_visited = false;
        }
    }

    if (all_visited)
    {
        return 1;
    }
    int ret = 0;
    for (size_t i = 0; i < N; i++)
    {
        if (!graph[v][i])
        {
            continue;
        }
        if (visited[i])
        {
            continue;
        }

        visited[i] = true;
        ret += dfs(i, N, visited);
        visited[i] = false;
    }

    return ret;
}

void solve(long long N)
{
    //帰ったらすぐとく
    map<int, ll> prime;
    ll ans = 1;
    for (int i = 2; i <= N; i++)
    {
        ll temp = i;
        for (int j = 2; j <= i; j++)
        {
            ll cnt = 0;
            while (temp % j == 0)
            {
                cnt++;
                temp /= j;
            }
            if (cnt != 0)
            {
                if (prime.find(j) == prime.end())
                {
                    prime[j] = cnt;
                }
                else
                {
                    prime[j] += cnt;
                }
            }
        }
    }

    for (auto i = prime.begin(); i != prime.end(); i++)
    {
        ans = mulMod(ans, i->second+1);
    }

    cout << ans << endl;
}

int main()
{
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 1;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const double PI = acos(-1.0);

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define possible(n) cout << ((n) ? "possible" : "impossible") << endl
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << endl;

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(50) << setiosflags(ios::fixed);
  int q;
  cin >> q;
  map<string, int> mp;
  rep(qi, q)
  {
    int type;
    cin >> type;
    if (type == 0)
    {
      string key;
      int x;
      cin >> key >> x;
      mp[key] = x;
    }
    else if (type == 1)
    {
      string key;
      cin >> key;
      cout << (mp.count(key) ? mp[key] : 0) << endl;
    }
    else if (type == 2)
    {
      string key;
      cin >> key;
      mp.erase(key);
    }
    else
    {
      string l, r;
      cin >> l >> r;
      auto itr = mp.lower_bound(l);
      while (itr != mp.end() && itr->first <= r)
      {
        cout << itr->first << " " << itr->second << endl;
        itr++;
      }
    }
  }
  return 0;
}



Measured memory_bytes: 25772
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <fstream>

using namespace std;

#define ll long long
#define INF 2000000000
#define LINF 2000000000000000000
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define dum(x) cout<<#x<<'='<<x<<endl
#define dum2(x,y) cout<<#x<<'='<<x<<' '<<#y<<'='<<y<<'\n'<<endl
#define dum3(x,y,z) cout<<#x<<'='<<x<<' '<<#y<<'='<<y<<' '<<#z<<'='<<z<<'\n'<<endl
#define darr(arr,n) rep(i,(n-arr)){cout<<*(arr+i)<<' ';}cout<<endl

//ifstream in("Text.txt");cin.rdbuf(in.rdbuf());
int A[1010][1010];
int cone[1010];
int ctwo[1010];

int main() {
    int N;
    cin >> N;
    rep(i, 2)rep(j, N)cin >> A[i][j];

    cone[0] = A[0][0];
    for (int i = 1; i < N; i++) {
        cone[i] = cone[i - 1] + A[0][i];
    }
    ctwo[N - 1] = A[1][N - 1];
    for (int i = N - 2; i >= 0; i--) {
        ctwo[i] = ctwo[i + 1] + A[1][i];
    }

    int ma = 0;
    rep(i, N) {
        ma = max(ma, cone[i] + ctwo[i]);
    }
    cout << ma << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string n;
  cin >> n;
  if((n[0] == n[1] && n[1] == n[2]) || (n[1] == n[2] && n[2] == n[3])){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] line = Stream.of(sc.nextLine().split(" ", 0)).mapToInt(Integer::parseInt).toArray();
		char[][] map = new char[line[0]][line[1]];

		for (int i = 0; i < line[0]; i++) {
			map[i] = sc.nextLine().toCharArray();
		}
		int con = 0;
		int ans = 0;
		for (int i = 0; i < (1 << line[0]); i++) {
			for (int j = 0; j < (1 << line[1]); j++) {
				con = 0;
				for (int k = 0; k < line[0]; k++) {
					for (int l = 0; l < line[1]; l++) {
						if (map[k][l] == '#' && (((i >> k) & 1) != 1) && (((j >> l) & 1) != 1)) {
							con++;
						}
					}
				}
				if (con == line[2]) {
					ans++;
				}
			}
		}
		System.out.println(ans);
	}
}


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

using ll = long long;
#define rep(n, i) for(ll i = 0; i < n; ++i)

void solve(void){
  ll n; cin >> n;
  vector<vector<ll>> a(n, vector<ll>(3, 0));

  rep(n, i) {
    rep(3, j) cin >> a[i][j];
  }

  vector<vector<ll>> dp(n+10, vector<ll>(3, 0));

  for(ll i = 1; i <= n; ++i) {
    rep(3, j) {
      rep(3, k) {
        if (j == k) continue;
        dp[i][k] = max(dp[i][k], dp[i-1][j] + a[i-1][k]);
      }
    }
  }

  ll res = 0;
  rep(3, j) res = max(res, dp[n][j]);
  cout << res << endl;
}

int main(void) {
  solve();
  return 0;
}


Measured memory_bytes: 14316