akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
std::vector<int> xs;
        vector<int> ys;
        int X1[1002],X2[1002],Y1[1002],Y2[1002];
        bool bmap[5000][5000];
class SOLVE{
    public:
    int ans(){
        int w,h,n;
        scanf("%lld %lld",&w,&h);
        if(w==0&&h==0){
            return (int)-1;
        }
        scanf("%lld",&n);
        if(xs.size())xs.clear();
        if(ys.size())ys.clear();
        fill(bmap[0],bmap[5000],false);
        xs.push_back(0);xs.push_back(w);
        ys.push_back(0);ys.push_back(h);
        
        
        rep(i,n){
            int x1,x2,y1,y2;
            scanf("%lld %lld %lld %lld",&x1,&y1,&x2,&y2);
            X1[i]=x1;Y1[i]=y1;X2[i]=x2;Y2[i]=y2;
            xs.push_back(x1);
            xs.push_back(x1+1);
            xs.push_back(x2-1);
            xs.push_back(x2);
            ys.push_back(y1);
            ys.push_back(y1+1);
            ys.push_back(y2-1);
            ys.push_back(y2);
        }
        sort(xs.begin(),xs.end());
        sort(ys.begin(),ys.end());
        xs.erase( unique(xs.begin(),xs.end() ) , xs.end() );
        ys.erase( unique(ys.begin(),ys.end() ) , ys.end() );
        rep(i,n){
            X1[i]=find(xs.begin(),xs.end(),X1[i])-xs.begin();
            X2[i]=find(xs.begin(),xs.end(),X2[i])-xs.begin();
            Y1[i]=find(ys.begin(),ys.end(),Y1[i])-ys.begin();
            Y2[i]=find(ys.begin(),ys.end(),Y2[i])-ys.begin();
        }
        int ans=0;
        rep(i,n){
            for(int x=X1[i];x<X2[i];x++){
                for(int y=Y1[i];y<Y2[i];y++){
                    bmap[x][y]=true;
                }
            }
        }
        int ww=find(xs.begin(),xs.end(),w)-xs.begin();
        int hh=find(ys.begin(),ys.end(),h)-ys.begin();
        /*rep(i,ww){
            rep(j,hh){
                printf("%lld",(int)bmap[i][j]);
            }
            printf("\n");
        }*/
        rep(i,ww){
            rep(j,hh){
                queue<pair<int,int> > que;
                if(bmap[i][j]){continue;}
                else{
                    que.push(make_pair(i,j));ans++;
                    //printf("%lld %lld/",i,j);
                    while(que.size()){
                        pair<int,int> p=que.front();que.pop();int x=p.first;int y=p.second;
                        if(bmap[x][y]==true){continue;}
                        bmap[x][y]=true;
                        //printf("[%lld %lld]",x,y);
                        if(x>0&&bmap[x-1][y]==false){que.push(make_pair(x-1,y) );}
                        if(y>0&&bmap[x][y-1]==false){que.push(make_pair(x,y-1) );}
                        if(x<ww-1&&bmap[x+1][y]==false){que.push(make_pair(x+1,y) );}
                        if(y<hh-1&&bmap[x][y+1]==false){que.push(make_pair(x,y+1) );}
                    }
                }
            }
        }
        return ans;
    }
};
signed main(void){
    while(1){
        SOLVE sol;
        int pr=sol.ans();
        if(pr==-1)break;
        printf("%lld\n",pr);
    }
    return 0;
}

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

typedef long long ll;

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

    ll h[n];
    for(int i = 0; i < n; i++)  cin >> h[i];

    stack<pair<int,ll>> s;

    ll ans = 0;
    for(int i = 0; i < n; i++){
        if(s.empty()){
            s.push({i, h[i]});
        }else if(s.top().second > h[i]){
            pair<int,ll> tmp;
            while(!s.empty()){
                if(s.top().second <= h[i])  break;
                tmp = s.top();
                ans = max(ans, (i-tmp.first)*tmp.second );
                s.pop();
            }
            s.push({tmp.first, h[i]});
        }else if(s.top().second < h[i]){
            s.push({i, h[i]});
        }
    }

    while(!s.empty()){
        auto x = s.top(); s.pop();
        ans = max(ans, (n-x.first)*x.second);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 5320
using System;
class Program
{
    static IO io = new IO();

    static void Main(string[] args)
    {
        io.ReadSplit();
        int W = io.Int();
        int a = io.Int();
        int b = io.Int();

        int length = 0;

        if (a < b)
        {
            if (a + W < b)
            {
                length = b - a - W;
            }
        }
        else
        {
            if (b + W < a)
            {
                length = a - b - W;
            }
        }

        io.Write(length.ToString());
    }
}

class IO
{
    private string[] input;
    private int index;
    public void Read()
    {
        input = new string[1];
        input[0] = Console.ReadLine();
        index = -1;
    }
    public void ReadSplit()
    {
        input = Console.ReadLine().Split(' ');
        index = -1;
    }
    public string String()
    {
        index += 1;
        return input[index];
    }
    public string[] String(int count)
    {
        index += 1;
        string[] rv = new string[count];
        Array.Copy(input, index, rv, 0, count);
        return rv;
    }
    public int Int()
    {
        index += 1;
        return int.Parse(input[index]);
    }
    public int[] Int(int count)
    {
        index += 1;
        int[] rv = new int[count];
        for (int i = 0; i < count; ++i)
        {
            rv[i] = int.Parse(input[index + i]);
        }
        return rv;
    }
    public long Long()
    {
        //index += 1;
        //return long.Parse(input[index]);
        return ++index;
    }
    public long[] Long(int count)
    {
        index += 1;
        long[] rv = new long[count];
        for (int i = 0; i < count; ++i)
        {
            rv[i] = long.Parse(input[index + i]);
        }
        return rv;
    }
    public void Write(string str)
    {
        Console.WriteLine(str);
    }
}

Measured memory_bytes: 11092
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] sarr = br.readLine().split(" ");
        int[] iarr    = Stream.of(sarr).mapToInt(Integer::parseInt).toArray();
        if (canConverse(iarr)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    static boolean canConverse(int[] iarr) {
        int a = iarr[0];
        int b = iarr[1];
        int c = iarr[2];
        int d = iarr[3];
        if (Math.abs(a - c) <= d) {
            return true;
        } else if (Math.abs(a - b) <= d && Math.abs(b - c) <= d ) {
            return true;
        }
        return false;
    }
}


