akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
#define fr(i,n) for(ll i=0;i<n;i++)
using namespace std;
const ll A = 1000005;
ll k[A],j[A];ll n;
bool pairwise(){
for(ll i=2;i<A;i++)
    {int cnt = 0;

        for(ll ii=i;ii<A;ii+=i)
        {
            cnt += j[ii];
        }
        if(cnt>1)
        {
            return false;
        }
    }
    return true;}

bool setwise(){
    ll gcd=k[0];
for(ll i=1;i<n;i++){
        gcd=__gcd(k[i],gcd);
        {if(gcd==1)return true;}
}
return false;}


int main() {
    cin>>n;
    fr(i,n)cin>>k[i],j[k[i]]++;
   if(pairwise())cout<<"pairwise coprime";
    else if(setwise())cout<<"setwise coprime";
    else  cout<<"not coprime";

    }


Measured memory_bytes: 19208
#include <iostream>
#include <vector>
using namespace std;
void printVector(vector<int> a, int n) {
  for (int k = 0; k < n; ++k) {
    cout << a.at(k) << ((k == n - 1) ? "\n" : " ");
  }
}

void insertionSort(vector<int> a, int n) {
  for (int i = 1; i < n; ++i) {
    int v = a.at(i);
    int j = i - 1;
    while (j >= 0 && a.at(j) > v) {
      a.at(j + 1) = a.at(j);
      j--;
    }
    a.at(j + 1) = v;
    printVector(a, n);
  }
}

int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a.at(i);
  }
  printVector(a, n);
  insertionSort(a, n);
  return 0;
}



Measured memory_bytes: 3144
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int x = n * 800;
            int y = (n / 15) * 200;
            Console.WriteLine(x - y);
            //Console.ReadKey();

        }
    }
}


Measured memory_bytes: 11092
using System;
using System.Linq;

namespace helloworld2
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split().Select(x=>int.Parse(x)).ToArray();
            Console.WriteLine(Combination(input[0],2)+Combination(input[1],2));
        }

        static int Combination(int a, int b)
        {
            var s=1;
            var t=1;
            for(var i=1; i<=b; i++)
            {
                s*=i;
                t*=(a-i+1);
            }

            return t/s;
        }
    }
}


Measured memory_bytes: 13268
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
  cout << endl; cout << "       ";
  for(int i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}


ll GCD(ll a, ll b){
	//if(a < b) std::swap(a, b);//これ入れたらTLEになった
	if(b == 0) return a;
	return GCD(b, a%b);
}

ll LCM(ll a, ll b){
	//return a * b/GCD(a, b);;
	return a/GCD(a, b) * b; //オーバーフローしないように先にgcd(a, b)で割る
}

int num_2(ll x){
	int res = 0;
	while(x%2 == 0){
		res++;
		x /= 2;
	}
	return res;
}

int main(){
	int N;
	ll M;
	cin >> N >> M;
	vector<ll> a(N);
	for(int i=0; i<N; i++) cin >> a[i];
	
	for(int i=0; i<N; i++) a[i] = a[i]>>1;
	for(int i=0; i<N-1; i++){
		if(num_2(a[i]) != num_2(a[i+1])){
			cout << 0 << endl;
			return 0;
		}
	}
	// cout << " a: "; print_vec(a);
	// cout << " num2: " << num_2(a[0]) << endl;
	if(N == 1 ) a.push_back(1);
	ll lcm = LCM(a[0], a[1]);
	for(int i=0; i<N; i++){
		lcm = LCM(lcm, a[i]);
	}
	// cout << " gcd: " << GCD(a[0], a[1]) << " lcm: " << lcm << endl;
	if(lcm > M){
		cout << 0 << endl;
		return 0;
	}

	ll ans = (M/lcm+2-1) /2; // (M/lcm) / 2の切り上げ;
	cout << ans << endl;


}



Measured memory_bytes: 4012
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.StringTokenizer;

public class Main {

