akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
 
typedef long long lint;
typedef long double louble;
template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return b<a?a:b;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}
 
namespace ae86
{
	const int bufl = 1<<15;
	
	char buf[bufl],*s=buf,*t=buf;
	
	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}
 
	inline int ty()
	{
		int a=0,b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;
 
const int _ = 407 , __ = 100007;
 
int n,m,tar[__][2]={0},faint[__]={0};
bitset<_> got[_]={0};
 
int main()
{
	n=ty(),m=ty();
	for(int i=1;i<=m;i++)tar[i][0]=ty(),tar[i][1]=ty();
	for(int i=1;i<=n;i++)
	{
		got[i][i]=1;
		for(int j=m;j>=1;j--)
		{
			if(got[i][tar[j][0]] && got[i][tar[j][1]]){faint[i]=1;break;}
			else if(got[i][tar[j][0]] || got[i][tar[j][1]])
				got[i][tar[j][0]]=got[i][tar[j][1]]=1;
		}
	}
 
	int ans=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			if(!faint[i] && !faint[j] && !(got[i]&got[j]).any())ans++;
 
	printf("%d\n",ans);
 
	return 0;
}

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

void fnInput(int64_t& rnNumber)
{
  cin >> rnNumber;
}

int64_t fnMinStepGet(int64_t nNumber)
{
  int nSqrtInt = sqrt(nNumber);
  int nMultpler;
  int64_t nMultplcand;

  for (int n = 1; n <= nSqrtInt; n++)
    if (nNumber % n == 0)
    {
      nMultpler = n;
      nMultplcand = nNumber / n;
    }

  return (nMultplcand + nMultpler - 2);
}

int main()
{
  int64_t nNumber;

  fnInput(nNumber);
  cout << fnMinStepGet(nNumber) << endl;

  return 0;
}

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

 
void LCS(char *high,char *width){
  int k=0,l=0,i,j;
    int c[MAX][MAX];
    


    k = strlen(high);
    l = strlen(width);

    /*なぜか答えが合わないので追加*/
    k=k+1;
    l=l+1;


    for(i = 0;i < k;i++){

 c[i][0] = 0;
    }

    for(j = 0;j < l; j++){

 c[0][j] = 0;
    } 
    for(i = 1;i <= k-1; i++)
    {
        for(j = 1;j < l; j++) 
        {
            if (high[i-1] == width[j-1]) c[i][j] = c[i-1][j-1] +1;
           
	    else if (c[i-1][j] >= c[i][j-1]) c[i][j] = c[i-1][j];
            
	    else c[i][j] = c[i][j-1];
          
        }
    }
    printf("%d\n",c[i-1][j-1]);
}

int main()
{
    char A[MAX],B[MAX];
    int n=0,i;
    

    scanf("%d",&n);
    

    for(i = 0;i < n; i++) 
    {
        scanf("%s",A);
        scanf("%s",B);
        LCS(A,B);
    }
    return 0;
}

Measured memory_bytes: 4524
#include<bits/stdc++.h>
using namespace std;
int main(){
  int k,s;
  cin >> k>>s;
  int ans = 0;
  int i,j;
  for(i=0;i<=k;i++){
    for(j=0;j<=k;j++){
      if(s-i-j<=k&&s-i-j>=0)ans++;
    }
  }
  cout << ans << endl;
}


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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

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

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"; return os;}
template<class T,size_t n> ostream& operator<<(ostream &os, const array<T,n> &t) {os<<"{"; rep(i,n) {os<<t[i]<<",";} os<<"}"; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

const ll INF = 1e9+7;


int main(){
	ios_base::sync_with_stdio(false);
	int A, B, C, D, ans=0;

	cin >> A >> B >> C >> D;

	cout << ((A-1)/D >= (C-1)/B ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 3604
n = int(input())

heights = list(map(int, input().split()))

values = dict()

count = 0
for i, h in enumerate(heights):
    left = i + h
    if left in values:
        values[left].append((i, h))
    else:
        values[left] = [(i, h)]

    r = i - h
    if r in values:
        count += len(values[r])


print(count)

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

int main(){

    int q;
    cin >> q;
    multimap<string, int> mp;
    for(int i = 0; i < q; ++i){
        int com;
        string key;
        cin >> com;
        if(com != 3){
            cin >> key;
        } 

        if(com == 0){
            int x;
            cin >> x;
            mp.emplace(key, x);
        }
        else if(com == 1){
            auto p = mp.equal_range(key);
            for (auto it = p.first; it != p.second; ++it) {
                cout << it->second << endl;
            }
        }
        else if(com == 2){
            mp.erase(key);
        }
        else{
            string L, R;
            cin >> L >> R;
            auto l = mp.lower_bound(L);
            auto r = mp.upper_bound(R);
            for(auto it = l; it != r; ++it){
                cout << it->first << " " << it->second << endl;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 24924
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		if (s.charAt(2) == s.charAt(3) && s.charAt(4) == s.charAt(5)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
}

Measured memory_bytes: 35428
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String[] Str = new String[2];
		Str[0] = sc.nextLine();
		Str[1] = sc.nextLine();
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for(int i=0; i < Str[0].length()-1; i++){
			sb.append(Str[0].charAt(i));
			sb.append(Str[1].charAt(i));
		}
		sb.append(Str[0].charAt((Str[0].length()-1)));
		if(Str[0].length() == Str[1].length()){
			sb.append(Str[1].charAt((Str[1].length()-1)));
		}
		System.out.println(sb.toString());
	}

}


Measured memory_bytes: 21844
// AtCoder165 C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
#include <ctype.h>

// qsortで用いる比較用関数．*a<*bならaが先になる．
int compare(const void* a, const void* b) {
    return *(int*)a - *(int*)b;
}

int revcompare(const void* a, const void* b) {
    return *(int*)b- *(int*)a;
}

double dmax(double x, double y){
    if(x < y) return y;
    return x;
}

int main() {
    int i,j;
    int n;
    int x;
    int* a;

    scanf("%d %d", &n, &x);
    a = (int*)malloc(sizeof(int) * n);

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

    qsort(a, n, sizeof(int), compare);
    int cnt = 0;
    int distributed = 0;
    for(i = 0;i < n; i++){
        distributed += a[i];
        if(distributed > x) break;
        cnt++;
    }

    if(distributed < x) cnt--;
    printf("%d", cnt);
    return 0;

}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, k;
  bool flg = true;
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  cin >> e;
  cin >> k;
  if (k < e-a || k < e-b || k < e-c || k < e-d) flg = false;
  
  if (!flg) cout << ":(" << endl;
  else cout << "Yay!" << endl;
}


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

int main(){
  string S,T;
  long a=0;
  
  cin >> S >> T;
  
  for(int i = 0; i < S.size(); i++){
    if(S.at(i)!=T.at(i)){
      a++;
    }
  }
 

  
  cout << a << endl;
  

}

Measured memory_bytes: 3836
#include<bits/stdc++.h>
#include<boost/dynamic_bitset.hpp>
using namespace std;
using u64 = uint32_t;
using s64 = int32_t;

u64 f(const u64 x) {
    return (x == 0) ? 0 : f(x % __builtin_popcount(x)) + 1;
}

// A = B * C <-> A % N = (B % N) * (C % N) % N 
// A = B + C <-> A % N = (B % N) + (C % N) % N

int main(void) {
    u64 N;
    cin >> N;

    boost::dynamic_bitset<> X;
    //string X;
    cin >> X;
    
    // pre cal
    u64 bcnt = X.count();
    u64 bcnt_p = bcnt + 1;
    u64 bcnt_m = (bcnt > 1) ? bcnt - 1 : 1;
    vector<u64> mod_p(N, 1);
    vector<u64> mod_m(N, 1);

    mod_p[0] = 1 % bcnt_p;
    mod_m[0] = 1 % bcnt_m;
    for(u64 i=1; i<N; i++) {
        mod_p[i] = mod_p[i-1] * 2 % bcnt_p;
        mod_m[i] = mod_m[i-1] * 2 % bcnt_m;
    }

    u64 pre_ans_p = 0;
    u64 pre_ans_m = 0;
    for(u64 i=0; i<N; i++) {
        if(X[i]) {
            pre_ans_p = (pre_ans_p + mod_p[i]) % bcnt_p;
            pre_ans_m = (pre_ans_m + mod_m[i]) % bcnt_m;
        }
    }

    for(s64 i=N-1; i>=0; i--) {
        X.flip(i);

        // all 0
        if(X.none()) {
            cout << 0 << endl;
            X.flip(i);
            continue;
        }

        // firstly
        u64 val;
        if(X[i]) {
            val = (pre_ans_p + mod_p[i]) % bcnt_p;
        } else {
            val = (pre_ans_m >= mod_m[i]) ? (pre_ans_m - mod_m[i]) % bcnt_m : (pre_ans_m + bcnt_m - mod_m[i]);;
        }
        X.flip(i);

        // secondly
        u64 ans = f(val) + 1;
        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 4784
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;
int N;
string X;
int rem0[200000]; // sum-1
int rem1[200000]; // sum+1

int calc(int n){
    if(n == 0) return 0;
    int sum = 0;
    for(int i = 0; i < 20; i++){
        int m = 1<<i;
        if(n&m) sum++;
    }
    return calc(n%sum)+1;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N >> X;
    int sum = 0;
    for(int i = 0; i < N; i++){
        if(X[i] == '1') sum++;
    }
    ll rem_sum0 = 0;
    if(sum > 1){
        rem0[0] = 1;
        if(X[N-1] == '1') rem_sum0 += 1;
        for(int i = 1; i < N; i++){
            rem0[i] = (rem0[i-1]*2)%(sum-1);
            if(X[N-i-1] == '1'){
                rem_sum0 += rem0[i];
                rem_sum0 %= (sum-1);
            }
        }
    }
    rem1[0] = 1;
    ll rem_sum1 = 0;
    if(X[N-1] == '1') rem_sum1 = 1;
    for(int i = 1; i < N; i++){
        rem1[i] = (rem1[i-1]*2)%(sum+1);
        if(X[N-i-1] == '1'){
            rem_sum1 += rem1[i];
            rem_sum1 %= (sum+1);
        }
    }

    for(int i = 0; i < N; i++){
        if(X[i] == '1'){
            // -1
            if(sum == 1) {
                cout << 0 << endl;
                continue;
            }
            ll tmp = (rem_sum0 - rem0[N-i-1] + sum-1)%(sum-1);
            cout << calc(tmp)+1 << endl;
        }else{
            // +1
            ll tmp = (rem_sum1 + rem1[N-i-1])%(sum+1);
            // cout << rem_sum1 << ' ' << rem1[N-i-1] << ' ' << tmp << ' ' << calc(tmp)+1 << endl;
            cout << calc(tmp)+1 << endl;

        }
    }
}

Measured memory_bytes: 5288
#include <bits/stdc++.h>
#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 SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
#define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 1000000007;
// const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;


int n, m, k;



signed main(){
    ios::sync_with_stdio(0);
    cin >> n >>  m >>  k;

    for(int a = 0;a < n+1;a++){
        for(int b = 0;b < m+1;b++){
            if(a*m+b*n-2*a*b == k){
                cout<< "Yes\n";
                return 0;
            }
        }
    }
    cout<< "No\n";

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
#define vll vector<long long>
#define mll map<long long,long long>
#define pb push_back
typedef  long long ll;
typedef long double ld;
long double pi=3.14159265358979323846;

vll al[500005];
ll vis[500005],color[500005],I[101][101];

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

bool isPrime(int n)
{
    if (n<=1) return false; 
    if (n<=3) return true; 
    if (n%2==0||n%3==0) return false; 
    for (int i=5;i*i<=n;i=i+6) if (n%i==0||n%(i+2)==0) return false; 
    return true; 
}

ll bpow(ll n, ll po)
{
	ll res=1;
	while(po>0)
	{
		if(po%2)
		{
			res*=n;
			po--;
		}
		else
		{
			n*=n;
			po/=2;
		}
	}
	return res;
}

ll binpow(ll n, ll po, ll mod)
{
	ll res=1;
	while(po>0)
	{
		if(po%2)
		{
			res=(res*n)%mod;
			po--;
		}
		else
		{
			n=(n*n)%mod;
			po/=2;
		}
	}
	return res;
}

ll swap(ll a, ll b)
{
	a=a+b;
	b=a-b;
	a=a-b;
}

ll fact(ll n) { 
   if ((n==0)||(n==1))
      return 1;
   else
      return n*fact(n-1);
}

ll C(ll n, ll r) {
    if(r > n - r) r = n - r; 
    ll ans = 1;
    ll i;

    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
        ans=ans%1000000007;
    }

    return ans;
}

//bool bipartite_dfs(ll node, ll flag)
//{
//	vis[node]=1;
//	ll cflag=flag;
//	color[node]=cflag;
//	for(ll child : al[node])
//	{
//		if(!vis[child])
//		{
//			bool n=bipartite_dfs(child,1-cflag);
//			if(n==false) return false;
//		}
//		else if(color[child]==color[node]) return false;
//	}
//	return true;
//}

void mmul(ll A[][101], ll B[][101], ll dim)
{
	ll res[dim][dim];
	for(ll i=0;i<dim;i++) for(ll j=0;j<dim;j++)
	{
		res[i][j]=0;
		for(ll k=0;k<dim;k++) res[i][j]=(res[i][j]+A[i][k]*B[k][j])%1000000007;
	}
	for(ll i=0;i<dim;i++) for(ll j=0;j<dim;j++) A[i][j]=res[i][j];
}

void mpow(ll A[][101],ll dim, ll po)
{
	for(ll i=0;i<dim;i++) for(ll j=0;j<dim;j++)
	{
		if(i==j) I[i][j]=1;
		else I[i][j]=0;
	}
	while(po>0)
	{
		if(po%2==1)
		{
			mmul(I,A,dim);
			po--;
		}
		else
		{
			mmul(A,A,dim);
			po/=2;
		}
	}
	for(ll i=0;i<dim;i++) for(ll j=0;j<dim;j++) A[i][j]=I[i][j];
}

ll ans[500005],h[500005];

void dfs(ll node)
{
	ll flag=0;
	for(ll child : al[node])
	{
		if(h[child]>=h[node]) flag=1;
	}
	if(flag==0) ans[node]=1;
}


int main()
{
	ll n,m,a,b;
	cin>>n>>m;
	for(ll i=1;i<=n;i++) cin>>h[i];
	for(ll i=0;i<m;i++)
	{
		cin>>a>>b;
		al[a].pb(b);
		al[b].pb(a);
	}
	for(ll i=1;i<=n;i++)
	{
		dfs(i);
	}
	ll an=0;
	for(ll i=1;i<=n;i++)
	{
		if(ans[i]==1) an++;
	}
	cout<<an;
}


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

int main(){
  string S;
  cin >> S;
  string ans;
  if(S[2] == S[3] && S[4] == S[5]){
    ans = "Yes";
  } else {
    ans = "No";
  }
  cout << ans << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "********************************************\n"
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL)
ll fac[2000006], ifac[2000006], n, m, k;
ll c[5003], r[5003], dp[5003];
ll pwr(ll b, ll e)
{
	ll ans = 1;
	while (e)
	{
		if (e & 1)
			ans = (ans * b) % mod;
		e >>= 1;
		b = (b * b) % mod;
	}
	return ans;
}
ll solve(ll x1, ll y1, ll x2, ll y2)
{
	ll dx = x2 - x1;
	ll dy = y2 - y1;
	ll ans = fac[dx + dy];
	ans = (ans * ifac[dx]) % mod;
	ans = (ans * ifac[dy]) % mod;
	return ans;
}
ll fun(ll num)
{
	vpll bad;
	for (int i = 0; i < k; ++i)
	{
		bad.pb(mp(r[i], c[i]));
	}
	bad.pb(mp(n, m));
	sort(bad.begin(), bad.end());
	ll sz = bad.size();
	for (int i = 0; i < sz; ++i)
	{
		ll temp = solve(1, 1, bad[i].x, bad[i].y);
		for (int j = 0; j < i; ++j)
		{
			if (bad[j].x <= bad[i].x && bad[j].y <= bad[i].y)
				temp = (temp - (dp[j] * solve(bad[j].x, bad[j].y, bad[i].x, bad[i].y)) % mod + mod) % mod;
		}
		dp[i] = temp;
	}
	return dp[sz - 1];
 
}
int main(int argc, char const *argv[])
{
	fast;
	fac[0] = ifac[0] = 1;
	for (ll i = 1; i <= 2000000; ++i)
	{
		fac[i] = (i * fac[i - 1]) % mod;
		ifac[i] = (pwr(i, mod - 2) * ifac[i - 1]) % mod;
	}
	cin >> n >> m >> k;
	for (int i = 0; i < k; ++i)
	{
		cin >> r[i] >> c[i];
	}
	ll nop1 = fun(1);
	cout << nop1;
	return 0;
}

Measured memory_bytes: 31744
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
//#define at(x,i) get<i>(x);//
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll h,w;cin >> h >>w;
    ll d;cin >> d;
    vl y(h*w),x(h*w);
    rep(i,h){
        rep(j,w){
            ll a;cin >> a;a--;
            y[a]=i+1;x[a]=j+1;
        }
    }
    vvl cus(d);
    rep(i,d){
        ll k=(w*h-i-1)/d+1;
        cus[i].pb(0);
        rep(j,k-1){
            ll tmp=abs(y[(j+1)*d+i]-y[j*d+i]);
            tmp+=abs(x[(j+1)*d+i]-x[j*d+i]);
            cus[i].pb(tmp);
        }
        //rep(j,k)cout << cus[i][j] <<" ";
        //cout <<endl;
        rep(j,k-1){
            cus[i][j+1]+=cus[i][j];
        }
    }
    /*rep(i,d){
        for(auto p:cus[i])cout << p <<" ";
        cout <<endl;
    }*/
    ll q;cin >> q;
    rep(i,q){
        ll a,b;cin >>a >>b;a--;b--;
        ll k=a%d;
        a/=d;b/=d;
        //cout << k << " " <<a <<" " <<b <<endl;
        //cout << cus[k][b] <<" " <<cus[k][a] <<endl;
        cout << cus[k][b]-cus[k][a] <<endl;
    }
}

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

struct Card {char suit, value;};

void bubble(struct Card A[], int N) {
    for (int i=0; i<N; i++) {
        for (int j=N-1; j>=i; j--) {
            if (A[j].value < A[j-1].value) {
                Card t = A[j];
                A[j] = A[j-1];
                A[j-1] = t;
            }
        }
    }
}

void selection(struct Card A[], int N) {
    for (int i=0; i<N; i++) {
        int minj = i;
        for (int j=i; j<N; j++){
            if (A[j].value < A[minj].value) {
                minj = j;
            }
        }
        Card t = A[i];
        A[i] = A[minj];
        A[minj] = t;
    }
}

void print(struct Card A[], int N) {
    for (int i=0; i<N; i++){
        if (i>0) {
            cout << " ";
        }
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

// バブルソートと選択ソートの比較
bool isStable (struct Card C1[], struct Card C2[], int N ) {
    for (int i=0; i<N; i++) {
        if (C1[i].suit != C2[i].suit) {
            return false;
        }
    }
    return true;
}

int main(){
    Card C1[100], C2[100];
    int N;
    cin >> N;
    for (int i=0; i<N; i++) {
        cin >> C1[i].suit >> C1[i].value;
        C2[i] = C1[i];
    }
    
    bubble(C1, N);
    selection(C2, N);
    
    print(C1, N);
    cout << "Stable" << endl;
    
    print(C2, N);
    if (isStable(C1, C2, N)) {
        cout << "Stable" <<endl;
    }
    else  {
        cout << "Not stable" << endl;
    }
}


Measured memory_bytes: 3096
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl
#define OUT2(A, B) cout << "(" << #A << ", " << #B << ") = (" << (A) << ", "<< (B) << ")" << endl
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(ALL(c), (e)) != (c).end())



void init() {

}

void input() {

}

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int res = 100000;
  chmin(res, a+b);
  chmin(res, b+c);
  chmin(res, c+a);
  cout << res << endl;
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void sb()
{	
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}


int main()
{
	//sb();
	int h,w;
	cin>>h>>w;
	vector<string> v;
	for(int i=0;i<h;i++){
		string s;
		cin>>s;
		v.push_back(s);
	}
	vector< vector<int> > dp(h,vector<int>(w,0));
	dp[0][0] = (v[0][0]=='.');
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(v[i][j] == '.'){
			if(i>0)
				dp[i][j] = (dp[i-1][j]%mod+ dp[i][j]%mod)%mod;
			if(j>0)
				dp[i][j] = (dp[i][j-1]%mod+ dp[i][j]%mod)%mod;
		}
		//cout<<dp[i][j]<<" ";
		}
		//cout<<endl;
	}
	cout<<dp[h-1][w-1];

	
	
}

Measured memory_bytes: 5248
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <cmath>
#include <cstring>

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int N;
int xs[51];
int ys[51];

const int INF = 1<<29;
typedef pair<int, int> P;
set<P> pts;

int count(int p, int q) {
    int res = 0;
    rep(i, N) {
        int x = xs[i], y = ys[i];
        if (pts.find(make_pair(x - p, y - q)) == pts.end()) {
            res ++;
        }
    }
    return res;
}

int main() {
    cin >> N;
    rep(i, N) {
        cin >> xs[i] >> ys[i];
        pts.insert(make_pair(xs[i], ys[i]));
    }
    int ans = count(1, 0);
    rep(i, N) {
        rep(j, N) {
            if (i == j) continue;
            int p = xs[j] - xs[i];
            int q = ys[j] - ys[i];
            ans = min(ans, count(p, q));
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
    string S;
    cin >> S;
    int sizeS = 0, mem = 0;

    for (int i = 0; i < S.length() + 1; ++i)
    {
        if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T')
        {
            sizeS++;
            continue;
        }
        if (mem < sizeS)
            mem = sizeS;
        sizeS = 0;
    }
    cout << mem << endl;
}

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

#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")

#define endl        '\n'
#define ll          long long
#define pb          push_back
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define rs(v,n)     v.resize(n)
#define hell        1000000007
#define peak        9123372036854775807
#define pii         acos(-1)
#define clr(a,x)    memset(a,x,sizeof(a))
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

namespace InOp{
template<class x,class y>
istream &operator>>(istream &in,pair<x,y> &p) 
{ 
    in>>p.F>>p.S;
    return in;
}
template<class x>
istream &operator>>(istream &in,vector<x> &v) 
{
    for(auto& i:v)
        in>>i;
    return in;
}
template<class x,class y>
ostream &operator<<(ostream &out,pair<x,y> &p) 
{ 
    out<<"("<<p.F<<","<<p.S<<") ";
    return out; 
}
template<class x>
ostream &operator<<(ostream &out,vector<x> &v) 
{ 
    out<<v.size()<<endl;
    for(auto i:v)
        out<<i<<" ";
    out<<endl;
    return out; 
}
}
using namespace InOp;

namespace ModOp{
template<class x,class y,class z> z add(x a,y b,z m){return (a+b)%m;}
template<class x,class y,class z> z sub(x a,y b,z m){return (a-b+m)%m;}
template<class x,class y,class z> z mul(x a,y b,z m){return ((ll)a*b)%m;}
template<class y,class z> z expo(ll b,y e,z m){ll a=1;b%=m;while(e!=0){if((e&1)==1){a=a*b;a=a%m;}b=b*b;b%=m;e>>=1;}return a%m;}
template<class x,class z> z inv(x b,z m){return expo(b,m-2,m);}
template<class x,class y> x invGeneral(x a,y b){if(a==0)return b==1?0:-1;x m=invGeneral(b%a,a);return m==-1?-1:((1-(ll)b*m)/a+b)%b;}
template<class x,class y,class z> z div(x a,y b,z m){ll c=inv(b,m);return mul(a,c,m);}
}
using namespace ModOp;

namespace Debug{
template<class x> void deb(x a){cerr<<"a"<<": "<<a<<endl;}
template<class x,class y> void deb(x a,y b){cerr<<"a"<<": "<<a<<" | "<<"b"<<": "<<b<<endl;}
template<class x,class y,class z> void deb(x a,y b,z c){cerr<<"a"<<": "<<a<<" | "<<"b"<<": "<<b<<" | "<<"c"<<": "<<c<<endl;}
template<class x,class y,class z,class xy> void deb(x a,y b,z c,xy d){cerr<<"a"<<": "<<a<<" | "<<"b"<<": "<<b<<" | "<<"c"<<": "<<c<<" | "<<"d"<<": "<<d<<endl;}
}
using namespace Debug;

#define N  1000005

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll tt=1;
    // cin>>tt;
    while(tt--)
    {
        ll i,j,k,l,r,x,y,m,n;
        cin>>n;
        vi v(n+1,0);
        for(i=1;i<=n;i++)
        {
            for(j=i;j<=n;j+=i)v[j]++;
        }
        ll ans=0;
        for(i=1;i<=n-1;i++)ans+=v[i];
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 11120
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int n;
    cin >> n;
    vector<P> c(n);
    rep(i,n) cin >> c[i].first >> c[i].second;
    set<P> st;
    rep(i,n) st.insert(c[i]);
    if (n == 1){
        cout << 1 << endl;
        return 0;
    }
    int ans = n;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if (i == j) continue;
            int p = c[j].first - c[i].first;
            int q = c[j].second - c[i].second;
            int sum = n;
            for(int k = 0; k < n; k++){
                P point = make_pair(c[k].first - p, c[k].second - q);
                if (st.find(point) != st.end()) sum--;
            }
            ans = min(ans, sum);
        }
    }
    cout << ans << endl;
    return 0;
}

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

bool isseries(string S, int n, int l, int u) {
	for (int i = l; i < u; ++i) {
		if (S[i - 1] == '#') {
			for (int j = 1; j < n;++j) {
				if ((i - j - 1 > l) && (S[i - 1 - j] == '#')) return true;
			}
		}
	}
	return false;
}

bool issparse(string S, int n, int l, int u) {
	for (;l <= u; ++l) {
		if ((S[l - 1] != '#') && (S[l - 1 + 1] != '#') && (S[l - 1 - 1] != '#')) return true;
	}
	return false;
}

int No() {
	cout << "No";
	return 0;
}

signed main() {
	int N, A, B, C, D;
	string S;
	cin >> N >> A >> B >> C >> D;
	cin >> S;

	if (isseries(S, 2, min(A, B), max(C, D))) return No();
	if ((A < B) && (C > D)) {
		if (!issparse(S, 3, B, D)) return No();
	}
	if ((A > B) && (C < D)) {
		if (!issparse(S, 3, A, C)) return No();
	}
	cout << "Yes";
	return 0;
}


Measured memory_bytes: 772
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;
//_|
ull gcd(ull x,ull y){
	ull t;
	while(y!=0){
		t=x%y;x=y;y=t;
	}
	return x;
}
ull lcm(ull a, ull b) {
  return a  / gcd(a, b)* b;
}

ull nlcm(vector<ull> numbers) {
	ull L;
	L = numbers[0];
	for (ull i = 1; i < numbers.size(); i++) {
		L = lcm(L, numbers[i]);
//		cout<<L<<endl;
	}
	return L;
}

int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
	
	ull i,n;
	cin>>n;
	vector<ull> a(n,0);
	rep(i,n)cin>>a[i];
	cout<<nlcm(a)<<endl;
	
	
	
//////////////////////////////////////////////////////
return 0;}











Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#include <sstream>
#include <bitset>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
ll poww(ll a, ll b) { if (a == 0ll) {return 0ll;} ll ans = 1; while (b) {if (b & 1) {ans = ans * a ;} a = a * a ; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
pll a[maxn];
int n;
bool cmp(pll aa, pll bb)
{
	if (aa.se != bb.se)
	{
		return aa.se < bb.se;
	} else
	{
		return aa.fi > bb.fi;
	}
}
int main()
{
	//freopen("D:\\code\\text\\input.txt","r",stdin);
	//freopen("D:\\code\\text\\output.txt","w",stdout);
	n = readint();
	repd(i, 1, n)
	{
		ll x = readll();
		ll l = readll();
		a[i] = mp(x - l, x + l);
	}
	sort(a + 1, a + 1 + n, cmp);
	ll now = -1e18;
	ll ans = 0ll;
	repd(i, 1, n)
	{
		// cout << a[i].fi << " " << a[i].se << endl;
		if (a[i].fi >= now)
		{
			now = a[i].se;
			ans++;
		}
	}
	printf("%lld\n", ans );
	return 0;
}




Measured memory_bytes: 1792
(let ((n (read))
      (vs nil)
      (cs nil)
      (ans 0))
  (loop :for i :from 1 :to n
        :do (push (read) vs))
  (loop :for i :from 1 :to n
        :do (push (read) cs))
  (loop :for v :in vs
        :for c :in cs
        :if (< 0 (- v c))
        :do (incf ans (- v c)))
  (format t "~A~%" ans))


Measured memory_bytes: 24672
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String c = sc.next();
        Monmo momo = new Monmo(c);
        do{
            momo.lef();
            momo.rig();
            //System.out.println(momo.left + " " + momo.right);
        }while(momo.overlap());
        System.out.println(momo.count);
    }
}

class Monmo {
    String s;
    int left;
    int right;
    int count;
    
    Monmo(String s){
        this.s = s;
        left = -1;            //lef,rigメソッドでインクリメントするので
        right = s.length();   //初期値は左右配列の上下プラマイ１
        count=0;
    }
    
    boolean overlap(){
        if(left >= right){
            return false;
        }else{
            count++;
            return true;
        }
    }
    
    void lef(){
        int flag = 0;
        left++;
        for(int i=left;i<s.length();i++){
            char sub = s.charAt(i);
            if(sub == 'W'){
                left=i;
                flag = 1;
                break;
            }
        }
        if(flag == 0)left = s.length();
    }
    
    void rig(){
        int flag = 0;
        right--;
        for(int i=right;i>=0;i--){
            char sub = s.charAt(i);
            if(sub=='R'){
                right=i;
                flag = 1;
                break;
            }
        }
        if(flag == 0)right = 0-1;
    }
    
}



Measured memory_bytes: 40636
import java.util.*;
import java.util.Map.Entry;
import java.math.*;
import java.awt.geom.*;
import java.io.*;
      
      
public class Main {	
	static char[] tank = new char[] {'^','>','v','<'};
	static int[] vx = new int[] {0,1,0,-1};
	static int[] vy = new int[] {-1,0,1,0};
	static final int INF = 2 << 28;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int N = sc.nextInt();
			int M = sc.nextInt();
			int L = sc.nextInt();
			if(N == 0 && M == 0 && L == 0) break;
			int[] A = new int[M];
			int[] B = new int[M];
			int[] D = new int[M];
			int[] E = new int[M];
			Node[] node = new Node[N];
			for(int i = 0; i < N; i++) {
				node[i] = new Node(i+1);
			}
			for(int i = 0; i < M; i++) {
				A[i] = sc.nextInt();
				B[i] = sc.nextInt();
				D[i] = sc.nextInt();
				E[i] = sc.nextInt();
				node[A[i]-1].to.add(new Edge(node[B[i]-1],D[i],E[i]));
				node[B[i]-1].to.add(new Edge(node[A[i]-1],D[i],E[i]));
			}
			int[][] dp = new int[N][L+1];
			for(int i = 0; i < N; i++) {
				Arrays.fill(dp[i], INF);
			}
			PriorityQueue<Data> queue = new PriorityQueue<Data>();
			queue.add(new Data(node[0],0,L));
			int MIN = INF;
			while(!queue.isEmpty()) {
				Data tmp = queue.poll();
				Node now = tmp.now;
				if(dp[now.id-1][tmp.l] <= tmp.cost) continue;
				dp[now.id-1][tmp.l] = tmp.cost;
				if(now.id == N) {
					MIN = Math.min(MIN, tmp.cost);
					break;
				}
				for(int i = 0; i < now.to.size(); i++) {
					Edge next = now.to.get(i);
					queue.add(new Data(next.to,tmp.cost + next.e,tmp.l));
					if(tmp.l - next.d >= 0) {
						queue.add(new Data(next.to,tmp.cost,tmp.l - next.d));
					}
				}
			}
			System.out.println(MIN);
			
			
		}
	}
	static class Data implements Comparable<Data>{
		Node now;
		int cost;
		int l;
		Data(Node a, int b, int c) {
			now = a;
			cost = b;
			l = c;
		}
		public int compareTo(Data o) {
			return this.cost - o.cost;
		}
	}
	
	static class Node {
		int id;
		ArrayList<Edge> to = new ArrayList<Edge>();
		Node(int a) {
			id = a;
		}
	}
	static class Edge {
		Node to;
		int  d;
		int  e;
		Edge(Node a,int b, int c) {
			to = a;
			d = b;
			e = c;
		}
	}
	
 }

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

int main() {
	int tate,yoko,i;
	cin>>tate>>yoko;
		vector<string> moji(tate);
	
    for(i=0;i<tate;i++){
    	cin>>moji.at(i);
    }
    for(i=0;i<(yoko+2);i++){
    	cout<<"#";
    }
    cout<<endl;
    for(i=0;i<tate;i++){
    	cout<<"#";
    	cout<<moji.at(i);
    	cout<<"#";
    	cout<<endl;
    }
    for(i=0;i<(yoko+2);i++){
    	cout<<"#";
    }
    cout<<endl;
	return 0;
}









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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
		String str = br.readLine();
		
		int S = Integer.parseInt(str);
		
		int h,m,s;
		
		h=S/(3600);
		m=(S/60)-(h*60);
		s=S-((h*3600)+(m*60));
					
		System.out.println(h+":"+m+":"+s);
	}
		
}