Measured memory_bytes: 26452
import sys

class Imos1D:
    def __init__(self,sz):
        self.__seq = [0] * sz

    def update(self, a, b): # [a,b)
        self.__seq[a] += 1
        self.__seq[b] -= 1

    def calc(self):
        for i in range(len(self.__seq) - 1):
            self.__seq[i + 1] += self.__seq[i]

    def get(self,i):
        return self.__seq[i]

def main():
    n = int(input())
    imos = Imos1D(1000000 + 10)

    for i in range(n):
        a, b = map(int, sys.stdin.readline().split())
        imos.update(a, b + 1)

    imos.calc()

    # solve
    ans = 1
    for i in range(n + 2):
        if imos.get(i) >= i - 1:
            ans = max(ans, i)

    print(ans - 1) # ???????????????


if __name__ == '__main__':
    main()

Measured memory_bytes: 18532
#include<bits/stdc++.h>
using namespace std;
inline void read(int &x)
{
	char c=getchar();
	x=0;
	while (c>'9'||c<'0')
		c=getchar();
	while (c>='0'&&c<='9')
	{
		x=x*10+c-'0';
		c=getchar();
	}
}
const int N=505;
int a[N][N],n,m;
char s[N];
int main()
{
	read(n);
	read(m);
	for (int i=1;i<=n;++i)
	{
		scanf("%s",s+1);
		for (int j=1;j<=m;++j)
			a[i][j]=s[j]=='#';
	}
	for (int i=1;i<=m;++i)
		putchar('.');
	putchar('\n');
	for (int i=2;i<n;++i)
	{
		putchar('#');
		for (int j=2;j<m;++j)
			putchar(i%2==0||a[i][j]?'#':'.');
		putchar('.');
		putchar('\n');
	}
	for (int i=1;i<=m;++i)
		putchar('.');
	putchar('\n');
	putchar('\n');
	for (int i=1;i<=m;++i)
		putchar('.');
	putchar('\n');
	for (int i=2;i<n;++i)
	{
		putchar('.');
		for (int j=2;j<m;++j)
			putchar(i%2||a[i][j]?'#':'.');
		putchar('#');
		putchar('\n');
	}
	for (int i=1;i<=m;++i)
		putchar('.');
	putchar('\n');
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
using namespace std;
int gcd(int x,int y){
    while(y){
        if(x<y)swap(x,y);
        int tmp=x;
        x=y;
        y=tmp%y;
    }
    return x;
}
int main(void){
    int a,b;
    cin>>a>>b;
    int k=gcd(a,b);
    string s,t;
    cin>>s>>t;
    for(int i=0;i<k;i++){
        if(s[(a/k)*i]!=t[(b/k)*i]){
            cout<<"-1"<<endl;
            return 0;
        }
    }
    cout<<(long long)a*b/k<<endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))

const double pi = 4 * atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n, x, t;
	cin >> n >> x >> t;
	cout << (n/x+(n%x!=0))*t << "\n";

}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using llint = long long;
using vint = vector<int>;
using vvint = vector<vector <int>>;

int main () {
    int a, b, ans;
    cin >> a >> b;
    ans = 6 - (a + b);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, N)
	amap := make(map[int]int)

	for i := 0; i < N; i++ {
		fmt.Scan(&a[i])
		amap[i] = a[i]
	}

	first := a[0]
	cnt := 1
	for i := 0; i < N; i++ {
		if a[i] < first {
			cnt++
			first = a[i]
		}
	}

	// for i, v1 := range amap {
	// 	for j := i; j < N; j++ {
	// 		if v1 > first {
	// 			continue
	// 		}
	// 		if amap[j] > v1 {
	// 			delete(amap, j)
	// 		}
	// 	}
	// }

	// for i, v1 := range amap {
	// 	j := i
	// 	for {
	// 		if j > len(amap) {
	// 			break
	// 		}
	// 		// if v1 > first {
	// 		// 	j++
	// 		// 	continue
	// 		// }
	// 		if amap[j] > v1 {
	// 			delete(amap, j)
	// 		}
	// 		j++
	// 	}
	// }
	// first := a[0]

	// for i, v1 := range amap {
	// 	for j, v2 := range amap {
	// 		if v1 > first {
	// 			continue
	// 		}
	// 		if j > i && v2 > v1 {
	// 			delete(amap, j)
	// 		}
	// 	}
	// }

	// for i := 0; i < N; i++ {
	// 	elem := a[i]
	// 	for j, v := range amap {
	// 		if elem > first {
	// 			continue
	// 		}
	// 		if j > i && v > elem {
	// 			delete(amap, j)
	// 		}
	// 	}
	// }
	fmt.Println(cnt)
}


