akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<int,int> P;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),v.end()
const ll mod=1000000007;
const ll mod2=998244353;
const ll inf=100000000000000000;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
vector<int> dy={-1,0,1,0},dx={0,-1,0,1};
int main(){
int n;
cin>>n;
multiset<int> s;
multiset<int,greater<int>> tmp;
vector<int> a((1<<n));
for(int i=0;i<(1<<n);i++){
  cin>>a[i];
  s.insert(a[i]);
}
multiset<int>::iterator ite;
ite=s.end();
ite--;s.erase(ite);
tmp.insert((int)*ite);
for(int times=0;times<n;times++){
  vector<int> slime;
    for(auto ite=tmp.begin();ite!=tmp.end();ite++){
        auto it=s.lower_bound((int)*ite);
       // cout<<s.size()<<endl;
        if(it==s.begin()){
          cout<<"No"<<endl;
          return 0;
        }
        it--;
        s.erase(it);
        slime.push_back((int)*it);
    }
    for(int i=0;i<slime.size();i++){
            tmp.insert(slime[i]);
    }
}
cout<<"Yes"<<endl;
}

Measured memory_bytes: 14328
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <iomanip>
using namespace std;
int main ()
{
	int n,a;
	scanf("%d%d",&n,&a);
	printf("%d\n",n*n-a);
	return 0;
}


Measured memory_bytes: 256
H,W=map(int,input().split())
n=int(input())
a=list(map(int,input().split()))

grid=[[0 for i in range(W)] for j in range(H)]
cur=0
curcnt=0
for i in range(H):
  for j in range(W):
    p=j
    if i%2==1:
      p=W-1-j
    grid[i][p]=cur+1
    curcnt+=1
    if curcnt==a[cur]:
      cur+=1
      curcnt=0
      
for i in range(H):
  print(*grid[i])

Measured memory_bytes: 3920
#define _USE_MATH_DEFINES

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

using namespace std;

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

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

int main(){
    int N, K;
    cin >> N >> K;
    int V[100];
    for(int i = 0; i < N; i++){
        cin >> V[i];
    }
    long long int ans = 0;
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= N; j++){
            if(i + j > K || i + j > N){
                continue;
            }
            vector<long long int> v;
            long long int S = 0;
            for(int k = 0; k < i; k++){
                v.push_back(V[k]);
                S += V[k];
            }
            for(int k = 0; k < j; k++){
                v.push_back(V[N - 1 - k]);
                S += V[N - 1 - k];
            }
            sort(v.begin(), v.end());
            int rem = K - (i + j), sz = v.size();
            for(int k = 0; k < min(rem, sz); k++){
                if(v[k] >= 0){
                    break;
                }
                S -= v[k];
            }
            ans = max(ans, S);
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;
constexpr int MAX_N = 1000;

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

  int n;
  cin >> n;

  if (n == 2) {
    cout << -1 << endl;
    return 0;
  }

  if (n % 3 == 0) {
    vector<string> board(n, string(n, '.'));
    for (int i = 0; i < n / 3; i++) {
      board[3 * i][3 * i] = 'a';
      board[3 * i][3 * i + 1] = 'a';
      board[3 * i + 1][3 * i + 2] = 'a';
      board[3 * i + 2][3 * i + 2] = 'a';
    }
    for (const string& row : board) {
      cout << row << endl;
    }
    return 0;
  }

  vector<tuple<bool, int, int, int>> dp(MAX_N + 1, make_tuple(false, -1, -1, -1));
  dp[4] = make_tuple(true, 1, 0, 0);
  dp[5] = make_tuple(true, 0, 1, 0);
  dp[7] = make_tuple(true, 0, 0, 1);
  for (int k = 1; k <= n; k++) {
    if (k - 4 >= 0 && get<0>(dp[k - 4])) {
      dp[k] = dp[k - 4];
      get<1>(dp[k])++;
    } else if (k - 5 >= 0 && get<0>(dp[k - 5])) {
      dp[k] = dp[k - 5];
      get<2>(dp[k])++;
    } else if (k - 7 >= 0 && get<0>(dp[k - 7])) {
      dp[k] = dp[k - 7];
      get<3>(dp[k])++;
    }
  }

  int a, b, c;
  tie(ignore, a, b, c) = dp[n];

  vector<string> p4 = {
    "aabc",
    "ddbc",
    "efgg",
    "efhh"
  };
  vector<string> p5 = {
    "..abc",
    "..abc",
    "ddeef",
    "ggh.f",
    "iihjj"
  };
  vector<string> p7 = {
    "....abc",
    "....abc",
    "....def",
    "....def",
    "gghh..i",
    "jjkk..i",
    "llmmnn."
  };

  vector<string> board(n, string(n, '.'));
  int base = 0;
  for (int k = 0; k < a; k++) {
    for (int y = 0; y < 4; y++) {
      for (int x = 0; x < 4; x++) {
        board[base + y][base + x] = p4[y][x];
      }
    }
    
    base += 4;
  }
  for (int k = 0; k < b; k++) {
    for (int y = 0; y < 5; y++) {
      for (int x = 0; x < 5; x++) {
        board[base + y][base + x] = p5[y][x];
      }
    }
    base += 5;
  }
  for (int k = 0; k < c; k++) {
    for (int y = 0; y < 7; y++) {
      for (int x = 0; x < 7; x++) {
        board[base + y][base + x] = p7[y][x];
      }
    }
    base += 7;
  }

  for (const string& row : board) {
    cout << row << endl;
  }
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define rep(i,n) for (int i=0;i<(n);++i)
#define REP(i,n) for (int i=1;i<=(n);++i)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define read(x) scanf("%d",&x)
int n,m;
int a[15][15];
int sum[15];
int innersum[1<<15];
int cost[1<<15];
const int INF=1e9;
int dp[1<<15][15];
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>m;
	while(m--){
		int u,v,c;cin>>u>>v>>c;--u,--v;a[u][v]=a[v][u]=c;
	}
	rep(i,n) rep(j,n) sum[i]+=a[i][j];
	//rep(i,n) cout<<sum[i]<<';';
	//cout<<endl;
	int full=(1<<n)-1;
	for (int mask=0;mask<=full;++mask)
		rep(i,n-1) if (mask&(1<<i)) for (int j=i+1;j<n;++j) if (mask&(1<<j)) innersum[mask]+=a[i][j];
	for (int mask=0;mask<=full;++mask) for (int i=0;i<n;++i) dp[mask][i]=INF;
	for (int mask=0;mask<=full;++mask){
		for (int i=0;i<n;++i) if (mask&(1<<i)) cost[mask]+=sum[i];
		cost[mask]-=2*innersum[mask];
	}
	for (int mask=1;mask<full;mask+=2) dp[mask][0]=cost[mask];
	//cout<<cost[7]<<endl;
	for (int mask=1;mask<full;mask+=2){
		for (int i=0;i<n;++i) if (mask&(1<<i)){
			if (dp[mask][i]>=INF) continue;
			for (int j=0;j<n;++j) if (a[i][j]&&(!(mask&(1<<j)))){
				int rest=full-mask-(1<<j);
				for (int sub=rest;;sub=(sub-1)&rest){
					dp[mask|sub|(1<<j)][j]=min(dp[mask|sub|(1<<j)][j],dp[mask][i]+cost[sub|(1<<j)]-2*a[i][j]);
					if (sub==0) break;
				}
			}
		}
	}
	cout<<dp[full][n-1]/2;
	return 0;
}

