akhauriyash/Code-Regression huggingface dataset:
// We only fail when we stop trying
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()



int main()
{
  int S, W;
  cin >> S >> W;
  if(W >= S) cout << "unsafe" << endl;
  else cout << "safe" << endl;
  return 0;
}


Measured memory_bytes: 3632
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int A, B, K;
    cin >> A >> B >> K;

    vector<int> v;

    FOR(i, 1, 101) {
        if (A % i == 0 && B % i == 0) v.pb(i);
    }

    sort(v.begin(), v.end(), greater<>());

    cout << v[K - 1] << endl;

}

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    cout << min(B / A, C) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N,M;
 cin >> N >> M;
  vector<vector<char>> A(N, vector<char>(N));
  vector<vector<char>> B(M, vector<char>(M));
  vector<vector<char>> C(M, vector<char>(M));//判別用行列
  
  for(int i = 0;i<N;i++){
    for(int j = 0;j<N;j++){
      cin >> A[i][j];
    }
  }
  for(int i = 0;i<M;i++){
    for(int j = 0;j<M;j++){
      cin >> B[i][j];
    }
  }
  bool flag = false;
  bool flag2 = false;
  for(int i = 0;i<=N-M;i++){
   for(int j = 0;j<=N-M;j++){//左上の点を決めた
     for(int k = i;k<=i+M-1;k++){
       for(int l = j;l<=j+M-1;l++){
        C[k-i][l-j] = A[k][l];
       }
     }
     if(C==B){
       flag = true;
       break;
     }
   }
    if(flag){
      flag2 = true;
      break;
    }
  }
     if(flag2) cout << "Yes" << endl;
     else cout << "No" << endl;
}
  

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define ld long double
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define all(x) x.begin(),x.end() 
#define rep(i,a,b) for(ri i=(a);i<=(b);++i)
#define per(i,a,b) for(ri i=(a);i>=(b);--i)
#define ls (x<<1)
#define rs (x<<1|1)
#define mid (l+r>>1)
#define de(x) cout << #x << " = " << x << endl
#define dd() cout << "Out Put!\n"
const int mod= 1e9+7,maxn=1000010;
const double eps = 1e-8,PI = acos(-1.0);
const int inf=0x7f7f7f7f;
using namespace std;
int a[maxn]={0},b[maxn],v[maxn];
string s;
signed main()
{
	int t=1;
//	cin >> t;
	while(t--)
	{
		int n;
		cin >> n;
		rep(i,1,n)
		{
			string s;
			cin >> s;
		//	cout << s <<endl;
			if(s == "AC")
				a[1]++;
			if(s=="WA")
				a[2]++;
			if(s=="TLE")
				a[3]++;
			if(s=="RE")
				a[4]++;
		}
		printf("AC x %lld\n",a[1]);
		printf("WA x %lld\n",a[2]);
		printf("TLE x %lld\n",a[3]);
		printf("RE x %lld\n",a[4]);
	}
	return 0;
}

Measured memory_bytes: 3724
n = int(input())
a = sorted((sorted(input()) for _ in range(n)))
ret = 0
cnt = 1
for i in range(1, n):
    if a[i] == a[i - 1]:
        cnt += 1
    if a[i] != a[i - 1] or i == n - 1:
        ret += cnt * (cnt - 1) // 2
        cnt = 1
print(ret)

Measured memory_bytes: 97624
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int N, L;
  cin >> N >> L;
  vector<int> A;
  for (int i = 1; i <= N; i++) {
    A.push_back(L+i-1);
  }
  sort(A.begin(), A.end(), [](int x, int y) {
    return abs(x) < abs(y);
  });
  int total = 0;
  for (int i = 1; i < N; i++) {
    total += A[i];
  }
  cout << total << '\n';
  return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    bool even = true;
    int cnt = 0;
    while (1) {
        for (int i = 0; i < n; i++) {
            if (a[i] % 2 == 0) a[i] /= 2;
            else {
                even = false;
                break;
            }
        }
        if (even) cnt++;
        else break;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main () {
	int N;
	scanf ("%d", &N);
	for (int i = 1; i < 10; i++) {
		int X = N % i;
		int Y = N / i;
		if (X == 0 && Y < 10) {
			N = N / i;
			printf ("Yes");
			break;
		}
		while (i == 9) {
			printf ("No");
			break;
		}
	}
	
	return 0;
}

Measured memory_bytes: 1704
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	nk := strings.Fields(nextLine())
	n, _ := strconv.Atoi(nk[0])
	k, _ := strconv.Atoi(nk[1])
	word := nextLine()
	for i := 0; i < n; i++ {
		if i == k-1 {
			fmt.Printf("%s", strings.ToLower(string(word[i])))
		} else {
			fmt.Printf("%s", string(word[i]))
		}
	}
}


Measured memory_bytes: 640
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(a < b) {
			System.out.println("a" + " < " + "b");
		}else if(a>b){
			System.out.println("a" + " > " + "b");
		}else {
			System.out.println("a" + " == " + "b");
		}

	}
}



