akhauriyash/Code-Regression huggingface dataset:
# D
import sys
import bisect

n = int(input())
l = list(map(int, sys.stdin.readline().strip().split()))

l. sort()
ans = 0
for i in range(len(l) - 1):
    for j in range(i + 1, len(l)):
        a = l[i]
        b = l[j]
        ab = a + b
        right = bisect.bisect_left(l, ab) - 1
        ans += (right - j)

print(ans)

Measured memory_bytes: 44892
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;

//---

template <typename T>
inline void print(const T& rhs){ std::cout<<" = "<<rhs<<std::endl; }
template <typename T>
inline void print(const std::vector<T>& rhs){
    std::cout<<" = [ ";
    for(uint i=0; i<rhs.size(); ++i){ std::cout<<rhs[i]<<' '; }
    std::cout<<"]"<<std::endl;
}
template <typename T>
inline void print(const std::vector<std::vector<T>>& rhs){
    std::cout<<" = "<<std::endl;
    std::cout<<"[[ ";
    for(uint p=0; p<rhs.size(); ++p){
        if(p!=0){ std::cout<<" [ "; }
        for(uint q=0; q<rhs[p].size(); ++q){
            std::cout<<rhs[p][q]<<' ';
        }
        if(p!=rhs.size()-1){ std::cout<<"]"<<std::endl; }
    }
    std::cout<<"]]"<<std::endl;
}
#define printn(var) {printf("%s", #var);print(var);}
#define printn_all(var) {printf("%s(%d): ", __func__, __LINE__);printf("%s", #var);print(var);}

//---

int main(){
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
    
    string S; cin >> S;
    string T; cin >> T;
    
    uint vN = 'z'-'a'+1;
    vector<pair<int, vector<int>>> vAZ_s( vN );
    vector<pair<int, vector<int>>> vAZ_t( vN );
    for(uint i=0; i<vN; ++i){ vAZ_s[i].first = -1; }
    for(uint i=0; i<vN; ++i){ vAZ_t[i].first = -1; }
    
    uint sN = S.size();
    for(uint i=0; i<sN; ++i){
        int idx = S[i]-'a';
        if(vAZ_s[idx].first==-1){ vAZ_s[idx].first = i;
        }          else         { vAZ_s[idx].second.push_back( i ); }
    }
    for(uint i=0; i<sN; ++i){
        int idx = T[i]-'a';
        if(vAZ_t[idx].first==-1){ vAZ_t[idx].first = i;
        }          else         { vAZ_t[idx].second.push_back( i ); }
    }
    sort(vAZ_s.begin(), vAZ_s.end());
    sort(vAZ_t.begin(), vAZ_t.end());
    /*
    // for dbg
    for(uint i=0; i<vN; ++i){
        printn(vAZ_s[i].first);
        printn(vAZ_s[i].second);
    }
    printf("\n");
    for(uint i=0; i<vN; ++i){
        printn(vAZ_t[i].first);
        printn(vAZ_t[i].second);
    }
    //*/
    
    for(uint i=0; i<vN; ++i){
        if(vAZ_s[i].first != vAZ_t[i].first){ cout << "No" << endl; return 0; }
        
        if(vAZ_s[i].second.size() != vAZ_t[i].second.size()){ cout << "No" << endl; return 0; }
        uint size = vAZ_s[i].second.size();
        for(uint ci=0; ci<size; ++ci){
            if(vAZ_s[i].second[ci]!=vAZ_s[i].second[ci]){ cout << "No" << endl; return 0; }
        }
    }
    cout << "Yes" << endl;
    
    return 0;
}


Measured memory_bytes: 2888
#include <bits/stdc++.h>
// #include <iostream>
// #include <vector>
// #include <map>
// #include <algorithm>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

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

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

void solve(){
    int D;
    cin >> D;

    if (D == 25) {
        cout << "Christmas" << endl;
    }else if (D == 24){
        cout << "Christmas Eve" << endl;
    }else if (D == 23){
        cout << "Christmas Eve Eve" << endl;
    }else if (D == 22){
        cout << "Christmas Eve Eve Eve" << endl;
    }

    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}


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

int x[200000];
int y[200000];
int main() {
    //ios_base::sync_with_stdio(false);
    //cout<<fixed<<setprecision(20);
    int n;
    cin>>n;
    int k=0;
    while(k*(k+1)/2<n)k++;
    if(k*(k+1)/2!=n){
        cout<<"No";
        return 0;
    }
    cout<<"Yes"<<'\n'<<k+1<<'\n';
    int beg=0;

    for(int i=1;i<=k;i++){
        y[i]=y[i-1]+(k-i);
    }
    for(int i=0;i<k+1;i++){
        cout<<k<<" ";
        for(int j=0;j<i;j++){
            cout<<y[j]+i<<" ";
        }
        for(int j=i;j<k;j++){
            cout<<y[i]+j+1<<" ";
        }
        cout<<'\n';
    }
    return 0;
}

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


class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        int a = n / 100;
        int b = (n - a*100) / 10;
        int c = (n - a*100 - b*10);
        if (a == 1) { a = 9; } else { a = 1; }
        if (b == 1) { b = 9; } else { b = 1; }
        if (c == 1) { c = 9; } else { c = 1; }


        Console.WriteLine(a*100+b*10+c);
        
       
    }


}