Measured memory_bytes: 24332
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        int n = sc.nextInt();
        int taroScore=0;
        int hanaScore=0;
        while(sc.hasNext()){
            String taro = sc.next();
            String hana = sc.next();
            int score = taro.compareTo(hana);  
            if (score < 0)  
                hanaScore+=3;
            else if (score > 0) 
                    taroScore+=3;
                 else {  
                    hanaScore+=1;
                    taroScore+=1;}
        }
        System.out.println(taroScore +" "+ hanaScore);
    }
}


Measured memory_bytes: 30072
import java.util.*;
//import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        int i = 1, j = 1, k = 1, n, count;
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        for (n = 1; n <= N; n++) {
            count = 0;
            for (i = 1; i <= Math.sqrt(n-5*(i*i)); i++) {
                for (j = i; j <= Math.sqrt(n - (i*i + 2*j*j + 2*i*j)); j++) {
                    for (k = j; k <= Math.sqrt(n - (i*i + j*j + i*j + j*k + k*i)); k++) {
                        if (i * (i + j) + j * (j + k) + k * (k + i) == n) {
                            if (i == j && j == k) {
                                count += 1;
                            } else if (i == j || j == k || k == i) {
                                count += 3;
                            } else {
                                count += 6;
                            }
                        }
                    }
                }
            }
            System.out.println(count);
        }
    }
}