Measured memory_bytes: 26132
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    int x, y, a, b, c;
    std::cin >> x >> y >> a >> b >> c;

    std::multiset<i64> p, q, r;
    for (int i = 0; i < a; i++) {
        i64 in;
        std::cin >> in;
        p.insert(in);
    }
    for (int i = 0; i < b; i++) {
        i64 in;
        std::cin >> in;
        q.insert(in);
    }
    for (int i = 0; i < c; i++) {
        i64 in;
        std::cin >> in;
        r.insert(in);
    }

    while (p.size() > x) p.erase(p.begin());
    while (q.size() > y) q.erase(q.begin());

    for (auto it = r.rbegin(); it != r.rend(); it++) {
        const i64 v = *it;
        if (*p.begin() < v && *q.begin() < v) {
            if (*p.begin() < *q.begin()) {
                p.erase(p.begin());
                p.insert(v);
            } else {
                q.erase(q.begin());
                q.insert(v);
            }
        } else if (*p.begin() < v) {
            p.erase(p.begin());
            p.insert(v);
        } else if (*q.begin() < v) {
            q.erase(q.begin());
            q.insert(v);
        }
    }

    i64 s = 0;
    for (const auto &v : p) s += v;
    for (const auto &v : q) s += v;

    std::cout << s << std::endl;

    return 0;
}


Measured memory_bytes: 14336
a, b, n = map(int, input().split())
 
tmp = 0
for x in (range(1, b+1, b-2) if b<=n else range(1, n+1, n-1)):
#for x in range(1, n+1):
    calc = a*x//b - a*(x//b)
    if calc > tmp:
        tmp = calc
 
print(tmp)