Measured memory_bytes: 16128
N = int(input())

h1, h2, h3 = [0] * N, [0] * N, [0] * N

for i in range(N):
  a, b, c = map(int, input().split())
  if i == 0:
    h1[i], h2[i], h3[i] = a, b, c
  else:
    h1[i] = a + max(h2[i-1], h3[i-1])
    h2[i] = b + max(h1[i-1], h3[i-1])
    h3[i] = c + max(h1[i-1], h2[i-1])
print(max(h1[-1], h2[-1], h3[-1]))



Measured memory_bytes: 14836
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
int32_t main()
{  lli n,m,i,k,j,c=0,v1=0,v2=0;
   cin>>n>>m>>k;
   lli a[n+5];
   lli b[m+5];
   for(i=1;i<=n;i++)
    { cin>>a[i];
      if(i!=1) a[i]+=a[i-1];
      if(k>=a[i]) v1=i;
    }
   for(i=1;i<=m;i++)
    { cin>>b[i];
      if(i!=1) b[i]+=b[i-1];
      if(k>=b[i]) v2=i;
    }
   i=1;  j=m;
   c=max(v1,v2);
   while(i<=n && j>=1)
   {  if(a[i]+b[j] <=k)
       {   c=max(c,i+j);
           i++;
       }
       else
         j--;
   }
   cout<<c<<"\n";
   return 0;
}


Measured memory_bytes: 6688
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;
 
#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7
 
typedef long long ll;
typedef long long int lli;
 
int main() {
	string S;
    int res = 0;
    stack<char> Sstack;
	cin >> S;
    int Ssize = S.size();
    for (int i = 0; i < Ssize; i++){
        if (Sstack.size() == 0) {
            Sstack.push(S[i]);
        }else{
            if (S[i] == Sstack.top()) {
                Sstack.pop();
                res++;
            }else{
                Sstack.push(S[i]);
            }
        }
    }
	cout << res << endl;
	return 0;
}

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

int main(){
    string s = "";
    cin >> s;
    int counter = 0;
    bool hasZero = 0;
    int am = 0;
    for(int i = 0; i < s.length(); i++){
        if(s[i] == '0')
            am++;
        counter  += s[i] - '0';
    }
    if(am == s.length() - 1){
        if(s[0] == '1')
            counter *= 10;
        
    }
    cout << counter << endl;

    return 0;
}


Measured memory_bytes: 256
A=int(input())
B=int(input())
C=int(input())
X=int(input())
cnt=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i+100*j+50*k ==X:
                cnt += 1
print(cnt)

Measured memory_bytes: 3060
using System;

class Program
{
    static void Main(string[] args)
    {
        String[] aryInput = Console.ReadLine().Split(' ');
        int n = int.Parse(aryInput[0]);
        int m = int.Parse(aryInput[1]);
        int l = int.Parse(aryInput[2]);

        long[,] A = new long[n, m];
        long[,] B = new long[m, l];
        long[,] C = new long[n, l];

        //配列A代入
        for (int i = 0; i < n; i++)
        {
            String[] tmp1 = Console.ReadLine().Split(' ');

            for (int j = 0; j < m; j++)
            {
                A[i, j] = int.Parse(tmp1[j]);
            }

        }

        //配列B代入
        for (int i = 0; i < m; i++)
        {
            String[] tmp2 = Console.ReadLine().Split(' ');

            for (int j = 0; j < l; j++)
            {
                B[i, j] = int.Parse(tmp2[j]);
            }

        }

        //Cの配列に整数入力
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < l; j++)
            {
                for (int k = 0; k < m; k++)
                {
                    C[i,j] += A[i,k] * B[k,j];
                }
            }
        }

        //Cの中身出力
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < l; j++)
            {
                if (j == 0)
                {
                    Console.Write(C[i, j]);
                }
                else
                {
                    Console.Write(" " + C[i, j]);
                }
            }
            Console.WriteLine();
        }

    }
}

Measured memory_bytes: 9808
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main(){
	long a,b,c,ab;
	while(cin >> a >> b){
		ab=a*b;
		while(b!=0){
			a=a%b;
			c=b;b=a;a=c;
		}
		cout << a <<" " <<ab/a<<"\n";
	}
return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

typedef long long ll;
typedef double db;

const db d = 1e-9;
const ll T = 1e6;
bool isPrime[T + 10];
ll Prime[T + 10];
ll n, res;
ll cnt;

ll check(ll x) {
	db t = x + d;
	return (sqrtl(1 + 8 * t) - 1) / 2;
}

void GetPrime(int n)//筛到n
{
	memset(isPrime, 1, sizeof(isPrime));
	//以“每个数都是素数”为初始状态，逐个删去
	isPrime[1] = 0;//1不是素数

	for (int i = 2; i <= n; i++)
	{
		if (isPrime[i])//没筛掉 
			Prime[++cnt] = i; //i成为下一个素数

		for (int j = 1; j <= cnt && i*Prime[j] <= n/*不超上限*/; j++)
		{
			//从Prime[1]，即最小质数2开始，逐个枚举已知的质数，并期望Prime[j]是(i*Prime[j])的最小质因数
			//当然，i肯定比Prime[j]大，因为Prime[j]是在i之前得出的
			isPrime[i*Prime[j]] = 0;

			if (i % Prime[j] == 0)//i中也含有Prime[j]这个因子
				break; //重要步骤。见原理
		}
	}
}

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

	ll x = n;
	ll i = 1;
	ll e = 0;
	while (x != 1) {
		while (x % Prime[i] == 0) {
			x /= Prime[i];
			e++;
		}

		if (e != 0) {
			res += check(e);
		}
		i++;
		if (i > cnt) {
			break;
		}
		e = 0;
	}
	if (x != 1) {
		res++;
	}
	cout << res << endl;

	return 0;
}