Measured memory_bytes: 11092
N, K = map(int, input().split())
S = input()
RL = 0
for i in range(N - 1):
    if S[i] == 'R' and S[i + 1] == 'L':
        RL += 1
egde = (S[0] == 'L') + (S[-1] == 'R')
if K >= RL:
    K -= RL
    RL = 0
    if K > 0:
        egde = max(1, egde - K)
else:
    RL -= K
print(N  - 2 * RL - egde)


Measured memory_bytes: 9228
import sys
sys.setrecursionlimit(10**6)

def main(n):
	s = input()
	a = [1] * 300
	ans = 1
	for i in s:
		a[ord(i)] += 1
	for i in a:
		ans = ans * i % 1000000007
	print(ans-1)
main(int(input()))

Measured memory_bytes: 3188
n = int(input())
s = [""]*n
t = [0]*n
for i in range(n):
    l = list(input().split())
    s[i] = l[0]
    t[i] = int(l[1])
x = input()
time_count = 0
for i in range(n):
    time_count += t[i]
    if s[i] == x:
        break
print(sum(t) - time_count)

Measured memory_bytes: 3064
list = [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]

K =  int(input())

print(list[K - 1])

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

int main(){
  int n;
  cin >> n;
  vector<int> a(9);
  for(int i=0;i<n;i++){
    int x;
    cin >> x;
    a.at(min(x/400,8))++;
  }
  
  int p=0,q=a.at(8);
  for(int i=0;i<8;i++){
    p+=(a.at(i)>0);
  }
  cout << max(p,1) << " " << p+q << endl;
}

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

int main(){
    int a,b;
    cin>>a>>b;

    int a_sup,b_sup;
    a_sup=a/0.08;
    b_sup=b/0.1;

    int m=max(a_sup,b_sup);

    bool check=false;

    for(int i=0; i<10; i++){
        if((int)((m+i)*0.08)==a && (int)((m+i)*0.1)==b){
            cout<<m+i<<endl;
            check=true;
            break;
        }
    }

    if(check==false){
        cout<<-1<<endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>

using namespace std;
#define lli long long int

lli dp[100005];

int main()
{
    int n,h[100005],i;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>h[i];
    }
    dp[0]=0;
    h[0]=0;
    for(i=1;i<=n;i++)
    {
        if(i==1)
            dp[i]=0;
        else if(i==2)
            dp[i]=abs(h[2]-h[1]);
        else
        {
            dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
        }
    }
    // for(i=1;i<=n;i++)
    //     cout<<dp[i]<<" ";
    cout<<dp[n]<<"\n";
    return 0;
}

Measured memory_bytes: 1408
import java.util.*;
public class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        long a =sc.nextInt();
        long b= sc.nextInt();
        long c = sc.nextInt();
        long k = sc.nextLong();
        if(a+c == b+c){
            System.out.println(0); return;
        }
        if(k%2 == 0){
            System.out.println(a-b);
        } else {
            System.out.println(b-a);
        }
        
    }
}


Measured memory_bytes: 21844
//  Created by conan1024hao in 2020.
//  Copyright © 2020 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao Twitter/QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 10e17
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}
//---------------------------------------------------------------------------
int n;
int d[20][20];
int dp[1<<20][20];
int st[20][20];
int rec(int S,int v){
    if(dp[S][v]>=0)return dp[S][v];
    
    if(S==(1<<n)-1&&v==0){
        return dp[S][v]=0;
    }
    
    int res=IINF;
    for(int u=0;u<n;u++){
        if(!(S>>u&1)){
            if(st[v][u]!=IINF)
                res=mmin(res,rec(S|1<<u,u)+st[v][u]);
        }
    }
    return dp[S][v]=res;
}
//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ! llか? 统一类型 memset()! ペナを減らせ!!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    memset(dp,-1,sizeof(dp));
    cin>>n;
    int m;cin>>m;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            st[i][j]=IINF;
        }
    }
    for(int i=0;i<m;i++){
        int s,t,d;cin>>s>>t>>d;
        //s--;t--;
        st[s][t]=d;
        //st[t][s]=d;
    }
    int ans=rec(0,0);
    if(ans==IINF)ans=-1;
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------



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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
int inf = 1e9;
Int mod = 1e9+7;

int main() {
    vector<int> res;
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;
        vector<int> h(n * 2), m(n * 2), s(n * 2);
        for (int i = 0; i < n * 2; i++) {
            char a, b;
            cin >> h[i] >> a >> m[i] >> b >> s[i];
        }
        vector<int> time(24 * 60 * 60 + 1, 0);
        for (int i = 0; i < n * 2; i++) {
            int sec = h[i] * 3600 + m[i] * 60 + s[i];
            if (i % 2 == 0) {
                time[max(sec, 0)]++;
            }
            else {
                time[min(sec, 24 * 60 * 60)]--;
            }
        }
        for (int i = 0; i < 24 * 60 * 60; i++) {
            time[i + 1] += time[i];
        }
        int ma = -1;
        for (int i = 0; i < 24 * 60 * 60; i++) {
            if (ma < time[i]) {
                ma = time[i];
            }
        }
        res.push_back(ma);
    }
    for (int i = 0; i < (int)res.size(); i++) {
        dump(res[i]);
    }
    return 0;
}