Measured memory_bytes: 9192
#include <iostream>
using namespace std;
int main()
{
  int kosu;
  cin >> kosu;
  int kati[kosu],nedan[kosu];
  for(int i=0;i<kosu;i++){
    cin >> kati[i];
  }

  for(int i=0;i<kosu;i++){
    cin >> nedan[i];
  }

  int rieki[kosu];

  for(int i=0;i<kosu;i++){
    rieki[i]=kati[i]-nedan[i];
  }

  int sum=0,maxsum=0;

  for(int i=0;i<kosu;i++){
    for(int j=0;j<kosu;j++){
      if(rieki[j]>0)
        sum += rieki[j];
      if(sum>maxsum)
        maxsum=sum;
    }
    sum=0;
  }

  cout << maxsum << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string S;vector<int>U;
int p[11]={6,5,4,3,2,7,6,5,4,3,2};
bool solve(string F){
	int sum=0;
	for(int i=0;i<11;i++){
		sum+=p[i]*(F[i]-'0');
	}
	int G=F[11]-'0';sum%=11;
	if(sum<=1)sum=11;
	if((11-sum)==G)return true;
	return false;
}
int main(){
	cin>>S;int D=0;for(int i=0;i<S.size();i++){if(S[i]=='?')D=i;}
	for(int i=0;i<10;i++){
		string T=S;T[D]=(char)('0'+i);
		if(solve(T)==true)U.push_back(i);
	}
	if(U.size()>=2)cout<<"MULTIPLE"<<endl;
	else cout<<U[0]<<endl;
	return 0;
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;


int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int cnt = 0, ans = 0;
    rep(i, n) if (s[i] == 'R') cnt++;
    rep(i, cnt) if (s[i] == 'W') ans++;
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int n, m;
int par[100010];
bool al[100010];

void init(){
	for(int i = 1; i <= n; i++) par[i] = i;
}

int findR(int x){
	if(par[x] == x) return x;
	return par[x] = findR(par[x]);
}

void join(int a, int b){
	par[findR(a)] = findR(b);
}

int main(){
	scanf("%d%d", &n, &m);

	init();
	while(m--){
		int u, v, w;
		scanf("%d%d%d", &u, &v, &w);
		join(u, v);
	}

	int ans = 0;
	for(int i = 1; i <= n; i++){
		if(!al[findR(i)]){
			al[findR(i)] = 1;
			ans++;
		}
	}

	printf("%d\n", ans);
	
	return 0;
}

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

int main(){

    long long n;
    cin >> n;

    int nine_count = 0;
    int keta = 0;
    long long head_num;

    while(n > 0){
        if(n % 10 == 9) nine_count ++;
        keta ++;

        head_num = n;
        n = n / 10;
    }

    if(nine_count == keta){
        cout << 9 * nine_count << endl;
    }
    else if(head_num != 9 && nine_count == keta - 1){
        cout << 9 * nine_count + head_num << endl;
    }
    else{
        cout << 9 * (keta - 1) + head_num - 1 << endl;
    }


}

Measured memory_bytes: 384
#include <iostream>
#include <string>
using namespace std;
int main() {
    string n;
    cin >> n;
    for(int i=0; i<n.length(); i++) {
        if(n[i]=='9') cout << '1';
        else if(n[i]=='1') cout << '9';
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 9e18
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;

class Lowlink {
public:
	vi ord, low;
	vb vis;
	vi articulation;
	vPi bridge;

	Lowlink(const Graph &G) {
		ord = vi(G.size());
		low = vi(G.size());
		vis = vb(G.size(), false);
		int k = 0;
		for (int i = 0; i < G.size(); i++) {
			if (!vis[i]) dfs(G, i, -1, k);
		}
	}

	void dfs(const Graph &G, int v, int p, int &k)
	{
		vis[v] = true;

		ord[v] = k++;
		low[v] = ord[v];

		bool isArticulation = false;
		int ct = 0;

		for (int i = 0; i < G[v].size(); i++) {
			if (!vis[G[v][i].to]) {
				ct++;
				dfs(G, G[v][i].to, v, k);
				low[v] = min(low[v], low[G[v][i].to]);
				if (p != -1 && ord[v] <= low[G[v][i].to]) isArticulation = true;
				if (ord[v] < low[G[v][i].to]) bridge.push_back(make_pair(min(v, G[v][i].to), max(v, G[v][i].to)));
			}
			else if (G[v][i].to != p) {
				low[v] = min(low[v], ord[G[v][i].to]);
			}
		}

		if (p == -1 && ct > 1) isArticulation = true;
		if (isArticulation) articulation.push_back(v);
	}
};

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

	int N, M;
	cin >> N >> M;
	Graph G(N);
	rep(i, M) {
		int a, b;
		cin >> a >> b;
		//a--; b--;
		G[a].push_back(Edge{ a,b,1 });
		G[b].push_back(Edge{ b,a,1 });
	}

	Lowlink lowlink(G);
	sort(all(lowlink.articulation));

	for (auto a : lowlink.articulation)cout << a << endl;

	return 0;
}

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

public class Main {
	public static void main(String[] a) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuffer sb = new StringBuffer(str);
        str = sb.reverse().toString();
        System.out.println(str);
	}

}

Measured memory_bytes: 24156
#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>
#include <limits.h>

using namespace std;

typedef long long LL;

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define dumpMap(m) { for (auto it: m) cout << it.first << "=>" << it.second << ' '; }

const int MOD = 1000000007;

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

    int K;
    cin >> K;

    int e = K / 2;
    int o = K - e;

    cout << (e * o) << endl;

    return 0;
}


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

int main(){
  int N;
  cin >> N;
  int i=0;
  int M=N;

  while(M!=0){
    i+=M%10;
    M=M/10;
  }
  if(N%i==0){
  	cout << "Yes" << endl;
  }else{
  	cout << "No" << endl;
  }
}


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

string a[105];

bool cmp(string a,string b)
{
    return a<b;
}

int main()
{
    int n,L;
    while(cin>>n>>L)
    {
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
        }
        sort(a,a+n,cmp);
        string ans="";
        for(int i=0;i<n;i++)
        {
            ans=ans+a[i];
        }
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long               ll;
typedef long double             ld;
 
 
#define racecar          ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define si(a)            scanf("%d", &a)
#define si2(a,b)         scanf("%d %d", &a,&b)
#define sll(a)           scanf("%I64d",&a)
#define sll2(a,b)        scanf("%I64d %I64d",&a,&b)
#define pb               push_back
#define pi(a)            printf("%d",int(a))
#define pll(a)           printf("%I64d",ll(a))
#define all(x)           (x).begin(),(x).end()
#define rall(x)          (x).rbegin(),(x).rend()
#define ps               printf(" ")
#define nln              printf("\n")
#define ff               first
#define ss               second
#define vi               vector<int>
#define vll              vector<ll>
#define vstr             vector<string>
#define vc               vector<char>
#define pii              pair<int,int>
#define PLL              pair<ll,ll>
#define PI               acos(-1)
#define sq(x)            x*x
#define forr(i,a,b)      for(ll i=ll(a);i<ll(b);i++)
#define forn(i,a,b)      for(ll i=ll(a);i>ll(b);i--)
#define max3(a,b,c)      max(a,max(b,c))
#define max4(a,b,c,d)    max(max3(a,b,c),d)
#define min3(a,b,c)      min(a,min(b,c))
#define mod              1000000007
#define inf              9223372036854775807
 
ll power(ll b,ll n)
{
    if(n==0) return 1;
    else if(n%2) return b*power(b,n/2)*power(b,n/2);
    else return power(b,n/2)*power(b,n/2);
} 
 
ld root(ll n,ll r)
{
    ld dif=0.0001;
    ld guess=n/2.0;
    while(abs(pow(guess,r)-n)>=dif)
    {
        ld temp=pow(guess,r)-n;
        ld tmp=r*pow(guess,r-1);
        guess-=temp/tmp;
    }
    return guess;
}
 
void fileio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
}
 
      
 
int solve()
{   
	int n;
	si(n);
	int two=0;
	while(n)
	{
		if(n%10==2) two++;
		n/=10;
	}
	pi(two);
	
	return 0;
}
 
int main()
{   
 
//    racecar;
//    cout<<fixed<<setprecision(6);
//    fileio();
    solve();
}
 
 
 
///    Before submission=>
///    ***check for integer overflow,array bounds
///    ***check for n

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#define  endl '\n'
#define all(s) s.begin(),s.end()
#define lowbit(x) (x&-x)
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mem(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define pb push_back
#define PI acos(-1.0)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int mod=1e9+7;
const double eps=1e-8;
const int inf=0x3f3f3f3f;
const int N=2e5+10;
int a[N],b[N],h[N],ans[N];
int main()
{
	int n,m,q,k;
	cin>>n>>m;
	for(int i=1;i<=n;i++) cin>>h[i];
	for(int i=1;i<=m;i++){
		cin>>a[i]>>b[i];
		if(h[a[i]]<h[b[i]]) ans[a[i]]=1; 
		else if(h[b[i]]<h[a[i]]) ans[b[i]]=1;
		else ans[a[i]]=ans[b[i]]=1;
	}
	int tot=0;
	for(int i=1;i<=n;i++){
		if(ans[i]==0) tot++;
	}
	cout<<tot;
}


Measured memory_bytes: 5236
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <map>
#include <vector>
//#include <unordered_map>
//#include <unordered_set>
#include <stack>
#include <set>
#include <queue>
#include <list>
#define LL long long
#define N 100100
#define M 110
#define MOD 1000000007
#define FOR(i,l,r) for (int i = (l); i <= (r); i ++)
#define CLR(a,x) memset(a,x,sizeof(a))
#define INF 0x3f3f3f3f
#define ALL(x) x.begin(),x.end()
#define pb push_back
#define X first
#define Y second
using namespace std;
const int maxn=100005;
map<int,int>co;
map<int,int>::iterator it;
int main()
{
    int n,k;
    scanf("%d",&n);
    for(int i=0;i<n;++i)
    {
        scanf("%d",&k);
        ++co[k];
        ++co[k-1];
        ++co[k+1];
    }
    int ma=-1;
    for(it=co.begin();it!=co.end();++it)
    {
        if((it->second)>ma)
        {
            ma=it->second;
        }
    }
    printf("%d\n",ma);
	return 0;
}


Measured memory_bytes: 4736
#include<bits/stdc++.h>
using namespace std;
int n;
map<int,int>mp;
int a[100005];
int main()
{
	scanf("%d",&n);
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		int tmp;
		scanf("%d",&tmp);
		mp[tmp]++;a[i]=tmp;
		if(mp[tmp]>tmp)ans++;
	}
	for(int i=1;i<=n;i++)
	{
		if(mp[a[i]]!=0&&mp[a[i]]<a[i])
		{
			ans+=mp[a[i]];
			mp[a[i]]=0;
		}
	}
	cout<<ans<<endl;
	return 0;
} 

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
using namespace std;
typedef long long ll;

int N;
int L[110];

int main(){
  cin >> N;
  rep(i, N) cin >> L[i];

  int sums = 0;
  rep(i, N) sums += L[i];

  sort(L, L+N);

  if (sums - L[N-1] > L[N-1]) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3648
import java.io.IOException;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) throws IOException {
		
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] i = {1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51};
		System.out.println(i[n-1]);
		
		
	}
}