Measured memory_bytes: 2432
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            var s = Console.ReadLine();
            var result = Regex.Matches(s, "(A|C|G|T)+");
            int answer = 0;
            foreach(Match m in result)
            {
                answer = Math.Max(answer, m.Length);
            }            

            Console.WriteLine(answer);
        }
    }
}


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

using namespace std;

string s, t;

// int rotation() {

    // char x = s[s.length() - 1];

    // for (int i = s.length() - 1; i >= 0; i--) {
    //     if (i == 0) s[i] = x;
    //     else s[i] = s[i - 1];
    // }
//     return 0;
// }

int main()
{
    cin >> s >> t;
    string ret = "No";

    for (int i = 0; i < s.length(); i++) {
        char x = s[s.length() - 1];

        for (int i = s.length() - 1; i >= 0; i--) {
            if (i == 0) s[i] = x;
            else s[i] = s[i - 1];
        }
        if (s == t) {
            ret = "Yes";
            break;
        }
    }

    cout << ret << endl;

    return 0;
}

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

int main()
{
    int n, m;
    int i = 0, all = 0;

    scanf("%d %d", &n, &m);

    vector<int> vec(m);
    for (i = 0; i < m; i++) {
        cin >> vec.at(i);
        all += vec.at(i);
    }


    if (n-all >= 0)
        printf("%d",n-all);
    else
        printf("-1");
    return 0;
}

Measured memory_bytes: 3828
import java.util.Deque
import java.util.ArrayDeque

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val queue: Deque<Long> = ArrayDeque()
    for (i in 1..9) queue.add(i.toLong())
    var res: Long = 0L
    for (i in 1..n) {
        res = queue.poll()!!
        if (i == n) {
            println(res)
            return
        }
        if (res%10L != 0L) queue.add((res*10)+(res%10)-1)
        queue.add((res*10)+(res%10))
        if (res%10L != 9L) queue.add((res*10)+(res%10)+1)
    }
}

Measured memory_bytes: 38676
use proconio::*;

fn main() {
    input!{
        n: usize,
        ab: [(usize, usize); n],
    }

    let mut a = ab.iter().map(|&x| x.0).collect::<Vec<_>>();
    let mut b = ab.iter().map(|&x| x.1).collect::<Vec<_>>();
    a.sort();
    b.sort();

    if n % 2 == 1 {
        println!("{}", b[n/2] - a[n/2] + 1);
    } else {
        println!("{}", (b[n/2] + b[n/2-1]) - (a[n/2] + a[n/2-1]) + 1);
    }
}