Measured memory_bytes: 39280
/*Bismillahir Rahmanir Rahim*///{
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace std; using __gnu_cxx::power;
using ll = long long; using ull = unsigned long long; using ld = long double;
const ll llinf = (1ll<<61)-1;
const double eps = 1e-6, ldeps = 1e-9;
struct Dbg {
static constexpr auto &os = cout;   // replace by cerr in interactive.
template<class C> static auto dud(C *x)->decltype(os << *x, 0);
template<class C> static char dud(...);
template<class C> typename enable_if<sizeof dud<C>(0)!=1, Dbg&>::type operator<<(const C &x) { os << x; return *this; }
template<class C> Dbg &dump(C b, C e) {
    *this << "\n[";
    int cur = 0;
    for (C i = b; i!=e and cur<26; i++, cur++) *this << ", "+2*(i==b) << *i;
    return *this << ']';
}
template<class C> typename enable_if<sizeof dud<C>(0)==1, Dbg&>::type operator<<(const C &x) {
    return dump(begin(x), end(x));
}
template<class C, size_t X> typename enable_if<!is_same<C, const char>::value, Dbg&>::type operator <<(C (&x)[X]) {
    return dump(begin(x), end(x));
}
template<class B, class C> Dbg &operator <<(const pair<B, C> &x) {
    return *this << '{' << x.first << ", " << x.second << '}';
}
Dbg &operator<<(ostream&(*x)(std::ostream&)) { os << x; return *this; }
} dbg;
void err(istringstream *iss) { delete iss; }
template<class C, class... Args> void err(istringstream *iss, const C &val, const Args &... args) {
    string name; *iss >> name; if (name.back()==',') name.pop_back();
    dbg << name << " = " << val << "; ", err(iss, args...);
}
#define bug(args...) dbg << __LINE__ << ": ", err(new istringstream(#args), args), dbg << endl
#define cbug(a, args...) if (a) bug(args);
#define ASSERT(a, o, b, args...) if (!((a)o(b))) bug(a, b, ##args), assert((a)o(b));
#define sl(a) int(strlen(a))
#define sz(a) int(a.size())
int T, Q, cn;//}
const int inf = 1000000007, mxn = 505;