Measured memory_bytes: 21844
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num[] = new int[n];
        for(int i = 0 ; i < n ; i++)
            num[i] = sc.nextInt();
        int min = num[0];
        int max = num[1] - num[0];
        for(int i = 0 ; i < n-1 ; i++){
            if(num[i] < min)
                min = num[i];
            if(num[i+1] - min > max)
                max = num[i+1] - min;
        }
        System.out.println(max);
    }
}


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

using namespace std;

typedef long long LL;
typedef double LF;

#define clr(x, y) memset(x, y, sizeof(x))

const int MAXN = 5e3 + 15;

struct Node{int t, val, num; Node(){num = 0;};}a[MAXN];
int n, cost[2][MAXN][MAXN], f[MAXN][MAXN], pos[2][MAXN];

inline int read(){
	int r = 0, z = 1; char ch = getchar();
	while(ch < '0' || ch > '9'){if(ch == '-') z = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9'){r = r * 10 + ch - '0'; ch = getchar();}
	return r * z;
}

void work(){
	n = read();
	for(int i = 1; i <= n * 2; i ++){
		char ch[2]; scanf("%s", ch + 1); a[i].val = read();
		if(ch[1] == 'B') a[i].t = 0; else a[i].t = 1;
		pos[a[i].t][a[i].val] = i;
	}
	for(int i = 1; i <= n * 2; i ++)
		for(int j = i + 1; j <= n * 2; j ++){
			if(a[i].t == a[j].t && a[i].val > a[j].val) a[i].num ++;
		}
	for(int t = 0; t < 2; t ++)
		for(int i = 1; i <= n; i ++){
			cost[t][i][0] = a[pos[t][i]].num;
			for(int j = 1; j <= n; j ++) cost[t][i][j] = cost[t][i][j - 1] + (pos[t][i] < pos[t ^ 1][j]);
		}
	f[0][0] = 0;
	for(int i = 1; i <= n; i ++) f[i][0] = f[i - 1][0] + cost[0][i][0], f[0][i] = f[0][i - 1] + cost[1][i][0];
	for(int i = 1; i <= n; i ++)
		for(int j = 1; j <= n; j ++) f[i][j] = min(f[i - 1][j] + cost[0][i][j], f[i][j - 1] + cost[1][j][i]);
	printf("%d\n", f[n][n]);
}

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

Measured memory_bytes: 124416
#include<stdio.h>
#include<math.h>
typedef double D;
const D pi=3.14159265358979323846264338327950288419716939937510L;
signed main(void)
{
  int A,B,H,M;
  if(~scanf("%d %d %d %d",&A,&B,&H,&M))
  {
    D theta=(60*H-11*M)*pi/360.0,x,y;
    x=(A-B*cos(theta)),y=B*sin(theta);
    return printf("%.20lf",pow(x*x+y*y,0.5)),0;
  }
}

Measured memory_bytes: 2640
n, m = map(int, input().split())
xstr = input().split()
xdec = []

for xs in xstr:
    xdec.append(int(xs))
xdec.sort()

dif = []
for i in range(len(xdec) - 1):
    dif.append(xdec[i+1] - xdec[i])

dif.sort()

sum = 0
for i in range(len(dif) + 1 - n):
    sum += dif[i]

print(sum)

Measured memory_bytes: 14728
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
        return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main() {
        ll x;
        cin >> x;

        cout << x / 500 * 1000 + x % 500 / 5 * 5 << endl;

        return 0;
}


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

const int maxn=10;
int x,y,cnt,pos[maxn];
long long dis[maxn];
map<int,int> mp;
bool inq[maxn];
vector<pair<int,int> > g[maxn];

int main(){
	cin>>x>>y;
	mp[x];mp[-x];mp[y];mp[-y];
	for(map<int,int>::iterator i=mp.begin();i!=mp.end();++i)
		i->second=++cnt,pos[cnt]=i->first;
	for(int i=1;i<=cnt;++i)
		dis[i]=1e18;
	dis[mp[x]]=0;
	for(int i=1;i<=cnt;++i)
		for(int j=1;j<=cnt;++j)
			if(pos[i]<=pos[j])
				g[i].push_back(make_pair(j,pos[j]-pos[i]));
	g[mp[x]].push_back(make_pair(mp[-x],1));
	g[mp[-x]].push_back(make_pair(mp[x],1));
	g[mp[y]].push_back(make_pair(mp[-y],1));
	g[mp[-y]].push_back(make_pair(mp[y],1));
	queue<int> q;
	inq[mp[x]]=true;
	q.push(mp[x]);
	while(!q.empty()){
		int pos=q.front();q.pop();
		inq[pos]=false;
		for(int i=0,v,w;i<g[pos].size();++i)
			if(dis[v=g[pos][i].first]>dis[pos]+(w=g[pos][i].second)){
				dis[v]=dis[pos]+w;
				if(!inq[v]){
					inq[v]=true;
					q.push(v);
				}
			}
	}
	printf("%d\n",dis[mp[y]]);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define rep(i,n) for(ll i=0;i<n;i++)
#define INF 1e9+7
#define LLINF 1e18
using namespace std;
const ll MOD = 1e9 +7;




int main(){
    ll n,a[200010];
    cin>>n;
    multiset<ll> set;
    rep(i,n){
        cin>>a[i];
        set.insert(a[i]);
    }
    ll ans=0;
    ll int i;
    while(!set.empty()){
        auto it=set.end();
        it--;
        ll x= *it;
        set.erase(it);
        for(i=1;i<=x;i*=2);
        if(set.find(i-x) !=set.end()){
            set.erase(set.find(i-x));
            ans++;   
        }
    }
    cout<<ans<<endl;
    return 0;
}


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


int a[5], bil, k, ada=0;

int main () {
	for(int i=1;i<=5;i++){
		cin >>a[i];
	}
	cin >> k;
	for(int i=2;i<=5;i++){
		for(int j=1;j<=4;j++){
			if((a[i]-a[j])>k)
					ada++;
			}
		}
	if(ada>0) cout << ":(";
	else cout << "Yay!";
}




Measured memory_bytes: 256
fun main(args: Array<String>) {

    val a = readLine()!!

    println(abc141b(a))
}

fun abc141b(a: String): Any? {

    for ((i, e) in a.toCharArray().withIndex()) {

        if (i % 2 != 0) {
            // 偶数
            if (e == 'R') {
                return "No"
            }

        } else {
            // 奇数
            if (e == 'L') {
                return "No"
            }
        }
    }
    return "Yes"
}


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

#define FOR(i, l, r) for(ll i = l; i < r; i++)
#define rep(i, N) FOR(i, 0, N)

#define MOD 1000000007
#define INF 1000000000

using ll = long long int;
using namespace std;

typedef pair<int,int> P;
typedef vector<P> vp;
typedef vector<int> vi;
typedef vector<vi> vvi;

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

    int ans = 3*n*n;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
function Main(input) {
  input = input.trim()
  input = input.split(" ").map(Number);
if(input[0]+input[1]>input[2]+input[3]){
  console.log("Left")
}else if(input[0]+input[1]<input[2]+input[3]){
  console.log("Right")
}else{
  console.log("Balanced")
}
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) i64((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

int main(int argc, char *argv[]) {
  i64 N;
  cin >> N;
  i64 ans = 0;
  i64 p = 2;
  while(p * p <= N) {
    if(N % p == 0) {
      i64 count = 0;
      while(N % p == 0) {
	N /= p;
	count++;
      }
      i64 a = 1;
      while(a * (a + 1) <= count * 2) {
	a++;
      }
      //cout << count << " " << a << endl;
      ans += a - 1;
    }
    p++;
  }
  if(N != 1) {
    ans += 1;
  }
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3648
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] list = sc.next().toCharArray();
		int red = 0;
		int blue = 0;
		for(int i = 0; i < list.length; i++) {
			if(list[i] == '0') {
				red++;
			} else {
				blue++;
			}
		}
		System.out.println(Math.min(red, blue) * 2);
	}

}


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

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C& _a4, C _b4) { _a4 = min(_a4, _b4); }
template<class C> void maxi(C& _a4, C _b4) { _a4 = max(_a4, _b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream& operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto& vv : V) os << vv << ","; os << "]";
  return os;
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif


const int P = 1e9 + 7;

#define MAX 100010
int t[MAX],s[MAX];
bool cz[MAX];
int n;
void zero(){
  cout << "0\n";
  exit(0);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n;
  R(i,n) cin >> t[i];
  R(i,n) cin >> s[i];
  int pom = 0;
  R(i,n){
    if(t[i] > pom){
      if(t[i] > s[i])zero();
      pom = t[i];
      cz[i] = 1;
    }
  }
  pom = 0;
  for(int i = n-1; i >= 0; i --){
    if(s[i] > pom){
      if(s[i] > t[i])zero();
      pom = s[i];
      cz[i] = 1;
    }
  }
  int res = 1;
  R(i,n)if(!cz[i]){
    debug(i,min(t[i],s[i]));
    res = res * min(t[i], s[i]) % P;
  }
  cout << res << "\n";
}


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

typedef long long ll;
ll n, cnt;
void f(ll p, ll q) {
	while (p % q == 0) p /= q;
	if (p % q == 1) cnt++;
}

int main()
{
	ll i, j;
	cin >> n;
	if (n == 2) {
		cout << 1;
		return 0;
	}
	for (i = 2; i * i <= n; i++) {
        if (n % i == 0) {
			f(n, i);
			if (n / i != i) f(n, n / i);
        }
	}
	for (i = 2; i * i <= n - 1; i++) {
		if ((n - 1) % i == 0) {
			cnt += 2;
			if (i * i == n - 1) cnt--;
		}
	}
	cout << cnt + 2;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
    
#define int long long
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define FORR(i,m,n) for(int i=m;i>=n;i--)
#define pb(x) push_back(x)
#define all(x) ((x).begin(), (x).end())
#define mp(x, y) make_pair(x, y) 
#define SORT(x) sort((x).begin(), (x).end())
#define INF 99999999999
#define MOD (int)(1e9)+7
    
using namespace std;
    
int dy[4]={1, 0, -1, 0};
int dx[4]={0, 1, 0, -1};

int32_t main(){
    int n;
    cin >> n;
    if(n<1000) {
        printf("ABC\n");
    } else {
        printf("ABD\n");
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#define REP(i, a, b) for(int i = a; i < b; i++)
#define REP_(i, a, b) for(int i = a; i <= b; i++)
#define sl(n) scanf("%lld", &n);
#define si(n) scanf("%d", &n);
#define RepAll(a) for(auto x: a)
#define cout(ans) cout << ans << endl;
typedef long long ll;
const int inf = 0x3f;
const int maxn = 1e5 + 10;
int n, ans, m, startcity, endcity;
using namespace std;
//int ab[maxn][maxn];
//map <int ,int> point;
vector<vector<int>> city(maxn);
vector<int> point(maxn);
int main(){
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &startcity, &endcity);
    startcity--,endcity--,point[startcity]++,point[endcity]++;//可连接到
    city[startcity].push_back(endcity);city[endcity].push_back(startcity);
    //城市的链接是双向的
  }
  for (int i = 0; i < n; ++i) {if (point[i] & 1) {return printf("No\n") * 0;}}
  for (int i = 0; i < n; ++i) {if (point[i] >= 6) {return printf("Yes\n") * 0;}}
  for (int i = 0; i < n; ++i) {    if (point[i] == 4) {++ans;}}
  if (ans >= 3) {return printf("Yes\n") * 0;}
  if (ans == 2) {
    for (int i = 0; i < n; ++i) {
      if (point[i] == 2) {
        int x = city[i][0], y = city[i][1];
        if (x == y) {return printf("Yes\n") * 0;}
        for (int j = 0; j < (int) (city[x].size()); j++) {
          if (city[x][j] == i) {
            city[x][j] = y;
            break;
          }
        }
        for (int j = 0; j < (int) city[y].size(); ++j) {
          if (city[y][j] == i) {
            city[y][j] = x;
            break;
          }
        }
      }
    }
  }
  return printf("No\n") * 0;
}


Measured memory_bytes: 6144
N = int(input())
H = list(map(int, input().split()))
tmp = 0
result = 0
for i in range(1,N):
    if H[i] <= H[i-1]:
        tmp += 1
    else:
        result = max(tmp, result)
        tmp = 0
result = max(tmp, result)
print(result)

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

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

    int ac = 0, wa = 0, tle = 0, re = 0;
    rep(i, n) {
        string s;
        cin >> s;
        if (s == "AC")
            ac++;
        else if (s == "WA")
            wa++;
        else if (s == "TLE")
            tle++;
        else if (s == "RE")
            re++;
    }

    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
    return 0;
}


Measured memory_bytes: 3620
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        for(char i = 'a'; i <= 'z'; i++){
            if(S.indexOf(i) >= 0){
                continue;
            }else{
                System.out.println(i);
                return;
            }
        }
        System.out.println("None");
    }
}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define rep0(i,n) for (int i=0; i<=(int)(n); ++i)
#define rep1(i,n) for (int i=1; i<=(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using vb = vector<bool>;
using boolGraph = vector<vb>;
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const int MOD2 = 998244353;
const double EPS = 1e-9;