Measured memory_bytes: 12960
#include<bits/stdc++.h>
#define int long long
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf2=0x3f3f3f3f;
const long long inf=0x3f3f3f3f3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
namespace fastio{
	char in[100000];
	int itr=0,llen=0;
	char get(){
		if(itr==llen)llen=fread(in,1,100000,stdin),itr=0;
		if(llen==0)return EOF;
		return in[itr++];
	}
	char out[100000];
	int itr2=0;
	void put(char c){
		out[itr2++]=c;
		if(itr2==100000){
			fwrite(out,1,100000,stdout);
			itr2=0;
		}
	}
	int clear(){
		fwrite(out,1,itr2,stdout);
		itr2=0;
		return 0;
	}
	int getint(){
    	int r=0; bool ng=0; char c; c=get();
    	while (c!='-'&&(c<'0'||c>'9')) c=get();
   		if (c=='-') ng=1, c=get();
    	while (c>='0'&&c<='9') r=r*10+c-'0', c=get();
    	return ng?-r:r;
	}
	string getstr(){
		string ret="";
		char ch=get();
		while(ch==' '||ch=='\n')ch=get();
		while(ch!=' '&&ch!='\n')ret.push_back(ch),ch=get();
		return ret;
	}
	void putstr(string s){
		for(int i=0;i<s.size();i++)put(s[i]);
	}
	void putint(int x){
		if(x<0){
			put('-');
			x=-x;
		}
		if(x==0){
			put('0');
			return;
		}
		char c[20];int pos=0;
		while(x){
			c[pos++]='0'+x%10;
			x/=10;
		}
		for(int i=pos-1;i>=0;i--)put(c[i]);
	}
	void getarr(int arrname[],int size){
		 for(int i=0;i<size;i++)arrname[i]=getint();
	}
}
using namespace fastio;
#define fastio
struct UFS{
	int par[200005];
	void init(int n){
		for(int i=0;i<=n;i++)par[i]=i;
	}
	int find(int x){
		return x==par[x]?x:par[x]=find(par[x]);
	}
	void unite(int x,int y){
		par[find(x)]=find(y);
	}
	bool same(int x,int y){
		return find(x)==find(y);
	}
}uf;
int n,d;
int a[200005];
struct Edge{
	ll val;int x,y;
};
bool operator<(Edge a,Edge b){
	return a.val<b.val;
}
vector<Edge>edge;
void solve(int l,int r){
	if(l==r)return; 
	int mid=l+r>>1;
	solve(l,mid);solve(mid+1,r);
	ll mn=inf,pl=-1;
	for(int i=l;i<=mid;i++){
		ll vl=a[i]-d*i;
		if(mn>vl){
			mn=vl;
			pl=i;
		}
	}
	mn=inf;ll pr=-1;
	for(int i=mid+1;i<=r;i++){
		ll vr=a[i]+d*i;
		if(mn>vr){
			mn=vr;
			pr=i;
		}
	}
	for(int i=l;i<=mid;i++){
		int vl=a[i]-d*i;
		int vr=a[pr]+d*pr;
		edge.push_back((Edge){vl+vr,i,pr});
	}
	for(int i=mid+1;i<=r;i++){
		int vl=a[pl]-d*pl;
		int vr=a[i]+d*i;
		edge.push_back((Edge){vl+vr,pl,i});
	}
}
signed main(){
	n=getint();d=getint();
	for(int i=0;i<n;i++)a[i]=getint();
	solve(0,n-1);
	sort(edge.begin(),edge.end());
	uf.init(n+2);
	ll ans=0;
	for(int i=0;i<edge.size();i++){
		if(!uf.same(edge[i].x,edge[i].y)){
			uf.unite(edge[i].x,edge[i].y);
			ans+=edge[i].val;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 102368
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class B
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var (A, B) = Scanner.Scan<int, int>();
            var answer = "";
            if(A < B) answer = string.Join("", Enumerable.Repeat(A, B).ToArray());
            else answer = string.Join("", Enumerable.Repeat(B, A).ToArray());
            Console.WriteLine(answer);
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
            public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T)));
        }
    }
}


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

#define LL long long
#define mods 1000000009



int main()
{
   // factorila();
    //freopen("amin.txt","w",stdout)
    long long n,i;
    cin>>n;
    LL ans=1;
    for(i=1;i<=n;i++)
    {
        ans=(ans*i)%1000000007;
    }
    cout<<ans<<"\n";
}


Measured memory_bytes: 384
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;
typedef long long ll;

const ll INF = 1e18;//极大值 

ll fmx(ll a,ll b,ll c){
	ll t=a;
	if(t<b)	t=b;
	if(t<c)	t=c;
	return t;
}

ll fmn(ll a,ll b,ll c){
	ll t=a;
	if(t>b)	t=b;
	if(t>c)	t=c;
	return t;
}

ll find(ll x,ll y){
	ll tmx,tmn;
	ll a1,a2,a3;
 	ll ans=INF;
 	//第一种情况： 全部横着切或者竖着切 
 	a1=(ceil(x*1.0/3))*y;
	a2=(floor(x*1.0/3))*y;
	a3=y*x-a1-a2;
	ans=min(ans,fmx(a1,a2,a3)-fmn(a1,a2,a3));
	
	//第二种情况： a1横着，a2，a3在a1下方，分为两份 或者（a1竖着，a2，a3在a1右边） 
	for(int h1=1;h1<=x/2;h1++){
		a1=y*h1;
		a2=(x-h1)*(y/2);
		a3=x*y-a1-a2;
		if(a1==0||a2==0||a3==0)	continue;

		ans=min(ans,fmx(a1,a2,a3)-fmn(a1,a2,a3));
	}
	return ans;
}


 int main() {
 	ll h,w;
 	cin>>h>>w;
 	//如果长宽是3的倍数，那么既可以划分成三份一样的，面积全都相同 
	if(w%3==0||h%3==0){
		cout<<"0"<<endl;
		return 0;
	}
	//分为两大类（交换h，w即可），每一类包含两种情况
	//第一种情况： 全部横着切，30-33行
	//第二种情况： a1横着，a2，a3在a1下方，分为两份 
	ll ans=min(find(h,w),find(w,h));
	cout<<ans<<endl;
 	return 0;
 }