Measured memory_bytes: 5296
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

type works []struct {
	a int
	b int
}

func (w works) Len() int {
	return len(w)
}

func (w works) Less(i, j int) bool {
	return w[i].b < w[j].b
}

func (w works) Swap(i, j int) {
	w[i], w[j] = w[j], w[i]
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()

	w := make(works, n)
	for i := 0; i < n; i++ {
		w[i] = struct {
			a int
			b int
		}{
			a: nextInt(),
			b: nextInt(),
		}
	}

	sort.Sort(w)

	time := 0
	ans := "Yes"
	for i := 0; i < n; i++ {
		time += w[i].a
		if time > w[i].b {
			ans = "No"
			break
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 6272
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define mod 1000000007
#define INF (ll)1e19
#define N 200005

using namespace std;

ll n, x, y, s[N], p[N], d[N];
vector <int> v[N];
void dfs(int x, int pr) {
    p[x] = pr;
    d[x] = d[pr] + 1;
    s[x]++;
    for (int i = 0; i < v[x].size(); i++) {
        if (v[x][i] == pr) continue;
        dfs(v[x][i], x);
        s[x] += s[v[x][i]];
    }
}
int main() {
    //freopen("txt.in", "r", stdin);
    //freopen("txt.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i = 1; i < n; i++)
        cin >> x >> y, v[x].pb(y), v[y].pb(x);
    dfs(1, 0);
    int k = d[n] - d[1];
    k--;
    k /= 2;
    int f = n;
    while(k--) n = p[n];
    if (s[n] >= f - s[n]) cout << "Snuke" << endl;
    else cout << "Fennec" << endl;

	return 0;
}


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

int main() {
    int  N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A.at(i);

    vector<int> B(N);
    rep(i, N) B.at(A.at(i) - 1) = i + 1;
    rep(i, N) cout << B.at(i) << " ";
    cout << endl;
}


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

struct info{
	ll w,s,v;
	info(ll _w,ll _s,ll _v){
		w = _w;
		s = _s;
		v = _v;
	}
	bool operator<(const info &b)const{
		return w+s < b.w+b.s;
	}
};
const int maxn = 1000+10;
const int maxsumW = 10000+10;
ll memo[maxn][maxsumW];
vector<info> A;
int N;

ll dp(int pos,int sumw){
	if(pos >= N)return 0;
	ll &res = memo[pos][sumw];
	if(res != -1)return res;
	res = dp(pos+1,sumw);
	if(sumw <= A[pos].s){
		res = max(res,A[pos].v+dp(pos+1,min(sumw+A[pos].w,10000ll+5)));
	}
	return res;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	forn(i,0,maxn)forn(j,0,maxsumW)memo[i][j] = -1;
	cin >> N;
	forn(i,0,N){
		ll w,s,v; cin >> w >> s >> v;
		A.pb(info(w,s,v));
	}
	sort(all(A));
	cout << dp(0,0) << '\n';
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


Measured memory_bytes: 79488
#include <iostream>

using namespace std;
int main(){
	int L[4]={},R[4]={};
	double left,right;
	while(cin >> left >> right){
		if(left >= 1.1){
			L[0]++;
		}else if(left >= 0.6){
			L[1]++;
		}else if(left >=0.2){
			L[2]++;
		}else{
			L[3]++;
		}
		if(right >= 1.1){
			R[0]++;
		}else if(right >= 0.6){
			R[1]++;
		}else if(right >=0.2){
			R[2]++;
		}else{
			R[3]++;
		}
	}
		for(int i=0;i<4;i++){
			cout << L[i] << ' ' << R[i] << endl;
		}
	return 0;
}

Measured memory_bytes: 1224
N=int(input())

e = [0]*(N+1)
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            e[j] +=1
            cur //=j

def cnt(n):
    return len(list(filter(lambda x: x>=n-1, e)))

print(cnt(75) + cnt(15)*(cnt(5)-1) + cnt(25)*(cnt(3)-1) + cnt(5) * (cnt(5)-1) * (cnt(3)-2) // 2)





Measured memory_bytes: 38896
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

const int MOD = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int r; cin >> r;
    cout << r * r;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>

int main() {
   
   char a;
   
   std::cin >> a;
   
   if (std::isupper(a))
   {
      std::cout << "A" << std::endl;
   }
   else
   {
      std::cout << "a" << std::endl;
   }
   
   
   return 0;
   
}


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

using ll = long long;
using ld  = long double;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const int INF=1e9+7;
const ll LINF=9223372036854775807;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld EPS = 1e-10; //微調整用（EPSより小さいと0と判定など）

int ii() { int x; if (scanf("%d", &x)==1) return x; else return 0; }
long long il() { long long x; if (scanf("%lld", &x)==1) return x; else return 0; }
string is() { string x; cin >> x; return x; }
char ic() { char x; cin >> x; return x; }
void oi(int x) { printf("%d ", x); }
void ol(long long x) { printf("%lld ", x); }
void od_nosp(double x) { printf("%.15f", x); } // 古い問題用
void od(double x) { printf("%.15f ", x); }
// long doubleで受け取り、fをLfなどに変えて出力すると、変な数値が出る
// それをなんとかするには独自の出力を作らなければならなそう
void os(const string &s) { printf("%s ", s.c_str()); }
void oc(const char &c) { printf("%c ", c); }
#define o_map(v){cerr << #v << endl; for(const auto& xxx: v){cout << xxx.first << " " << xxx.second << "\n";}} //動作未確認
void br() { putchar('\n'); }

// #define gcd __gcd //llは受け取らない C++17~のgcdと違うので注意
// int lcm(int a, int b){return a / gcd(a, b) * b;}
#define b_e(a) a.begin(),a.end() //sort(b_e(vec));
#define REP(i,m,n) for(ll i=(ll)(m) ; i < (ll)(n) ; i++ )
#define DREP(i,m,n) for(ll i=(ll)(m) ; i > (ll)(n) ; i-- )
#define rep(i,n) REP(i,0,n)
#define m_p(a,b) make_pair(a,b)
#define p_b push_back
#define SZ(x) ((ll)(x).size()) //size()がunsignedなのでエラー避けに
#define endk '\n'


// coutによるpairの出力（空白区切り）
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << " " << p.second << ")";}
// coutによるvectorの出力（空白区切り）
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << " "; //"\t"に変えるとTabで見やすく区切る
  }
  return s;
}
// coutによる多次元vectorの出力（空白区切り）
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}

//最大値、最小値の更新。更新したor等しければtrueを返す
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

//4近傍（上下左右） rep(i, 2) にすると右・下だけに進む
vector<int> dx_4 = {1, 0, -1, 0};
vector<int> dy_4 = {0, 1, 0, -1};

// -------- template end - //


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


// --------- library end - //



int main(){

  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  vector<ll> ans(4);

  cout << max({a*c, a*d, b*c, b*d}) << endk;

}



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

int main() {
  int N,c;
  c = 0;
  cin >> N;
  vector<int> mochi(N);
  for(int i=0;i<N;i++){
    cin >> mochi.at(i);
  }
  sort(mochi.begin(), mochi.end());
  for(int i=0;i<N-1;i++){
    if(mochi.at(i) == mochi.at(i+1)){
      continue;
    }
    c++;
  }
  cout << c+1 << endl;
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
  ∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

//保留所有权利。
#include<iostream>
#include<stdio.h>//printするよ
#include<vector>
#include<algorithm>//辞書順はnext_permutationだよ
#include<set>
#include<string>
#include<sstream>
#include<string.h>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swapで数値交換するよ
//END OF LIBRARIES.
#define rt "\n"//改行を最速化させるよ
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define cncn int cnt=0
#define smsm int sum=0
#define str srting
#define v vector
#define please return
#define AC 0//おまじないだよ
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
//END OF DEFINE.
using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;
//printf("%02d:%02d:%02d\n", h, m, s);・・・2文字は埋める・h、m、ｓ
//END OF TYPEDEF.

//最大公約数（GCD）を求めるよ
//最小公倍数（LCM）は＜＜　A × B ÷ GCD　 ＞＞で求まるよ

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}
unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}
int tow(int n) {//2のn乗を求めるらしい！！！
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;
	//dominoに借りたやつです
}
/*
  for A以上B未満でI探索 for (int I = A; i <= B; i++)

  string s = to_string(i);　iをstringでsに変換

  char　小文字のほうが32大--------------------大文字と小文字の境=93

  大文字→小文字 文字列のn文字目を大文字で出力→ (char)toupper(a[n])

  int i = sqrt (n) で、ｎの平方根(9に対する3)をiに入れる

  pow(a,b) → aのb乗を求める

  s1.erase(n) 文字列s1の、n文字目以降削除
  */