Measured memory_bytes: 3580
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
ll MOD = 1000000007;

bool compare(pii& lhs, pii& rhs) {
  if (lhs.first < rhs.first)
    return true;
  else if (lhs.first == rhs.first)
    return lhs.second < rhs.second;
  return false;
}

int main() {
  //
  int N, M;
  cin >> N >> M;
  vector<pii> br;
  rep(i, M) {
    int a, b;
    cin >> a >> b;
    br.push_back(make_pair(a, i + 1));
    br.push_back(make_pair(b, -(i + 1)));
  }
  sort(ALL(br), compare);
  set<int> idx;
  int cnt = 0;
  for (auto& p : br) {
    // cout << p.first << "," << p.second << endl;
    if (p.second < 0) {
      int i = -p.second;
      if (idx.find(i) != idx.end()) {
        cnt++;
        idx.clear();
      }
    } else {
      int i = p.second;
      idx.insert(i);
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 3440
#include <bits/stdc++.h>
#include <math.h>
#define ALL(a)    a.begin(), a.end() 
#define rep(i, K, N)  for(int i = K; i < N; i++)
#define ll long long int
using namespace std;

int main() {
ll L, R, d;cin >> L >> R >> d;
ll Ans = 0;
rep(i, L, R + 1){
if(i%d == 0)Ans++;
}
cout << Ans;
}

Measured memory_bytes: 3616
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define forn(i,n) for(int i=0;i<(int)(n);++i)
#define ford(i,n) for(int i=(int)(n)-1;i>=0;--i) 
const int maxn=110000,maxd=11;
int c[maxn][maxd];
int col[maxn];
template<class T>bool uin(T &a,T &b){
	return a>b?(a=b,true):false;
}
template<class T>bool uax(T &a,T &b){
	return a<b?(a=b,true):false;
}
vi e[maxn];
int main(){
	int n,m,q;
	cin>>n>>m;
	forn(i,m){
		int a,b;
		cin>>a>>b;
		--a,--b;
		e[a].push_back(b);
		e[b].push_back(a);  
	}
	cin>>q;
	forn(i,q){
		int v,d;
		cin>>v>>d>>col[i+1];
		--v;
		c[v][d]=i+1;
	}
	ford(i,maxd-1) forn(v,n) for(int u:e[v]){
		uax(c[u][i],c[v][i+1]);
	}
	forn(v,n){
		int res=0;
		forn(d,maxd)
			uax(res,c[v][d]);
		cout<<col[res]<<endl;
	}
}

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

struct unionfind{
    vector<int> par;
    vector<int> size;
    unionfind(int n):par(n),size(n,1){
        rep(i,n)par[i]=i;
    }
    
    int root(int x){
        if(par[x]==x)return x;
        return par[x]=root(par[x]);
    }
    
    void unit(int x,int y){
        int rx=root(x);
        int ry=root(y);
        if(rx==ry)return;
        if(size.at(rx)<size.at(ry)) swap(rx,ry);
        par[ry]=rx;
        size.at(rx)+=size.at(ry);
    }
    
    bool same(int x,int y){
        int rx=root(x);
        int ry=root(y);
        return rx==ry;
    }
    
    int sizes(int x){
        return size.at(root(x));
    }
};

int main(){
    int n,m,k;
    cin>>n>>m>>k;
    vector<int> d(n+1,0);
    unionfind tree(n+1);
    rep(i,m){
        int x,y;
        cin>>x>>y;
        d.at(x)++;
        d.at(y)++;
        tree.unit(x,y);
    }
    vector<vector<int>> c(n+1);
    rep(i,k){
        int x,y;
        cin>>x>>y;
        c.at(x).push_back(y);
        c.at(y).push_back(x);
    }

    for(int i=1;i<=n;i++){
        int tot=tree.sizes(i)-d.at(i)-1;
        for(int j=0;j<c.at(i).size();j++)if(tree.root(i)==tree.root(c.at(i).at(j)))tot--;
        //cout<<tree.sizes(i)<<' '<<d.at(i)<<' '<<tree.sizes(i)-d.at(i)-1<<endl;
       if(i!=1)cout<<' ';
       cout<<tot;
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 7168
//
//  main.cpp

#include <iostream>
using namespace std;
const int tomato = 1;
const int cream = 2;
const int basil = 3;
int dp[101][4][4][4];//i??\??????????????????a???i-1??\??????????????????b???i-2??\??????????????????c??¨???????????????????????????????????°???
int day[101]={};
int n,k;

int pasta(int i,int a,int b,int c){//i??\??????i??\???????????????a???i-1??\???????????????b???i-2??\???????????????c???
	if(a == b&&b == c)return 0;
	if(dp[i][a][b][c]){//?????§????¨??????????(!=0)????????????????????????
		return dp[i][a][b][c];
	}
	if(day[i] && day[i] != a)return 0;//?????????????±???????????????????????????????????????¨?????????????????????????????????
	if(day[i-1] && day[i-1] != b)return 0;
	if(day[i-2] && day[i-2] != c)return 0;
	if(i == 3){
		dp[i][a][b][c] = 1;
		return dp[i][a][b][c];
	}
	
	int ret=0;
	for(int j=1;j<4;j++){
		ret += pasta(i-1,b,c,j);
	}
	dp[i][a][b][c] = ret % 10000;
	return dp[i][a][b][c];
}

int main(){	
	
	cin >> n >> k;
	for(int i=0;i<101;i++){
		day[i] = 0;
	}
	int input;
	for(int i=1;i<=k;i++){
		cin >> input;
		cin >> day[input];
	}
	
	for(int i=0;i<101;i++){
		for(int j=0;j<4;j++){
			for(int k=0;k<4;k++){
				for(int r=0;r<4;r++){
					dp[i][j][k][r] = 0;
				}
			}
		}
	}
	
	int answer=0;
	for(int i=1;i<4;i++){
		for(int j=1;j<4;j++){
			for(int k=1;k<4;k++){
				answer += pasta(n,i,j,k) % 10000;
			}
		}
	}
	cout << answer % 10000 << endl;
	
	return 0;
}

Measured memory_bytes: 3124
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e6 + 10; 
const double pi = acos(-1.0);

inline ll read()
{
    ll kk=0,f=1;
    char cc=getchar();
    while(cc<'0'||cc>'9'){if(cc=='-')f=-1;cc=getchar();}
    while(cc>='0'&&cc<='9'){kk=(kk<<1)+(kk<<3)+cc-'0';cc=getchar();}
    return kk*f;
}

char s[10];
int main(void)
{
	scanf("%s",s);
	if(s[2]==s[3]&&s[4]==s[5])printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
using ll = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;};
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;};

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

  Int n;
  cin>>n;
  vector<Int> ss(n),ls(n),ps(n);
  for(Int i=0;i<n;i++) cin>>ss[i]>>ls[i]>>ps[i];

  const Int MAX = 500;
  const Int INF = 1e15;
  vector<Int> dp(MAX,-INF);
  dp[0]=0;
  for(Int i=0;i<n;i++)
    for(Int j=0;j<MAX;j++)
      for(Int k=ss[i];k<=ls[i];k++)
        if(j+k<MAX) chmax(dp[j+k],dp[j]+ps[i]);    
  
  Int m;
  cin>>m;
  vector<Int> ws(m);
  for(Int i=0;i<m;i++) cin>>ws[i];  
  
  auto NG=[](){cout<<-1<<endl;exit(0);};
  for(Int i=0;i<m;i++)
    if(dp[ws[i]]<0) NG();
  
  for(Int i=0;i<m;i++) cout<<dp[ws[i]]<<endl;
  return 0;
}



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

#define     F       first
#define     S       second
typedef pair<int, int>  pi;
typedef long long       ll;

vector<int>v;
vector<int>ans;
int res;
int sumOfDigits (int n)
{
    int sum = 0;

    while (n)
    {
        sum += n % 10;
        n /= 10;
    }

    return sum;
}


ll fastpow(ll a,ll b){
if(!b)
    return 1;

ll  sq=fastpow(a,b/2);
sq*=sq;
if(b%2!=0)
    sq*=a;

    return sq;

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

const int maxx=1e3+100;
int c[maxx];
int n,m,d;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
char a,b;
cin>>a>>b;
if(a>b)
    cout<<">\n";
else if(a<b)
    cout<<"<\n";
else
    cout<<"=\n";

	return 0;
}







Measured memory_bytes: 3564
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))

const [N, K] = nexts(2)
const P = nexts(N)

priceList = P.sort((a, b) => a - b)
console.log(priceList.slice(0, K).reduce((prev, cur) => prev+ cur, 0))


Measured memory_bytes: 29784
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
  #include "dbgtoki.hpp"
  #define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
DbgTimer D_t;
  #define TSTART() D_t.start()
  #define TSTOP() D_t.stop()
#else
  #define DUMP(i) 
  #define TSTART()
  #define TSTOP()  
#endif
 
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

const int EPS = 1e-9;

int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string  n;
  while(cin >> n ){
    TSTART();
    cout << "ABC" << n << endl;
    TSTOP();
  }
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define ll long long

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	int arr[m];
	for (int i = 0; i < m; i++) {
		cin >> arr[i];
	}
	sort(arr, arr + m);
	int sub[m - 1];
	for (int i = 0; i < m - 1; i++) {
		sub[i] = abs(arr[i + 1] - arr[i]);
	}
	sort(sub, sub + m - 1);
	int ans = 0;
	for (int i = 0; i < m - n ; i++)
		ans += sub[i];
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4336
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<(int)n; i++)
#define REPR(i, n) for(int i=(int)n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=(int)m; i<(int)n; i++)
#define FORR(i, m, n) for(int i=(int)m-1; i>=(int)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
typedef long long ll;
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
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; }