Measured memory_bytes: 256
#include <iostream>
int main()
{
  int N;
  std::cin >> N;
  int a;
  
  a = N%10;
  
  if( a==2 || a==4 || a==5 || a==7 || a==9 ){ std::cout << "hon" <<std::endl;}
  if( a==0 || a==1 || a==6 || a==8 ){ std::cout << "pon" <<std::endl;}
  if( a==3 ){ std::cout << "bon" <<std::endl;}
}

Measured memory_bytes: 3636
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;
 
int main()
{
    string s;
    int n, i;
    n = 0;
    while (cin>>s) {
        n++;
        for (i = 0; i < s.size()/2; i++) {
            if (s[i] != s[s.size()-i-1]) {
                n--;
                break;
            }
        }
    }
    cout<<n<<endl;
    return 0;
}


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

int main() {
	string week[] = { "MON","TUE","WED","THU","FRI","SAT","SUN" };
	string day;
	cin >> day;
	for (int i = 0; i < 7; i++) {
		if (day == week[i]) {
			if (day == "SUN") {
				cout << 7 << endl;
			}
			else {
				cout << 7 - i-1 << endl;
			}
		}
	}
}



Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <cassert>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
using VVI = vector<vector<long long int> >;

int main(void) {
    Int n, m;
    cin >> n >> m;
    vector<Int> v(n, -1);
    bool result = true;
    for (Int i = 0; i < m; ++i) {
        Int s, c;
        cin >> s >> c;
        --s;
        if (v[s] == -1) {
            v[s] = c;
        } else if (v[s] == c) {
        } else {
            result = false;
        }
    }
    if (n != 1 && v[0] == 0) {
        result = false;
    }

    if (!result) {
        cout << -1 << endl;
    } else {
        Int answer = 0;
        if (n == 1 && v[0] == -1) {
            answer = 0;
        } else if (n != 1 && v[0] == -1) {
            ++answer;
        } else {
            answer += v[0];
        }
        for (Int i = 1; i < n; ++i) {
            answer *= 10;
            if (v[i] == -1) {
            } else {
                answer += v[i];
            }
        }
        cout << answer << endl;
    }
    return 0;
}



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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int H,W;
char fld[555][555];


char R[555][555],B[555][555];

signed main(){
    cin>>H>>W;
    rep(i,H)cin>>fld[i];

    rep(i,H)rep(j,W)R[i][j]=B[i][j]='.';
    for(int i=1;i+1<H;i+=2){
        for(int j=0;j+1<W;j++)R[i][j]='#';
        if(i!=1)R[i-1][0]='#';
    }

    for(int i=2;i+1<H;i+=2){
        for(int j=1;j<W;j++)B[i][j]='#';
        if(i!=2)B[i-1][W-1]='#';
    }
    rep(i,H)rep(j,W){
        if(fld[i][j]=='#'){
            R[i][j]=B[i][j]='#';
        }
    }

    rep(i,H){
        cout<<R[i]<<endl;
    }
    cout<<endl;
    rep(i,H){
        cout<<B[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
    ll x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    if (__int128(k) * d <= x) {
        cout << x - k * d << endl;
    } else {
        k = k - x / d;
        x -= (x / d) * d;
        k = k % 2;
        cout << abs(x - k * d) << endl;
    }
}


Measured memory_bytes: 3600
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class Main {
    
    

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        List<Integer> list = new ArrayList<>();
                
        
       for(int i=0; i<2; i++){
           
            int x = sc.nextInt();
           
            list.add(x);
           
       }
       
       
       
      
            
            System.out.printf(list.get(0)/list.get(1) +" "+ list.get(0)%list.get(1) +" ");
            System.out.println(String.format("%.5f",(double)list.get(0)/list.get(1) ));
           
        
        
    }}
       
     



Measured memory_bytes: 26508
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    int num, size;
    cin >> num;
    cin >> size;
    unordered_map<int, int> map;
    for (int i = 0; i < size; i++)
    {
        int a;
        cin >> a;
        map[a] = 1;
    }
    int l = num, r = num;
    while (1)
    {
        if (!map[l])
        {
            cout << l << endl;
            return 0;
        }
        if (!map[r])
        {
            cout << r << endl;
            return 0;
        }
        l--;
        r++;
    }

    return 0;
}


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

