akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define loope(i,a,b) for(ll i=a;i<=b;i++)
#define test() ull t;cin>>t;while(t--)
#define pll pair<ll,ll>
#define puu pair<ull,ull>
#define f first
#define s second
#define pb push_back
#define mkp make_pair
#define ins insert
#define Vint vector<int>
#define Vll vector<ll>
#define Vull vector<ull>
#define nl cout<<endl
#define sp cout<<" "
#define MOD 1000000007
#define all(x) x.begin(),x.end()

int main() 
{
// 	 #ifndef ONLINE_JUDGE
//         freopen("input.txt", "r", stdin);
//         freopen("output.txt", "w", stdout);
//     #endif
//     fastio();
    ll n,m;
    cin>>n>>m;
    if(n==m)
    	cout<<"Yes";
    else
    	cout<<"No";
}

Measured memory_bytes: 256
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

b = 0
tb = 0

for i in range(M):
    if tb + B[i] > K:
        break
    tb += B[i]
    b = i+1

ans = [0, b]
m = b
a = 0
ta = 0

for i in range(N):
    if ta + A[i] > K:
        break
    a = i+1
    ta += A[i]
    while True:
        if ta + tb > K:
            if b == 0:break
            b -= 1
            tb -= B[b]
        else:
            if a + b > m:
                m = a + b
                ans = [a, b]
            break

print(ans[0]+ans[1])




Measured memory_bytes: 40540
#include<stdio.h>

int main(void)
{
	int n,i,g,b,f,r,v;
	int count[4][3][10] = {0};

	scanf("%d",&n);

	for(i = 0;i < n;i++)
	{
		scanf("%d %d %d %d",&b,&f,&r,&v);
		count[b-1][f-1][r-1] += v;
	}
	for(i = 0;i < 4;i++)
	{
		for(n = 0;n < 3;n++)
		{
			for(g = 0;g < 10;g++)
			{
				printf("%2d",count[i][n][g]);
			}
			printf("\n");
		}
		if(i != 3)
		{
			printf("####################\n");
		}
	}
	return 0;
}

Measured memory_bytes: 620
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] s = br.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int m = Integer.parseInt(s[1]);
        Map<Integer, List<Integer>> mp = new HashMap<>();
        for(int i=1; i<=n; ++i) mp.putIfAbsent(i, new ArrayList<>());
        boolean ok = false;
        for(int i=1; i<=m; ++i){
            s = br.readLine().split(" ");
            int u = Integer.parseInt(s[0]);
            int v = Integer.parseInt(s[1]);
            if(u == 1 || v == 1) ok = true;
            mp.get(u).add(v);
            mp.get(v).add(u);
        }
        if(!ok){
            System.out.println("No");
            return;
        }
        int[] sign = new int[n+1];
        Queue<Integer> q = new LinkedList<>();
        Set<Integer> set = new HashSet<>();
        q.add(1);
        set.add(1);
        while(!q.isEmpty()){
            int curr = q.poll();
            for(int v : mp.getOrDefault(curr, new ArrayList<>())){
                if(!set.contains(v)){
                    sign[v] = curr;
                    set.add(v);
                    q.add(v);
                }
            }
        }

        System.out.println("Yes");
        for(int i=2; i<=n; ++i){
            System.out.println(sign[i]);
        }
    }

}