void solve(long long X){
	ll res = 0;
	ll fs = X/500;
	ll nokori = X-fs*500;
	ll f = nokori/5;
	res = fs*1000 + f*5;

	cout << res << "\n";
}

int main(){
    long long X;
    scanf("%lld",&X);
    solve(X);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  int a,b,c,s;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  
  s=a+b;
  if(s>=c){
    printf("Yes\n");
  }
  else if(s<c){
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define MOD 1000000007
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define RREP(i,a,b) for(ll i=(a); i>=(b); i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef int64_t in;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> p;
typedef vector<pair<ll, ll>> vpl;




int main(){
    string s; cin >> s;
    bool flag=true;
    if(s[0] == s[1]){
        if(s[1] == s[2] || s[1] == s[3] || s[2]!=s[3]) flag = false;
    } else {
        if(s[2] != s[0]){
            if(s[2] != s[1]){
                flag = false;
            }else{
                if(s[0] != s[3]){
                    flag = false;
                }
            }
        }else{
            if(s[1] != s[3]) flag = false;
        }
    }
    if(flag) cout << "Yes" << "\n";
    else cout << "No" << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vb vector<bool>
#define pii pair<int,int>
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define F first
#define S second
#define inf (long long) 1e18
#define f(i,n)  for(int i=0;i<n;i++)
#define f(i,n) for(int i=n-1;i>=0;i--)
#define f(i,n) for(int i=1;i<=n;i++)

const int MOD = 1e9 + 7;

void solve()
{
    int n;
    cin >> n;
    int flag=0;
    for(int i=0;i<50000;i++)
    {
        if(floor(i*1.08)==n){flag=1;
            cout << i;}
    }
    if(flag==0)
        cout << ":(";
}


int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t=1;
  //cin>>t;
  while(t--)
  {
      solve();
  }
}


Measured memory_bytes: 3624
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[allow(dead_code)]
struct Eratosthnes {
    n: usize,           // incluesive
    bprime: Vec<bool>,  // self.bprime[5] = true
    primes: Vec<usize>, // self.primes[2] = 5
}
#[allow(dead_code)]
impl Eratosthnes {
    fn new(n: usize) -> Eratosthnes {
        let mut bprime = vec![true; n + 1];
        let mut primes = vec![];
        primes.reserve(n / 10 + 1000);
        bprime[0] = false;
        bprime[1] = false;
        for i in 2..n + 1 {
            if !bprime[i] {
                continue;
            }
            primes.push(i);
            if i * i > n {
                continue;
            }
            let mut j = i * i;
            while j <= n {
                bprime[j] = false;
                j += i;
            }
        }
        Eratosthnes {
            n: n,
            bprime: bprime,
            primes: primes,
        }
    }
}

const MAX_P: usize = 55555;
struct Solver {
    n: usize,
    era: Eratosthnes,
}

impl Solver {
    fn new() -> Solver {
        let n: usize = read();
        let era = Eratosthnes::new(MAX_P);
        Solver { n: n, era: era }
    }
    fn solve(&mut self) {
        let mut ans = vec![];
        for &p in self.era.primes.iter().filter(|p| *p % 5 == 1) {
            ans.push(p);
            if ans.len() == self.n {
                break;
            }
        }
        for &v in ans.iter() {
            if v != ans[0] {
                print!(" ");
            }
            print!("{}", v);
        }
        println!("");
    }
}

fn main() {
    let mut solver = Solver::new();
    solver.solve();
}


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

int N, x[100], y[100], h[100], H;

int main() {
    cin >> N;
    rep(i, N) {
        cin >> x[i] >> y[i] >> h[i];
    }
    rep(X, 101) {
        rep(Y, 101) {
            rep(i, N) {
                if (h[i]) H = abs(x[i] - X) + abs(y[i] - Y) + h[i];
            }
            bool isAns = true;
            rep(i, N) {
                int num = max(H - abs(x[i] - X) - abs(y[i] - Y), 0);
                if (num != h[i]) isAns = false;
            }
            if (isAns) printf("%d %d %d\n", X, Y, H);
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using ll = long long;
using namespace std;

int main() {
  int n, k;
  cin >> n >> k;
  int ans = 1;
  for (int i = 0; i < n; i++) {
    ans = min(ans * 2, ans + k);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var x int
	fmt.Scan(&x)
	for a := -118; a < 120; a++ {
		a5 := pow5(a)
		for b := -118; b < 120; b++ {
			if pow5(b) + x == a5 {
				fmt.Println(a, b)
				return
			}
		}
	}
}

func pow5(x int) int {
	return x * x * x * x * x
}

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

int main() {
  int H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;
  int sum = (H2 - H1) * 60 + (M2 - M1);
  if(sum == K) cout << 0;
  else if(sum > K) cout << sum - K;
 return 0;
}



Measured memory_bytes: 3620
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    ans = 0

    for i in range(1, n + 1):
        if 10 <= i <= 99:
            continue
        elif 1000 <= i <= 9999:
            continue
        elif i == 100000:
            continue
        else:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
//Sinhov : "Hi stalker!"
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mod 1000000007
int main() {
    ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
    ll n,l,r,i,j,ans=0;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>l>>r;
        ans+=r-l+1;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int lim = 4e5+5;
int n;
vector<pair<int,int>> plane;

int solve(int p,int q) {
	int cost = 0;
	set<pair<int,int>> lines(plane.begin(),plane.end());
	while(!lines.empty()) {
		cost += 1;
		int bx = lines.begin()->first;
		int by = lines.begin()->second;
		while(lines.find({bx,by})!=lines.end())
			lines.erase({bx,by}),bx+=p,by+=q;
	}
	return cost;
}

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

	cin>>n;
	if(n==1) {
		cout<<1;
		return 0;
	}
	for(int i=0;i<n;i++) {
		int x,y;
		cin>>x>>y;
		plane.push_back({x,y});
	}
	sort(plane.begin(),plane.end());

	int ans = 1e9;
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++)
			ans = min(ans,solve(plane[j].first-plane[i].first,plane[j].second-plane[i].second));
	cout<<ans;
	
	return 0;
}

Measured memory_bytes: 256
N,T = map(int,input().split())
t = list(map(int,input().split()))
ma = t[-1] + T
mainasu = 0

for i in range(N-1):
    if t[i+1] - t[i] <T:
        continue
    else:
         mainasu += t[i+1] - t[i] - T
print(ma - mainasu)

Measured memory_bytes: 26704
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

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

	return true;
}

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)

int main() {
	ll N;
	std::cin >> N;
	while (N > 0) {
		if (N % 10 == 7) {
			std::cout << "Yes" << endl;
			return 0;
		}
		N /= 10;
	}

	std::cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> h(n);
  rep(snip_i, n) cin >> h.at(snip_i);
  int ans = 0, co = 0;
  rep2(i, 1, n){
    if(h.at(i-1) >= h.at(i)) co++;
    else{
      ans = max(ans, co);
      co = 0;
    }
  }
  ans = max(ans, co);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n,i,j,temp;
  cin>>n;
  long long a[n];
  for(i=0;i<n;i++)
  {
    cin>>a[i];
  }
  for(i=0;i<n-1;i++)
  {
    if(a[i]==0)
      continue;
    for(j=i+1;j<n;j++)
    {
      temp=temp+(a[i]*a[j]);
    }
  }
  cout<<temp<<endl;
  return 0;
}

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

int main(){
    int n;cin >> n;
    vector<pair<int,int>> job(n);
    for(int i = 0; i < n ; i++){
        int a,b;cin >> a >> b;
        job[i] = make_pair(b,a);
    }

    sort(job.begin(),job.end());

    ll nt = 0;  
    bool flag = false;
    for(auto e: job){
        nt += e.second;
        if(nt > e.first){
            flag = true;
            break;
        }
    }

    if(flag)cout << "No" << endl;
    else cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 1792
// AOJ DPL_5_E Balls and Boxes 5
// n 個の区別できないボールを k 個の区別できる箱に入れる
// とき、可能な入れ方の総数を求めてください。
// ただし、
//    どのボールも、必ずいずれかの箱に入れる。
//    各箱に入れることのできるボールの数は高々1つまで。
// 答えは組み合わせ combi(k, n)
// 2019.3.11 bal4u

#include <stdio.h>
#include <stdlib.h>

#define MOD 1000000007
int tbl[1001][1001];

int combi(int n, int k)
{
	int ans;

	if (tbl[n][k]) return tbl[n][k];
	if ((k << 1) > n) k = n - k;
	if (k == 0) ans = 1;
	else if (k == 1) ans = n;
	else ans = combi(n - 1, k) + combi(n - 1, k - 1);
	return tbl[n][k] = ans % MOD;
}

int main()
{
	int n, k;

	scanf("%d%d", &n, &k);
	if (n > k) puts("0");
	else printf("%d\n", combi(k, n));
	return 0;
}


Measured memory_bytes: 4220
# -*- coding: utf-8 -*-

x1, y1, x2, y2 = map(int, input().split(' '));

ix, iy = (x2 - x1, y2 - y1)

dx, dy = (-iy , ix)
ddx, ddy = (-ix , -iy)

x3, y3 = (x2 + dx, y2 + dy)
x4, y4 = (x3 + ddx, y3 + ddy)

print("{} {} {} {}".format(x3, y3, x4, y4) )

Measured memory_bytes: 3064
#include <algorithm>
#include <cstdio>
#include <cstring>

typedef long long LL;

const int MAXN = 2000;
const LL INF = 0x3f3f3f3f;

int N, X;
int A[MAXN + 5];
int Dp[MAXN + 5];

int main() {
	scanf("%d%d", &N, &X);
	LL Ans = 1ll << 60;
	for (int i = 1; i <= N; i++)
		scanf("%d", &A[i]), Dp[i] = INF;
	for (int k = 0; k < N; k++) {
		LL cur = 0;
		for (int i = 1; i <= N; i++)
			cur += Dp[i] = std::min(Dp[i], A[(i + k - 1) % N + 1]);
		Ans = std::min(Ans, (LL)k * X + cur);
	}
	printf("%lld", Ans);
	return 0;
}


Measured memory_bytes: 1720
#include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>

#define fr(i,b,e) for(int i=(b); i!=(e); ++i)
#define rep(i,e) for(int i=0; i!=(e); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long int li;
typedef long long int ll;
using graph = vector<vector<int>>;
using edgedp = vector<vector<pair<int,ll>>>;
constexpr int INF=1000000;
//constexpr int MOD=998244353;
constexpr int MOD=1e9+7;



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

    ll n;
    cin >> n;
    ll sum=(n+1)*n/2;
    
    ll a,b,c;
    a=n/3;
    b=n/5;
    c=n/15;
    sum+=c*(c+1)*15/2;
    sum-=a*(a+1)*3/2;
    sum-=b*(b+1)*5/2;
    cout << sum << "\n";
}   

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

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

ll lcm(ll x, ll y) {
    return x / gcd(x,y) * y;
}
int main(void)
{
    IOS
    ll a, b;
    cin >> a >> b;

    OUT(lcm(a,b))

    return 0;
}

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

int n, k;
vector<int> d;
vector<vector<int>> a;

void input(){

  cin >> n >> k; 
  d.resize(k);
  a.resize(k, vector<int>());
  for(int i = 0; i < k; i++){
    cin >> d[i];
    a[i].resize(d[i]);
    for(int j = 0; j < d[i]; j++){
      cin >> a[i][j];
    }
  }
}

void solve(){
  int ans = 0;
  for(int i = 1; i <= n; i++){
    bool have = false;
    for(auto v: a){
      for(auto e: v){
        if(e == i) have = true;
      }
    }
    if(!have) ans++;
  }
  cout << ans << endl;
}

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

Measured memory_bytes: 3644
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn input_tuple_str() -> (String, String) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<String> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0].to_string(), vec[1].to_string())
}

fn main() {
    let (s, t) = input_tuple_str();
    let (a, b) = input_tuple();
    let u: String = input();

    if s == u {
        println!("{} {}", a-1, b);
    } else {
        println!("{} {}", a, b-1);
    }
}


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

int N, W;
int v[111], w[111];
int dp[111][11111]; // dp[i][j]: 重さ制限jで個数iまで見たときの最大の価値

int main() {
    // 入力
    cin >> N >> W;
    // インデックスを1つずらしている
    for (int i = 0; i < N; i++) { cin >> v[i+1] >> w[i+1]; }

    // DP
    for (int i = 1; i <= N; i++) {
        for (int j = 0; j <= W; j++) {
            if (j >= w[i]) {
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-w[i]] + v[i]);
            } else {
                dp[i][j] = dp[i-1][j];
            }
        }
    }
    cout << dp[N][W] << endl;

    return 0;
}


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