int main(){
    int N,K;
    cin >> N >> K;
    vector<int> H(N);
    for (int i = 0; i < N; i++){
        cin >> H.at(i);
    }
    sort(H.begin(), H.end());
    reverse(H.begin(), H.end());
    int64_t ans = 0;
    if (K > N){
        ans = 0;
    }
    else{
        for (int i = K; i < N; i++){
            ans += H.at(i);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main()
{
    int a,b,c,i;
    scanf("%d%d%d",&a,&b,&c);
    if(a>b && a>c)
    {
        i=a;
        i=(i*10)+b+c;
    }
    else if(c>b && c>a)
    {
        i=c;
        i=(i*10)+a+b;
    }
    else
    {
        i=b;
        i=(i*10)+a+c;
    }
    printf("%d",i);
    return 0;
}


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

int main(){

 int a, b;

 cin >> a >> b;

 if (a < b) {
  cout << "a < b\n";
 } else if (a > b) {
  cout << "a > b\n";
 } else {
  cout << "a == b\n";
 }

 return 0;
}

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

const int DIM = 1e5 + 5;
const int MOD = 1e9 + 7;

int cnt[DIM];

int main( void ) {
    
    int n;
    cin >> n;
    
    int ans = 1;
    for( int i = 1; i <= n; i ++ ) {
        int x;
        cin >> x;
        
        cnt[x] ++;
        
        if( cnt[0] > 1 || cnt[x] > 2 || ( (x & 1) == (n & 1) ) )
            ans = 0;
    }
    
    for( int i = 1; i <= (n >> 1); i ++ )
        ans = ( ans << 1 ) % MOD;
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
ABCD = list(map(int, input().split()))
A = ABCD[0]
B = ABCD[1]
C = ABCD[2]
D = ABCD[3]
if C%B != 0:
    if D*(C//B) >= A:
        print('No')
    else:
        print('Yes')
else:
    if D*(B//C - 1) >= A:
        print('No')
    else:
        print('Yes')

Measured memory_bytes: 9188
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>

using namespace std;

int main() {
    int H, W;
    int h, w;
    cin >> H >> W;
    cin >> h >> w;

    cout << H * W - (h * W + H * w - h * w) << endl;
    return 0;
}


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

int main(void) {
  int n, m, l, i, j, k;
  unsigned long long sum;
  scanf(" %d %d %d", &n, &m, &l);
  int *A = (int *) malloc(sizeof(int) * n * m);
  int *B = (int *) malloc(sizeof(int) * m * l);
  for (i = 0; i < n * m; i++)
    scanf(" %d", A + i);
  for (i = 0; i < m * l; i++)
    scanf(" %d", B + i);
  for (i = 0; i < n; i++) {
    for (j = 0; j < l; j++) {
      sum = 0;
      for (k = 0; k < m; k++) {
	sum += (unsigned long long) *(A + i * m + k) * (unsigned long long) *(B + k * l + j);
      }
      printf("%llu", sum);
      if (j != l - 1)
	printf(" ");
    }
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 2076
#include <stdio.h>

int main(){
    int a, b, c;
    int temp;

    scanf("%d %d %d", &a, &b, &c);

    if (b > c) {
        temp = b;
        b = c;
        c = temp;
    }
    if (a > b) {
        temp = a;
        a = b;
        b = temp;
    }
    if (b > c) {
        temp = b;
        b = c;
        c = temp;
    }

    printf("%d %d %d\n", a, b, c);

    return 0;
}

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

using namespace std;

void solve() {
    int N;
    cin >> N;
    vector<int> f(N+1, 0);
    int tmp;
    for (int x = 1; x < 100; x++)
    {
        for (int y = 1; y < 100; y++)
        {
            for (int z = 1; z < 100; z++)
            {
                tmp = (x + y + z) * (x + y + z) - (x * y + y * z + z * x);
                if (tmp <= N)
                {
                    f[tmp]++;
                }
                
            }
        }
        
    }
    
    for (int i = 0; i < N; i++)
    {
        cout << f[i+1] << endl;
    }
    
}

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

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){

  int n,a,b;
  string str;
  int h[]={0,100,1,2,3,4,5,6,7,8,9,10,12,13};

  cin >> n;
  cout <<(n<1200 ? "ABC" : "ARC" ) fin;
  
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e15)+1;
const ll mod = 998244353;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()

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

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

ll factorial(ll n){
    ll t = 1;
    rep1(i, n){
        t *= i;
        t %= mod;
    }
    return t;
}

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

ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    if(a < b) return 0;
    ll ans = 1;
    for(ll i = 0; i < b; i++) {
        ans *= (a - i);
        ans %= mod;
        ans *= power(i + 1, mod - 2);
        ans %= mod;
    }
    return ans;
}
int main(){
    string s;
    cin >> s;
    for (ll i = 0; i < s.size(); i += 2) {
        if(s[i] != 'h' || s[i + 1] != 'i'){
            pf("No");
            return 0;
        }
    }
    pf("Yes");
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		if (b%a == 0) {
			System.out.println(a+b);
		}
		else {
			System.out.println(b-a);
		}
	}
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int; //任意長整数 
using Real32 = mp::number<mp::cpp_dec_float<32>>;
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
using Rat = boost::rational<Bint>;//有理数*/
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);

ll dp[53][2];

signed main(){
    ll n,p;;
    cin>>n>>p;
    dp[0][0]=1;
    dp[0][1]=0;
    for(int i=0;i < n;i++)
    {
        ll x; cin>>x;
        if(x%2==0){
            dp[i+1][0]=dp[i][0]*2;
            dp[i+1][1]=dp[i][1]*2;
        }
        else {
            dp[i+1][0]=dp[i][1]+dp[i][0];
            dp[i+1][1]=dp[i][0]+dp[i][1];
        }
    }

    if(p==0){
        cout<<dp[n][0]<<endl;
    }else{
        cout << dp[n][1] << endl;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int i,j,k,a,b,flg;
	scanf("%d",&k);
	scanf("%d %d",&a,&b);
	flg=0;
	for(i=a;i<=b;i++){
		for(j=1;j<=200;j++){
			if(i==j*k){
				flg=1;
			}
		}
	}
	if(flg==1){
		printf("OK\n");
	}
	else{
		printf("NG\n");
	}
	return 0;
}

Measured memory_bytes: 1656
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int n, l[2345];
int bs(int key) {
	if (key <= l[0])return 0;
	if (l[n - 1] < key)return n;
	int l1 = 0, r = n - 1;
	while (r - l1 > 1) {
		int mid = (l1 + r) / 2;
		if (key <= l[mid])r = mid;
		else l1 = mid;
	}
	return r;
}
signed main() {
	cin >> n; for0(i, n)cin >> l[i]; sort(l, l + n);
	int ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			//|a-b|<c<a+b
			int a = l[i], b = l[j];
			ans += max(0, bs(a + b) - 1 - max(j, bs(abs(a - b))));
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Main
{
	
	public static ArrayList<String> AL = new ArrayList<String>();
	
	
	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		int n = fs.nextInt();
		long a[] = fs.readArray(n);
		long count =0 ;
		for(int i =0 ;i<n-1;i++) {
			
			if(a[i]>a[i+1]) {
				count+=a[i]-a[i+1];
				a[i+1] = a[i];
			}
		}
		
		System.out.println(count);
	}
		
	
	  
	static final Random random=new Random();
	
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		long[] readArray(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

	
}


Measured memory_bytes: 55400
#include<bits/stdc++.h>
using namespace std;
main(){
  int a,b,c;
  cin>>a>>b>>c;
  int mx;
  int sma;
  int ju=0;
  mx=max(a,b);
  mx=max(mx,c);
  int mi,ce;
  if(mx==c){
    mi=min(a,b);
    ce=max(a,b);
  }else{
    if(mx==a){
      mi=min(b,c);
      ce=max(b,c);
    }else{
      mi=min(a,c);
      ce=max(a,c);
    }
  }
  if(a==b && mx==a && mx%2!=c%2 || a==c && mx==c && mx%2!=b%2|| b==c && mx==b && mx%2!=a%2) ju=1;
  int cnt=0;
  while(mi<ce){
    cnt++;
    mi+=2;
  }
  while(mi<mx){
    mi++;
    ce++;
    cnt++;
  }
  if(ju)cout<<cnt+1<<endl;
  else if(mi!=ce) cout<<cnt+2<<endl;
  else cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

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

	public void start() {
		Scan sc = new Scan();
		int inputs[] = new int[3];
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		System.out.println(getResult(a, b, c));

	}

	private String getResult(int a, int b, int c) {

		boolean tmps[] = new boolean[b];
		int count = 1;
		while (true) {
			int tmp = (a * count) % b;
			if(tmp==0){
				return "NO";
			}
			if (tmps[tmp]) {
				return "NO";
			} else {
				tmps[tmp] = true;
			}
			
			if (c % tmp == 0) {
				return "YES";
			}
			count++;
		}

	}

}

class Scan {
	BufferedReader br;
	StringTokenizer st;

	public Scan() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

}

Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll h;
    ios::sync_with_stdio(false);
    while(cin>>h)
    {
        ll sum=0;
        ll k=1;
        while(1)
        {
            sum+=k;
            h/=2;
            if(h==0)
                break;
            k*=2;
        }
        cout<<sum<<endl;
    }
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

ll dist_sq(ll x, ll y) {
    return x*x + y*y;
}

int main() {
    // For fast I/O
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll n, d, cnt = 0;
    cin >> n >> d;
    ll max_dis = d * d;
    for (int i = 0; i < n; i++) {
        ll x, y;
        cin >> x >> y;
        if (dist_sq(x, y) <= max_dis) cnt++;
    }
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;

int main()
{

	ios_base:: sync_with_stdio(false); cin.tie(0);
	int n; cin>>n;
	int mx=0;
	int s=0;
	for(int i=0; i<n; i++) {
		int c; cin>>c;
		mx=max(c,mx);
		s+=c;
	}
	if(mx<s-mx) {
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}


	return 0;
}


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

int main(){
    int a;
    int cnt;
    int ans;
    cin>>a;
    for(int i=1; i<=a; i++){
        for(int j=1; j<=i; j++){
            if(i%j==0){
                cnt++;
                
                if(i%2==1 && cnt==8){ans++;}
            }
            
        }
        cnt=0;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#if defined(__GNUC__)
#include <bits/stdc++.h>
#define __int32 __int32_t
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(ALL(x), greater<decltype(x)::value_type>())
#define RSORT2(x, T) sort(ALL(x), greater<T>())
#define REVERSE(x) reverce(ALL(x))
#define ACM(x, y) accumulate(ALL(x), y)

#define INT_POW(x, y) [](int a, int b) -> int {int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)
#define FCT(x) [](int a) -> int {int r = 1; REP(i, a){r *= i;} return r;}(x)

// デバッグ用
#define PUT_LIST(x, y) std::copy(ALL(x), ostream_iterator<decltype(x)::value_type>(cout, y))

const int kMod = 1e9 + 7;

itn main() {
	ios::sync_with_stdio(false);

	int n, a, b;

	cin >> n >> a >> b;

	if (!a) {
		cout << 0;
		return 0;
	}

	int x = n / (a + b);
	int y = n % (a + b);

	cout << x * a + min(y, a);

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define maxn 300000
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef double db;

struct segtree
{
    #define ls i*2
    #define rs i*2+1
    int a[maxn*4+5];
    void pu(int i)
    {
        a[i]=max(a[ls],a[rs]);
    }
    void add(int i,int l,int r,int q,int x)
    {
        if(q<=l && r<=q)
        {
            a[i]+=x;
            return;
        }
        if(r<q || q<l) return;
        int mid=(l+r)>>1;
        add(ls,l,mid,q,x);
        add(rs,mid+1,r,q,x);
        pu(i);
    }
}t;

vi pool[maxn+5];

int main()
{
    int h,w,m; scanf("%d%d%d",&h,&w,&m);
    rep(i,1,m)
    {
        int x,y; scanf("%d%d",&x,&y);
        pool[x].pb(y);
        t.add(1,1,w,y,1);
    }
    int ans=0;
    rep(x,1,h)
    {
        int tmp=pool[x].size();
        for(auto y: pool[x]) t.add(1,1,w,y,-1);
        //printf("%d: %d\n",x,t.a[1]);
        tmp+=t.a[1];
        ans=max(ans,tmp);
        for(auto y: pool[x]) t.add(1,1,w,y,1);
    }
    printf("%d\n",ans);
    return 0;
}

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n,k;cin >> n >> k;
    vl a(n);
    rep(i,n)cin >>a[i];
    rep(i,100001){
        if(k+(i-1)*(k-1)>=n){
            cout << i << endl;
            return 0;
        }
    }
}


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

int main()
{
    int N, M;
    cin >> N >> M;

    if (N == M) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
import math

n = int(input())
count = 0
p = n

for z in range(2, int(math.sqrt(n)) + 1):
    e = 1
    while n % z ** e == 0:
        n //= z ** e
        count += 1
        e += 1
    if n % z == 0: #これを行わなければ，素因数同士でかける場合も含んでしまう．
        while n % z == 0:
            n //= z

if n != 1:
    count += 1
if count == 0 and p != 1:
    count = 1

print(count)


Measured memory_bytes: 81272
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define mod 1000000007

using namespace std;
typedef pair<llint, llint> P;

struct edge{
	llint to, cost;
	edge(llint a, llint b){
		to = a, cost = b;
	}
};

llint n, m, s, t, d;
vector<edge> G[100005];
llint distS[100005], distT[100005];
llint dpS[100005], dpT[100005];
vector<int> topo;
bool used[100005];

void dijkstra(vector<edge> G[], llint S, llint dist[])
{
	for(int i = 0; i <= n; i++) dist[i] = inf;
	dist[S] = 0;
	
	priority_queue< P, vector<P>, greater<P> > Q;
	Q.push( make_pair(0, S) );
	
	llint v, d;
	while(Q.size()){
		d = Q.top().first;
		v = Q.top().second;
		Q.pop();
		if(dist[v] < d) continue;
		for(int i = 0; i < G[v].size(); i++){
			if(dist[G[v][i].to] > d + G[v][i].cost){
				dist[G[v][i].to] = d + G[v][i].cost;
				Q.push( make_pair(dist[G[v][i].to], G[v][i].to) );
			}
		}
	}
}

vector<llint> g[100005];

void tpsort(int v)
{
	used[v] = true;
	for(int i = 0; i < g[v].size(); i++){
		if(!used[g[v][i]]) tpsort(g[v][i]);
	}
	topo.push_back(v);
}

void calc(llint S, llint distS[], llint distT[], llint dp[])
{
	for(int i = 1; i <= n; i++) g[i].clear();
	for(int i = 1; i <= n; i++){
		for(int j = 0; j < G[i].size(); j++){
			llint u = G[i][j].to;
			if(distS[i] + G[i][j].cost == distS[u] && distS[i] + distT[u] + G[i][j].cost == d) g[i].push_back(u);
		}
	}
	topo.clear();
	for(int i = 1; i <= n; i++) used[i] = false;
	for(int i = 1; i <= n; i++) if(!used[i]) tpsort(i);
	reverse(topo.begin(), topo.end());
	
	for(int i = 1; i <= n; i++) dp[i] = 0;
	dp[S] = 1;
	for(int i = 0; i < topo.size(); i++){
		llint v = topo[i];
		for(int j = 0; j < g[v].size(); j++) (dp[g[v][j]] += dp[v]) %= mod;
	}
}

int main(void)
{
	cin >> n >> m >> s >> t;
	llint u, v, w;
	for(int i = 1; i <= m; i++){
		cin >> u >> v >> w;
		G[u].push_back(edge(v, w));
		G[v].push_back(edge(u, w));
	}
	dijkstra(G, s, distS);
	dijkstra(G, t, distT);
	d = distS[t];
	
	calc(s, distS, distT, dpS);
	calc(t, distT, distS, dpT);
	
	llint ans = dpS[t]*dpS[t]%mod;
	for(int i = 1; i <= n; i++){
		if(d%2 == 0 && distS[i] == d/2 && distT[i] == d/2){
			llint tmp = dpS[i]*dpT[i]%mod;
			ans += mod - tmp*tmp%mod, ans %= mod;
		}
		for(int j = 0; j < G[i].size(); j++){
			llint u = G[i][j].to;
			if(distS[i] < d/2 && distT[u] < d/2 && distS[i] + G[i][j].cost == distS[u] && distS[i] + distT[u] + G[i][j].cost == d){
				llint tmp = dpS[i]*dpT[u]%mod;
				ans += mod - tmp*tmp%mod, ans %= mod;
			}
		}
	}
	cout << ans << endl;
	
	return 0;
}


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

struct edge {
    int src, dest, cost; 
    edge(int s, int t, int c): src(s), dest(t), cost(c) {}
};
const int INF = 1e8;

void bellman_ford(const vector<edge> &edges, vector<int> &d, const int s) {
    d.assign(d.size(), INF);
    d[s] = 0;
    for(int i=0; i < edges.size(); ++i) {
        edge e = edges[i];
        if (d[e.dest] > d[e.src] + e.cost) {
            d[e.dest] = d[e.src] + e.cost;
            i = -1;
        }
    }
}

int main(void) {
    int n, m, s, g1, g2;
    while(cin >> n >> m >> s >> g1 >> g2 && n) {
        vector<edge> edges;
        vector<vector<int> > d(n, vector<int>(n));
        --s; --g1; --g2;
        REP(i, m) {
            int b1, b2, c;
            cin >> b1 >> b2 >> c;
            edges.push_back(edge(b1-1, b2-1, c));
        }
        REP(i, n) {
            bellman_ford(edges, d[i], i);
        }
        int ans = 0;
        int cost = numeric_limits<int>::max();
        REP(i, n) {
            cost = min(cost, d[s][i] + d[i][g1] + d[i][g2]);
        }
        cout << cost << endl;
    }
    return 0;
}

Measured memory_bytes: 3200
n, W = map(int, input().split())
#item =[]
# for i in range[n]:
#     item = list(map(int, input().split()))
value =[]
weight = []
dp = [[0 for i in range(W + 1)]for j in range(n + 1)]

for el in range(n):
    x, y = map(int, input().split())
    value.append(x)
    weight.append(y)

for w in range(W):
    dp[0][w] = 0

for i in range(n):
    for w in range(W + 1):
        if w >= weight[i]:
            #dp[i + 1][w]はi番目の品物の中から重さがwを超えないように選んだ時の、価値の総和の最大値
            dp[i + 1][w] = max(dp[i][w - weight[i]] + value[i] , dp[i][w])
            #その品物を選ぶか選ばないか判定する前のその重さの時の価値の最大値が既に分かっているので、判定するものの重量を差し引いた時の価値の最大値と判定しているものの価値を足し合わせて、
            #判定する前のその時点(w)での元からある価値の最大値（dp[i][w]と比べている
            #DP表には価値の最大値が書いてあり、組み合わせを記述するわけではない
        else:
            dp[i + 1][w] = dp[i][w]

print(dp[n][W])



Measured memory_bytes: 42268
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 100005

ll table[10];
ll M;
char buf[SIZE];


int main(){

	scanf("%lld",&M);
	scanf("%s",buf);

	for(int i = 0; i < 10; i++){

		table[i] = 0;
	}

	int length;
	for(length = 0; buf[length] != '\0'; length++);

	ll weight = 1;

	for(int i = length-1; i >= 0; i--){

		table[buf[i]-'0'] += weight;
		table[buf[i]-'0'] %= MOD;
		weight *= 10;
		weight %= MOD;
	}

	ll work[10];

	for(ll i = 0; i < 10; i++){

		work[i] = i;
	}

	ll tmp;

	do{

		if(work[buf[0]-'0'] == 0 && length >= 2)continue;

		tmp = 0;

		for(int i = 0; i < 10; i++){

			tmp += work[i]*table[i];
			tmp %= MOD;
		}

		if(tmp == M){

			for(int i = 0; i < length; i++){

				printf("%lld",work[buf[i]-'0']);
			}
			printf("\n");

			return 0;
		}


	}while(next_permutation(work,work+10));


	printf("-1\n");

	return 0;
}



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

int z[2];

long long comb[111][111];

long long C(int a, int b)
{
    if (b == 0 || a == b) return 1;
    if (comb[a][b] == 0)
        comb[a][b] = C(a - 1, b) + C(a - 1, b - 1);
    return comb[a][b];
}

int main()
{
    int a, b;
    scanf("%d%d",&a,&b);
    while (a--)
    {
        int x;
        scanf("%d",&x);
        z[x&1]++;
    }

    if (b == 0)
    {
        long long ans = 0;
        for (int i = 0; i <= z[1]; i += 2) ans += C(z[1], i);
        printf("%lld\n", ans << z[0]);
    }
    else
    {
        long long ans = 0;
        for (int i = 1; i <= z[1]; i += 2) ans += C(z[1], i);
        printf("%lld\n", ans << z[0]);
    }
}


Measured memory_bytes: 256
use std::collections::HashSet;

use proconio::input;

fn main() {
    input! {
        n: usize,
        k: usize,
    }

    let mut sunukes: HashSet<usize> = (1..(n + 1)).collect();

    for _ in 0..k {
        input! {
            d: usize,
            a: [usize; d],
        }

        for sunuke in a {
            sunukes.remove(&sunuke);
        }
    }

    println!("{}", sunukes.len());
}


Measured memory_bytes: 2128
//这是我见过的几乎最水的紫题qwq
#include<bits/stdc++.h>
using namespace std;
int t=1;
string a,b;
int main()
{
    cin>>a, b=a;
    for(int i=0;i<=a.length()-1;i++) switch(a[i])
    {
        case 'q': a[i]='p'; break;
        case 'p': a[i]='q'; break;
        case 'b': a[i]='d'; break;
        case 'd': a[i]='b'; break;
    }
    for(int i=0;i<=a.length()-1;i++) if(a[i]!=b[a.length()-1-i]) t=0;
    if(t) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 512
package main

import "fmt"

func stringToRunes(s string) (runes []rune) {
	runes = make([]rune, len(s))
	for i, r := range s {
		runes[i] = r
	}
	return
}

func main() {
	var A, B string
	fmt.Scan(&A, &B)
	var ans string
	if len(A) != len(B) {
		switch {
		case len(A) > len(B):
			ans = "GREATER"
		case len(A) < len(B):
			ans = "LESS"
		}
	} else {
		la := stringToRunes(A)
		lb := stringToRunes(B)
	L:
		for i := 0; i < len(la); i++ {
			switch {
			case la[i] > lb[i]:
				ans = "GREATER"
				break L
			case la[i] < lb[i]:
				ans = "LESS"
				break L
			case la[i] == lb[i]:
				if i == len(la)-1 {
					ans = "EQUAL"
					break
				}
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512