Measured memory_bytes: 85448
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	long long a,b;
	cin>>a>>b;
	if(abs(a)==abs(b)||a<0&&b>0){
		cout<<"Zero"<<endl;
		return 0;
	}
	if(a>0&&b>0){
		cout<<"Positive"<<endl;
	}
	else{
		if((b-a+1)%2==0)
		cout<<"Positive"<<endl;
		else
		cout<<"Negative"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    LR = [tuple(map(int, a.split())) for a in args[1:]]

    ret = 0

    # lp, rq = max(L), min(R)
    # d_max = max(1+r-l for l, r in LR)
    lp, rq = 0, 1+10**9
    d_max = 0
    for l, r in LR:
        lp, rq = max(lp, l), min(rq, r)
        d_max = max(d_max, 1+r-l)

    ret = max(0, 1+rq-lp) + d_max

    AB = [[max(0, 1+r-lp), max(0, 1+rq-l)] for l, r in LR]
    AB.sort(key=lambda x: (x[0], -x[1]))
    A, B = map(list, zip(*AB))

    # for i in range(1, n):
    #     ret = max(ret, min(A[i:]) + min(B[:i]))
    b_min = 1+10**9
    for i in range(n-1):
        b_min = min(b_min, B[i])
        ret = max(ret, b_min + A[i+1])

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


Measured memory_bytes: 54872
#include<bits/stdc++.h>
using namespace std;
    static const double pi = 3.141592653589793;
 typedef pair<int64_t,int64_t> P;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main() {
int64_t a,b,c;
  cin>>a>>b>>c;
  int64_t count=a/(b+c);
  if(a-count*(b+c)>b) cout<<(count+1)*b;
else cout<<count*b+a-count*(b+c);
 
}
 

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <cmath>
#define int long long
using namespace std;
const int mo = 2019;
main()
{
    int l,r;
    cin >> l >> r ;
    if( r - l >= 1e4 ) { cout << 0 << endl;}
    else
    {
        int ans = 2019;
        for( int i = l; i < r; i++ )
        {
            for( int j = i + 1; j <= r; j++ )
            {
                if( ans > i * j % mo )ans = i * j % mo;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
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 ALL(x) (x).begin(),(x).end()

using ll = long long;
using ull = unsigned long long;
 
const ll INF = 1LL<<60;
const int MINF = 1e9;
const int MOD = 1e9+7;

using vi = vector<int>;
using vii = vector<vi>;

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

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n,k;cin >> n >> k;
    vi p(n);rep(i,n)cin >> p[i];

    int Max = 0;
    int max_index = 0;
    int sum = 0;
    for(int i=0;i<k;i++){
        sum += p[i];
    }
    Max = sum;

    for(int i=k;i<n;i++){
        sum = sum + p[i] - p[i-k];
        if(chmax(Max,sum))max_index = i-(k-1);
    }

    long double ans = 0;
    for(int i=max_index;i<max_index+k;i++){
        ans += 0.5 * (p[i] + 1.0);
    }
    cout << fixed << setprecision(10);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * {}
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

func factorial(x:Int)->Int{return (1...x).reduce(1){$0*$1%1000000007}}
let (N, M) = *readIntSplit()
print(factorial(N)*factorial(M)*(N==M ? 2:abs(N-M)<2 ?1:0)%1000000007)


Measured memory_bytes: 7016
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <cmath>
#include <cassert>

using namespace std;

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main()
{
	int n;
	cin>>n;
	cout<<pow(n,3)<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define ALL(a) (a.begin(), a.end())
using ll = long long;
template<typename T> void Out(T x) { cout << x << endl; }

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, x, y;
  cin >> n >> x >> y;

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

  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int dist = (j - i);
      dist = min(dist, (abs(x - i) + 1 + abs(j - y)));
      // dist = min(dist, abs(y - i) + 1 + abs(x - j));
      cnt[dist]++;
    }
  }
  for (int i = 1; i < n; i++) {
    cout << cnt[i] << endl;
  }

}


Measured memory_bytes: 256
#include<stdio.h>

/* 再帰関数による最大公約数 */
int gcd(int x, int y) {
  return y ? gcd(y, x % y) : x;
}

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", gcd(a, b));

  return 0;
}


Measured memory_bytes: 2712
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};

typedef unsigned long long ull;

struct P{
    double x, y;
    double size(){
        return std::sqrt(x*x + y*y);
    }
    double sizeS(){
        return x*x + y*y;
    }
};

P operator+(const P& lp, const P& rp){
    return {lp.x+rp.x, lp.y+rp.y};
}

P operator-(const P& lp, const P& rp){
    return {lp.x-rp.x, lp.y-rp.y};
}

P operator*(const P& p, const double& k){
    return {k*p.x, k*p.y};
}

double cross(const P& lp, const P& rp){
    return lp.x * rp.y - lp.y * rp.x;
}

int main(){
    int N;
    std::cin >> N;

    REP(i, N){
        P A, B, C, v1, v2, v3;
        std::cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y;
        v1 = B - A; v2 = C - A, v3 = B - C;

        double sinA = std::abs(cross(v1, v2)) / (v1.size() * v2.size()),
            r = v3.size() / 2.0 / sinA;

        double x = 0.5 * ((A.y-C.y)*(A.sizeS()-B.sizeS()) - (A.y-B.y)*(A.sizeS()-C.sizeS())) / ((A.x-B.x)*(A.y-C.y)-(A.x-C.x)*(A.y-B.y)),
            y = 0.5 * ((A.x-C.x)*(A.sizeS()-B.sizeS()) - (A.x-B.x)*(A.sizeS()-C.sizeS())) / ((A.y-B.y)*(A.x-C.x)-(A.y-C.y)*(A.x-B.x));

        printf("%.3f %.3f %.3f\n", x, y, r);
    }
}

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

int main(){
	int n,m;
	cin >> n  >> m;
	vector<P> p(m);
	rep(i,m) cin >> p[i].first >> p[i].second;
	rep(x,1000){
		int keta = 1;
		int nx = x/10;
		vector<int> d(1,x%10);
		while(nx){
			keta++;
			d.push_back(nx%10);
			nx /= 10;
		}
		if(keta != n) continue;
		bool ok = true;
		reverse(d.begin(),d.end());
		rep(i,m){
			if (d[p[i].first -1] != p[i].second) ok = false;
		}
		if(ok){
			cout << x << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
 
#define forn(i, n) for (llong i = 0ll; i < (llong) n; ++i)
#define fornn(i, l, r) for (llong i = (llong) l; i < (llong) r; ++i)
#define size(x) ((int) (x.size()))
 
using namespace std;
 
typedef long long llong;
const llong inf = (llong) 1e+9 + 7ll;
const llong linf = (llong) 1e+18 + 7ll;
const long double eps = (long double) 1e-9;
const long double pi = acosl((long double) -1.0);
const int alph = 26;

mt19937 mrand(random_device{} ()); 

template<typename T, typename U> inline llong umin(const T& a, const U& b) { return a < b ? a : b; }
template<typename T, typename U> inline llong umax(const T& a, const U& b) { return a > b ? a : b; }
 
static char buff[(int) 2e6 + 17]; // reads std::string
const int maxn = (int) 2e5 + 17;

int n, m;

bool read()
{
	if (scanf("%d %d", &n, &m) != 2)
		return false;

	return true;
}

llong get(int n, int m, int nn, int mm)
{
	llong s1 = 1ll * n * m, s2, s3;

	if (1ll * nn * mm % 2 == 0)
		return abs(s1 - 1ll * nn * mm / 2);
	
	llong res1 = max({s1, 1ll * (nn / 2) * mm, 1ll * (nn / 2 + 1) * mm})
			   - min({s1, 1ll * (nn / 2) * mm, 1ll * (nn / 2 + 1) * mm});
	llong res2 = max({s1, 1ll * (mm / 2) * nn, 1ll * (mm / 2 + 1) * nn})
			   - min({s1, 1ll * (mm / 2) * nn, 1ll * (mm / 2 + 1) * nn});

	return min(res1, res2);
}

void solve()
{
	llong ans = linf;

	for (int i = 1; i < n; ++i)
	{
		ans = min(ans, get(i, m, n - i, m));
		ans = min(ans, get(n - i, m, i, m));
	}

	for (int i = 1; i < m; ++i)
	{
		ans = min(ans, get(n, i, n, m - i));
		ans = min(ans, get(n, m - i, n, i));
	}

	printf("%lld\n", ans);
}

int main()
{
#if SEREZHKA
	freopen("file.in", "r", stdin);
#endif

	while (read())
		solve();

	return 0;
}


Measured memory_bytes: 256
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, k = list(map(int, readline().split()))

    ans = 0
    s_min = 0
    s_max = 0

    for i in range(k - 1):
        s_min += i
        s_max += (n - i)

    for i in range(k - 1, n + 1):
        s_min += i
        s_max += (n - i)
        ans += (s_max - s_min + 1)
        ans %= MOD

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 63584
//Heaplax
#include<bits/stdc++.h>
#define LL long long
#define LOG(x) cerr<<#x<<" = "<<x<<endl
#define add_edge(u,v) nxt[++cnt]=head[u],head[u]=cnt,to[cnt]=v
#define open(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
char ch;bool fs;void re(int& x)
{
	while(ch=getchar(),ch<33);
	if(ch=='-')fs=1,x=0;else fs=0,x=ch-48;
	while(ch=getchar(),ch>33)x=x*10+ch-48;
	if(fs)x=-x;
}
using namespace std;
int n,m,a,b;
int main()
{
	re(n),re(m),re(a),re(b);
	if(n%a==0 && m%b==0)return puts("No"),0;
	puts("Yes");
	for(int i=1;i<=n;++i,puts(""))
		for(int j=1;j<=m;++j)
		{
			if(n%a!=0)
				printf("%d ",i%a?555:-(555*(a-1)+1));
			else 
				printf("%d ",j%b?555:-(555*(b-1)+1));
		}
}
/*
x * H/h
y * H-H/h

x=(h-1)y+1
x * H/h  < y * (H-H/h)
*/


Measured memory_bytes: 1280
#pragma GCC optimize("Ofast")
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
using namespace std;
#define INF 1LL<<62
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll

signed main(){
    ll N,M;
    cin>>N>>M;
    vector<int> A(N),B(M);
    for(int i=0;i<N;i++) cin>>A[i];
    for(int i=0;i<M;i++) cin>>B[i];
    sort(A.rbegin(),A.rend());
    sort(B.rbegin(),B.rend());

    A.push_back(0);
    B.push_back(0);
    bool flag=false;
    for(int i=0;i<N;i++) if(A[i]==A[i+1]) flag=true;
    for(int i=0;i<M;i++) if(B[i]==B[i+1]) flag=true;

    if(flag){
        cout<<0<<endl;
        return 0;
    }

    ll  nowA=-1,nowB=-1;
    ll ans=1;
    for(int x=N*M;x>=1;x--){
        while(A[nowA+1]>=x){
            nowA++;
        }
        while(B[nowB+1]>=x){
            nowB++;
        }
        if(A[nowA]==x && B[nowB]==x) continue;
        if(A[nowA]==x){
            ans*=(nowB+1);
            ans%=MOD;
        }else if(B[nowB]==x){
            ans*=(nowA+1);
            ans%=MOD;
        }else{
            if((nowA+1)*(nowB+1)-(N*M-x)<=0 || nowA<0 || nowB<0){
                cout<<0<<endl;
                return 0;
            }
            ans*=((nowA+1)*(nowB+1)-(N*M-x) );
            ans%=MOD;
        }
        
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

#define MAX_N 1000010
ll inv[MAX_N+10],fac[MAX_N+10],ifac[MAX_N+10];

void setComb(){
  inv[0]=1;inv[1]=1;fac[1]=1;ifac[1]=1;fac[0]=1;ifac[0]=1;
  for(int i=2;i<MAX_N;i++){
    inv[i]=(-MOD/i)*inv[MOD%i]%MOD;
    fac[i]=fac[i-1]*i%MOD;
    ifac[i]=ifac[i-1]*inv[i]%MOD;

    inv[i]=(inv[i]+MOD)%MOD;
    fac[i]=(fac[i]+MOD)%MOD;
    ifac[i]=(ifac[i]+MOD)%MOD;
  }
  return;
}

ll comb(ll n,ll k){
  if(n<k||n<0||k<0) return 0;
  else return ((fac[n]*ifac[k]%MOD*ifac[n-k]%MOD+MOD)%MOD);
}

ll hcomb(ll n,ll r){// this size is really ok??
  if(n==0&&r==0) return 1;
  else if(n<0||r<0) return 0;
  else return comb(n+r-1,r);
}

ll mod_pow(ll x,ll n){
  x%=MOD;
  ll res=1;
  while(n>0){
    if(n&1) res=res*x%MOD;
    x=x*x%MOD;
    n>>=1;
  }
  return res;
}

void add(ll &a,ll b){
  a=(a+b)%MOD;
}

void mul(ll &a,ll b){
  a%=MOD;b%=MOD;
  a=a*b%MOD;
}

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

  ll N,K;
  cin>>N>>K;

  ll ans=0;
  ll mi=0,ma=0;
  for(ll i=0;i<=N;i++){
    mi+=i;
    ma+=N-i;
    if(i+1>=K) add(ans,ma-mi+1);
  }

  cout<<ans<<endl;

  return 0;
}


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

int main(){
    int n; cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    vector<int> c(n);
    rep(i ,n) cin >> a[i] >> b[i] >> c[i];
    int64 dp[n+1][3]={-1};
    dp[0][0]=dp[0][1]=dp[0][2]=0;
    dp[1][0]=a[0];
    dp[1][1]=b[0];
    dp[1][2]=c[0];
    for(int i=2;i<=n;++i){
        rep(j ,3){
            if(j==0){
                dp[i][j]=max(dp[i-1][1]+a[i-1],dp[i-1][2]+a[i-1]);
            } else if(j==1){
                dp[i][j]=max(dp[i-1][0]+b[i-1],dp[i-1][2]+b[i-1]);
            } else if(j==2){
                dp[i][j]=max(dp[i-1][0]+c[i-1],dp[i-1][1]+c[i-1]);
            }
        }
    }
    int64 ans;
    ans = max(dp[n][0],dp[n][1]);
    ans = max(ans , dp[n][2]);
    cout << ans << endl;
}

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

int main() {
    int N,M,C,res=0;
    cin >> N >> M >> C;
    int B[M];
    for (int i=0;i<M;i++){
        cin >> B[i];
    }
    int A[N][M];
    for(int i=0;i<N;i++){
        int tmp=C;
        for(int j=0;j<M;j++){
            cin >> A[i][j];
            tmp = tmp +  A[i][j]*B[j];
        }
        if (tmp>0){
            res++;
        }
    }

    cout << res << endl;
}

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

#define ASC(vec) vec.begin(), vec.end()    // 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend() // 降順ソート 例：sort(DESC(vec));
#define rep(i, n) for (int i = 0; i < (n); i++)
#define Rep(i, n) for (int i = 1; i < n; i++)
#define REP(i, vec) for (auto i = vec.begin(); i != vec.end(); ++i)

const int       mod = 1000000007;
const int       inf = (1 << 21);
const long long INF = 1LL << 60;

using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vd = vector<double>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vii = vector<pair<int, int>>;
using vll = vector<pair<ll, ll>>;

template<class T>
inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T>
inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T>
T GCD(T a, T b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
template<class T>
T LCM(T a, T b) {
	return a / GCD(a, b) * b;
}
template<class T>
inline T upper(T a, T b) {return (a + (b - 1)) / b; }

constexpr array<int, 9> dx = { 0, 1, 0, -1, -1, 1, 1, -1, 0 };
constexpr array<int, 9> dy = { 1, 0, -1, 0, 1, 1, -1, -1, 0 };

// ──────────────────────────────────────────────────────────────────

int g[101][101];

int main() {
	int a, b;
	cin >> a >> b;

	if (!a) {
		cout << "1 1" << endl << "#" << endl;
	}
	if (!b) {
		cout << "1 1" << endl << "." << endl;
	}

	cout << "100 100" << endl;

	for (int y = 1; y <= 100; ++y) {
		for (int x = 1; x <= 100; ++x) {
			if (y <= 50) g[y][x] = 0;
			else g[y][x] = 1;
		}
	}

	a--, b--;
	for (int y = 1; y <= 50 && b; y += 2) {
		for (int x = 1; x <= 100 && b; x += 2) {
			g[y][x] = 1;
			b--;
		}
	}

	for (int y = 1; y <= 50 && a; y += 2) {
		for (int x = 1; x <= 100 && a; x += 2) {
			g[101 - y][x] = 0;
			a--;
		}
	}

	for (int y = 1; y <= 100; ++y) {
		for (int x = 1; x <= 100; ++x) {
			if (g[y][x] == 1) cout << "#";
			else cout << ".";
		}
		cout << endl;
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;

int main(){
    int N; cin >> N;
    string S; cin >> S;
    int K; cin >> K;
    
    for(int i=0;i<S.length();i++){
        if(i==K-1) continue;
        if(S[i]!=S[K-1]){
            S[i]='*';
        }
    }
    cout << S << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc,char *args[]){
    int a,b;
    scanf("%d%d",&a,&b);
    if(a < b)      printf("a < b\n");
    else if(a > b) printf("a > b\n");
    else           printf("a == b\n");
    return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
    int h,w;cin >> h >> w;
    vector<string> f(h);
    rep(i,h)cin >> f[i];
    vector<int> ngi(h),ngj(w);
    rep(i,h){
        auto check = [&](int x){
            rep(j,w){
                if(f[x][j] == '#')return false;
            }
            return true;
        };
        if(check(i))ngi[i] = 1;
    }
    rep(i,w){
        auto check = [&](int x){
            rep(j,h){
                if(f[j][x] == '#')return false;
            }
            return true;
        };
        if(check(i))ngj[i] = 1;
    }
    rep(i,h){
        string ret;
        if(ngi[i])continue;
        rep(j,w){
            if(ngj[j])continue;
            ret += f[i][j];
        }
        cout << ret << "\n";
    }
    return 0;
}

Measured memory_bytes: 3620
;; -*- coding: utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (progn (ql:quickload '(:cl-debug-print :fiveam))
                 (shadow :run)
                 (use-package :fiveam)))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
(defmacro dbg (&rest forms)
  #+swank
  (if (= (length forms) 1)
      `(format *error-output* "~A => ~A~%" ',(car forms) ,(car forms))
      `(format *error-output* "~A => ~A~%" ',forms `(,,@forms)))
  #-swank (declare (ignore forms)))

(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 2 4 7 8 15 16 31 32 62 63 64)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 (princ obj stream) (terpri stream))))

(defconstant +mod+ 1000000007)

;; Body

(defun main ()
  (declare #.OPT)
  (let* ((s (map '(simple-array uint4 (*)) #'digit-char-p (read-line)))
         (n (length s))
         (res 0))
    (declare ((integer 1 10) n)
             (uint62 res))
    (dotimes (l n)
      (loop for r from l to n
            do (incf res
                     (* (loop with res of-type uint62 = 0
                              for i from l below r
                              do (setf res (+ (the uint62 (* 10 res)) (aref s i)))
                              finally (return res))
                        (if (zerop l)
                            1
                            (expt 2 (- l 1)))
                        (if (= r n)
                            1
                            (expt 2 (- n r 1)))))))
    (println res)))

#-swank(main)


Measured memory_bytes: 8804
#include<iostream>
    using namespace std;
    int main(void){
    	string s;
    	int n;
    	cin>>n>>s;
    	int count = 0;
    	int states = 0;
    	for(int i=0;i<n;i++){
    		switch(states){
    			case 0:
    				if(s[i] == 'A'){
    					states++;
    				}
    				break;
    			case 1:
    				if(s[i] == 'B'){
    					states++;
    				}else if(s[i] == 'A'){
    					states=1;
    				}else{
    					states = 0;
    				}
    				break;
    			case 2:
    				if(s[i]=='C'){
    					count++;
    					states=0;
    				}else if(s[i] == 'A'){
    					states=1;
    				}else{
    					states = 0;
    				}
    				break;
    		}
    	}
    	printf("%d\n",count);
    	return 0;
    }

Measured memory_bytes: 256
s=str(input())
n1=int(s[0])
n2=int(s[1])
n3=int(s[2])
n4=int(s[3])
sum1=0
sum2=0
sum3=0
ans=''
op=['+','-']
for i in range(2):
  if i == 0:
    sum1 = n1+n2
  else:
    sum1 = n1-n2
  for j in range(2):
    if j == 0:
      sum2 = sum1+n3
    else:
      sum2 = sum1-n3
    for k in range(2):
      if k == 0:
        sum3=sum2+n4
      else:
        sum3=sum2-n4
      if sum3==7:
        ans=str(n1)+op[i]+str(n2)+op[j]+str(n3)+op[k]+str(n4)+'=7'
print(ans)


Measured memory_bytes: 3064
read A
read B
read C
read D
read E

# SUM=$((A+B+C+D+E))

mA=$(( ((A+9)/10)*10 ))
mB=$(( ((B+9)/10)*10 ))
mC=$(( ((C+9)/10)*10 ))
mD=$(( ((D+9)/10)*10 ))
mE=$(( ((E+9)/10)*10 ))

SUM=$((mA+mB+mC+mD+mE))
MIN=10

MIN=$(((A-1)%10<MIN?(A-1)%10:MIN))
MIN=$(((B-1)%10<MIN?(B-1)%10:MIN))
MIN=$(((C-1)%10<MIN?(C-1)%10:MIN))
MIN=$(((D-1)%10<MIN?(D-1)%10:MIN))
MIN=$(((E-1)%10<MIN?(E-1)%10:MIN))
# echo $MIN
if [[ MIN -eq 9 ]]; then
    echo $((SUM))
    exit
fi

if [[ $(((A-1)%10)) -eq MIN ]]; then
    echo $((SUM-mA+A))
    exit
fi
if [[ $(((B-1)%10)) -eq MIN ]]; then
    echo $((SUM-mB+B))
    exit
fi
if [[ $(((C-1)%10)) -eq MIN ]]; then
    echo $((SUM-mC+C))
    exit
fi
if [[ $(((D-1)%10)) -eq MIN ]]; then
    echo $((SUM-mD+D))
    exit
fi
if [[ $(((E-1)%10)) -eq MIN ]]; then
    echo $((SUM-mE+E))
    exit
fi

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

#define mp make_pair
#define pb push_back
#define fst first
#define snd second
#define int long long
#define fast_io() ios::sync_with_stdio(false)
#define FOR(i, l, r) for(int i = (l); i < (r); i++)

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef set<int> si;
typedef double ld;
typedef pair<ld, ld> dd;

const ll INF = 1000000000000000000LL;
const int NMAX = 1e6+4;
const int mod = 1e9+7;
const ld eps = 1e-10;
const ld PI = acos(-1);

int goal, N;
vi a;
bitset<4000010> b;

signed main(){
    fast_io();
    cin >> N;
    a.resize(N);
    FOR(i, 0, N) cin >> a[i];
    b[0] = 1;
    FOR(i, 0, N) b |= b<<a[i];
    int S = 0;
    FOR(i, 0, N) S += a[i];
    if(S % 2 != 0) S ++;
    S /= 2;
    FOR(i, S, 4000010) if(b[i]) {cout << i << endl; break;}



    /*
    vi S;
    S.assign( (1<<N) , 0);
    FOR(i, 0, N) FOR(j, 0, 1<<N) if(j & (1<<i)) S[j] += a[i];
    sort(S.begin(), S.end());
    for(int s : S) cout << s << " ";
    cout << endl;
    cout << S[1<<(N-1)] << endl;
    */

}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int,int>;
/* ちゃんと考えてわかって実装 */

int main(void){
    int a;
  cin >> a;
  cout << a + a*a + a*a*a;
    return 0;
}

Measured memory_bytes: 3612
import java.util.Scanner;
 
//Palindrome
public class Main{
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c = 0;
        while(sc.hasNext()){
            String s = sc.next();
            if(s.equals((new StringBuffer(s)).reverse().toString()))c++;
        }
        System.out.println(c);
    }
}




Measured memory_bytes: 25748
# -*- coding: utf-8 -*-
K = int(input())

def gcd(p, q):
  if(p % q == 0):
    return q
  else:
    return gcd(q, p % q)

sum1 = 0
for c in range(1, K+1):
  for b in range(c+1, K+1):
    d = gcd(b, c)
    for a in range(b+1, K+1):
      sum1 += gcd(a, d)

sum2 = 0
for a in range(1, K+1):
  for c in range(a+1, K+1):
      sum2 += gcd(a, c)

sum3 = 0
for a in range(1, K+1):
  sum3 += a

sum = sum1*6 + sum2*6 + sum3
print(sum)


Measured memory_bytes: 9216
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, Q = map(int, input().split())
S = list(input().rstrip())
l = [0] * Q
r = [0] * Q

for i in range(Q):
	l[i], r[i] = map(int, input().split())

j = 0

count_N = 0
count_Nr = 0
count_L = [0]
count_R = [0]
for i in range(N - 1):
	if S[i] == 'A' and S[i + 1] == 'C':
		count_N += 1
	if S[N - 2 - i] == 'A' and S[N - 1 - i] == 'C':
		count_Nr += 1
	count_L.append(count_N)
	count_R.append(count_Nr)

for i in range(Q):
	ans = count_N - count_L[l[i] - 1] - count_R[N - r[i]]
	print(ans)


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

#define IOS std::cin.tie(0);std::ios_base::sync_with_stdio(false)

#define ll      long long
#define Fi      first
#define Se      second
#define Pb      push_back
#define vi      vector<int>
#define vp      vector<pair<int,int>>
#define vvi     vector<vector<int>>
#define vvp     vector<vector<pair<int,int>>>
using Graph  =  vector<vector<int>>;

#define sz(x) (int)x.size()
#define all(v) v.begin(),v.end()
#define output_s(s) printf("%s\n",(s).c_str())
#define END cout<<"\n"

#define rep(i,n)        for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m)      for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m)     for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m)    for(int i=(int)(n);i>=(int)(m);i--)
#define SRepS(i,n,m)    for(int i=(int)(n);i*i<=(int)(m);i++)
#define RepA(x)         for(auto &item:(x))

void CINT(){} //@shibh308's template
template<class Head,class... Tail> void CINT(Head&& head,Tail&&... tail){cin>>head; CINT(move(tail)...);}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define VCIN(x) for(auto &item:x) cin>>item

void OUT(){}
template<class Head,class...Tail> void OUT(Head&& head,Tail&&...tail){cout<<head<<(sizeof...(tail)?" ":"\n"); OUT(move(tail)...);}
#define COUT(...) OUT(__VA_ARGS__)

template<typename TypeInt>TypeInt GCD(TypeInt a,TypeInt b){return a%b==0?b:GCD(b,a%b);} //最大公約数
template<typename TypeInt>TypeInt LCM(TypeInt a,TypeInt b){return a*b/GCD(a,b);} //最小公倍数
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}
template<class T>bool comp(T a,T b){return abs(a)<abs(b);} //比較関数

void YES(bool f){printf(f?"YES\n":"NO\n");}
void Yes(bool f){printf(f?"Yes\n":"No\n");}
void Possible(bool f){printf(f?"Possible\n":"Impossible\n");}
void POSSIBLE(bool f){printf(f?"POSSIBLE\n":"IMPOSSIBLE\n");}

//----------------------library------------------------//

//const int dx[4]={1,0,-1,0};
//const int dy[4]={0,1,0,-1};
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int NMAX = 55;
const int INF = 1e9;
const int MOD = 1e9+7;
bool flag;

//----------------------Global-------------------------//

signed main(){
    SCIN(s);
    printf(s=="ABC"?"ARC":"ABC");

    return 0;
}

Measured memory_bytes: 3684
#include<iostream>
#include<vector>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;
#include<algorithm>
#include<math.h>
#include<map>
#include<queue>

int main() {
	int k, x;
	cin >> k >> x;
	if (500 * k >= x) {
		cout << "Yes";

	}
	else {
		cout << "No";
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#define linf 9000000000000000000ll


using namespace std;
typedef long long ll;


struct edge
{
	ll to, len, cost;
	edge(ll to, ll len, ll cost) : to(to), len(len), cost(cost) {}
};

const int MAX_N = 50;
const int MAX_M = 100;
const int MAX_A = 2500;

int A[MAX_M], B[MAX_M], C[MAX_N], D[MAX_N];

int n, m, sil;

vector<edge> G[51];
vector<ll> _time[MAX_A + 1], min_time;
vector<int> prev[MAX_A + 1];

void dijkstra(int s)
{
	for (int i = 0; i <= MAX_A; i++)
	{
		_time[i].resize(n, linf);
	}

	min_time.resize(n, linf);
	_time[sil][s] = 0;
	min_time[s] = 0;

	using P = pair<ll, pair<int, int>>; // time, (pos, sil)
	priority_queue<P, vector<P>, greater<P>> Q;
	Q.push({0, {s, sil}});

	while (!Q.empty())
	{
		ll cur_time = Q.top().first;
		int cur_pos = Q.top().second.first;
		int cur_sil = Q.top().second.second;
		Q.pop();


		if (_time[cur_sil][cur_pos] < cur_time) continue;
		if (cur_sil != MAX_A)
		{
			int nx_sil = min(MAX_A, cur_sil + C[cur_pos]);
			ll nx_time = cur_time + D[cur_pos];
			if (_time[nx_sil][cur_pos] > nx_time)
			{
				_time[nx_sil][cur_pos] = nx_time;
				Q.push({nx_time,{cur_pos, nx_sil}});
			}
		}

		for (edge e : G[cur_pos])
		{
			ll nx_time = cur_time + e.len;
			int nx_pos = e.to;
			int nx_sil = cur_sil - e.cost;

			if (nx_sil >= 0 and nx_time < _time[nx_sil][nx_pos])
			{
				_time[nx_sil][nx_pos] = nx_time;
				min_time[nx_pos] = min(min_time[nx_pos], nx_time);
				Q.push({nx_time, {nx_pos, nx_sil}});
			}
		}

	}
}


int main()
{
	std::ios::sync_with_stdio(false);

	cin >> n >> m >> sil;
	sil = min(sil, MAX_A);

	for (int i = 0; i < m; i ++)
	{
		int u,v;
		cin >> u >> v >> A[i] >> B[i];
		u--;
		v--;
		G[u].push_back(edge(v, B[i], A[i]));
		G[v].push_back(edge(u, B[i], A[i]));
	}

	for (int i = 0; i < n; i++)
	{
		cin >> C[i] >> D[i];
	}

	dijkstra(0);

	for (int i = 1; i < n; i++)
		cout << min_time[i] << endl;

	return 0;
}

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

using namespace std;

int main() {
  int N;
  cin >> N;
  int answer = numeric_limits<int>::max();
  for (int i = 0; i < N; i++) {
    int A;
    cin >> A;
    answer = min(answer, __builtin_ctz(A));
  }
  cout << answer;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
#define ll long long
const int MOD = 1e9+7;
using namespace std;


int main(){
	int n;
	ll ans = 0;
	cin >> n;
	vector<ll> a(n);
	vector<ll> coun(60);
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	for (int i = 0; i < n; i++){
		for (ll j = 0; j <= 60; j++){
			if (a[i] & 1ll << j){
				coun[j]++;
			}
		}
	}
	for (int i = 0; i < 60; i++){
		ans += ((coun[i]*(n-coun[i])%MOD)*((1ll<<i)%MOD))%MOD;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}




Measured memory_bytes: 2560
using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            long x = long.Parse(Console.ReadLine());
            long nowCharge = 100;
            int nowYear = 0;
            while(nowCharge < x)
            {
                nowCharge = nowCharge + nowCharge / 100;
                nowYear++;
            }
            Console.WriteLine(nowYear);
        }
    }
}


Measured memory_bytes: 27528
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let n: usize = read(&mut stdin_lock, &mut buf, b' ');
    let m: usize = read(&mut stdin_lock, &mut buf, b'\n');
    let mut av = vec![true; n + 1];
    for _ in 0..m {
        av[read::<usize>(&mut stdin_lock, &mut buf, b'\n')] = false;
    }

    let mut tbl = vec![0i32; n + 1];
    tbl[0] = 1;
    tbl[1] = tbl[0];
    for i in 2..n + 1 {
        let a = if av[i - 1] {
            (tbl[i - 1]) % 1_000_000_007
        } else {
            0
        };
        let b = if av[i - 2] {
            (tbl[i - 2]) % 1_000_000_007
        } else {
            0
        };
        tbl[i] = (a + b) % 1_000_000_007;
    }
    println!("{}", tbl[n]);
}


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

int main() {
  int N,sum=0;
  cin>>N;
  vector<int> v(N);
  for(int i=0;i<N;i++) cin>>v[i];
  
  sort(v.begin(),v.end());

  for(int i=0;i<N;i++) sum+=v[i];
    
  if(sum%10!=0) cout<<sum;
   
  else{
    int c=0;
    for(int i=0;i<N;i++){
      if(v[0]%10==0){
        v.erase(v.begin());
        c++;
      }
    }
  
    if(c==N) cout<<0;
    else cout<<sum-v[0];
  }
}

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

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

  char s[n];
  cin >> s;

  int e[n]={0},w[n]={0};
  for(int i=1;i<n;i++){
    w[i]=w[i-1];
    if(s[i-1]=='W') w[i]++;
  }

  for(int i=n-2;i>=0;i--){
    e[i]=e[i+1];
    if(s[i+1]=='E') e[i]++;
  }

  int min=1000000000;
  for(int i=0;i<n;i++){
    if(w[i]+e[i]<min) min=w[i]+e[i];
  }
  
  cout << min << endl;
  return 0;
}


Measured memory_bytes: 2944
#define _CRT_SECURE_NO_WARNINGS

#include <bits/stdc++.h>
#include <random>
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef map<int, int> mii;
typedef pair<int, ii> edge;


#define sc(x)  scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(v) (int)v.size()
#define rsz(v) v.resize
#define clr(v) v.clear()
#define rev(v) reverse(all(v))
#define lop(i,end) for(int i=0; i<end; i++)
#define rlop(i,start) for(int i=start-1; i>=0; i--)
#define loop(i,start,end) for(int i=start; i<end; i++)
#define rloop(i,start,end) for(int i=start-1; i>=end; i--)
#define PB push_back
#define pb pop_back
#define mP make_pair
#define f first
#define s second

const ll OO = (ll)(4e18) + 9;
const int MOD = (int)(1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);

//enum dir { D, R, U, L , dr, ur, dl, ul };
int dx[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dy[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiouy"; //and sometimes "aeiouy"

template<typename X, typename Y> bool ckmin(X& a, Y b) { return a > b ? a = b, true : false; }
template<typename X, typename Y> bool ckmax(X& a, Y b) { return a < b ? a = b, true : false; }
bool cklex(string &a, string b) {
	if (b == "") return false;
	if (a == "") return a = b, true;
	if (sz(a) < sz(b)) return false;
	if (sz(b) < sz(a)) return a = b, true;
	if (a < b) return false;
	return a = b, true;
}

int dcmp(ld d1, ld d2) { return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1; } //Compare Double Numbers
ll gcd(ll x, ll y) { return !y ? x : gcd(y, x%y); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
int conv_2_1(int r, int c, int nCol) { return (nCol*r) + c + 1; } //convert index from 2D array to 1D array. (Zero-indexed)
ii conv_1_2(int n, int nCol) { return{ n / nCol, n % nCol }; } //convert index from 1D array to 2D array (row, col). (Zero-indexed)
template<typename T> void inter(T X) { cout << X << endl; fflush(stdout); }



int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int t = 1;
	//cin >> t;
	while (t--) {
		int n, x, t;
		cin >> n >> x >> t;
		cout << ((n + x - 1) / x)*t << endl;
	}


	return 0;
}


Measured memory_bytes: 3640
// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Sat Dec 29 04:55:53 2018
//
package main

import (
	"fmt"
	"sort"
)

type point struct {
	x, y int
}

func (p point) lessThan(q point) bool {
	return p.x < q.x && p.y < q.y
}

type points []point

// (p points) ...
func (p points) Less(i, j int) bool {
	if p[i].x == p[j].x {
		return p[i].y < p[j].y
	}

	return p[i].x < p[j].x
}

// (p points)Len ...
func (p points) Len() int {
	return len(p)
}

// (p points)Swap ...
func (p points) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}
func main() {
	var N int

	fmt.Scan(&N)
	reds := make(points, N)
	for i := range reds {
		fmt.Scan(&reds[i].x, &reds[i].y)
	}
	sort.Sort(reds)

	blues := make(points, N)
	for i := range blues {
		fmt.Scan(&blues[i].x, &blues[i].y)
	}
	sort.Sort(blues)

	ans := 0
	paired := make([]bool, N)
	for _, b := range blues {
		max := -1
		pair := -1
		for j, r := range reds {
			if r.x < b.x && r.y < b.y && max < r.y && !paired[j] {
				max = r.y
				pair = j
			}
		}
		if pair != -1 {
			paired[pair] = true
			ans++
		}
	}

	fmt.Printf("%d\n", ans)
}


Measured memory_bytes: 512
#include<stdio.h>
int main(){
	int i,j;
	char a[10][10],b[10][10];
	for(i=0;i<8;i++)
		scanf("%s",a[i]);
	for(j=0;j<8;j++)
		for(i=0;i<8;i++)
		b[i][7-j]=a[j][i];
	printf("90\n");
	for(j=0;j<8;j++){
		for(i=0;i<8;i++)
			printf("%c",b[j][i]);
		printf("\n");
	}
	
	for(j=0;j<8;j++)
		for(i=0;i<8;i++)
		b[7-j][7-i]=a[j][i];
	printf("180\n");
	for(j=0;j<8;j++){
		for(i=0;i<8;i++)
			printf("%c",b[j][i]);
		printf("\n");
	}
		for(j=0;j<8;j++)
		for(i=0;i<8;i++)
		b[7-i][j]=a[j][i];
	printf("270\n");
	for(j=0;j<8;j++){
		for(i=0;i<8;i++)
			printf("%c",b[j][i]);
		printf("\n");
	}
	
	
	
	
	
	
	return 0;
}

Measured memory_bytes: 0