int main() {
    int n, m, max=0 ,cnt_s ,cnt_t;
    string tmp;
    vector<string> sn;
    vector<string> tm;

    cin >> n;
    for(int i=0; i<n; i++){
        cin >> tmp;
        sn.push_back(tmp);
    }
    cin >> m;
    for(int i=0; i<m; i++){
        cin >> tmp;
        tm.push_back(tmp);
    }

    for(int i=0; i<n; i++){
        cnt_s = 0;
        cnt_t = 0;
        for(int j=i; j<n; j++){
            if(sn.at(i) == sn.at(j)){
                cnt_s++;
            }
        }
        for(int k=0; k<m; k++){
            if(sn.at(i) == tm.at(k)){
                cnt_t++;
            }
        }

        if(max < (cnt_s - cnt_t)){
            max = cnt_s - cnt_t;
        }

    }

    cout << max << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
  int N,K;
  cin >> N >> K;
  
  int a[N];
  for(int i=0;i<N;i++){
    cin >> a[i];
  }
  sort(a,a+N);
  
  int h;
  h= 10e9;
  
  for(int j=0;j<N-K+1;j++){
    if(a[j-1+K]-a[j]<h){
      h=a[j-1+K]-a[j];
    }
  }
  
  cout << h;
  
  return 0;
}

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