	public static void main(String args[]) throws Exception {
		MyScanner sc = new MyScanner();
		int t = sc.nextInt();
		BigDecimal r = new BigDecimal(Integer.toString(t));
		BigDecimal area = new BigDecimal("0");
		BigDecimal two = new BigDecimal("2.0");
		BigDecimal pi = new BigDecimal(Double.toString(Math.PI));
		area = two.multiply(r).multiply(pi);
		System.out.println(area);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

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

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

Measured memory_bytes: 33548
#include <iostream>
#include <string>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main()
{
	char c;
	cin >> c;
	if(c =='A') cout <<"T";
	if(c =='T') cout <<"A";
	if(c =='C') cout <<"G";
	if(c =='G') cout <<"C";
	return 0;
}

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

int n;
int B[(int)1e5], A[(int)1e5];

int solve() {

	int sum = 0;

	A[0] = A[1] = B[0];
	for (int i = 1; i < n - 1; ++i) {
		if (B[i] >= B[i - 1])
			A[i + 1] = B[i];
		else {
			A[i] = B[i];
			A[i + 1] = B[i];
		}

	}

	for (int i = 0; i < n; ++i) {
		sum += A[i];
	}

	return sum;
}

int main() {
	cin >> n;
	for (int i = 0; i < n-1; ++i) {
		cin >> B[i];
	}

	cout << solve() << '\n';

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdlib>
#include <cmath> 
#include <vector> 
#include <queue>

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'


using namespace std;
using ll = long long;

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}


const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
int main() {
    COMint();
    ll N;cin>>N;
    ll K;cin>>K;
    ll ans;ans=0;
    
    for(int i=1;i<=K;i++){
        ans=COM(K-1,i-1)*COM(N-K+1,i);
        cout<<ans%MOD<<endl;
    }
    return 0;
}

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

using namespace std;

typedef int64_t ll;
typedef uint64_t ull;

const ll LINF = 9187201950435737471;
const ll nLINF = -9187201950435737472;
const int INF = 2139062143;
const int nINF = -2139062144;
const ull ULINF = numeric_limits<ull>::max();
const int MAXN = 1e3 + 15;
const ll MOD = 1e9 + 7;
const double EPS = 1e-7;
const double PI = acos(-1);
const double E = 2.718281828459045;
const int BLOCK = 2000;
auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rnd(seed);

#define all(_v) _v.begin(), _v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int)(v.size())
#define sqr(_v) ((_v) * (_v))
#define eb emplace_back
#define pb push_back
#define pf push_front
#define mod(x, m) ((x) % m + (x < 0 ? m: 0))

inline void IO() {
#ifdef buyolitsez
    freopen("input.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
}


template <typename T>
istream& operator >> (istream& in, vector<T>& a) {
    for (auto& i : a)
        in >> i;
    return in;
}

template <typename T>
ostream& operator << (ostream& out, const vector<T>& a) {
    for (auto& i : a) {
        out << i << " ";
    }
    return out;
}

template <typename T, typename D>
istream& operator >> (istream& in, pair<T, D>& a) {
    in >> a.first >> a.second;
    return in;
}

template <typename T, typename D>
ostream& operator << (ostream& out, const pair<T, D>& a) {
    out << a.first << " " << a.second;
    return out;
}

#define int int64_t

inline void solve() {
    int k;
    cin >> k;
    vector <int> now = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    while (k > sz(now)) {
        k -= sz(now);
        vector <int> nxt;
        for (auto u : now) {
            int kek = 10 * u;
            int last = u % 10;
            if (last != 0) {
                nxt.eb(kek + last - 1);
            }
            nxt.eb(kek + last);
            if (last != 9) {
                nxt.eb(kek + last + 1);
            }
        }
        swap(nxt, now);
    }
    sort(all(now));
    cout << now[k - 1];
}

signed main() {
    IO();
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 1712
# include<algorithm>
# include<bitset>
# include<algorithm>
# include<cstdio>
using namespace std;
int n,x,s;
bitset<2002001> f;
int main() {
	scanf("%d",&n);
	f[0] = 1;
	for (int i=0;i<n;i++) {
		scanf("%d",&x);
		f |= f << x;
		s += x;
	}
	for (int i=(s + 1)/2;i<=s;i++) {
		if (f[i]) {
			printf("%d", i);
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 896
import sys
from collections import Counter


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    S = input()
    c = Counter(S)
    ans = c.get("R", 0) * c.get("G", 0) * c.get("B", 0)

    out = 0
    for start in range(N):
        for mid in range(start + 1, N):
            d = mid - start
            last = d + mid
            if last < N:
                if S[start] != S[mid] and S[mid] != S[last] and S[last] != S[start]:
                    out += 1

    print(ans - out)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9472
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define out(x) cout << x << '\n'
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define _GLIBCXX_DEBUG
const lli INF = 2147483647;
const lli MINF = -2147483648;
const lli LINF = 9223372036854775807;
const lli MOD = 1000000007; //10^9+7
const double PI = acos(-1);
#define SORT(n) sort(n.begin(), n.end())
#define SORTR(n) sort(n.begin(), n.end(), greater<int>())
#define REV(n) reverse(n.begin(), n.end())
#define pb push_back
#define eb emplace_back
#define mp make_pair
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<lli>;
using vvli = vector<vlli>;
using vs = vector<string>;
using vvs = vector<vs>;
using vb = vector<bool>;
using vvb = vector<vb>;
using ll = long long;
//---------------------------------------------------------------------------------------------------
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  // os << '}';
  return os;
}
// aよりもbが大きいならばaをbで更新する(更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T &b)
{
  if (a < b)
  {
    a = b; // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する(更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T &b)
{
  if (a > b)
  {
    a = b; // aをbで更新
    return true;
  }
  return false;
}
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
void solve()
{
  lli b = 0, c = 0, h = 0, n = 0, x, y, w = 0, ans = 0, count = 0;
  string s = "", t = "";
  vector<pair<lli, lli>> pr;
  map<lli, lli> mp;
  set<lli> st;
  double a = 0;
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> w;
  rep(i, 0, n)
  {
    cin >> x >> y;
    a = sqrt(abs(x * x) + abs(y * y));
    if (a <= w)
    {
      count++;
    }
  }
  out(count);
}

//---------------------------------------------------------------------------------------------------
signed main()
{
  solve();
}

Measured memory_bytes: 3652
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
			int E = sc.nextInt();
			int s = sc.nextInt();
			if(E<=8&&s<=8)System.out.println("Yay!");
			else System.out.println(":(");
	}
}

Measured memory_bytes: 23252
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <iterator>
#include <fstream>
#include <math.h>

#include <random>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <list>
#include <bitset>
#include <unordered_set>
#include <unordered_map>

#include <random>
#include <ctime>

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i, from, to) for (int i = from; i < to; i++)
#define ROF(i, from, to) for (int i = from; i > to; i--)

const long double PI = 3.141592653589793238463;
const int INF = 0x3f3f3f3f;
const int INFS = 1000000000;
const ll M = 1000000007;
const ll LLINF = 1000000000000000000;
const double EPS = 1e-8;

#define int long long

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin >> n;
    vector<int> a(n);
    FOR(i, 0, n) {
        cin >> a[i];
    }
    int ans = 0;
    FOR(i, 0, n) {
        ans += a[i] / 2;
        a[i] %= 2;
        if (i != n - 1 && a[i] % 2 && a[i + 1] > 0) {
            --a[i + 1];
            ++ans;
        }
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 3964
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind
#define rt (a); return (a); 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 1000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
llint gcd(llint a, llint b) {
	if (b > a)swap(a, b);
	if (a % b == 0)return b;
	return gcd(b, a % b);
}
llint Tow(int n) {//2のn乗
	if (n == 0)return 1;
	llint x = Tow(n / 2);
	x %= mod;
	x *= x;
	x %= mod;
	if (n % 2 == 1)x *= 10;
	x %= mod;
	return x;
}

int main(){
	int n;
	cin >> n;
	hei(int) a(n);
	rep(i, 0, n) {
		cin >> a[i];
		a[i]--;
	}
	int ans = 0;
	rep(i, 0, n) {
		if (a[i] == INF)continue;
		if (i == a[a[i]]) {
			ans++;
			a[a[i]] = INF;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>

int main()
{

    int a[100];
    int n=0;

    int maxIndex;

    int cnt=0;

    scanf("%d", &n);

    for(int i=0;i<n;i++){
        scanf("%d", &a[i]);
    }

    int loop = 0;

    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){

                

                if(a[i]+a[j]>a[k] && a[j]+a[k]>a[i] && a[k]+a[i]>a[j]
                    && a[i]!=a[j] && a[j]!=a[k] && a[k] != a[i]){
                    cnt++;
                }
                
            }
        }
    }

    printf("%d\n", cnt);

    return 0;
}

Measured memory_bytes: 2168
n,a,b=map(int,raw_input().split())
ab=a+b
s=list(raw_input())
p=0
r=[]
ro=0
for i in range(n):
    if s[i]=="a" and p<ab:
        r.append("Yes")
        p+=1
    elif s[i]=="b" and p<ab and ro<b:
        ro+=1
        p+=1
        r.append("Yes")
    elif s[i]=="c":
        r.append("No")
    else:
        r.append("No")
for i in range(n):
    print(r[i])

Measured memory_bytes: 32744
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		int road[] = new int[6];
        int count = 0;
        for(int i = 0; i < 6; i++){
        	road[i] = sc.nextInt();
            for(int j = 0; j < i; j++){
            	if(road[i] == road[j]){
                	count++;
                }
            }
        }
        if(count == 2){
        	System.out.println("YES");
        }else{
        	System.out.println("NO");
        }
    }
}

Measured memory_bytes: 35712
N, H = map(int, input().split())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
A.sort(reverse = True)
B.sort(reverse = True)
count = 0
for b in B:
  if b > A[0]:
    H -= b
    count += 1
  else:
    break
  if H <= 0:
    break
if H > 0:
  count += (H + A[0] - 1) // A[0]
print(count)

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if ((a < c && c < b) || (b < c && c < a)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int pi=3.1415926535897932384626433832795;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};
#define ll long long
#define inf int(1e9+7)
#define pb push_back
#define mp make_pair
int n;
char ch[100005];
bool a[100005];
int main()
{
	scanf("%d%s",&n,&ch);
	for(int i=0;i<2;i++)
		for(int j=0;j<2;j++)
		{
			a[0]=i;
			a[1]=j;
			for(int k=1;k<n-1;k++)
				a[k+1]=a[k-1]^a[k]^(ch[k]=='x');
			if(ch[n-1]=='x'==a[n-2]^a[n-1]^a[0]&&ch[0]=='x'==a[n-1]^a[0]^a[1])
			{
				for(int k=0;k<n;k++)
					printf(a[k]?"W":"S");
				return 0;
			}
		}
	puts("-1");
	return 0;
}

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

int main(void){
  int cntA=0,cntB=0,cntAB=0,cntO=0,num;
  string blood;
  char comma;

  while( cin >> num >> comma >> blood ){

    if( blood  == "A" ) cntA++;
    else if( blood == "B" ) cntB++;
    else if( blood == "AB" ) cntAB++;
    else cntO++;
  
    
  }
  cout << cntA << endl;
  cout << cntB << endl;
  cout << cntAB << endl;
  cout << cntO << endl;

  return 0;
}

Measured memory_bytes: 1204
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] p = new int[N];
		for (int i = 0; i < N; i++) {
			p[i] = sc.nextInt();
		}
		sc.close();

		int ans = 0;
		for (int i = 1; i < N - 1; i++) {
			if ((p[i - 1] < p[i] && p[i] < p[i + 1]) || (p[i - 1] > p[i] && p[i] > p[i + 1])) {
				ans++;
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23252
def primes(n):  #エラストテネスのふるい
   is_prime = [True] * (n + 1)
   is_prime[0] = False
   is_prime[1] = False
   for i in range(2, int(n**0.5) + 1):
      if not is_prime[i]:
         continue
      for j in range(i * 2, n + 1, i):
         is_prime[j] = False
   return [i for i in range(n + 1) if is_prime[i]]

from fractions import gcd
import math
A,B=map(int,input().split())
C=gcd(A,B)
prime_numbers=primes(int(math.sqrt(C))+1)

count=1
for p in prime_numbers:
   if C==1:
      break

   flag=False
   while C%p==0:
      C//=p
      flag=True
   if flag:
      count+=1
      p=p+1 if p==2 else p+2
   else:
      p=p+1 if p==2 else p+2

if C!=1:
   count+=1

print(count)

Measured memory_bytes: 16140
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
struct duck {
    duck() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
    }
} quack;

int main() {
    lint n;
    cin >> n;
    set<int> temp, ret;
    lint sum = 0;
    for (int i = 1; i <= n; ++i) {
        sum += i;
        temp.insert(i);
        if (sum >= n)
            break;
    }
    for (auto it = temp.rbegin(); it != temp.rend(); it = next(it)) {
        if (sum - *it >= n) {
            sum -= *it;
        } else {
            ret.insert(*it);
        }
    }
    for (auto &r : ret) {
        cout << r << "\n";
    }
    return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
#define rep(i,f,n) for(ll i=(f); (i) < (n); i++)
#define repe(i,f,n) for(ll i=(f); (i) <= (n); i++)
using namespace std;
using ll = long long;
#define MOD (ll)1000000007
#define PI 3.14159265359
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
//#define P pair<ll, ll>
#define dvec vector<vector<ll>>
//printf("%.10f\n")
//cout << fixed << setprecision(10);
template<class T> inline bool chmax(T& a, T b){if (a < b) { a = b; return true; } return false;}
template<class T> inline bool chmin(T& a, T b){if (a > b) { a = b; return true; } return false;}
ll INF = 1e+18;
int iINF = 1e9;
int main()
{
  int N, A, B, C; cin >> N >> A >> B >> C;
  vector<int> bam(N);
  rep(i, 0, N) cin >> bam[i];
  int cost = 100000;

  vector<int> bit(3, 0);
  for(bit[0] = 0; bit[0] < (1 << (N)); bit[0]++){
    for(bit[1] = 0; bit[1] < (1 << (N)); bit[1]++){
      if(bit[0] & bit[1]) continue;
      for(bit[2] = 0; bit[2] < (1 << (N)); bit[2]++){
        if(bit[2] & bit[0]) continue;
        if(bit[2] & bit[1]) continue;
        vector<int> mp(3);
        rep(i, 0, 3){
          if(__builtin_popcount(bit[i]) > 0) mp[i] += 10 * (__builtin_popcount(bit[i]) - 1);
        }
        vector<int> len(3, 0);
        rep(i, 0, 3){
          rep(k, 0, N){
            if(bit[i] & (1 << k)) len[i] += bam[k];
          }
        }
        mp[0] += abs(A - len[0]);
        mp[1] += abs(B - len[1]);
        mp[2] += abs(C - len[2]);
        int tmp = 0;
        rep(i, 0, 3) tmp += mp[i];
        if(tmp < cost && bit[0] > 0 && bit[1] > 0 && bit[2] >0) cost = tmp;
      }
    }
  }
  cout << cost << endl;
}


Measured memory_bytes: 3580
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{   
    int N; cin>>N;
    string s; cin>>s;

    vint a(N+1),b(N+1);
    for(int i=0;i<N;i++){
        a[i+1]=a[i]+(s[i]=='#');
    }
    for(int i=N-1;i>=0;i--){
        b[i]=b[i+1]+(s[i]=='.');
    }
    int ans=N;
    for(int i=0;i<=N;i++){
        ans=min(ans,a[i]+b[i]);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3716
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <numeric> // next_parmutation
#define ll long long
using namespace std;

int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++){
        cin >> a.at(i);
   }

   vector<int> s;
   vector<int> ord(n + 1, -1);
    int c, l;
   {
       int v = 1;
      
       while(ord[v] == -1){
           ord[v] = s.size();
           s.push_back(v);
           v = a[v - 1];
       }
       c = s.size() - ord[v];
       l = ord[v];
   }

   if(k < l) cout << s.at(k) << endl;
   else{
       k -=l;
       k %= c;
       cout << s.at(k + l) << endl;
   }
 return 0;

}

Measured memory_bytes: 6676
def test():

	string = list(input())

	for i in range(len(string)):

		# small character
		if ord('a') <= ord(string[i]) and ord(string[i]) <= ord('z'):
			string[i] = chr(ord(string[i]) - 0x20)
		#big character
		elif ord('A') <= ord(string[i]) and ord(string[i]) <= ord('Z'):
			string[i] = chr(ord(string[i]) + 0x20)

	print(''.join(string))

if __name__ == "__main__":
	test()


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

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

const int N = 2e5 + 5;
int n;
ll k;
int A[N];
int d[N];

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

  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> A[i];
  }
  int cur = 1;
  unordered_set<int> reached;
  reached.insert(1);
  d[0] = 1;
  int steps = 0;
  while (1) {
    ++steps;
    cur = A[cur];
    if (reached.count(cur)) break;
    reached.insert(cur);
    d[steps] = cur;
  }
  // Then calculate the circle
  int ci = 0;
  int start = cur;
  while (1) {
    cur = A[cur];
    ++ci;
    if (cur == start) break;
  }

  int a = steps - ci; // non cycle part
  if (k <= a) {
    cout << d[k] << endl;
  } else { // >
    k = (k - a) % ci + a;
    cout << d[k] << endl;
  }


  return 0;
}


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

#define pb push_back
#define all(v) (v).begin(), (v).end()

int n, k;
int arr[500010];
int v[500010];
int ans[500010];

int f(int s, int e) {
    if(s >= e) return 0;

    vector<int> v1, v2, ret;
    int p = s+e>>1;
    //int p = rand() % (e-s+1) + s;

    int mx = v[p];
    for(int i=p-1; i>=s; i--) {
        if(v[i] >= mx+k) {
            v2.pb(v[i]);
        }
        else {
            v1.pb(v[i]);
            mx = max(mx, v[i]);
        }
    }

    reverse(all(v1));
    reverse(all(v2));

    int mn = v[p];
    for(int i=p+1; i<=e; i++) {
        if(v[i] <= mn - k) {
            v1.pb(v[i]);
        }
        else {
            v2.pb(v[i]);
            mn = min(mn, v[i]);
        }
    }

    for(int i=0; i<v1.size(); i++) {
        ret.pb(v1[i]);
    }
    ret.pb(v[p]);
    for(int i=0; i<v2.size(); i++) {
        ret.pb(v2[i]);
    }

    for(int i=s; i<=e; i++) {
        v[i] = ret[i-s];
    }

    f(s, s+v1.size()-1);
    f(e - v2.size() + 1, e);
}

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

    srand(time(NULL));
    cin >> n >> k;

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

    f(1, n);

    for(int i=1; i<=n; i++) {
        ans[v[i]] = i;
    }

    for(int i=0; i<n; i++) {
        cout << ans[i] << "\n";
    }
}


Measured memory_bytes: 24876
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#define endl '\n'
#define ll long long

using namespace std;

int cost[10][10];
int H, W;
int dist[201][201];
int digit[10];

int main(void)
{
	cin.tie(NULL); ios_base::sync_with_stdio(false);
	cin >> H >> W;

	for(int i = 0; i < 10; i++)
	{
		for(int j = 0; j < 10; j++)
		{
			cin >> dist[i][j];
		}
	}

	for(int i = 0; i < H; i++)
		for(int j = 0; j < W; j++)
		{
			int temp; cin >> temp;
			if(temp == -1) continue;
			digit[temp] += 1;
		}
	
	/*
	for(int i = 0; i < 10; i++)
		for(int j = 0; j < 10; j++)
		{
			if(i == j)
				dist[i][j] = 0;
			else
				dist[i][j] = INT_MAX;
		}

	*/
	for(int k = 0; k < 10; k++)
	{
		for(int i = 0; i < 10; i++)
		{
			for(int j = 0; j < 10; j++)
			{
				if(dist[i][j] > dist[i][k] + dist[k][j])
					dist[i][j] = dist[i][k] + dist[k][j];
			}
		}
	}

	ll ret = 0;

	for(int i = 0; i < 10; i++)
		ret += dist[i][1] * digit[i];

	cout << ret << endl;
	
//	cout << "DEBUG" << endl;
//	cout << "1 to 8 " << dist[8][1];
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
// #include <cmath>
// #include <string>

using namespace std;
// typedef unsigned long long ull;


template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    for (const auto i : v) {
        os << i << " ";
    }
    os << "]";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os, const set<T>& s) {
    os << "[";
    for (const auto i : s) {
        os << i << " ";
    }
    os << "]";
    return os;
}

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


int main(int argc, char const *argv[]) {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> D(N), dist(N);
    for (int i = 0; i < N; i++) {
        D[i].resize(N, -1);
        dist[i].resize(N, 1000000);
        dist[i][i] = 0;
    }
    for (int i = 0; i < M; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        a -= 1;
        b -= 1;
        D[a][b] = D[b][a] = dist[a][b] = dist[b][a] = c;
    }

    for (int k = 0; k < N; k++) {
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                dist[i][j] = min(dist[i][k] + dist[k][j], dist[i][j]);
            }
        }
    }