int a=0, b=0, c = 0;
string s = "";

int main(void) {
	//vector,set,map,stack,queue,deque,priority_queue

	int h, w; cin >> h >> w;
	vstr c(h);
	vcin(c, h);
	rep(i, h) {
		cout << c[i] << rt;
		cout << c[i] << rt;
	}

	please AC;
}

Measured memory_bytes: 256
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>h[k]:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(n):
	if len(l[i])==0:
		score+=1
print(score)


Measured memory_bytes: 29340
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string S,T,U;
  int A,B;
  cin >> S >> T >> A >> B >> U;
  if(S==U) cout << A-1 << " " << B << endl;
  else cout << A << " " << B-1 << endl;
}

Measured memory_bytes: 3632
#include <stdio.h>
int main (void){
    int a,aa,i,j,card,taro[201],hana[201],ba,tans,hans;
    for(;;){
        scanf("%d",&a);
        if(a==0)break;
        ba=0,tans=0,hans=0;
        for(i=0;i<201;i++){
            taro[i]=0;
            hana[i]=1;
        }
        for(i=0;i<a;i++){
            scanf("%d",&card);
            taro[card]=1;
            hana[card]=0;
        }
        aa=2*a;
        taro[aa+1]=2,hana[aa+1]=2;
        for(i=1;i<=aa;i++){
            for(j=1;j<=aa;j++){
                if(taro[j]==1&&j>ba){
                    ba=j;
                    taro[j]=0;
                    break;
                }
            }
            if(j==aa+1){
                ba=0;
            }
            tans=0;
            for(j=1;j<=aa;j++){
                if(taro[j]==1){
                    tans++;
                }
            }
            if(tans==0)break;
            for(j=1;j<=aa;j++){
                if(hana[j]==1&&j>ba){
                    ba=j;
                    hana[j]=0;
                    break;
                }
            }
            if(j==aa+1){
                ba=0;
            }
            hans=0;
            for(j=1;j<=aa;j++){
                if(hana[j]==1){
                    hans++;
                }
            }
            if(hans==0)break;
        }
        printf("%d\n%d\n",hans,tans);
    }
return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define ll long long
#define ull unsigned long long
#define ld long double
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rrep(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define pll pair<long long,long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vvc vector<vector<char>>
#define vc vector<char>
#define vvb vector<vector<bool>>
#define vb vector<bool>
#define maxe(x) *max_element(all(x))
#define mine(x) *min_element(all(x))
#define Size(x) ((int)(x).size())
#define umap unordered_map
const long long INF = 1LL << 60;
const long double pi = 3.1415926535897932;
long long MOD = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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

//lis,modpow,uf,modncr,soinsubunkai,yakusurekkyo,gyakugen
//mint

    signed main(){
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        string s;
        ll K;
        cin>>s>>K;
        vector<string> vec;
        map<string,ll> m;
        ll S=Size(s);
        rep(i,S){
            string A="";
            rep(j,K){
                ll a=i+j;
                if(a>=S)break;
                A+=s[a];
                if(m[A]>0)continue;
                m[A]++;
                vec.pb(A);
            }
        }
        sort(all(vec));
        cout<<vec[K-1]<<endl;
    }

Measured memory_bytes: 2048
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False
# show_flg = True


def main():
    N = I()
    A = LI()
    A = sorted(A, reverse=True)
    max_a = max(A)
    ans = 0
    arr = []
    cnt = 0
    cur = 0
    v = max_a

    while cur < len(A) and v == A[cur]:
        cur += 1
        cnt += 1
        arr.append(v)
        arr.append(v)

    while cur < len(A):
        cnt = 0
        while cur < len(A) and v == A[cur]:
            cur += 1
            cnt += 1

        # print(v, cnt)
        for i in range(cnt * 2):
            arr.append(v)
        if cur < len(A):
            v = A[cur]
        if len(arr) >= 2 * N:
            break

    # print(arr)
    # print(arr[1:])
    # print(arr[1:N])
    print(sum(arr[1:N]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 129816
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	cout << (n+1)/2 << endl;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val xs = IntArray(n, { readLine()!!.toInt() })

  if (xs[0] != 0) {
    println(-1)
    return
  }

  var ans = 0L
  for (i in 1 until n) {
    if (xs[i] == xs[i - 1] + 1) {
      ans += 1
    } else if (xs[i] <= xs[i-1]) {
      ans += xs[i]
    } else {
      println(-1)
      return
    }
  }

  println(ans)
}


Measured memory_bytes: 43152
n=int(input())
t=[0]*n
x=[0]*n
y=[0]*n
c=0
a=0
b=0
ans='Yes'
for i in range(n):
    t[i],x[i],y[i]=map(int,input().split())
for j in range(n):
    if t[j]-c>=x[j]+y[j]-a-b:
        if (t[j]-c-(x[j]+y[j]-a-b))%2==0:
            a=x[j]
            b=y[j]
            c=t[j]
        else:
            ans='No'
            break
    else:
        ans='No'
        break
print(ans)
        

Measured memory_bytes: 11636
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int s[3],a[3][3],ans=0;
    for(int i=0;i<3;i++) cin>>s[i];
    sort(s,s+3);
    for(int i=0;i<3;i++)
    {
    	for(int j=i+1;j<3;j++)
    	{
    		a[i][j]=(max(s[i],s[j])-min(s[i],s[j]))%2;
    		a[j][i]=a[i][j];
    	}
    }
    for(int i=0;i<3;i++)
    {
    	bool w=true;
    	for(int j=0;j<3;j++)
    	{
    		if(i==j) continue;
    		if(a[i][j]==0) w=false;
    	}
    	if(w==true)
    	{
    		ans++;
    		for(int j=0;j<3;j++)
	    	{
	    		if(i==j) continue;
	    		s[j]++;
	    	}
    	}
    }
    ans+=(s[2]-s[0])/2;
    ans+=(s[2]-s[1])/2;
    cout<<ans<<endl;
}

Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(c) c.begin(),c.end()
#define PB push_back

using namespace std;
typedef long long ll;

char mp[60][60];

int main()
{
  int H, W;
  cin >> H >> W;
  REP(i, 60)REP(j, 60) mp[i][j] = '.';
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      cin >> mp[i][j];
    }
  }

  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      int cnt = 0;
      if (mp[i + 1][j] == '.') cnt++;
      if (mp[i - 1][j] == '.') cnt++;
      if (mp[i][j + 1] == '.') cnt++;
      if (mp[i][j - 1] == '.') cnt++;
      if (mp[i][j] == '#' && cnt == 4) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;

  return 0;
}