int H, W, h, w;

int a[mxn][mxn];

#define yes cout << "Yes\n"
#define no cout << "No\n", exit(0)

signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(11);
// int a[10][10] =
// {
//     1000000, 0000000, 0000000, 0000000, 1000000, 0000000, 0000000, 0000000
//     0000000, 0000000, 0000000,-1000001, 0000000, 0000000, 0000000,-1000001
//     1000000, 0000000, 0000000, 0000000, 1000000, 0000000, 0000000, 0000000
// }
    cin >> H >> W >> h >> w;
    if (H%h == 0 and W%w == 0) no;
    yes;
    for (int i = 1; i <= H; i += h) {
        for (int j = 1; j <= W; j += w) {
            a[i][j] = 1000000;
        }
    }
    for (int i = h; i <= H; i += h) {
        for (int j = w; j <= W; j += w) {
            a[i][j] = -1000001;
        }
    }
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            cout << a[i][j] << " \n"[j == W];
        }
    }

#ifdef DEBUG
    for (int i = 1; i+h-1 <= H; i++) {
        for (int j = 1; j+w-1 <= W; j++) {
            ll sum = 0;
            for (int k = i; k <= i+h-1; k++) {
                for (int l = j; l <= j+w-1; l++) {
                    sum += a[k][l];
                }
            }
            ASSERT(sum, <, 0, i, j)
        }
    }