template<typename T>
struct is_vector : false_type{};

template<typename T>
struct is_vector<vector<T>> : true_type{};

template<typename T>
ostream &operator << (ostream &ostr, const vector<T> &vec) {
  if (vec.empty()) {
    return ostr;
  }
  ostr << vec.front();
  for (auto itr = ++vec.begin(); itr != vec.end(); ++itr) {
    if (is_vector<T>()) ostr << "\n" << *itr;
    else ostr << ' ' << *itr;
  }
  return ostr;
}

void solve() {
  int N, M; cin >> N >> M;
  vi arr(M);
  rep(i,M) cin >> arr[i];

  sort(all(arr));

  if (N >= M) {
    cout << 0 << endl;
    return;
  }

  vi dist(M-1);
  rep(i,M-1) dist[i] = arr[i+1] - arr[i];

  sort(rall(dist));

  int ans = arr.back() - arr.front();
  rep(i,N-1) ans -= dist[i];

  cout << ans << endl;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}


Measured memory_bytes: 1024
// 200220.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    string S;
    cin >> S;

    int count = 0;
    int index = 0;
    for (int i = 1; i < 4; i++) {
        if (S[i] == S[0]) {
            count++;
            if (count == 1) {
                index = i;
            }
        }
    }
    
    if (count == 1 && index == 1) {
        if (S[2] == S[3]) {
            cout << "Yes" << endl;
            return 0;
        }
        else {
            cout << "No" << endl;
            return 0;
        }
    } else if (count == 1 && index == 2) {
        if (S[1] == S[3]) {
            cout << "Yes" << endl;
            return 0;
        }
        else {
            cout << "No" << endl;
            return 0;
        }
    } else if (index == 3) {
        if (S[1] == S[2]) {
            cout << "Yes" << endl;
            return 0;
        }
        else {
            cout << "No" << endl;
            return  0;
        }
    } else {
        cout << "No" << endl;
    }
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