using lli = long long;
using pii = pair<int, int>;
using pll = pair<lli, lli>;
using Double = long double;
template<typename T>
using Vector = vector<vector<T>>;
template<typename T>
using Prior = priority_queue<T>;
template<typename T>
using prior = priority_queue<T, vector<T>, greater<T>>;

#define IOS() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define X first
#define Y second
#define Push push_back
#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()

void solve() {
	lli n, t;
	cin >> n >> t;

	vector<lli> cost(n);
	for (auto &x : cost) cin >> x;

	lli nowMax = 0, nowPro = 0, ans = 0;
	for (int i = n-1; i >= 0; --i) {
		nowMax = max(nowMax, cost[i]);
		if (nowMax - cost[i] == nowPro) {
			++ans;
		}
		else if (nowMax - cost[i] > nowPro) {
			nowPro = nowMax - cost[i];
			ans = 1;
		}
	}

	cout << ans << "\n";
}

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

Measured memory_bytes: 1024
inputs = [int(s) for s in input().split()]
h_bool = (inputs[0] >= inputs[2] + inputs[4]) and \
            (inputs[2] - inputs[4] >= 0)
w_bool = (inputs[1] >= inputs[3] + inputs[4]) and \
            (inputs[3] - inputs[4] >= 0)

if h_bool and w_bool:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 5604
/******************************************
*    AUTHOR:         JULIAN FERRES        *
*    INSTITUITION:   FIUBA                *
******************************************/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define pb push_back
#define mp make_pair
#define DBG(x) cerr << #x << " = " << (x) << endl
#define DBGV(v,n) forn(i,n) cout << v[i] << " "; cout << endl
const int N = 100005;
const int mod = 1000000007;