Measured memory_bytes: 256
# ABC129C - Typical Stairs
import sys
input = sys.stdin.readline
 
def main():
    N, M = tuple(map(int, input().split()))
    A = set(map(int, [input() for _ in range(M)]))
    MOD = 10 ** 9 + 7
    dp = [0] * (N + 1)
    dp[:2] = 1, 1 if 1 not in A else 0
    for i in range(2, N + 1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
    print(dp[-1])
 
 
if __name__ == "__main__":
    main()

Measured memory_bytes: 58972
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<string.h>
#include <iomanip>
#include <sstream>
using namespace std;

int main() {
  int N, M;
  int ans = 0;
  string s;

  cin >> N;

  vector<int> A(N);
  vector<int> B(N);
  for(int i = 0; i < N; i++){
    cin >> A[i];
    B[i] = i+1;
  }
  vector<pair<int,int>> AB(N);
  for(int i = 0; i < N; i++){
    AB[i] = make_pair(A[i], B[i]);
  }
   sort(AB.begin(), AB.end());

  
  for(int i = 0; i < N; i++){
    if(i>0){
      cout <<" " ;
    }
    cout  <<  AB[i].second;
  }
    cout << endl;


}


Measured memory_bytes: 2432
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define hell 998244353
#define PI 3.14159265358979323846
#define N 300005
using namespace std;
vector<ll> adj[100005];
int vis[100005];
void dfs(ll x)
{
    vis[x]=1;
    for(ll i=0;i<adj[x].size();i++)
        if(!vis[adj[x][i]])
        dfs(adj[x][i]);
}
int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
  // cin>>t;
    //int c=0;
    while(t--) {
        ll x,y,n,m,i,j;
        cin>>n>>m;
        for(i=0;i<m;i++)
        {
            cin>>x>>y;
            adj[x].pb(y);
            adj[y].pb(x);
        }
        for(i=1;i<=n;i++)
            vis[i]=0;
            ll ans=0;
        for(i=1;i<=n;i++)
        {
            if(!vis[i])
            {
                dfs(i);
                ++ans;
            }
        }
        cout<<ans-1;
    }

}


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