int main(){
    string s;
    cin>>s;
    for(int i=1; i<s.size(); i++){
        if(s[i]==s[i-1]){
            cout<<"Bad"<<endl;
            return 0;
        }
    }
    cout<<"Good"<<endl;

    return 0;
}

Measured memory_bytes: 256
(let* ((n (read))
       (m (read))
       (lst (sort (loop :repeat n :collect (cons (read) (read))) #'< :key #'car))
       (a 0))
  (loop :for k :in lst :do(cond ((= m 0) nil)
                                ((<= 0 (- m (cdr k))) (incf a (* (car k) (cdr k))) (decf m (cdr k)))
                                (t (incf a (* m (car k))) (setf m 0))))
  (princ a))

Measured memory_bytes: 61796
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 998244353
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using o_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define M 1000010



int main(){
	IOS;
	ll a,b,c;cin>>a>>b>>c;
	cout<<min(a+b,min(b+c,c+a));
	
	return 0;
}



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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> vec(N, 0);

    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        vec.at(a - 1) += 1;
        vec.at(b - 1) += 1;
    }

    for (int i = 0; i < N; i++) {
        cout << vec.at(i) << endl;
    }
}

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

int main(){
  int X;
  cin>>X;
  set<int> power;
  power.insert(1);
  for(int i=2;i<40;i++){
    int j=i*i;
    while(j<=X){
      power.insert(j);
      j*=i;
    }
  }
  /*
  for(auto x:power){
    cout<<x<<" ";
  }
  cout<<endl;
  */
  while(power.count(X)==0){
    X--;
  }
  cout<<X<<endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int n_itens, capacidade;

long long valores[101][3];

long long inventario[100001][101];

int main(){
    cin >> n_itens >> capacidade;

    for(int i = 1; i <= n_itens; i++){
        cin >> valores[i][1];
        cin >> valores[i][2];
    }

    for(int i = 1; i <= capacidade; i++){
        for(int j = 1; j <= n_itens; j++){
            inventario[i][j] = 0;
        }
    }

    for(int i = 1; i <= n_itens; i++){
        for(int j = 1; j <= capacidade; j++){
            long long custoAnterior = inventario[j][i - 1];

            long long custoItem = 0;

            if(j - valores[i][1] >= 0){
                 custoItem = valores[i][2] + inventario[j - valores[i][1]][i - 1];
            }

            long long maximo = max(custoAnterior, custoItem);

            inventario[j][i] = maximo;
        }
    }

    cout << inventario[capacidade][n_itens] << endl;

    return 0;
}

Measured memory_bytes: 79104
from sys import stdin
import numpy as np
# import math
# import random
# import fractions
# import sys
# sys.setrecursionlimit(100000)
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = stdin.readline().rstrip().split()[0]

N, K = [int(x) for x in stdin.readline().rstrip().split()]

prob = [-1]*200003
def f(n):
  if prob[n]!=-1:
    return prob[n]
  if n>=K:
    prob[n] = 1.0
    return 1.0
  
  prob[n] = f(2*n)/2.0
  return prob[n]
for i in range(N, 0, -1):
  f(i)
ans = sum(prob[1:N+1])/N
print(ans)
  

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

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define ph push
#define f first
#define s second
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ((ll)x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define btinpct(x) __builtin_popcountll((x))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return (rng() % (y+1-x)) + x; } //inclusivesss
string to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?b:gcd(b%a,a); }

