akhauriyash/Code-Regression huggingface dataset:
/*
    2014.07.03 1834~1940
    2014.07.04 1148~
    C language Lecture week ∞
*/

#include <stdio.h>
#include <string.h>

int main (void) {
    
    // AIに勝つにはアルファベットが27種類であることを利用して何らかの文字で攻めればよい。
    // 実は3,4文字でシステマチックに作って言っても勝てるはず
    char yell[8] = { 'x', 'a', 'i', '\0', '\0' };
    char yelled[50][4];
    char ai_input[4];
    int ai_input_len;
    
    // 開幕テンプレ
    printf ( "?bakaai\n" );
    fflush ( stdout );
    
    int cnt = 0;
    int bcode = 0;
    
    while(1){
        
        // 相手の出方を見る
        scanf ( "%s", ai_input );
        
        // 一応馬鹿していないか確認
        if ( ai_input[0] != 'i' ) {
            bcode = 1;
            break;
        }
        strcpy ( yelled[cnt], ai_input );
        for ( int ly = 0; ly < cnt; ly ++ ) {
            if ( strcmp ( yelled[ly], ai_input ) == 0 ) {
                bcode = 1;
                break;
            }
        }
        if ( bcode == 1 ) {
            break;
        }
        
        ai_input_len = strlen ( ai_input );
        yell[0] = ai_input[ai_input_len-1];
        
        printf ( "?%s\n", yell );
        fflush ( stdout );
        
        // 相手の最後の文字を最初の文字、最後の文字をiにして、中間を a, b, c, ... z, ai, bi, .. と変更していく。
        // 理論上54手目で勝てるはず
        yell[1] ++;
        if ( yell[1] > 'z' ) {
            yell[1] = 'a';
            yell[3] = 'i';
        }
        cnt ++;
        
    }
    
    // 勝てなかったら失敗なんだから勝てるでしょ！
    printf ( "!OUT\n" );
    fflush ( stdout );
    
    return 0;
    
}

Measured memory_bytes: 1256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;using vvi=vector<vi>;using vl=vector<ll>;
using P=pair<int,int>;using PL=pair<ll,ll>;using vp=vector<P>;
const int INF=1<<30,MOD=1000000007;const ll LINF=1ll<<60;
#define _ol3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a,i##_l=(b);i<i##_l;++i)
#define REP(...) _ol3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)
#define REPR(i,n) for(int i=n-1;i>=0;--i)
#define REPA(i,v) REP(i,v.size())
#define all(v) (v).begin(),(v).end()
#define bit(n) (1ll<<(n))
#define clamp(n,mi,ma) max(min(n,ma),mi)
#define uniq(v) sort(all(v));v.erase(unique(all(v)),v.end())
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define cho(n,a,b) cout<<((n)?a:b)<<endl
#define YES(n) cho(n,"YES","NO")
#define Yes(n) cho(n,"Yes","No")
#define Poss(n) cho(n,"Possible","Impossible")
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(a>b){a=b;return 1;}return 0;}
template<class T>ostream&operator<<(ostream&o,const vector<T>&v){for(const T&i:v)o<<i<<' ';return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(T&j:v)i>>j;return i;}
template<class T,class U>ostream&operator<<(ostream&o,const pair<T,U>&p){return o<<p.F<<' '<<p.S;}
template<class T,class U>istream&operator>>(istream&i,pair<T,U>&p){return i>>p.F>>p.S;}
template<class T>ostream&operator<<(ostream&o,const set<T>&v){for(const T&i:v)o<<i<<' ';return o;}
template<class T>ostream&operator<(ostream&o,const T&t){return o<<t;}
template<class T>istream&operator>(istream&i,T&t){return i>>t;}
#ifndef LOCAL
struct ostdmy{
template<class T>ostdmy&operator<<(const T&t){return*this;}
template<class T>ostdmy&operator<(const T&t){return*this;}};ostdmy cer_;
#define cerr cer_
#endif
int main(){
    cin.tie(0);ios::sync_with_stdio(0);
    int n;
    cin>n;
    vi h(n);
    cin>h;
    int ma=0;
    int cnt=0;
    REP(i,n){
        if(ma<=h[i])cnt++;
        chmax(ma,h[i]);
    }
    cout<cnt<endl;
    return 0;
}


Measured memory_bytes: 256
// Confessions of a Dangerous Mind

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int N = 2e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 2e3 + 5;
const int logN = 22, BL = 400;
const double EPS = 3e-16;

/*
	Keep moving forward. Take the Leap of Faith
*/

int main(){
//  freopen(".in", "r", stdin);
//  freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
	
    long long n; cin >> n;
    
   	long long p = n * (n + 1) >> 1;
  	
   	cout << p - n;
	
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	n := r.nextInt()

	ans := 0
	for i := 1; i <= n; i++ {
		x := n / i * i
		ans += (x + i) * (n / i) / 2
	}
	fmt.Fprintln(stdout, ans)
}


Measured memory_bytes: 1780
#include <iostream>
#include <string>