int n;
vi g[N];
vi black(N,1), white(N,1);

ll mul(ll a, ll b){
	return a*b % mod;
}


void dfs(ll v, ll p){
	for(auto u : g[v]) {
		if(u == p) continue;
		dfs(u,v);
		white[v] = mul(white[v], white[u]+black[u]);
		black[v] = mul(black[v], white[u]);
	}
}

int main()
{
	FIN;
	cin >> n;
	forn(i,n-1){
		int a,b;
		cin >> a >> b;
		a--, b--;
		g[a].pb(b); g[b].pb(a);
	}
	dfs(0,-1);
	cout << (black[0] + white[0])%mod << endl;
	// DBGV(black, n);
	// DBGV(white, n);

	return 0;
}


Measured memory_bytes: 14208
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define clr(x,y) memset(x,y,sizeof(x))
#define in(a) a=read()
#define out(a) printf("%d\n",a)
inline ll read(){
    char c=getchar();ll f=1,x=0;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+(c-'0'),c=getchar();
    return x*f;
}
#define mod 1000000000000ll
#define maxn 100010
#define inf (1ll<<60)
char s[maxn];
int main(){
	scanf("%s",s+1);	
	int n=strlen(s+1);
	FOR(i,1,n){
		if(i%2&&s[i]=='L')return puts("No"),0;
		if(i%2==0&&s[i]=='R')return puts("No"),0;	
	}
	puts("Yes");
}