#define ll long long int 
#define ld long double
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >= (ll)(ee); --ii)
typedef pair <ll, ll> pi; typedef pair <ll, pi> spi; typedef pair <pi, pi> dpi;

#define LLINF ((long long) 1e18)//1234567890987654321
#define INF 1234567890ll
// #define cerr if(0)cout
#define MAXN (200006)
string S;
ll fw[MAXN];
void update(ll x,ll nval) {
	for(;x<MAXN;x+=x&(-x)) fw[x]+=nval;
}
ll sum(ll x) {
	ll res=0; for(;x;x-=x&(-x)) res+=fw[x]; return res;
}
ll sum(ll a,ll b) { return sum(b)-sum(a-1); }
int main()
{
	FAST
	cin>>S;
	vector<int> co(26, 0);
	for(auto i:S) co[i-'a'] ++;
	ll odd=0;
	for(int i=0;i<26;++i) odd += (co[i]&1);
	if(odd > (siz(S)&1)) { cout<<"-1\n"; return 0; }
	ll half=siz(S)/2;
	ll ans=0;
	vector<vector<int>> pos(26, vector<int>());
	FOR(i,0,siz(S)-1) {
		pos[S[i]-'a'].pb(i);
	}
	if(odd) {
		int letter=-1; FOR(i,0,25) if(co[i]&1) letter=i;
		ll place=pos[letter][siz(pos[letter])/2];
		FOR(i,0,25) FOR(j,0,siz(pos[i])/2-1) {
			if(pos[i][j] > place || pos[i][siz(pos[i])-1-j] < place) ++ ans;
		}
	}
	vector<pi> v;
	FOR(i,0,25) {
		FOR(j,0,((int)pos[i].size()/2)-1) {
			v.eb(pos[i][j], pos[i][siz(pos[i])-1-j]);
		}
	}
	sort(all(v));
	for(auto i:v) {
		ans += 2*sum(i.f) + sum(i.f+1, i.s+1);
		update(i.s+1, 1);
	}
	cout<<ans<<'\n';
}