#endif
}

Measured memory_bytes: 3328
import copy
k=int(input())
ans=[[str(i+1) for i in range(9)]]
l2=[]
for i in range(9):
  l=ans[-1]
  l2=[]
  for j in range(len(l)):
    if int(l[j][-1])!=0:
      l2.append(l[j]+str(int(l[j][-1])-1))
    l2.append(l[j]+str(int(l[j][-1])))
    if int(l[j][-1])!=9:
      l2.append(l[j]+str(int(l[j][-1])+1))
  ans.append(l2)
  l=copy.copy(l2)
a=[]
for i in range(10):
  a=a+ans[i]
print(a[k-1])

Measured memory_bytes: 65500
#n桁のるんるん数のrisutoを求める
import sys

sys.setrecursionlimit(10**9)

def runrun(n):
    if n == 1:
        return [['1','2','3','4','5','6','7','8','9']]
    else:
        li = runrun(n-1)
        li2 = []
        for i in range(len(li[n-2])):
            p = int(li[n-2][i][-1])
            if p == 0:
                li2.append(li[n-2][i]+'0')
                li2.append(li[n-2][i]+'1')
            elif p == 9:
                li2.append(li[n-2][i]+str(8))
                li2.append(li[n-2][i]+'9')
            else:
                li2.append(li[n-2][i]+str(p-1))
                li2.append(li[n-2][i]+str(p))
                li2.append(li[n-2][i]+str(p+1))
        li2 =[li2]
        li.extend(li2)
        return li
    