const int maxN = 3005, mod = 998244353;

int A, B, C, D;
int f[maxN + 1][maxN + 1];

inline void update(int &x, int y) { x = x + y >= mod ? x + y - mod : x + y; }

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

	f[A][B] = 1;
	for(int i = A; i <= C; i++)
		for(int j = B; j <= D; j++)
		{
			if(i == A && j == B) continue;
			update(f[i][j], 1ll * f[i - 1][j] * j % mod);
			update(f[i][j], 1ll * f[i][j - 1] * i % mod);
			update(f[i][j], mod - 1ll * f[i - 1][j - 1] * (i - 1) * (j - 1) % mod);
		}

	printf("%d\n", f[C][D]);
	return 0;
}


Measured memory_bytes: 38920
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String[] tmp = br.readLine().split(" ");
        int a = Integer.parseInt(tmp[0]);
        int b = Integer.parseInt(tmp[1]);
        int c = Integer.parseInt(tmp[2]);
        
        if(a < c && c < b || a > c && c > b) System.out.println("Yes");
        else System.out.println("No");

        br.close();
    }
}

Measured memory_bytes: 22356
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

const int MOD = 1e9 + 7;
const int INF32 = 1<<30;	
const ll INF64 = 1LL<<60;

int main()
{
	// #ifndef ONLINE_JUDGE
	// freopen(".in.txt", "r", stdin);
	// freopen(".out.txt", "w", stdout);
	// #endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int k; cin >> k;
	string s; cin >> s;
	cout << (s.size() > k ? s.substr(0, k) + "..." : s);

	return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (int i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()

int n;

int main() {
    cin >> n;
    FOR (i, 1, 10) FOR (j, 1, 10) {
        if (n == i*j) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void) {
	int num;
	char input1[9];
	char input2[9];
	char output[9];
	output[0] = '\0';
	int change1;
	int change2;
	int count1;
	int count2;

	scanf("%d", &num);
	for (count1 = 0; count1 < num; count1++) {
		change1 = 0;
		change2 = 0;
		scanf("%s", input1);
		scanf("%s", input2);
		for (count2 = 0; count2 < strlen(input1); count2++) {
			if (input1[count2] == 'm')
				change1 = 1000;
			else if (input1[count2] == 'c')
				change1 += 100;
			else if (input1[count2] == 'x')
				change1 += 10;
			else if (input1[count2] == 'i') {
				change1 += 1;
				break;
			}
			else {
				if (input1[count2 + 1] == 'm')
					change1 += (input1[count2]-'0') * 1000;
				else if (input1[count2 + 1] == 'c')
					change1 += (input1[count2]-'0') * 100;
				else if (input1[count2 + 1] == 'x')
					change1 += (input1[count2]-'0') * 10;
				else {
					change1 += input1[count2]-'0';
					break;
				}
				count2++;
			}
		}
		for (count2 = 0; count2 < strlen(input2); count2++) {
			if (input2[count2] == 'm')
				change2 = 1000;
			else if (input2[count2] == 'c')
				change2 += 100;
			else if (input2[count2] == 'x')
				change2 += 10;
			else if (input2[count2] == 'i') {
				change2 += 1;
				break;
			}
			else {
				if (input2[count2 + 1] == 'm')
					change2 += (input2[count2]-'0') * 1000;
				else if (input2[count2 + 1] == 'c')
					change2 += (input2[count2]-'0') * 100;
				else if (input2[count2 + 1] == 'x')
					change2 += (input2[count2]-'0') * 10;
				else {
					change2 += input2[count2]-'0';
					break;
				}
				count2++;
			}
		}
		count2 = 0;
		change1 += change2;
		if (change1 / 1000 > 1) {
			output[0]= '0' + change1 / 1000;
			output[1] = 'm';
			count2 = 2;
			change1 = change1 % 1000;
		}
		else if (change1 / 1000 == 1) {
			output[0]= 'm';
			count2 = 1;
			change1 = change1 - 1000;
		}
		if (change1 / 100 > 1) {
			output[count2]= '0' + change1 / 100;
			output[count2 + 1] = 'c';
			count2 += 2;
			change1 = change1 % 100;
		}
		else if (change1 / 100 == 1) {
			output[count2]= 'c';
			count2++;
			change1 = change1 - 100;
		}
		if (change1 / 10 > 1) {
			output[count2]= '0' + change1 / 10;
			output[count2+1]= 'x';
			count2 += 2;
			change1 = change1 % 10;
		}
		else if (change1 / 10 == 1) {
			output[count2]= 'x';
			count2++;
			change1 = change1 - 10;
		}
		if (change1 > 1) {
			output[count2]= '0' + change1;
			output[count2+1]= 'i';
			count2 += 2;
		}
		else if (change1 == 1) {
			output[count2]= 'i';
			count2++;
		}
		output[count2]= '\0';
		printf("%s\n", output);
	}
}


Measured memory_bytes: 2024
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;


    void solve()
    {
        int N = cin.nextint;
        int A = cin.nextint;
        int B = cin.nextint;

        int zero_a = A - 1;
        int a_b = B - A - 1;
        int b_n = N - B;
        if (a_b % 2 == 1)
        {
            WriteLine("Alice");
        }
        else
        {
            WriteLine("Borys");
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 11220
import * as fs from 'fs';

namespace AtCoder.abc096 {
    export class Program {
        constructor(private readonly args: string[][]) {
        }

        main(this: Program) {
            const abc: number[] = this.args[0].map(Number);
            const abcSorted: number[] = abc.sort((a, b) => b - a);
            const [k]: number[] = this.args[1].map(Number);
            for (let i: number = 1; i <= k; i++) {
                abcSorted[0] = abcSorted[0] * 2;
            }

            const ans: number = abcSorted.reduce((acc: number, cur: number) => acc + cur, 0);
            console.log(ans);
        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(x => x.split(' '));
const prg: AtCoder.abc096.Program = new AtCoder.abc096.Program(args);
prg.main();

Measured memory_bytes: 7500
#include <bits/stdc++.h>
using namespace std;
int main()
{
    // 整数の入力
	int n,d;
    int space;

    cin >> n >> d;
    space = 2*d+1;
    for(int i=1;i<=n;i++){
        if(n<=space*i){
            cout << i << endl;
            return 0;
        }
    }
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
const int DN=105,DK=1e5+5,M=1e9+7;
int n,k,a[DN],dp[DN][DK],sum;
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    	cin>>a[i];
    dp[0][0]=1;
    for(int i=1;i<=n;i++)
    {
    	sum=0;
    	a[i]++;
    	for(int j=0;j<=k;j++)
    	{
    		sum=(sum+dp[i-1][j])%M;
    		if(j>=a[i])
    			sum=(sum+M-dp[i-1][j-a[i]])%M;
    		dp[i][j]=sum;
    	}
    }
    cout<<dp[n][k];
}

Measured memory_bytes: 40832
#include <iostream>
using namespace std;
 
int main() {
	int W, H, N;
	int count = 0;
	bool area[110][110] = { false };//一番目が高さ、2番目が幅
	int n_info[110][3] = { 0 };
	cin >> W >> H >> N;
	for (int i = 0; i < H; i++) {
		for (int i2 = 0; i2 < W; i2++) {
			area[i][i2] = true;
			//cout << "(" << i << "," << i2 << ") " << flush;
		}
	}
 
	//以下ｎについての情報配列
	for (int i = 0; i < N; i++) {
		int xi, yi, ai;
		cin >> xi >> yi >> ai;
		n_info[i][0] = xi;
		n_info[i][1] = yi;
		n_info[i][2] = ai;
	}
 
	//以下ｎによる処理
	for (int i = 0; i < N; i++) {
		switch(n_info[i][2]) {
		case 1://長方形のx＜xiを満たす領域をfalseにする
			for (int i2 = 0; i2 < H; i2++) {
				for (int i3 = 0; i3 < n_info[i][0]; i3++) {
					area[i2][i3] = false;
				}
			}
			break;
 
		case 2://長方形のx＞xiを満たす領域をfalseにする
			for (int i2 = 0; i2 < H; i2++) {
				for (int i3 = n_info[i][0]; i3 < W; i3++) {
					area[i2][i3] = false;
				}
			}
			break;
 
		case 3://長方形のｙ＜yiを満たす領域をfalseにする
			for (int i2 = 0; i2 < W; i2++) {
				for (int i3 = 0; i3 < n_info[i][1]; i3++) {
					area[i3][i2] = false;
				}
			}
			break;
 
		case 4://長方形のｙ＞yiを満たす領域をfalseにする
			for (int i2 = 0; i2 < W; i2++) {
				for (int i3 = n_info[i][1]; i3 < H; i3++) {
					area[i3][i2] = false;
				}
			}
			break;
 
		default:
			cout << "error:: unknown ai number." << endl;
			break;
		}
		
	}
	
	for (int i = 0; i < 110; i++) {
		for (int i2 = 0; i2 < 110; i2++) {
			if (area[i][i2] == true) {
				count++;
			}
		}
	}
	
	cout << count << endl;
}

Measured memory_bytes: 256