Measured memory_bytes: 4744
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n; i >= 0; --i)
#define FOR(i, n, m) for (int i = m; i < n; i++)
#define MM(i, n, m) for (int i = m; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

typedef long long ll;
/**
 * C問以降は ll を使う.
 * double型にするのを忘れない.
 * nC2の求め方 (1/2)*n*(n-1)
 * vector<型> 変数名(要素数, 初期値)
*/
int main()
{
  int N;
  cin >> N;
  vector<ll> A(N);
  REP(i, N)
  {
    cin >> A.at(i);
  }

  int cnt = 0;

  while (1)
  {
    bool flag = true;
    REP(i, N)
    {
      if (A.at(i) % 2 == 1)
      {
        flag = false;
      }
      else
      {
        A.at(i) /= 2;
      }
    }
    if (!flag)
      break;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
ans = []

N = I()
A = LI()
dp = [0]*N

for i in range(N-1,-1,-1):
    judge = int(0)
    if A[i]==1:
        judge +=1
    k = int(i + 1)
    while k < N:
        k += (i+1)
        if k<N+1 and dp[k - 1] == 1:
            judge += 1
#    if judge%2 != A[i]:
#        print("-1")
#        print(judge,i)
#        exit()
#    else:
    dp[i] = judge%2

#print(dp)
print(sum(dp))
for i in range(N):
    if dp[i]==1:
        ans.append(i+1)

print(" ".join(map(str,ans)))




Measured memory_bytes: 19868
#include<bits/stdc++.h>
using namespace std;
int main() {
  int N; cin >> N;
  vector<int> X(N), Y(N);
  vector<char> D(N);
  map<char, char> nd;
  nd['U'] = 'R';
  nd['R'] = 'D';
  nd['D'] = 'L';
  nd['L'] = 'U';
  constexpr int MAX = 200000;
  for (int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i] >> D[i];
  }
  auto f = [&]() {
    for (int i = 0; i < N; i++) {
      int t = X[i];
      X[i] = Y[i];
      Y[i] = MAX-t;
      D[i] = nd[D[i]];
    }
  };
  int res = 1e9;
  for (int cnt = 0; cnt < 4; cnt++, f()) {
    vector<vector<pair<int, int>>> y(MAX+1);
    for (int i = 0; i < N; i++) {
      if (D[i] == 'U') y[X[i]].emplace_back(Y[i], -1);
      else if (D[i] == 'D') y[X[i]].emplace_back(Y[i], 1);
    }
    for (int i = 0; i <= MAX; i++) {
      sort(y[i].begin(), y[i].end());
      for (int j = 1; j < y[i].size(); j++) {
        auto [a, b] = y[i][j-1];
        auto [c, d] = y[i][j];
        if (b != -1 || d != 1) continue;
        res = min(res, (c - a) * 5);
      }
    }
    y.clear(); y.resize(MAX*2+1);
    for (int i = 0; i < N; i++) {
      if (D[i] == 'U') y[X[i] + Y[i]].emplace_back(Y[i], -1);
      else if (D[i] == 'R') y[X[i] + Y[i]].emplace_back(Y[i], 1);
    }
    for (int i = 0; i <= MAX*2; i++) {
      sort(y[i].begin(), y[i].end());
      for (int j = 1; j < y[i].size(); j++) {
        auto [a, b] = y[i][j-1];
        auto [c, d] = y[i][j];
        if (b != -1 || d != 1) continue;
        res = min(res, (c - a) * 10);
      }
    }
  }
  if (res == 1e9) cout << "SAFE" << endl;
  else cout << res << endl;
}


Measured memory_bytes: 25952
#include<iostream>

using namespace std;

typedef long long ll;

ll keta(ll n){
  ll count = 0;
  while(n>0){
    n /= 10;
    count++;
  }
  return count;
}

int main(){
  ll N;
  ll i;
  cin >> N;
  ll min = 11111111111111;
  for(i=1;i*i<=N;i++)
    if(N%i==0 && keta(N/i) < min) min = keta(N/i);
  cout << min << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int D = sc.nextInt();
    sc.close();

    double r = (double) N / (2 * D + 1);

    int res = (int) Math.ceil(r);

    System.out.println(res);

  }
  
}

Measured memory_bytes: 21844