    // cout << "dist\n";
    // cout << dist << endl;

    set<pair<int, int>> used;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if (D[i][j] == -1) continue;
            for (int k = 0; k < N; k++) {
                if (dist[i][k] == D[i][j] + dist[j][k]) {
                    used.insert(make_pair(min(i, j), max(i, j)));
                    break;
                }
            }
        }
    }
    // cout << used << endl;

    cout << M - used.size() << endl;

    return 0;
}


Measured memory_bytes: 384
n = str(input())
s = 0
e = 0
for i in range(0, len(n)):
    if n[i] == 'A':
        s = i
        break
for i in range(len(n) - 1, 0, -1):
    if n[i] == 'Z':
        e = i
        break
print(int(e - s + 1))


Measured memory_bytes: 9172
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
#define m_p make_pair
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    ll a,b,c;
    cin >> a >> b >> c;
    cout << (a+b>=c?"Yes\n":"No\n");
    return 0;
}

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

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

int main(){
    using namespace std;
    string s;
    cin >> s;
    auto it = ostream_iterator<char>(cout);
    copy(s.begin(), s.begin() + 4, it);
    cout << " ";
    copy(s.begin() + 4, s.end(), it);
    cout << endl;
}

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

string S;

bool pal(string &s,int l,int r){
    while(l<r){
        if(s[l]!=s[r])return false;
        l++;r--;
    }
    return true;
}