using namespace::std;

char a,ans;
string S;
bool s,N;
int main() {
	cin >> S;
	
	for (a = 'a'; a <= 'z'; a++) {
		s = false;
		N = false;
		for(int i=0;i<S.size();i++){
			if (S[i] ==a) {
				s = true;
			}
		}
		if (s == false) {
			ans = a;
			break;
		}
		if (a == 'z') {
			N = true;
		}
	}
	if (N == false) {
		cout << ans<<endl;
	}
	else {
		cout << "None"<<endl;
	}
	return 0;
		}


Measured memory_bytes: 512
N = int(input())
P = list(map(int,input().split()))

P1 = sorted(P)

fcount = 0
for count in range(N):
    if P[count] != P1[count]:
        fcount += 1

if fcount == 2 or fcount == 0:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int main()
{
    int a[3];
    for (int i = 0; i < 3; i++){
        cin >> a[i];
    }
    swap(a[0],a[1]);
    swap(a[0],a[2]);
    cout << a[0] << " " << a[1] << " "  << a[2] << endl;
    return 0;
}


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


int main(void)
{
    long long N;
    cin >> N;
    long long p = 2;
    long long count =0;
    while( p * p <= N){
        if( N % p != 0) {
            p++;
            continue;
        }

        long long z = p;
        while( N % z == 0 ){
                N /= z;
                z *= p;
                count++;               
        }

        while( N % p == 0) N /= p; 
    }

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

Measured memory_bytes: 3648
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int K=sc.nextInt();
    String S=sc.next();
    S=S.substring(0,K-1)+S.substring(K-1,K).toLowerCase()+S.substring(K);
    System.out.println(S);
  }
}


Measured memory_bytes: 21844
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] n = sc.next().split("");
        sc.close();

        String ans = "";

        for (int i = 0; i < 3; i++) {
            if (n[i].equals("1")) {
                ans += "9";
            } else {
                ans += "1";
            }
        }

        System.out.println(ans);

    }
}

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

ll N, K, Q;
const int MAX = 1.0e5 + 100;
ll A[MAX];

int main() {
    cin >> N >> K >> Q;
    for (int i = 0; i < Q; i++) cin >> A[i];

    int ans[N];
    for (int i = 0; i < N; i++) {
        ans[i] = K-Q;
    }

    for (int i = 0; i < Q; i++) {
        ans[A[i] - 1]++;
    }

    for (int i = 0; i < N; i++) {
        if (ans[i] > 0) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }
    }

    return 0;
}


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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

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

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n;
    cin >> n;
    vi l(n);
    rep(i, n) cin >> l[i];
    VSORT(l);
    ll ans = 0;
    rep(i, n) for (int j=i+1; j<n; ++j) {
        ans += distance(l.begin(), lower_bound(all(l), l[i]+l[j])) - (j+1);
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;
using ll=long long;

int main()
{
    int x, a, b;
    
    cin >> x >> a >> b;
    
    if (abs(x - a) <= abs(x - b))
    {
        printf("A\n");
    }
    else
    {
        printf("B\n");
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,j=0;
    cin>>n;
    int a[n];
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);

    for(int i=0; i<n-1; i++)
        if(a[i]!=a[i+1])j++;

    cout<<j+1;
    return 0;
}

Measured memory_bytes: 256
import java.util.Comparator;
import java.util.TreeSet;

public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int n = scanner.nextInt(), m = scanner.nextInt();
        City[] cities = new City[m];
        @SuppressWarnings("unchecked")
        TreeSet<City>[] a = new TreeSet[n];
        for (int i = 0, p; i < m; i++) {
            cities[i] = new City(p = scanner.nextInt(), scanner.nextInt());
            if (a[p - 1] == null)
                a[p - 1] = new TreeSet<>(Comparator.comparingInt(city -> city.y));
            a[p - 1].add(cities[i]);
        }
        for (TreeSet<City> citySet : a) {
            if (citySet != null) {
                int i = 0;
                for (City city : citySet) {
                    city.o = ++i;
                }
            }
        }
        for (City city : cities) {
            System.out.println(String.format("%06d%06d", city.p, city.o));
        }
    }

    static class City {
        int p, y, o;

        City(int p, int y) {
            this.p = p;
            this.y = y;
        }
    }
}

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

using namespace std;