Measured memory_bytes: 256
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int N = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int r = parseInt(sc.next());
		int g = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		out.println((r*100+g*10+b)%4==0?"YES":"NO");
	}
}


Measured memory_bytes: 21204
#include <iostream>
using namespace std;
int main()
{
    int K;
    cin>>K;
    int odd=0,even=0;
    for (int i=1; i<=K; i++)
    {
        if (i%2==0)
        {
            even++;
        }
        else if (i%2!=0)
        {
            odd++;
        }
    }
    int result=even*odd;
    cout<<result<<endl;
    return 0;
}


Measured memory_bytes: 256
// #define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = int64_t;
using ull = uint64_t;
using PLL = pair<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
// #include "../debug/debug.cpp"
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

bool solve() {
    string S;
    cin >> S;
    for(ll i = 1; i <= S.size(); i++) {
        char c = S[i - 1];
        if((i & 1)  && c == 'R' || c == 'U' || c == 'D') continue;
        if(!(i & 1) && c == 'L' || c == 'U' || c == 'D') continue;
        return false;
    }
    return true;
}

int main() {
    cout << (solve() ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
#define INF 1000000001
using namespace std;
int h[100005];
int n,k;
int dy[100005];
int main() {
	scanf("%d%d", &n,&k);
	int i,j;
	for (i = 1; i <= n; i++) scanf("%d", &h[i]);
	dy[1] = 0; dy[2] = abs(h[1] - h[2]);
	for (i = 3; i <= n; i++) {
		dy[i] = INF;
		for (j = 1; j <= k && i - j > 0; j++) {
			if (dy[i] > dy[i - j] + abs(h[i] - h[i - j]))
				dy[i] = dy[i - j] + abs(h[i] - h[i - j]);
		}
	}
	printf("%d", dy[n]);
	return 0;
}
/*
#include<cstdio>
int main() {
	freopen("input.txt", "r", stdin);
	freopen("output.txt","w",stdout);
	return 0;
}
*/

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

int main(){
  string S, T;
  cin >> S >> T;
  int ans=0;
  for(int i=0; i<3; i++){
    if(S.at(i)==T.at(i)) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
h = list(int(x) for x in input().split())
dp = []

# i番目に必要な最小の体力を求める
i = 0
while i != n:

    # i = 0の時
    if i == 0:
        dp.append(0)
        i += 1
        continue

    # i = 1の時
    if i == 1:
        dp.append(abs(h[i] - h[i-1]))
        i += 1
        continue

    # i >= 2の時
    # 必要な体力を求める
    hp1 = dp[i-2] + abs(h[i] - h[i-2])
    hp2 = dp[i-1] + abs(h[i] -h[i-1])

    # 体力が少ない方をdpに追加する
    if hp1 > hp2:
        dp.append(hp2)
    else:
        dp.append(hp1)

    i += 1
        
print(dp[-1])
            
        



Measured memory_bytes: 13928
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;

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

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

int main(){

  ll n; cin >> n;
  int ans = 0;
  for(ll i = 1;i<n;i++){
    for(ll j = 1;j<n;j++){
      if(i*j>=n) break;
      else ans++;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3624
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		for(int i = 0 ; i < s.length() ; i++) {
			ans += Integer.valueOf(s.charAt(i) + "");
          if(ans >= 9) {
				ans %= 9;
			}
		}

		sc.close();
		System.out.println(ans == 0 ? "Yes" : "No");

	}
}



Measured memory_bytes: 51892