int main(){
    cin>>S;
    int n=S.length();
    bool res=pal(S,0,n-1)*pal(S,0,(n-3)/2)*pal(S,(n+1)/2,n-1);
    if(res)cout<<"Yes\n";
    else cout<<"No\n";
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int a,b,d;
double c;
cin >>a>>b;
c = a*b;
d = c;
  if(c/2 == d/2)
    cout<<"Even"<<endl;
  else
    cout<<"Odd"<<endl;
  

}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    minj=i
    for j in range(i,n):
        if a[j]<a[minj]:
            j,minj=minj,j
    if i!=minj:
        a[i],a[minj]=a[minj],a[i]
        ans+=1
print(' '.join(map(str,a)))
print(ans)


Measured memory_bytes: 5600
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>

using namespace std;

typedef long long ll;

int main()
{
	ll N,gcds,down,upN,uph,upn,upw;
	scanf("%lld",&N);
	for(ll i=1;i<=3500;i++)
		for(ll j=1;j<=3500;j++)
		{
			gcds=__gcd(__gcd(i,j),N);
			down=i/gcds*j/gcds*N;
			upN=4*(down/N);
			uph=down/i;
			upn=down/j;
			upw=upN-uph-upn;
			if(upw>0 && __gcd(upw,down)==upw)
			{
				printf("%lld %lld %lld\n",i,j,down/upw);
				return 0;
			}
		}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <deque>
#include <string>
#include <stack>
#include <unordered_set>
#include <cmath>
#include <climits>
#include <cstdlib>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 201
#define PLUS 0
#define MINUS 1

using namespace std;

ll *dp;

ll LucasNumber(int i)
{
	if (dp[i] != 0)
		return dp[i];
	dp[i] = LucasNumber(i - 1) + LucasNumber(i - 2);
	return dp[i];
}

int main(void)
{
	cin.tie(NULL); ios_base::sync_with_stdio(false);
	int N;
	cin >> N;
	dp = new ll[N + 1]();
	dp[0] = 2; dp[1] = 1;


	cout << LucasNumber(N) << endl;
	return 0;
}

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

ll max(ll a, ll b)
{
    return a > b ? a : b;
}

void prime(ll *ar)
{
    for (int x = 2; x < 100005; x++)
    {
        if (ar[x] == 1)
        {
            int t = 2 * x;
            while (t < 100005)
            {
                ar[t] = 0;
                t += x;
            }
        }
    }
}

int main()
{
    ll n;
    cin >> n;
    ll ar[100005];
    for (int x = 0; x < 100005; x++)
    {
        ar[x] = 1;
    }
    ar[0] = 0;
    ar[1] = 0;
    prime(ar);

    int temp = n;
    // int temp = 0;
    while (temp < 100005)
    {
        if (ar[temp] == 1)
        {
            cout << temp << endl;
            break;
        }

        temp++;
    }
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define all(X) X.begin(),X.end()

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   str.substr (x) : returns a substring str[x],... end of string
   str.find(qtr) : returns the first occurenece of qtr in str */

const int M = (1<<20)+5;
const int md = 1e9+7;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

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

	ll n,k;

	cin >> n >> k;
	if(n == k)
		cout << 0 << endl;
	else if(n>k)
		cout << min(n%k,k-n%k) << endl;
	else
		cout << min(n,k-n) << endl;

	return 0;
}

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

template<long long MOD = 1000000007>
struct Mint {
private:
  long long val;

public:
  constexpr Mint(const long long x = 0) noexcept : val(x < 0 ? x % MOD + MOD : x >= MOD ? x % MOD : x) {}
  constexpr Mint &operator+=(const Mint rhs) noexcept {
    if ((val += rhs.val) >= MOD) val -= MOD;
    return *this;
  }
  constexpr Mint &operator-=(const Mint rhs) noexcept {
    if ((val -= rhs.val) < 0) val += MOD;
    return *this;
  }
  constexpr Mint &operator*=(const Mint rhs) noexcept {
    val = val * rhs.val % MOD;
    return *this;
  }
  constexpr Mint &operator/=(Mint rhs) noexcept {
    val = val * rhs.inv().val % MOD;
    return *this;
  }
  constexpr Mint operator+(const Mint& rhs) const noexcept { return Mint(*this) += rhs; }
  constexpr Mint operator-(const Mint& rhs) const noexcept { return Mint(*this) -= rhs; }
  constexpr Mint operator*(const Mint& rhs) const noexcept { return Mint(*this) *= rhs; }
  constexpr Mint operator/(const Mint& rhs) const noexcept { return Mint(*this) /= rhs; }
  constexpr Mint inv() const noexcept { return pow(MOD-2); }
  constexpr Mint pow(long long n) const noexcept {
    Mint ret(1), mul(val);
    while (n) {
      if (n % 2) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  constexpr bool operator==(const Mint& rhs) const noexcept { return val == rhs.val; }
  constexpr bool operator!=(const Mint& rhs) const noexcept { return val != rhs.val; }
  friend ostream &operator<<(ostream &os, const Mint<MOD> &x) { return os << x.val; }
  friend istream &operator>>(istream &is, Mint<MOD> &x) {
    long long t;
    is >> t;
    x.val = t % MOD;
    return is;
  }
};

int main() {
  int n, k; cin>>n>>k;
  vector<Mint<>> v(k+1, 0);
  Mint<> ans = 0;

  for (int i = k; i >= 1; i--) {
    v[i] = Mint<>(k/i).pow(n);
    for (int j = i*2; j <= k; j+= i) {
      v[i] -= v[j];
    }
    ans += v[i] * i;
  }

  cout << ans << endl;

  return 0;
}

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

const int inf = 1e9 + 9;
const int max_n = 5000;
typedef pair<int, int> P;

struct edge{
  int to, cost;
};

int n, k;
int V;
vector<edge> G[max_n];
vector<int> g[max_n];

int d[max_n];
int c[max_n], r[max_n];
bool f[max_n];

void dijkstra()
{
  priority_queue<P, vector<P>, greater<P>> q;
  fill(d, d + n, inf);
  d[0] = 0;
  q.push(P(0, 0));

  while (!q.empty()){
    P p = q.top(); q.pop();

    int v = p.second;
    if (d[v] < p.first) continue;
    for (int i = 0; i < G[v].size(); i++){
      edge e = G[v][i];
      if (d[e.to] > d[v] + e.cost){
        d[e.to] = d[v] + e.cost;
        q.push(P(d[e.to], e.to));
      }
    }
  }
}

void bfs(int R, int v)
{
  if (R == 0) return;
  if (f[v] >= R) return;
  f[v] = R;

  edge e;
  e.to = v; e.cost = c[V];
  G[V].push_back(e);

  for (int i = 0; i < g[v].size(); i++){
    bfs(R - 1, g[v][i]);
  }
}

int main()
{
  cin >> n >> k;
  for (int i = 0; i < n; i++){
    cin >> c[i] >> r[i];
  }
  for (int i = 0; i < k; i++){
    int a, b;
    cin >> a >> b;
    a--; b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  for (int i = 0; i < n; i++){
    memset(f, false, sizeof(f));
    
    queue<P> que;
    que.push(P(i, r[i] + 1));
    while (!que.empty()){
      P p = que.front(); que.pop();
      int v = p.first;
      if (p.second == 0) continue;
      if (f[v]) continue;
      f[v] = true;

      edge e;
      e.to = v; e.cost = c[i];
      if (i != v) G[i].push_back(e);
      for (int j = 0; j < g[v].size(); j++){
        que.push(P(g[v][j], p.second - 1));
      }
    }
  }

  dijkstra();

  cout << d[n - 1] << endl;
}

Measured memory_bytes: 127908
import java.util.*;

    class Main
    {

	public static void main(String[] args){

	Scanner in = new Scanner(System.in);

	int n,a,b,sum_a,sum_b;

	while(true){

	    n = in.nextInt();
	    if(n == 0)break;
	    sum_a=0;
	    sum_b=0;
	   

	    for(int i=0;i<n;i++){
		a=in.nextInt();
		b=in.nextInt();
		if(a>b)sum_a+=(a+b);
		else if(b>a)sum_b+=(a+b);
		else{ 
		    sum_a+=a;
		    sum_b+=b;
		}
	    }

	    System.out.println(sum_a+" "+sum_b);
	    
	    
	}



	}
    }

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

Measured memory_bytes: 256
/*

	TRY_TO_BE8T_ME

*/
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define FIO ios::sync_with_stdio(0);
ll gcd(ll a,ll b){while(a&&b)a>b?a%=b:b%=a;return a+b;}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
int main() 
{
	FIO;
	ll i,j,k,c=0,n,m,d=0,maxim=0;
	cin>>n;
	string s,w="",f="";
	cin>>s;
	for(i=0;i<n-1;i++)
	{
		vector<ll> vis(26,0);
		c=0;
		w+=s[i];
		f="";
		for(j=i+1;j<n;j++)
		{
			f+=s[j];	
		}
		for(j=0;j<w.length();j++)
		{
			for(k=0;k<f.length();k++)
			{
				if(w[j]==f[k]&&vis[w[j]-97]==0)
				{
					c++;
					vis[w[j]-97]=1;
				}
			}
		}
		if(c>maxim)
			maxim=c;
	}
	cout<<maxim;
	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();
int c = sc.nextInt();
int tmp;
if(a>b){
tmp=a;
a=b;
b=tmp;
}
if(b>c){
tmp=b;
b=c;
c=tmp;
}
if(a>b){
tmp=a;
a=b;
b=tmp;
}
System.out.println(a+" "+b+" "+c);
}
}

Measured memory_bytes: 26268
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main()
{
	int a,b,c,d,sum=0;
	string s;

	cin>>a>>b>>c;
    d=c/a;

    cout<<d*b;
	
	return 0;
}
	

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

using namespace std;

int main()
{
	int h, w;
	int sum = 0;
	bool flag = true;
	
	cin >> h >> w;
	
	vector<string> color(h);
	int num[50][50] = {0};
	int ans[50][50] = {0};
	
	for (int i = 0; i < h; i++) {
		cin >> color[i];
		for (int j = 0; j < w; j++) {
			if (color[i][j] == '#') {
				num[i][j] = 1;
			}
		}
	}
	
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (num[i][j] == 1) {
				if (i == 0) {
					if (j != 0 || j != w - 1) {
						sum += num[i][j-1] + num[i][j] + num[i][j+1] + num[i+1][j];
					}
					else {
						if (j == 0) {
							sum += num[i][j] + num[i][j+1] + num[i+1][j];
						}
						if (j == w - 1) {
							sum += num[i][j-1] + num[i][j] + num[i+1][j];
						}
					}
				}
				
				else if (i == h - 1) {
					if (j != 0 || j != w - 1) {
						sum += num[i][j-1] + num[i][j] + num[i][j+1] + num[i-1][j];
					}
					else {
						if (j == 0) {
							sum += num[i][j] + num[i][j+1] + num[i-1][j];
						}
						if (j == w - 1) {
							sum += num[i][j-1] + num[i][j] + num[i-1][j];
						}
					}
				}
				else {
					if (j != 0 || j != w - 1) {
						sum += num[i][j] + num[i][j-1] + num[i][j+1] + num[i-1][j] + num[i+1][j];
					}
					else {
						if (j == 0) {
							sum += num[i][j] + num[i][j+1] + num[i-1][j] + num[i+1][j];
						}
						if (j == w - 1) {
							sum += num[i][j] + num[i][j-1] + num[i-1][j] + num[i+1][j];
						}
					}
				}
				ans[i][j] = sum;
				sum = 0;
			}
		}
	}
	
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (color[i][j] == '#') {
				if (ans[i][j] < 2) {
					flag = false;
				}
			}
		}
	}
	
	if (flag == false) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static long mod = (long)(Math.Pow(10, 9) + 7);
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        int[] alpha = new int[26];
        string a = Console.ReadLine();
        for (int i = 0; i < a.Length; i++)
        {
            alpha[a[i] - 'a']++;
        }
        if(a== "zyxwvutsrqponmlkjihgfedcba") { Console.WriteLine(-1);Console.ReadLine(); return; }
        for (int i = 0; i < a.Length; i++)
        {
            string u = a.Substring(0, a.Length - i);
            if (i != 0)
            {
                alpha[a[a.Length - i] - 'a']--;
            }
            for (int j = (i == 0 ? 0 : a[a.Length - i] - 'a' + 1); j < 26; j++)
            {
                if (alpha[j] == 0)
                {
                    Console.WriteLine(u + (char)(j + 'a'));
                    Console.ReadLine();
                    return;
                }
            }
        }
        Console.WriteLine((char)(a[0]+1));
        Console.ReadLine();
    }
    public static long gcd(long a, long b)
    {
        if (b == 0) { return a; }
        return gcd(b, a % b);
    }
    public static long lcm(long a, long b) { return a / gcd(a, b) * b; }
    public static string Reverse(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static bool IsPrime(int num)
    {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                // 素数ではない
                return false;
            }
        }

        // 素数である
        return true;
    }
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long() { return long.Parse(Console.ReadLine()); }
    public static long[] longs() { return Console.ReadLine().Split().Select(long.Parse).ToArray(); }
    public static int Int() { return int.Parse(Console.ReadLine()); }
    public static int[] ints() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Measured memory_bytes: 13140