int main()
{
	int n;
	cin>>n; 
	double t=n;
	
	if (n%2==0) cout<<fixed<<setprecision(10)<<t/(2*t);
	
	else if (n!=1) cout<<fixed<<setprecision(10)<<((n/2)+1)/t;
	
	else cout<<fixed<<setprecision(10)<<t;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main() {
	int count, ac=0, wa=0, tle=0, re=0;
	string temp;
	cin >> count;
	for (int i = 0; i < count; i++) {
		cin >> temp;
		if (temp == "AC") ac++;
		if (temp == "WA") wa++;
		if (temp == "TLE") tle++;
		if (temp == "RE") re++;
	}
	cout << "AC x " << ac << "\n";
	cout << "WA x " << wa << "\n";
	cout << "TLE x " << tle << "\n";
	cout << "RE x " << re << "\n";
}

Measured memory_bytes: 3584
#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<string>
#include<map>
#include<queue>
#include<vector>
#include<stack>
#define ll long long
#define maxn 4001000
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rep(i,a,b) for(int i=a;i<=b;i++)
const ll P=1e9+7;
using namespace std;
const int N = 2e5 + 1000;
int main(){
	ll n;
	cin>>n;
	if(n & 1) cout<<0;
	else {
		ll sum = 0;
		ll x = n;
		
		for(ll t = 10;(x/t)!=0;t *= 5){
			sum += x/t;
		}
		cout<<sum;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int a[3],b,c,i,j,x;
	scanf("%d %d %d %d %d",&a[0],&a[1],&a[2],&b,&c);
	for(i=0;i<3;i++)for(j=i;j<3;j++)
	if(a[i]>a[j]){
		x=a[i];
		a[i]=a[j];
		a[j]=x;
	}
	if(b>c)b=c;
	printf("%d\n",a[0]+b-50);
	return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()
#define MOD 1000000007

int C[100010];

int main() {
	for (int i = 0;i < 100010;i++)C[i] = 0;
	int N, K, d, c;
	cin >> N >> K;
	for (int i = 0;i < K;i++) {
		cin >> d;
		for (int j = 0;j < d;j++) {
			cin >> c;
			C[c] = 1;
		}
	}
	d = 0;
	for (int i = 1;i <= N;i++) {
		if (C[i] == 0)d++;
	}
	cout << d << endl;
}

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

#define ll long long int

int main()
{
    int d, n;

    cin >> d >> n;
    if (n == 0)
    {
        cout << 0 << endl;
        return 0;
    }
    if (n == 100)
    {
        cout << 101;
    }
    else
    {
        cout << n;
    }
    for (int i = 0; i < d; i++)
    {
        cout << "00";
    }
    cout << endl;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  int A, B, C;
  scanf("%d%d%d", &A, &B, &C);

  int ans = 0;
  for (int i = 1; i * i <= C; i++){
    if (C % i != 0) continue;

    if (i * i == C){
      if (A <= i && i <= B) ans++; 
    }else{
      if (A <= i && i <= B) ans++;
      if (A <= C / i && C / i <= B) ans++;
    }
  }
  printf("%d\n", ans);


  return 0;
}



Measured memory_bytes: 3212
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <string.h>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#define INF 100000000
 
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;
const ll M = 998244353;
 
int main(void) {
    string s;
    cin >> s;
    if(s=="ABC") cout << "ARC" << endl;
    else cout << "ABC" << endl;
}

Measured memory_bytes: 3620
N = int(input())
S = list(input())
# print(N)
# print(S)

from collections import deque

cnt = 0  # マルバツスタンプの数

que = deque()

for s in S:
	if len(que) == 0:
		que.append(s)
	else:
		t = que.pop()
		if s != t:
			cnt = cnt + 1
		else:
			que.append(t)
#			que.append(s)

print(cnt)



Measured memory_bytes: 6660
#include <bits/stdc++.h>  // ver2.2.9
#define int long long
#define endl "\n"
#define ALL(v) (v).begin(),(v).end()
#define COUNT(a,k) upper_bound(ALL(a),k)-lower_bound(ALL(a),k)
#define BIGGER(a,k) a.end()-upper_bound(ALL(a),k)
#define SMALLER(a,k) lower_bound(ALL(a),k)-a.begin()
#define Vi vector<int>
#define VVi vector<Vi>
#define Vs vector<string>
#define Pii pair<int,int>
#define VPii vector<Pii>
#define Tiii tuple<int,int,int>
#define PQi priority_queue<int>
#define PQir priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define itos to_string
#define stoi stoll
#define FI first
#define SE second
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define cyes cout<<"yes"<<endl
#define cno cout<<"no"<<endl
#define _ <<' '<<
#define sortr(v) sort(v,greater<>())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define dem(a,b) ((a+b-1)/(b))
#define Vin(a) rep(iI,0,a.size())cin>>a[iI]
#define Vout(a) rep(lZ,0,a.size()-1)cout<<a[lZ]<<' ';cout<<a.back()<<endl
#define VVout(a) rep(lY,0,a.size()){if(!a[lY].empty()){Vout(a[lY]);}else cout<<endl;}
#define VPout(a) rep(lX,0,a.size())cout<<a[lX].FI<<' '<<a[lX].SE<<endl
#define Verr(a) rep(iZ,0,a.size()-1)cerr<<a[iZ]<<' ';cerr<<a.back()<<endl
#define VVerr(a) rep(J,0,a.size()){if(!a[J].empty()){Verr(a[J]);}else cerr<<'.'<<endl;}
#define VPerr(a) rep(iX,0,a.size())cerr<<a[iX].FI<<' '<<a[iX].SE<<endl
#define INF 3000000000000000000  //  3.0*10^18(MAXの1/3くらい)
#define MAX LLONG_MAX
#define MOD 1000000007  //  10^9 + 7
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm
int mypow(int x, int n, int m){  //  累乗x^n(mod m)  O(log(n))
if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int scomb(int n, int r){  //  nCr (小さい場合)
int a=1;for(int i=n;i>n-r;--i){a=a*i;}for(int i=1;i<r+1;++i){a=a/i;}return a;}
int comb(int n, int r){  //  nCr (%MOD)
int a=1;for(int i=n;i>n-r;--i){a=a*i%MOD;}for(int i=1;
i<r+1;++i){a=a*mypow(i,MOD-2,MOD)%MOD;}return a%MOD;}
int stpow(int n){  //  階乗(%MOD)
if(n==0)return 1;int a=1;rep(i,1,n+1)a=a*i%MOD;return a;}
Vi stpowV(){Vi a(100001);  //  階乗配列(%MOD)
a[0]=1;repeq(i,1,100000)a[i]=a[i-1]*i%MOD;return a;}
void press(auto &v){v.erase(unique(ALL(v)),v.end());}  //  圧縮



signed main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
  int a,b;
  cin >> a >> b;
  
  if((a+b)%3!=0){cout<<0<<endl;return 0;}
  if(b > a*2){cout<<0<<endl;return 0;}
  if(a > b*2){cout<<0<<endl;return 0;}
  
  int ct = (a+b)/3;
  
  int yoko = a-ct;
  cout << comb(ct,yoko) << endl;
  
  return 0;
}

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

using namespace std;

using ll = int_fast64_t;
constexpr ll llmax = INT_FAST64_MAX; // std::numeric_limits<int_fast64_t>::max()
constexpr ll llmin = INT_FAST64_MIN; // std::numeric_limits<int_fast64_t>::min()
using ull = uint_fast64_t;
constexpr ull ullmax = UINT_FAST64_MAX; // std::numeric_limits<uint_fast64_t>::max()

#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define RFOR(i, b, e) for (int i = ((e) - 1); (b) <= i; --i)
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define RREP(i, N) for (int i = ((N) - 1); 0 <= i; --i)
#define scanInt(x) int x; scanf("%d", &(x)); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &(x)); getchar();
#define scanVecInt(A, N) vector<int> A(N); REP(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); REP(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanLLInt(A);
    scanLLInt(B);
    scanLLInt(C);
    scanLLInt(K);
    if (K <= A){
        cout << K << endl;
    }else if (K <= A + B){
        cout << A << endl;
    }else{
        cout << A - (K - A - B) << endl;
    }
}


Measured memory_bytes: 3764
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 26 15:42:52 2020

@author: tinku
"""
def converter(arr,m,n):
    new_arr=[[0 for i in range(n)] for j in range(m)]
    for i in range(m):
        for j in range(n):
            if arr[i][j]=='.':
                new_arr[i][j]=0
            else:
                new_arr[i][j]=1
    return new_arr
            
m,n=map(int,input().split())
arr=[]
for i in range(m):
    arr.append(input())
arr=converter(arr,m,n)
if arr[0][0]==1 or arr[m-1][n-1]==1:
    print(0)
else:
    arr[0][0]=1
    for i in range(1,m):
        arr[i][0]=int(arr[i-1][0]==1 and arr[i][0]==0)
    for i in range(1,n):
        arr[0][i]=int(arr[0][i-1]==1 and arr[0][i]==0)
    for i in range(1,m):
        for j in range(1,n):
            if arr[i][j]==0:
                arr[i][j]=arr[i-1][j] + arr[i][j-1]
            else:
                arr[i][j]=0
    print((arr[m-1][n-1])%(10**9 +7))

Measured memory_bytes: 262560
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 10 == 7) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 100 / 10 == 7) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n / 100 == 7) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

int main()
{
  int n, t, count = 0;
  cin >> n >> t;
  int p[n];
  for (int i = 0; i < n; i++)
  {
    cin >> p[i];
  }

  count += t;

  for (int i = 1; i < n; i++)
  {
    if (p[i] - p[i - 1] > t)
    {
      count += t;
    }
    else
    {
      count += p[i] - p[i - 1];
    }
  }

  cout << count << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
// #include "lib.h"
using namespace std;
#define LLINF 1234567890987654321
#define INF 1234567890
#define pb push_back
#define ins insert
#define f first
#define s second
#define db 1
#define MAXN 1006
#define MAXK 1006
#define MAXX 2000
#define rep(kk, l1, l2)for(ll kk = l1; kk < l2; kk++)
#define bg(ms) *ms.begin()
#define ed(ms) *prev(ms.end(), 1)
#define addedge(a, b, c) v[a].pb(pi(b, c)); v[b].pb(pi(a, c))
#define ph push
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
ll n, x, A[MAXN], ans, lasttaken = 1;
int main()
{
	cin >> n >> x;
	for(ll i = 0; i < n; i++)
	{
		cin >> A[i];
	}
	sort(A, A+n);
	for(ll i = 0; i < n; i++)
	{
		if(A[i] <= x)x-=A[i], ans++;
		else lasttaken = 0;
	}
	if(lasttaken and x > 0)--ans;
	cout << ans;
}


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

int main() {
	int n; scanf("%d", &n);
	int cnt = 0;
	rep(i, n) {
		int d; scanf("%d", &d);
		for (int i = 1; i*i <= d; i++)if ((d - i) % (2 * i + 1) == 0)goto g;
		cnt++; g:;
	}
	printf("%d\n", cnt);
}

Measured memory_bytes: 3196
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let k: usize = sc.cin();
    let mut xs: Vec<usize> = sc.vec(n);
    xs.sort();
    put!((0..n-k+1).map(|i| xs[i + k - 1] - xs[i]).min().unwrap());
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}


Measured memory_bytes: 4352
#include<iostream> 
#include<stdio.h>
#include<string>
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
//#define _LIBCPP_DEBUG 0
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define all(a) (a).begin(),(a),end()
#define rep(i,n) for (ll i = 0; i < (n); ++i)	
//setprecision(16)

void outi(int x) { cout << x << endl; }
void outl(ll x) { cout << x << endl; }
void outs(string x) { cout << x << endl; }
ll max(ll a, ll b) {
	ll max;
	if (a > b) max = a;
	else max = b;
	return max;
}
ll min(ll a, ll b) {
	ll min;
	if (a < b) min = a;
	else min = b;
	return min;
}
//---------------------------------------------------------------

int main() {
	int a, b;
	double PI = acos(-1);
	int h, m;
	cin >> a >> b >> h >> m;

	double xa = a * cos(h * PI / 6 + m * PI / 360);
	double xb =	b * cos(m * PI / 30);
	double ya = a * sin(h * PI / 6 + m * PI / 360);
	double yb = b * sin(m * PI / 30);

	double ans = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));

	cout << setprecision(16) << ans << endl;
}

Measured memory_bytes: 4164
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end() 
using namespace std;

typedef long long ll;

const int N = 1e5 + 5;
ll a[N];

int main() {
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   int n;
   cin >> n;
   for(int i=0; i<n; ++i) {
        cin >> a[i];
   }
   sort(a, a+n, greater<ll>());
   set<ll> st1, st2;
   for(int i=0; i<n; ++i) {
       if(i+3 < n) {
           int flag = 0;
           for(int j=i; j<i+3; ++j)
               if(a[j] != a[j+1]) flag = 1;
           if(!flag)
               st2.insert(a[i]);
           else if(a[i] == a[i+1]) 
               st1.insert(a[i]);
       } else if(i+1 < n) {
           if(a[i] == a[i+1]) 
               st1.insert(a[i]);
       }
   }
   vector<ll> two, four;
   for(ll x: st1)
       two.push_back(x);
   for(ll x: st2)
       four.push_back(x);
   sort(all(four), greater<ll>());
   sort(all(two), greater<ll>());
   ll res = 0ll;
   if((int)two.size() >= 2) {
       res = max(res, two[0]*two[1]);
       if((int)four.size() >= 1) {
           res = max(res, four[0]*two[0]);
           res = max(res, four[0]*four[0]);
       }
   } else
       if((int)four.size() >= 1) 
           res = max(res, four[0]*two[0]);

   cout << res << "\n";
   return 0;
} 


Measured memory_bytes: 3584
N = int(input())
xdata = list(map(int,input().split()))
ydata = list(map(int,input().split()))
matome = 0
saidai = 0

for i in range (N):
    matome = sum(xdata[:i+1]) + sum(ydata[i:])
    if saidai <= matome:
        saidai = matome

print(saidai)

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

#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, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
//constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;



int main(){
  int X, N;
  cin >> X >> N;
  map<int, int> p;
  REP(i, N){
    int x;
    cin >> x;
    p[x]++;
  }
  int diff = INF;
  int ans = -1;
  FOR(i, -200, 202){
    if(p[i]) continue;
    if(diff > abs(X-i)){
      ans = i;
      diff = abs(X-i);
    }
  }
  cout << ans << endl;

  return 0;
}


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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  int N;
  cin >> N;
  cout << N * 800 - N / 15 * 200 << endl;

  return 0;
}


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

using namespace std;
int n,m,rt=99999999,lf=0,tmp1,tmp2;
int main()
{
    cin>>n>>m;
    for (int i=1;i<=m;++i)
    {
        cin>>tmp1>>tmp2;
        rt=min(rt,tmp2);
        lf=max(lf,tmp1);
    }
    if (rt<lf) cout<<0;
    else cout<<rt-lf+1;
    return 0;
}



Measured memory_bytes: 256
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Scanner;

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

	void run() {
		solver();
	}

	void solver() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long m = sc.nextLong();

		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = sc.nextLong();
		MathContext mc = new MathContext(25, RoundingMode.HALF_EVEN);

		// BigDecimal[] p = new BigDecimal[n];
		// for (int i = 0; i < n; i++)
		// p[i] = (new BigDecimal(sc.nextInt())).divide(BigDecimal.valueOf(100),
		// mc);
		int[] p = new int[n];
		for (int i = 0; i < n; i++)
			p[i] = sc.nextInt();

		long[] cnt = new long[1 << n];
		for (int i = 1; i < (1 << n); i++) {
			long l = 1;
			for (int j = 0; j < n; j++) {
				if (((i >> j) & 1) == 1) {
					l = lcm(l, a[j]);
					if (l == 0)
						break;
				}
			}
			if (l != 0)
				cnt[i] += m / l;
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < (1 << n); j++) {
				if (((j >> i) & 1) == 1) {
					cnt[j] -= cnt[j ^ (1 << i)];
				}
			}
		}
		double ans = 0;
		// BigDecimal ans = new BigDecimal(0);
		for (int i = 0; i < (1 << n); i++) {
			// BigDecimal pro = BigDecimal.valueOf(Math.abs(cnt[i]));
			double pro = Math.abs(cnt[i]);
			for (int j = 0; j < n; j++) {
				if (((i >> j) & 1) == 1) {
					// pro = pro.multiply(p[j], mc);
					pro *= p[j] / 100.0;
				} else {
					pro *= (100 - p[j]) / 100.0;
					// pro = pro.multiply(BigDecimal.ONE.subtract(p[j], mc),
					// mc);
				}
			}
			ans += pro;
//			ans = ans.add(pro, mc);

		}
		System.out.printf("%.10f\n", ans);
	}

	long gcd(long a, long b) {
		if (a < b) {
			long tmp = a;
			a = b;
			b = tmp;
		}
		if (b == 0)
			return a;
		else
			return gcd(b, a % b);
	}

	long lcm(long a, long b) {
		a /= gcd(a, b);
		if (a * b / b != a)
			return 0;
		else
			return a * b;
	}

	void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

Measured memory_bytes: 36060
import scala.io.StdIn._
object Main extends App {
  val n = readInt
  val weights = readLine.trim.split(' ').map(_.toInt)
  println(
    (1 until n).map{t ⇒ ((0 until t).map(weights).sum - (t until n).map(weights).sum).abs}.min
  )
}


Measured memory_bytes: 25580
#include <stdio.h>

#define FALSE 1
#define TRUE 0
#define MAX 36

typedef struct {
    char suit;
    int value;
} Card;


void print(Card C[],int N){
    int i;
    for(i=0;i<N;i++){
        printf("%c%d",C[i].suit,C[i].value);
        if(i!=N-1) printf(" ");
        else printf("\n");
    }
}


void Bubble(Card C[],int N){
    int i,j;
    Card tmp;
    
    for(i=0;i<N;i++){
        for(j=N-1;j>i;j--){
            if(C[j].value<C[j-1].value){
                tmp=C[j];
                C[j]=C[j-1];
                C[j-1]=tmp;
            }
        }
    }
    print(C,N);
    printf("Stable\n");
}

void Select(Card C[],int N){
    int i,j;
    int minj;
    Card tmp;
    
    for(i=0;i<N;i++){
        minj=i;
        for(j=i;j<N;j++){
            if(C[j].value<C[minj].value) minj=j;
        }
        tmp=C[i];
        C[i]=C[minj];
        C[minj]=tmp;
    }
    print(C,N);
}

int isStable(Card A[],Card B[],int N){
    int i;
    for(i=0;i<N;i++){
        if(A[i].suit!=B[i].suit) return FALSE;
    }
    return TRUE;
}

int main(){
    int n;
    int i;
    Card A[MAX],B[MAX];

    scanf("%d",&n);
    
    for(i=0;i<n;i++){
        scanf(" %c%d",&A[i].suit,&A[i].value);
        B[i]=A[i];
    }
    
    Bubble(A,n);
    Select(B,n);
    
    for(i=0;i<n;i++){
        if(A[i].suit!=B[i].suit)break;
    }
    
    if(isStable(A,B,n)==TRUE) printf("Stable\n");
    else printf("Not stable\n");    
    
    return 0;
}




Measured memory_bytes: 2004
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	string s[] = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
	map<string, int> mm;
	REP(i, 7) mm[s[i]] = i;
	
	string S;
	cin >> S;
	int ans = mm[S];
	ans = 7 - ans;
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
 
typedef long long LL;
 
int main () {
	LL h,w;
	while (scanf("%lld %lld",&h,&w) != EOF) {
		LL ans = min(h,w);
		if (h%3 ==0 || w%3 ==0) {
			puts("0");
			continue;
		}
		for (LL i=1;h>i;i++) {
			//first block is i*w
			LL s1=i*w;
			//left (h-i) * w
			//if s1 is max, then s2 should near s3
			LL s2=((h-i))*(w/2);
			LL s3=(h-i)*w-s2;
			ans = min(ans,max(max(s1,s2),s3) - min(s1,(min(s2,s3))));
			//s1 = (h-i) *~
			s2 = (h-i) * (s1/(h-i));
			s3 = (h-i)*w-s2;
			ans = min(ans,max(max(s1,s2),s3) - min(s1,(min(s2,s3))));
			s2 += (h-i);
			s3 -= (h-i);
			ans = min(ans,max(max(s1,s2),s3) - min(s1,(min(s2,s3))));
			;
		}
		swap(h,w);
		for (LL i=1;h>i;i++) {
			//first block is i*w
			LL s1=i*w;
			//left (h-i) * w
			//if s1 is max, then s2 should near s3
			LL s2=((h-i))*(w/2);
			LL s3=(h-i)*w-s2;
			ans = min(ans,max(max(s1,s2),s3) - min(s1,(min(s2,s3))));
			//s1 = (h-i) *~
			s2 = (h-i) * (s1/(h-i));
			s3 = (h-i)*w-s2;
			ans = min(ans,max(max(s1,s2),s3) - min(s1,(min(s2,s3))));
			s2 += (h-i);
			s3 -= (h-i);
			ans = min(ans,max(max(s1,s2),s3) - min(s1,(min(s2,s3))));
			;
		}
		printf("%lld\n",ans);
	}
}

Measured memory_bytes: 256
//include
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath> 
#include <iomanip>
#include <math.h>
#include <utility>
#include <functional>
#include <cstdlib>
//using
using namespace std;
using vl = vector <long long>;
using vs = vector <string>;
using vc = vector <char>;
using ll= long long;
using vvl = vector<vector<ll> >;
using vvc = vector<vector<char> >;
//vector<vector<char> > hyou(N, vector<char>(N));
using vd = vector <double>;
//define
//#define int long long
#define rep(i,n) for(int i=0; i<n; i++)
#define print(n) cout<<n<<endl;
#define sortp(d) sort(d.begin(),d.end()) //1234
#define sortm(d) sort(d.rbegin(),d.rend()) //4321
//素数判定　O(√A) 
bool is_prime(int x){
 if(x<=1) return false;
 for(int i=2;i*i<=x;i++)
 if(x%i==0) return false;
 return true;
 }
 //各位の和　
int wa(ll x)
{
ll sum = 0;
while(x!=0){
  sum += x% 10;
  x /= 10;
}
return sum;
}
/*順列生成
do {
  // 順列に対する処理
} while (next_permutation(配列変数.begin(), 配列変数.end()));*/

//絶対値　abs()
//文字→数字　'0' アルファベット→数字　'a'　'A'が65番,'a'が97番だわ
//型キャスト　char('a'+1)
//reverse 回文
//if(isupper('A'))->大なら真


//グローバル変数宣言
ll q=0,r=0;

int main()
{
  ll n;
  cin>>n;
  vl t(n);
  rep(i,n){cin>>t[i];q+=t[i];}
  ll m;
  cin>>m;
  vl p(m),x(m);
  rep(i,m){
    cin>>p[i]>>x[i];
    }
  rep(i,m)print(q-t[p[i]-1]+x[i])
}

Measured memory_bytes: 3636
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define Reverse(x) reverse(all(x));
#define Sort(x) sort(all(x));
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    cout << std::fixed << std::setprecision(10);
    lli n;
    cin >> n;
    n--;
    lli ans = 0;
    rep(i,n){
        ans += n / (i+1);
    }
    out(ans);
}

Measured memory_bytes: 3632
#include <stdio.h>

int main(void){

  long n;
  scanf("%ld", &n);
  long sum = 0;
  for (long i = 1; i <= n; i++) {
    if (i % 3 != 0 && i % 5 != 0) {
      sum += i;
    }
  }
  printf("%ld\n", sum);

  return 0;
}

Measured memory_bytes: 1732
#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<algorithm>
#include<climits>
#include<numeric>
#include<cmath>
#include<cstring>
#include<deque>
#include<map>
#include<iomanip>

#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 VSORT(v) sort(v.begin(), v.end());
#define VE vector<int>
#define VEP vector<pair<int,int>>
#define llong long long
#define pb(a) push_back(a)
using namespace std;
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
const vector<VE> DIR{ {-1,0},{1,0},{0,-1},{0,1} };
int main() {
	int len;
	string str;
	cin >> len;
	cin >> str;
	if (len % 2 == 1) {
		cout << "No" << endl;
		return 0;
	}
	for (int i = 0; i < len / 2; ++i) {
		if (str[i] != str[i + len/2]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#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>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://atcoder.jp/contests/abc150/tasks/abc150_c

int main() {
    int N; cin >> N;
    int P[N]; REP(i, N) cin >> P[i];
    int Q[N]; REP(i, N) cin >> Q[i];

    vector<int> perm;
    REP(i, N) perm.push_back(i+1);
    sort(perm.begin(), perm.end());

    int a = 0, b = 0;
    int t = 1;
    do {
        bool isa = true;
        bool isb = true;
        for (int i = 0; i < perm.size(); i++) {
            if (perm[i] != P[i]) isa = false;
            if (perm[i] != Q[i]) isb = false;
        }
        if (isa)a=t;
        if (isb)b=t;
        t++;
    } while(next_permutation(perm.begin(), perm.end()));

    cout << abs(a-b) << "\n";

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b, d;
    while(1){
        cin >> a >> b >> d;
        if(a + b + d == 0) break;
        int ay = INF, ax = INF;
        for(int x = -100000; x <= 100000; x++){
            int r = d - a * x; 
            if(r % b != 0) continue;
            int y = r / b;
            if(abs(x) + abs(y) < abs(ax) + abs(ay)){
                ax = x;
                ay = y;
            }else if(abs(x) + abs(y) == abs(ax) + abs(ay)){
                if(abs(x) * a + abs(y) * b < abs(ax) * a + abs(ay) * b){
                    ax = x;
                    ay = y;
                }
            }
        }
        cout << abs(ax) << ' ' << abs(ay) << endl;
    }
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define ff first
#define ss second
typedef pair<int,int> pii;

int32_t main()
{
	int x , y ;
	cin >> x >> y ;

	if(y & 1)return cout <<"No" , 0 ;

	y /= 2 ;
	int a = 2 * x - y , b = y - x ;

	if(a >= 0 && b >= 0)
		cout << "Yes";
	else 
		cout <<"No" ;
	return 0;
}        

Measured memory_bytes: 3636
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

max_x = max(x)
min_y = min(y)

if max_x < min_y and max_x < Y and X < min_y:
    print('No War')
else:
    print('War')


Measured memory_bytes: 2940
#include<bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define rep(i,m,n) for(int i = (m);i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
#define Vec(a) vector <int> a
const int INF = 1 << 20;
const int MOD = 1e9+7;





int main(){
  string s;
  cin >> s;
  REP(i,s.size()-1){
    if(s[i] == 'A' && s[i+1] == 'C'){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
sub f{$_[$i+1]=$_[$i++]^$_^$_[$i]for@s;$_[$i=0]^pop||$_[-1]^"@_"^$s^$_[1]||exit!print map$_?W:S,@_}<>;($s,@s)=`tr ox 01`=~/./g;f 0,0;f 0,1;f 1,0;f 1,1;print-1

Measured memory_bytes: 31184
#include <stdio.h>
#define n 10000
int main(void){
	int a[n];
	int i=1,j;
	while(i<=n){
		scanf("%d",&a[i]);
		if(a[i]==0)break;
		i++;
	}
	for(j=1;j<i;j++)printf("Case %d: %d\n",j,a[j]);
	return 0;
}



Measured memory_bytes: 1904
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace At
{
    class Program
    {
        static void Main(string[] args)
        {
            var o = Read();
            var e = Read();
            var s = 0;
            var z = false;
            if (o.Length == e.Length)
            {
                s = o.Length;
            }
            else
            {
                if (o.Length > e.Length)
                {
                    s = e.Length;
                    z = true;
                }
            }
            for (int i = 0; i < s; i++)
            {
                Write(o[i]);
                Write(e[i]);
            }
            if (z)
            {
                if (o.Length > e.Length)
                {
                    Write(o[o.Length-1]);
                }
                else
                {
                    Write(e[e.Length - 1]);
                }
            }
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

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

using namespace std;

int main(){
	int n; cin>>n;
	vector<string> s(n);
	vector<pair<int,int>> a(n);
	rep(i,n){
		cin>>s[i];
		int cnt=0,mn=0;
		for(char c:s[i]){
			if(c=='(') cnt++;
			else       cnt--, mn=min(mn,cnt);
		}
		a[i]={cnt,min(0,cnt)-mn};
	}

	vector<int> ord(n);
	iota(ord.begin(),ord.end(),0);

	sort(ord.begin(),ord.end(),[&](int i,int j){
		int ti=(a[i].first>=0?0:1);
		int tj=(a[j].first>=0?0:1);
		if(ti!=tj) return ti<tj;
		if(ti==0) return a[i].second<a[j].second;
		else      return a[i].second>a[j].second;
	});

	int cnt=0;
	for(int i:ord){
		for(char c:s[i]){
			if(c=='(') cnt++;
			else       cnt--;
			if(cnt<0) return puts("No"),0;
		}
	}
	puts(cnt==0?"Yes":"No");

	return 0;
}


Measured memory_bytes: 46204
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> P;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[10001],dp[100][100];

int main(){
  int x,y;
  int point = 0;
  int box[100];
  cin >> y >> x;
  cin >> n;
  rep(i,0,n){
    cin >> m;
    rep(j,0,m){
      d[point++] = i+1;
    }
  }
  point = 0;
  rep(i,0,y){
    clr(box,0);
    if(!(i % 2)){
      rep(j,0,x){
        box[j] = d[point++];
      }
    }else{
      rep(j,0,x){
        box[x-j-1] = d[point++];
      }
    }
    rep(j,0,x)cout << box[j] << " ";
    puts("");
  }
  return 0;
}

Measured memory_bytes: 384