x = int(input())
t = True
k=1
b = 0
while t:
    a = runrun(k)
    b = 0
    #k桁までに何個るんるん数があるか数えるもの
    for i in range(len(a)):
        b+=(len(a[i]))
        #k桁ということが確定したあと以下の処理を行う
    if x <= b:
        t = False
        if k == 1:
            print(x)
        else:
            tmp = runrun(k-1)
            c = 0
#まずk-1桁までのるんるん数の数を数える
            for i in range(len(tmp)):
                c += (len(tmp[i]))
            s = a[k-1][x-c-1]
            print(int(s))
    else:
        k += 1

Measured memory_bytes: 22040
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def divisions(n):
    sq = int(math.sqrt(n)+1)
    d = collections.defaultdict(int)
    while n % 2 == 0:
        n //= 2
        d[2] += 1
    i = 3
    while n > 1 and sq >= i:
        if n % i == 0:
            n //= i
            d[i] += 1
        else:
            i += 2

    if n > 1:
        d[n] += 1

    r = [1]
    for k, v in d.items():
        for c in r[:]:
            for i in range(1,v+1):
                r.append(c*(k**i))

    return sorted(r)

def main():
    n = I()
    a = LI()
    s = set()
    for i in range(n,0,-1):
        d = divisions(i)
        ld = len(d)
        for j in range(1,2**ld):
            c = []
            ff = True
            for k in range(ld):
                if j & (1<<k):
                    f = True
                    for e in c:
                        if d[k] % e == 0:
                            f = False
                            ff = False
                            break
                    if f:
                        c.append(d[k])
                if not ff:
                    break
            if ff:
                s.add(tuple(c + [n+1]))
    b = sorted(list(s), reverse=True)
    for c in b:
        t = 0
        for j in range(1,n+1):
            f = False
            for e in c:
                if j%e == 0:
                    f = True
                    break
            if f:
                t += a[j-1]
        if t < 0:
            for j in range(1,n+1):
                f = False
                for e in c:
                    if j%e == 0:
                        f = True
                        break
                if f:
                    a[j-1] = 0

    return sum(a)



print(main())




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

int main()
{
    int n, i, count=0;
    string s;
    cin >> n;
    char str[n];
    scanf("%s", str);

    for(i = 0;i < 50;i++){
        if(str[i] == 'A'){
            if(str[i+1] == 'B'){
                if(str[i+2] == 'C'){
                    count++;
                }
            }
        }
    }
    cout << count << endl;

}

Measured memory_bytes: 256