akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    n, r = LI()
    if n >= 10:
        print(r)
    else:
        print(r + 100 * (10 - n))
    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 38512
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		sb.append(sc.next());
		int q = sc.nextInt();
		int reverse = 0;

		for(int i = 0; i < q; i++) {
			int n = sc.nextInt();
			switch(n) {
			case 1:
				reverse = 1 - reverse;
				break;
			case 2:
				if(sc.nextInt() - 1 == reverse){
					sb2.append(sc.next());
				}else {
					sb.append(sc.next());
				}
				break;
			}
		}
		if(reverse == 1) System.out.println(sb.reverse().toString() + sb2.toString());
		else System.out.println(sb2.reverse().toString() + sb.toString());
		sc.close();
	}
}


Measured memory_bytes: 121196
#include<cstdio>
#include<cctype>
#include<cstring>
#include<algorithm>
using namespace std;
int n,cnt,tot,mini=0x7f7f7f7f,maxn,f[200010],vis[200010],sg[200010],head[200010],nxt[200010],to[200010];
bool iscir[200010];
void add_edge(int u,int v){
	nxt[++tot]=head[u];
	to[tot]=v;
	head[u]=tot;
	return;
}
void dfs(int u){
	for(int i=head[u];~i;i=nxt[i])
		if(!iscir[to[i]])
			dfs(to[i]);
	for(int i=head[u];~i;i=nxt[i])
		if(!iscir[to[i]])
			vis[sg[to[i]]]=1;
	for(sg[u]=0;vis[sg[u]];sg[u]++);
	for(int i=head[u];~i;i=nxt[i])
		vis[sg[to[i]]]=0;
	return;
}
void find_cir(){
	for(int i=1;vis[i]<=1;i=f[i]){
		vis[i]++;
		if(vis[i]==2){
			iscir[i]=1;
			++cnt;
		}
	}
	return;
}
char buffer[10000010],*hd;
char Getchar(){
	return *hd++;
}
int rd(){
	int x=0;
	char c;
	do c=Getchar();
	while(!isdigit(c));
	do{
		x=(x<<1)+(x<<3)+(c^48);
		c=Getchar();
	}while(isdigit(c));
	return x;
}
int main(){
	fread(buffer,1,10000000,stdin);
	hd=buffer;
	memset(head,-1,sizeof(head));
	n=rd();
	for(int i=1;i<=n;i++)
		add_edge(f[i]=rd(),i);
	find_cir();
	if(!(cnt&1)){
		puts("POSSIBLE");
		return 0;
	}
	memset(vis,0,sizeof(vis));
	for(int i=1;i<=n;i++){
		if(iscir[i]){
			dfs(i);
			maxn=max(maxn,sg[i]);
			mini=min(mini,sg[i]);
		}
	}
	if(maxn!=mini)
		puts("POSSIBLE");
	else puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 7808
#include <iostream>
#include <bits/stdc++.h>
#define f(i,a,b) for (int i=a; i<b; i++)
#define F(i,a,b) for (int i=a; i<=b; i++)
#define fod(i,a,b) for (int i=a; i>=b; i--)
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define MOD 1000000007

using namespace std;

template<class t> inline t read(t &x){
	x=0;char c=getchar();bool f=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return  x;
}
template<class t> inline void write(t x){
	if(x<0){putchar('-'),write(-x);}
	else{if(x>9)write(x/10);putchar('0'+x%10);}
}

typedef long long ll;
typedef pair<int, int> pii;
typedef map<int,int> mii;

int dp[3005][3005];
int dp2[3005][3005];
int main()
{
    string s, t;
    int flag=0;
    cin>>s>>t;
    s=' '+s;
    t=' '+t;
    f(i,1,s.size()) {
        dp2[1][i]=1;
        if (t[1]==s[i]) flag=1, dp2[1][i]=3;
        dp[1][i]=flag;
    }
    flag=0;
    f(i,1,t.size()) {
        dp2[i][1]=2;
        if (s[1]==t[i]) flag=1, dp2[i][1]=3;
        dp[i][1]=flag;
    }
    f(i,2,t.size())
        f(j,2,s.size()){
            if (t[i]!=s[j]) {
                if (dp[i-1][j]>dp[i][j-1]) dp[i][j]=dp[i-1][j], dp2[i][j]=2;
                else dp[i][j]=dp[i][j-1], dp2[i][j]=1;
            }
            else dp[i][j]=dp[i-1][j-1]+1, dp2[i][j]=3;
        }

    int i=t.size()-1, j=s.size()-1;
    string res;
    while (dp2[i][j]!=0) {
        if (dp2[i][j]==3) res+=t[i], i--, j--;
        else if (dp2[i][j]==2) i--;
        else if (dp2[i][j]==1) j--;
    }
    reverse(res.begin(), res.end());
    cout<<res;
    return 0;
}


Measured memory_bytes: 70784
package main

import (
	"fmt"
	"os"
)

type Ball struct {
	Name  string
	Mount int
}

func main() {
	var S = Ball{}
	var T = Ball{}
	var U string

	_, err := fmt.Scan(&S.Name, &T.Name, &S.Mount, &T.Mount, &U)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	switch U {
	case S.Name:
		S.Mount--
	case T.Name:
		T.Mount--
	}

	fmt.Println(S.Mount, T.Mount)

}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define all(ppp) ppp.begin(),ppp.end()
#define out(ppp) cout<<(ppp)<<endl
#define out1(ppp) cout<<(ppp) 
#define MAX_CHAR 256

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push_back

typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<vpi> vvpi;

typedef set<pi> spi;

const int INF=INT_MAX;

void solve(){
    int N,K;
    cin>>N>>K;
    vi v(N);
    F0R(i,N){
        cin>>v[i];
    }
    int ret=0;
    for(int l=0;l<=K;l++){
        for(int r=0;l+r<=K&&l+r<=N;r++){
            int sum=0;
            vi b;
            for(int i=0;i<l;i++){
                sum+=v[i];
                b.push_back(v[i]);
            }
            for(int j=0;j<r;j++){
                sum+=v[N-j-1];
                b.push_back(v[N-j-1]);
            }
            sort(all(b));
            int rem=K-l-r;
            int curr=accumulate(b.begin(),b.end(),0);
            for(int i=0;i<rem&&i<b.size()&&b[i]<0;i++){
                curr-=b[i];
            }
            ret=max(ret,curr);
        }
    }
    out(ret);
}

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

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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    long long N;
    cin >> N;
    
    long long ans = LONG_MAX;
    for(long long i=1;i*i<=N;i++) {
        if(N % i == 0) {
            long long f1 = i;
            long long f2 = N / i;
            long long t = (f1 - 1) + (f2 - 1);
            ans = min(ans, t);
        }
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int n,a,x;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a;
        x=x^a;

    }
    if(x==0)
        cout<<"Yes"<<endl;
    else cout<<"No";



}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define __builtin_popcount __builtin_popcountll

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 T> ostream& operator<<(ostream &os, const vector<T> &t) {
    os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
    os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;


int T, n, m;

int main(int argc, char *argv[]){
    ios::sync_with_stdio(false);
    cin >> n;
    map<int, int> mp;
    REP(i, n) {
        int x;
        cin >> x;
        mp[x] ++;
    }
    cin >> n;
    REP(i, n) {
        int x;
        cin >> x;
        if(mp[x] -- == 0){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 9600
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <stdio.h>
using namespace std;

int main() {
	int a, b, ans=0;
	cin >> a >> b;
	for (int i = 2; i > 0; i--) {
		if (a >= b) {
			ans += a;
			a--;
		}
		else {
			ans += b;
			b--;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define vint(a,n) vint a(n); rep(i, n) cin >> a[i];
#define ALL(n) begin(n),end(n)
#define RALL(n) rbegin(n),rend(n)
#define MOD (1000000007)
#define INF (2e9)
#define INFL (2e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
using vint=vector<int>;
using vll=vector<ll>;
using vbool=vector<bool>;
template<class T>using arr=vector<vector<T>>;
template<class T>int popcount(T &a){int c=0; rep(i, 8*(int)sizeof(a)){if((a>>i)&1) c++;} return c;}
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);}
template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main()
{
    int n; cin >> n;
    vint(a, n);

    int neg=0, pos=0;
    rep(i, n){
        if(a[i]<0) neg++;
        else pos++;
    }

    sort(ALL(a));

    vint v, w;

    if(neg==0){
        priority_queue<int, vector<int>, greater<int>> p;
        rep(i, n) p.push(a[i]);
        while(p.size()>1){
            int s, t;
            s = p.top(); p.pop();
            t = p.top(); p.pop();
            if(p.empty()) swap(s, t);
            v.push_back(s); w.push_back(t);
            p.push(s-t);
        }
        pr(p.top());
        rep(i, v.size()){
            cout << v[i] << " " << w[i] << endl;
        }
        return 0;
    }else if(pos==0){
        priority_queue<int> p;
        rep(i, n) p.push(a[i]);
        while(p.size()>1){
            int s, t;
            s = p.top(); p.pop();
            t = p.top(); p.pop();
            v.push_back(s); w.push_back(t);
            p.push(s-t);
        }
        pr(p.top());
        rep(i, v.size()){
            cout << v[i] << " " << w[i] << endl;
        }
        return 0;
    }

    priority_queue<int> p, q;
    rep(i, n){
        if(i<neg) q.push(a[i]);
        else p.push(a[i]);
    }

    while(p.size()>1){
        int s, t;
        s = q.top(); q.pop();
        t = p.top(); p.pop();
        swap(s, t);
        v.push_back(t); w.push_back(s);
        q.push(t - s);
    }

    while(!q.empty()){
        int s, t;
        s = q.top(); q.pop();
        t = p.top(); p.pop();
        v.push_back(t); w.push_back(s);
        p.push(t - s);
    }

    pr(p.top());
    rep(i, v.size()){
        cout << v[i] << " " << w[i] << endl;
    }
    return 0;}

Measured memory_bytes: 5428
#include <iostream>

using namespace std;

int main( void )
{
	double v;
	
	while (cin >> v)
	{
		double t = v / 9.8;
		int y = (4.9 * t * t);
		cout << (y + 5) / 5 + 1 << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1224
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int read()
{
    char ch=getchar();
    int x=0,f=1;
    while(ch<'0' || ch>'9')
    {
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
int cmp(int a,int b)
{
    return a>b;
}
int main()
{
    int t[1005];
    t[1]=1;
    for(int i=2;i<=1000;i++)
    {
        t[i]=t[i-1]+i;

    }
    int n,k;
    cin>>n>>k;
    double a[200005];
    cin>>a[0];
    a[0]=t[(int)a[0]]*1.0/a[0];
    for(int i=1;i<n;i++)
    {
        cin>>a[i];
        a[i]=t[(int)a[i]]*1.0/a[i];
        a[i]+=a[i-1];
    }
    double ans=a[k-1];
    int p=0;
    for(int i=k;i<n;i++)
    {
        ans=max(ans,a[i]-a[p]);
        p++;
    }
    printf("%lf\n",ans);
    return 0;

}

Measured memory_bytes: 1792
#include <vector>
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <cstdio>
#include <utility>
#include <bitset>
#include <complex>
#include <stack>
#include <tuple>

using namespace std;
typedef long long ll;
typedef tuple<ll,ll,ll> T;


int main(){
	string s;
	cin >> s;
	cout << s.substr(0,5) << " " << s.substr(6,7) <<  " " << s.substr(14,5) << endl;
	return 0;
}


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

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

ll min(ll a,ll b)
{
    if(a<b)
    {
        return a;
    }
    return b;
}

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

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



int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
int h,a;
cin>>h>>a;
if(a>h)
{
    cout<<"1";
}
else
{
   int ans =h/a;
    if(h%a!=0)
    {
        ans++;
    }
    cout<<ans;
}

    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		if(a % 2 == 0 || b % 2 == 0){
			System.out.println("No");
		} else {
			System.out.println("Yes");
		}
		
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 22740
S = input()[::-1]
T = input()[::-1]

flag = False
for i in range(len(S) - len(T) + 1):
    matched = True

    for j in range(len(T)):

        if S[i + j] != "?" and S[i + j] != T[j]:
            matched = False
    
    if matched:
        S = S[:i] + T + S[i + len(T):]
        flag = True
        break

if flag:
    print(S.replace("?", "a")[::-1])
else:
    print("UNRESTORABLE")

Measured memory_bytes: 9000
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

N=gets.to_i
if N==1
    puts "Hello World"
else
    A=gets.to_i
    B=gets.to_i
    puts A+B
end

Measured memory_bytes: 1788
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <map>
#include <queue>
#include <stack>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
    string s;
    cin >> s;
    int ans = 0;
    rep(i,s.size()/2){
        if(s[i] != s[s.size()-1-i]) ++ans;
    }

    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
using namespace std;
int main() {
	int n, f;
	cin >> n >> f;
	map<pair<string, string>, int> m;
	for (int i = 0; i < n; i++) {
		int M;
		cin >> M;
		vector<string>item(M);
		for (int j = 0; j < M; j++)cin >> item[j];
		sort(item.begin(), item.end());
		for (int j = 0; j < M; j++) {
			for (int k = j + 1; k < M; k++) {
				m[make_pair(item[j], item[k])] += 1;
			}
		}
	}
	int res = 0;
	for (map<pair<string, string>, int>::iterator it = m.begin(); it != m.end(); it++) {
		if (it->second >= f)res++;
	}
	cout << res << endl;
	for (map<pair<string, string>, int>::iterator it = m.begin(); it != m.end(); it++) {
		if (it->second >= f) cout << it->first.first << " " << it->first.second << endl;
	}
	return 0;
}

Measured memory_bytes: 3476
#include <cstdio>
#include <stdint.h>

int as[200005];

int main(){
  int N;
  scanf("%d",&N);
  for(int i=0;i<N;i++){
    scanf("%d",&as[i]);
  }
  int i=0;
  int sum=0;
  int64_t total=0;
  for(int j=0;j<N;j++){
    while((sum&as[j])!=0){
      sum^=as[i++];
    }
    sum^=as[j];
    total+=j-i+1;
  }
  printf("%ld\n",total);
  return 0;
}


Measured memory_bytes: 896
use proconio::fastout;
use proconio::input;

const MOD: usize = 1000000007;

#[fastout]
fn main() {
    input! {
        n: usize,
        ns: [usize; n],
    }
    let mut ans = 1;
    let mut table = [0, 0, 0];
    for &n in &ns {
        ans *= table.iter().filter(|&&x| x == n).count();
        ans %= MOD;
        if let Some(i) = table.iter_mut().find(|&&mut x| x == n) {
            *i += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 3284
#include "bits/stdc++.h"
#define esc(ret) cout << (ret) << endl,quick_exit(0)
#define fcout(d) cout << fixed << setprecision(d)
#define repU(i,s,t) for(int i = (int)(s); i <= (int)(t); ++i)
#define repD(i,s,t) for(int i = (int)(s); i >= (int)(t); --i)
#define rep(i,n) repU(i,0,(n) - 1)
#define rep1(i,n) repU(i,1,(n))
#define all(v) begin(v),end(v)
#define vct vector
#define prique priority_queue
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define qceil(n,d) ((n) > 0 ? ((n) - 1) / (d) + 1 : (n) / (d))
#define parity(a,b) (a & 1 ^ b & 1 ^ 1)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;
typedef pair<db,int> pdi;

const pii dir[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int mod = 1e9 + 7;
const int inf32 = (1 << 30) - 1;
const ll inf64 = (1LL << 62) - 1;

ll N,M,Q,K,L;
string S;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> N >> L;
	int s = 0;
	ll l = -inf32;
	rep(i,N){
		int a;
		cin >> a;
		if(l + a >= L) {s = i;break;}
		l = a;
	}
	if(!s) esc("Impossible");
	cout << "Possible" << endl;
	rep1(j,s - 1) cout << j << endl;
	repD(j,N - 1,s + 1) cout << j << endl;
	cout << s << endl;
}






Measured memory_bytes: 896
#include <bits/stdc++.h>
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
using namespace std;
using cd = complex <double>;
 
typedef pair <int, int> pii;
 
const int Inf = 1000000007;
const long long mod = 1000000007;//998244353;
const double Pi = acos(-1);
 
void Fastio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}
 
int n;
string s;
 
int main()
{
	cin >> n >> s;
	for(int i = 0; i < min(n, int(s.length())); i++)
	{
		cout << s[i];
	}
	if(s.length() > n)
	{
		cout << "...";
	}	
}

Measured memory_bytes: 3648
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter
import kotlin.math.min

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

fun solve() {
    val n = readInteger()
    val s = br.readLine()!!


    val eSumsFromLeft = s.foldIndexed(mutableListOf(0)) { i, acc, _ ->
        acc += acc.last() + if (s[i] == 'E') 1 else 0
        acc
    }

    var ans = Int.MAX_VALUE
    for (i in 0 until n) {
        val turnRight = i - eSumsFromLeft[i]
        val turnLeft = eSumsFromLeft[n] - eSumsFromLeft[i + 1]
        ans = min(ans, turnRight + turnLeft)
    }
    out.println(ans)
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


Measured memory_bytes: 48056
#include<stdio.h>

int main(void){
    int s;
    int lineA[1000000] = {0};
    int idx = 0;
    int i;

    scanf("%d", &s);
    lineA[0] = s;

    while(1){
        idx++;
        if(lineA[idx-1] % 2 == 0){lineA[idx] = lineA[idx-1] / 2;}
        else{lineA[idx] = 3 * lineA[idx-1] + 1;}
    
        for(i = 0; i < idx; i++){
            if(lineA[i] == lineA[idx]){
                printf("%d\n", idx+1);
                return 0;
            }
        }

    }
}

Measured memory_bytes: 4096
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%MOD;
        }
        x = (x*x)%MOD;
        n >>= 1;
    }
    return ret;
}

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

    vector<ll> a(n),b(n);

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

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

    ll ans = 0;

    for(int i = 0;  i< n; i++){
        ans += max((ll)0,a[i] - b[i]);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static final void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		int sum =0;
		for (String s: line.split("")) {
			sum +=Integer.parseInt(s);
		}

		System.out.println(Integer.parseInt(line) % sum == 0 ? "Yes" : "No");
	}
}


Measured memory_bytes: 35644
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<string>
#include<map>
#include<set>
#include<functional>
#include<list>
#include<bitset>
#include<numeric>
#include<utility>
#define MAX 10
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
 
ll a[100009],b[100009];
 
ll dist(ll d1,ll d2){
    if(d1>=0 && d2>=0){
        return max(d1,d2);
    }
    if(d1<=0 && d2<=0){
        return max(-d1,-d2);
    }
    d1=abs(d1);
    d2=abs(d2);
    return 2*min(d1,d2)+max(d1,d2);
}
 
int main(){
    ll x,y,q,xi;
    cin>>x>>y>>q;
    for(int i=1;i<=x;i++){
        cin>>a[i];
    }
    for(int i=1;i<=y;i++){
        cin>>b[i];
    }
    a[0]=-10000000000000;
    b[0]=-10000000000000;
    a[x+1]=10000000000000;
    b[y+1]=10000000000000;
    for(int i=0;i<q;i++){
        ll la=-10000000000100,ra=10000000000001;
        ll lb=-10000000000100,rb=10000000000001;
        cin>>xi;
        int arp=lower_bound(a,a+x+1,xi)-a;
        int brp=lower_bound(b,b+y+1,xi)-b;
        ra=a[arp]-xi;
        rb=b[brp]-xi;
        la=a[arp-1]-xi;
        lb=b[brp-1]-xi;
      	//cout<<ra<<" "<<rb<<" "<<la<<" "<<lb<<endl;
      	
        ll ans=dist(ra,rb);
      //cout<<ans<<" 1"<<endl;
        ans=min(ans,dist(ra,lb));
      //cout<<ans<<" 2"<<endl;
        ans=min(ans,dist(la,lb));
      //cout<<ans<<" 3"<<endl;
        ans=min(ans,dist(la,rb));
      //cout<<ans<<" 4"<<endl;
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 2816
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;

const int MAXN = 100000 + 10000;

int n, m = 0;
vector<int> edg[MAXN];

bool dfs(int x, int fa)
{
	bool ret = false;
	for(int i = 0; i < edg[x].size(); i++)
		if(edg[x][i] != fa)
			if(!dfs(edg[x][i], x) && !ret)
				ret = true, m++;
	// cerr << x << ' ' << ret << endl;
	return ret;
}

int main()
{
	ios::sync_with_stdio(false);
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);

	cin >> n;
	for(int i = 1; i <= n - 1; i++)
	{
		int x, y;
		cin >> x >> y;
		edg[x].push_back(y), edg[y].push_back(x);
	}

	dfs(1, 0);
	if(2 * m == n)
		cout << "Second" << endl;
	else
		cout << "First" << endl;


	return 0;
}


Measured memory_bytes: 6016
#include <iostream>
#include <vector>
#include <cstdlib>
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 INF = 1LL << 60;

int N ; 
long long h[100010];
long long dp[100010];
int main(){
    int N; cin >> N;
    for (int i = 0; i < N; ++i) cin >> h[i];
for (int i = 0; i < N; ++i) dp[i] = INF;
dp[0] = 0;
for (int i = 0; i < N; ++i){
    chmin(dp[i + 1], dp[i] + abs(h[i + 1] - h[i]));
    
    chmin(dp[i + 2], dp[i] + abs(h[i + 2] - h[i]));
    
}
cout << dp[N - 1] << endl;

}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define f first
#define s second
#define sort(v) sort(v.begin(),v.end())
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define mp make_pair
 
typedef long long ll;
const int MAXN=1e6+9;
ll dp[MAXN];
ll mod=1e9+7;
 
 
int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    //freopen("paint.in","r",stdin);
    //freopen("paint.out","w",stdout);
 
 
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int x;
    cin>>x;
    if (x==1) cout<<0;
    else cout<<1;
 
}   


Measured memory_bytes: 3608
#include<iostream>
#include<cmath>
#include <iomanip>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;
using LL = long long;

LL a, b, c, k;

int main() {

	cin >> a >> b >> c >> k;

	if (a >= k)cout << k << endl;
	else
		if (a + b >= k)cout << a << endl;
		else
			cout << a - (k - a - b) << endl;

	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	long long int a, b, k[55], l[55], m[55], o[55], mon, ans;
	cin >> a >> b;
	for (int i = 0; i < a; ++i) {
		cin >> k[i] >> l[i];
	}
	for (int i = 0; i < b; ++i) {
		cin >> m[i] >> o[i];
	}
	for (int i = 0; i < a; ++i) {
		mon = 9000000000;
		for (int j = b - 1; j >= 0; --j) {
			if (abs(k[i] - m[j]) + abs(l[i] - o[j]) <= mon) {
				mon = abs(k[i] - m[j]) + abs(l[i] - o[j]);
				ans = j;
			}
		}
		cout << ans + 1 << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <iostream>
using namespace std;

int main() {
  int A,B,K;
  cin >> A >> B >> K;
  if ((B-A) < K*2) {
    for (int i=A; i<B+1; i++) {
      cout << i << endl;
    }
  }
  else {
    for (int i=0; i<K; i++) {
      cout << A+i << endl;
    }
    for (int i=0; i<K; i++) {
      cout << B-K+1+i << endl;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18)+1;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

ll n,k;
vl a(200001);

bool f(ll x){
  ll cnt=0;//cntは、xを下回る積の数
  rep(i,n){
    if(a[i]*a[i]<x){
      cnt--;
    }
    if(a[i]==0&&x>0){
      cnt+=n;
    }
    else if(a[i]==0){
      continue;
    }
    else if(a[i]>0){
      ll ok=n,ng=-1;//okがx越え
      while(ok-ng>1){
        ll mid=(ok+ng)/2;
        if(a[mid]*a[i]<x){
          ng=mid;
        }
        else{
          ok=mid;
        }
      }
      cnt+=ok;
    }
    else{
      ll ok=-1,ng=n;//okがx越え
      while(ng-ok>1){
        ll mid=(ok+ng)/2;
        if(a[mid]*a[i]<x){
          ng=mid;
        }
        else{
          ok=mid;
        }
      }
      cnt+=n-ng;
    }
  }
  cnt /=2;
  if(cnt<k){
    return true;
  }
  else{
    return false;
  }
}

void solve(){
  ll ok=-INF,ng=INF;
  while(ng-ok>1){
    ll mid=(ng+ok)/2;
    if(f(mid)){
      ok =mid;
    }
    else{
      ng =mid;
    }
  }
  cout << ok << endl;
}

int main() {
  cin >> n >> k;
  a.resize(n);
  rep(i,n){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  solve();
}

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

int main() {
    int n, k, ans;
    ans = 0;
    cin >> n >> k;
    vector<int> vec(n);

    for(int i = 0; i < n; i++) {
        cin >> vec.at(i);
        if(vec.at(i) <= k - vec.at(i)) ans += 2*vec.at(i);
        else ans += 2*(k - vec.at(i));
    }

    cout << ans << endl;
}

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

int gcd(int a, int b, int c) {
  if (a == 1 || b == 1 || c == 1) return 1;
  else {
    int tmp = min(a, min(b, c));
    int gcd = 1;
    for (int i = tmp; i > 0; i--) {
      if (a%i == 0 && b%i == 0 && c%i == 0) {
        gcd = i;
        break;
      }
    }
    return gcd;
  }
}

int main() {
  int K;
  cin >> K;
  int res = 0;
  for (int i = 1; i <= K; i++) {
    for (int j = 1; j <= K; j++) {
      for (int k = 1; k <= K; k++) {
        res += gcd(i, j, k);
      }
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		int i,j,k,t,min,minv,maxv,l;
		Scanner sc=new Scanner(System.in);
		t=Integer.parseInt(sc.next());
		int n[]=new int[t+1];
		for(i=0;i<t;i++){
			n[i]=Integer.parseInt(sc.next());
		}
		
		minv=n[0];
		maxv=n[1]-n[0];
		for(i=1;i<t;i++){
			maxv=Math.max(maxv, n[i]-minv);
			minv=Math.min(minv, n[i]);
		}
		System.out.println(maxv);
	}
}

Measured memory_bytes: 72116
#include <bits/stdc++.h>
#define repl(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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 n;
    cin >> n;
    vector<ll> a(n,0);
    vector<ll> s(n,0);
    rep(i,n)cin >> a[i];
    copy(a.begin(),a.end(),s.begin());
    sort(s.begin(),s.end());
    ll r = s[n/2];
    ll l = s[n/2-1];
    rep(i,n){
        if(a[i] <= l)cout << r << endl;
        else cout << l << endl;
    }
    return 0;
}

Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
#define F(i,L,R) for(int i=L;i<R;i++)
#define FE(i,L,R) for(int i=L;i<=R;i++)
#define RF(i,l,r) for(int i=r;i>l;i--)
#define RFE(i,l,r) for(int i=r;i>=l;i--)
#define getI(i) scanf("%d",&i)
#define getII(i,j) scanf("%d%d",&i,&j)
#define getIII(i,j,k) scanf("%d%d%d",&i,&j,&k)
#define VgetI(i) int (i);scanf("%d",&(i));
#define VgetII(i,j) int (i),(j);scanf("%d%d",&(i),&(j));
#define VgetIII(i,j,k) int (i),(j),(k);scanf("%d",&(i),&(j),&(k));
#define EoF(n) int(n);while(~getI(n))
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define abs(n) (n>0?n:(-n))
#define INF 2147483647
#define nINF -2147483648
const int n=1e5+1;
int tbl[100005],arr[100005],bit[100005];
vector<int> prime;
void update(int x,int val){
	while(x<=n){
		bit[x]+=val;
		x+=(x&-x);
	}
}
int query(int r){
	int ans=0;
	while(r>0){
		ans+=bit[r];
		r-=(r&-r);
	}
	return ans;
}
void init(){
	F(i,0,100001) tbl[i]=1,arr[i]=0,bit[i]=0;
	for(int i=2;i<=100000;i++) if(tbl[i]) for(int j=i*2;j<=100000;j+=i) tbl[j]=0;
	for(int i=3;i<=100000;i+=2) if(tbl[i]&&tbl[(i+1)/2]) arr[i]=1;
	FE(i,3,100000) update(i,arr[i]);
}
int main(){
	int q;
	init();
	while(~getI(q)){
		int cnt[q],index=0;
		while(q--){
			VgetII(l,r);
			cnt[index]=query(r)-query(l)+arr[l];
			index++;
		}
		F(i,0,index) printf("%d\n",cnt[i]);
	}
}


Measured memory_bytes: 2176
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 210000000
#define int long long

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

int lcm(int a, int b) { return a * b / gcd(a, b); }
void solve(){
    int n;
    cin >> n;
    int m;
    cin >> m;
    vector<string> s;
    for(int i=0;i<n;i++){
        string tmp;
        cin >> tmp;
        s.push_back(tmp);
    }
    sort(s.begin(),s.end());
    string ans="";
    for(int i=0;i<n;i++){
        ans += s[i];
    }
    cout << ans;
}
signed main() {
    solve();
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     ll n;
     cin>>n;
     ll q=n/500;
     ll r=n-q*500;
     ll y=r/5;
     cout<<q*1000+y*5<<endl;
 }
 


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

int main(){
  int n;
  cin >> n;
  vector<pair<int,int>> p;
  for(int i=0; i<n; i++){
    int a;
    cin >> a;
    p.emplace_back(a, i);
  }
  sort(p.begin(), p.end());
  for(int i=0; i<n; i++){
    if(i == p[n-1].second){
      cout << p[n-2].first << endl;
    }else{
      cout << p[n-1].first << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 3312
#include"bits/stdc++.h"
#define ll long long
#define inf 1e9
using namespace  std;

int main(){

	ll days;
	cin>>days;

	vector<ll> dp(3,0);

	for(ll i=0;i<days;i++){
		vector<ll> c(3);

		for(ll j=0;j<3;j++){
			cin>>c[j];
		}
		vector<ll> new_dp(3,0);

		for(ll j=0;j<3;j++){
			for(ll k=0;k<3;k++){
				if(j!=k){
					new_dp[k] = max(new_dp[k],dp[j]+c[k]);
				}
			}
		}

		dp = new_dp;
	}

	cout<<max(dp[0],max(dp[1],dp[2]))<<endl;

	return 0;
}

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

using namespace std;

bool solve(){
    int n;
    cin>>n;
    if(n==0)return false;
    vector<int> a(n);
    long long s=0;
    for (int i = 0; i < n; ++i) {
        cin>>a[i];
        s+=a[i];
    }
    int ans=0;
    for (int i = 0; i < n; ++i) {
        if(a[i]*n<=s)++ans;
    }
    cout<<ans<<endl;
    return true;
}

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


Measured memory_bytes: 3140
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
    lld n,m;
    vector<lld> d,t;

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

    cin >> m;
    t.resize(m);
    for(int i = 0; i < m; i++)
    {
        cin >> t[i];
    }

    sort(d.begin(),d.end());
    sort(t.begin(),t.end());

    int now = 0;

    for(int i = 0; i < m; i++)
    {
        for(int j = now; j < n; j++)
        {
            if (d[j] == t[i])
            {
                now = j+1;
                if (i == m-1)
                {
                    cout << "YES" << endl;
                    return 0;
                }
                break;
            }else
            {
                if (j == n-1)
                {
                    cout << "NO" << endl;
                    return 0;
                }
            }
        }
    }

    cout << "NO" << endl;

    return 0;
}

Measured memory_bytes: 3328
import java.util.Arrays;
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		main.solve(sc);
		sc.close();
	}

	void solve(Scanner sc) {
		int[] array = new int[3] ;
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		System.out.println(array[0] * array[1] / 2);

	}
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
 
typedef long long ll;
typedef long double ld;
 
#define REP(i,a,n) for(int (i)=(a); (i)<(int)(n); (i)++)
#define rep(i,n) REP(i,0,n)
#define vec vector 



int main(){
  int n;
  cin >> n;
  vector<string> S(n);
  rep(i, n) cin >> S.at(i);
  
  vector<map<char, int>> memo(n);
  map<char, int> memo_all;
  rep(i, n){
    rep(j, S.at(i).size()){
      memo.at(i)[S.at(i).at(j)]++;
      memo_all[S.at(i).at(j)]++;
    }
  }
 
  map<char, int> res;
  
  for(const auto& x: memo.at(0)){
    int temp = memo.at(0)[x.first];
    rep(i, n){
      if(memo.at(i)[x.first] < temp) temp = memo.at(i)[x.first];
    }
    if(temp > 0) res[x.first] = temp;
  }
  
  for(auto&& it = res.begin(); it != res.end(); it++){
    rep(i, it->second) cout << it->first;
  }
  
  //for(auto&& it = memo.at(1).begin(); it != memo.at(1).end(); it++){
    //rep(i, it->second) cout << it->first;
  //}


 
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<string>
#define ls k<<1,l,mid
#define rs k<<1|1,mid+1,r
#define mp(x,y) make_pair(x,y)
#define r(x) read(x)
#define rr(x,y) read(x);read(y)
#define rrr(x,y,z) read(x);read(y);read(z)
#define FOR(i,l,r) for(int i=l;i<=r;i++)
#define pb(x) push_back(x)
#define sss(str) scanf("%s",str+1)
#define ssf(x) scanf("%lf",&x)
#define aLL(x) x.begin(),x.end()
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef double dd;
typedef pair<LL,LL> pt;
const int N=2e5+5;
const int M=2e2+5;
const int INF=0x7fffffff;
const int mod=1e9+7;
const int sz=18;
const double eps=1e-10;
const double pi=acos(-1);
//***********************
int n,m;
char str[N];
int f[N];
//***********************
template<class T>
inline void read(T &x)
{
    char c; x=1;
    while((c=getchar())<'0'||c>'9') if(c=='-') x=-1;
    T res=c-'0';
    while((c=getchar())>='0'&&c<='9') res=res*10+c-'0';
    x*=res;
}
int main()
{
    r(n);
    cout<<(n+1)/2<<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<int>a(n);
	for (int i = 0; i < n; i++)cin >> a.at(i);
	ll ans = 0;
	for (int i = 0; i < n-1; i++) {
		if (i+1 == a.at(i)) {
			swap(a.at(i), a.at(i + 1));
			ans++;
		}
	}
	if (n == a.at(n - 1))ans++;
	cout << ans << endl;
}

Measured memory_bytes: 640
#include <stdio.h>

int main(void)
{
	int map[16][16] = {0};
	int zero, max;
	int x, y, ink;
	int i, j;
	int dx[3][4] = {{-1, 0, 0, 1}, {-1, -1, 1, 1}, {-2, 0, 0, 2}};
	int dy[3][4] = {{0, -1, 1, 0}, {1, -1, 1, -1}, {0, -2, 2, 0}};

	while (~scanf("%d,%d,%d", &x, &y, &ink)){
		x += 3;
		y += 3;
		map[y][x]++;
		for (i = 0; i < ink; i++){
			for (j = 0; j < 4; j++){
				map[y + dy[i][j]][x + dx[i][j]]++;
			}
		}
	}
	zero = max = 0;
	for (i = 3; i < 13; i++){
		for (j = 3; j < 13; j++){
			zero += !map[i][j];
			if (max < map[i][j]) max = map[i][j];
		}
	}
	printf("%d\n%d\n", zero, max);
	
	return (0);
}

Measured memory_bytes: 600
import java.util.*;

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

        int N = sc.nextInt();
        Long[] T = new Long[N];

        for(int i=0; i<N; i++){
            T[i] = sc.nextLong();
        }
        long multiple = T[0];

        for(int i=1; i<N; i++){
            long lcm = divisor(multiple, T[i]);
            multiple = T[i] / lcm * multiple;
        }
        System.out.println(multiple);
    }

    private static long divisor(long x, long y){
        long max = Math.max(x, y);
        long min = Math.min(x, y);

        long amari = max % min;
        if(amari==0){
            return min;
        }

        min = divisor(min, amari);

        return min;
    }
}

Measured memory_bytes: 21844
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<complex>
#include<unordered_map>

#define INF 1000000000ll
#define MOD 1000000007ll
#define EPS 1e-8

#define REP(i, m) for(long long i = 0; i < m; ++i)
#define FOR(i, n, m) for(long long i = n; i < m; ++i)
#define ALL(v) v.begin(), v.end()
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;

int main() {
	string s;
	cin>>s;
	cout<<s[0]<<s.size()-2<<s[s.size()-1]<<endl;
}


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

constexpr int N = 2e3, P = 1000000007;

int n, m;
int C[N + 1][N + 1];
int a[N + 1][N + 1], b[N + 1][N + 1];
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    std::cin >> n >> m;
    
    for (int i = 0; i <= N; ++i) {
        C[i][0] = 1;
        for (int j = 1; j <= i; ++j)
            C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % P;
    }
    
    for (int y = 0; y < m; ++y) {
        int v = 0;
        for (int s = 0; s < n; ++s) {
            if (s <= y)
                v = (v + C[y][s]) % P;
            a[s + 1][y + 1] = v;
        }
    }
    
    for (int i = 0; i <= m; ++i)
        a[0][i] = 1;
    
    for (int x = 0; x <= n; ++x) {
        for (int y = 0; y < m; ++y) {
            if (x + y <= n) {
                b[x][y] = C[m - 1][y];
            } else {
                b[x][y] = C[n - x + m - y - 1][n - x];
            }
        }
    }
    
    for (int i = 0; i <= m; ++i)
        for (int j = 1; j <= n; ++j)
            a[j][i] = (a[j][i] + a[j - 1][i]) % P;
    
    int ans = 1;
    
    for (int i = 0; i <= m; ++i)
        for (int j = 0; j < n; ++j)
            ans = (ans + 1ll * a[j][i] * b[j + 1][i]) % P;
    
    std::cout << ans << "\n";
    
    return 0;
}

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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------
int a,b,c;
int res;

bool eq (int x, int y) {
  if (x == y) return true;
  else return false;
}

int main(){
  scanf("%d %d %d",&a,&b,&c);
  res = eq(a,b) + eq(b,c) + eq(a,c);

  if (res == 3) printf("1\n");
  else printf("%d\n",3 - res);

}


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

ll cvm(ll h){
    if (h == 1) return 1;
    else return 2 * cvm(h / 2) + 1;
}

int main(){
    ll h;
    cin >> h;
    ll ans = cvm(h);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String c = sc.next();
        int leftp = 0;
        int rightp = n-1;
        int ans=0;
        while (true) {
            while (c.charAt(leftp) == 'R') {
                leftp++;
                if (leftp == rightp) {
                    System.out.println(ans);
                    return;
                }
            }
            while (c.charAt(rightp) == 'W') {
                rightp--;
                if (leftp == rightp) {
                    System.out.println(ans);
                    return;
                }
            }
            ans++;
            leftp++;
            rightp--;
            if (leftp >= rightp) {
                System.out.println(ans);
                return;
            }
        }
    }
}


Measured memory_bytes: 40404
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
  int n,x,t;
  cin>>n>>x>>t;
  if(n%x==0)
  {
    cout<<(n/x)*t;
  }
  else
  {
    cout<<(n/x+1)*t;
  }
}

Measured memory_bytes: 3632