akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define INF 1e9
#define MAX 101010
#define ll long long
#define vi vector<int>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

int Q, l ,r;
vi vec,a,s;
vector<bool> is_prime;

void eratosthenes_sieve(){
    is_prime.resize(MAX,1);

    is_prime[0] = false, is_prime[1] = false;

    for(int i = 2; i < MAX; i++){
        if(!is_prime[i]) continue;
        for(int j = i*2; j < MAX; j+=i) is_prime[j] = 0;
    }
}

void solve(){
    eratosthenes_sieve();

    a.resize(MAX,0);
    rep(i, MAX){ //2017likeか?
        if(i % 2 == 0) continue;
        if(is_prime[i] && is_prime[(i+1)/2]) a[i] = 1;
    }

    s.resize(MAX+1,0);
    for(int i = 0; i < MAX; i++)  //s[i+1] = a[i]までの和
        s[i+1] = a[i] + s[i];
}

int main(){
    solve();

    cin >> Q;

    rep(i,Q){
        cin >> l >> r;
        ++r;

        cout << s[r] - s[l] << endl;
    }
}


Measured memory_bytes: 1408
/**Bismillahir Rahmanir Rahim.**/
#include<bits/stdc++.h>
#define ll 	 long long
#define pb push_back
#define mp make_pair
using namespace std;

int main() 
{ 

string x; cin>>x;

string a="SUN", b="MON", c="TUE", d="WED", e="THU", f="FRI", g="SAT";

if(x==a) cout<<"7\n";
else if(x==b) cout<<"6\n";
else if(x==c) cout<<"5\n";
else if(x==d) cout<<"4\n";
else if(x==e) cout<<"3\n";
else if(x==f) cout<<"2\n";
else if(x==g) cout<<"1\n";
    return 0;
} 

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;i--)
#define FOR(i,s,n) for(int i = s;i < (int)n;i++)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--)
#define ALL(a) a.begin(),a.end()
#define IN(a, x, b) (a<=x && x<b)
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a = b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a = b;return true;}return false;}
template<class T>istream&operator >>(istream&is,vector<T>&vec){for(T&x:vec)is>>x;return is;}
template<class T>inline void OUT(T t){cout<<t<<"\n";}
template<class T,class... Ts>inline void OUT(T t,Ts... ts){cout<<t<<" ";OUT(ts...);}
template<typename T=int>vector<T>mv(size_t a){return vector<T>(a);}
template<typename T=int,typename... Ts>auto mv(size_t a,Ts... ts){return vector<decltype(mv<T>(ts...))>(a,mv<T>(ts...));}
template<typename T,typename V>typename enable_if<is_class<T>::value==0>::type FILL(T&t,const V&v){t=v;}
template<typename T,typename V>typename enable_if<is_class<T>::value!=0>::type FILL(T&t,const V&v){for(auto &e:t)FILL(e,v);}
constexpr long long INF = 1e18;

signed main(){
	int N;
	cin>>N;
	if(N&1){
		OUT(0);
		return 0;
	}
	unsigned long long ans = 0,ans1 = 0;
	int n = N;
	while(N){
		ans1+=N/5;
		N/=5;
	}
	while(n){
		ans+=n/5-n/10;
		n/=5;
	}
	OUT(ans1-ans);

}
//124999999999999995
//1124999999999999995

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)

ll gcd(ll x, ll y) { return y ? gcd(y, x%y) : x; }

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

	int n, k; cin >> n >> k;
	vector<int> a(n);
	int max_a = -1;
	rep(i, n) {
		cin >> a[i];
		max_a = max(max_a, a[i]);
	}
	int GCD = a[0];
	REP(i, 1, n) GCD = gcd(GCD, a[i]);

	cout << (k%GCD == 0 && k <= max_a ? "POSSIBLE" : "IMPOSSIBLE") << '\n';
	return 0;
}

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

using namespace std;

#define ll long long
#define fix cout << fixed; cout << setprecision(0)





void solve() {

	int x;
	int n;
	cin >> x >> n;
	unordered_set<int> bag;
	while(n--) {
		int k;
		cin >> k;
		bag.insert(k);
	}
	for(int i = 0; i < 101; i++) {
		if(bag.find(x - i) == bag.end()) {
			cout << x - i << "\n";
			return;
		}
		if(bag.find(x + i) == bag.end()) {
			cout << x + i << "\n";
			return;
		}
	}





	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	fix;
	solve();

	return 0;
}

Measured memory_bytes: 3652
def main():
    n = int(input())
    s = list(input())
    w = 0
    e = 0
    ans = 1<<32
    for ss in s:
        if ss=="W":
            w+=1
        else:
            e+=1
    ww = 0
    for ss in s:
        if ss=="W":
            w -= 1
            ans = min(ans,e+ww)
            ww += 1
        else:
            e -= 1
            ans = min(ans,e+ww)
    print(ans)


if __name__ == '__main__':
    main()

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

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() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int n, m;
    cin >> n >> m;

    vector<int> a(m);
    rep(i, m) cin >> a[i];

    const int MOD = 1e9+7;

    ll dp[100100];
    for(int i = 0; i < 100100; ++i) {
        dp[i] = 0;
    }
    for(int i = 0; i < m; ++i) {
        dp[a[i]] = -1;
    }
    dp[0] = 0;
    if(dp[1] == -1 && dp[2] != -1) {
        dp[1] = 0;
        dp[2] = 1;
    }
    else if(dp[1] != -1 && dp[2] == -1) {
        dp[1] = 1;
        dp[2] = 0;
    }
    else if(dp[1] == -1 && dp[2] == -1) {
        dp[1] = 0;
        dp[2] = 0;
    }
    else {
        dp[1] = 1;
        dp[2] = 2;
    }

    for(int i = 3; i <= n; ++i) {
        if(dp[i] == -1) {
            dp[i] = 0;
            continue;
        }

        dp[i] = dp[i-1] + dp[i-2] % MOD;
    }

    ll ans = dp[n] % MOD;

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

Measured memory_bytes: 4456
import sys
write = sys.stdout.write

while True:
    entry = map(int, raw_input().split())
    H = entry[0]
    W = entry[1]
    if H == 0 and W == 0:
        break
    
    for j in range(H):
        for k in range(W):
            if (j + k) % 2 == 0:
                write("#")
            else:
                write(".")
        print ""
    print ""

Measured memory_bytes: 6376
nab = list(map(int, input().split()))
n = nab[0]
a = nab[1]
b = nab[2]

result_list = []

for i in range(n):
    j = i + 1
    result = sum(list(map(int, str(j))))
    if (result >= a) & (result <= b):
        result_list.append(j)

print(sum(result_list))

Measured memory_bytes: 3424
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

#define MAXN 1010LL


// range sum query using fenwick tree
// note index starts at 1

class fenwick_tree {
	vector<long> t;
	long size;
public:
	fenwick_tree(long n) {
		t.assign(n + 1, 0);
		size = n + 1;
	}

	long LSOne(long k) {	// least significant 1-bit
		return k & (-k);
	}

	void update(long index, long val) {	// can go up or go down
		for (; index < size; index += LSOne(index)) t[index] += val;
	}

	long query_full(long a, long b) {		// range query
		return query(b) - ((a <= 1) ? 0 : query(a - 1));
	}

	long query(long b) {	// range query 1..b
		if (b < 1) return 0;

		long sum = 0;
		for (; b; b -= LSOne(b)) sum += t[b];
		return sum;
	}
};

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

	long long n, i, j, k, a, b, ans, c1, c2, x;
	cin >> n;
	vector<long long> v(n), ct(MAXN, 0), s(MAXN, 0);

	for (i = 0; i < n; i++) {
		cin >> x;
		ct[x]++;
		v[i] = x;
	}
	sort(v.begin(), v.end());
	for (i = 1; i < MAXN; i++) s[i] = s[i - 1] + ct[i];
	
	fenwick_tree ft(MAXN);
	for (i = 1; i < MAXN; i++) ft.update(i, ct[i]);

	ans = 0;
	for (i = 0; i < n; i++) {
		ft.update(v[i], -1);
		for (j = i + 1; j < n; j++) {
			ft.update(v[j], -1);

			c2 = min(MAXN - 1, v[i] + v[j] - 1);
			c1 = max(v[j], v[j] - v[i] + 1);

			if (c1 > c2) continue;
			x = ft.query_full(c1, c2);
			ans += x;
		}
		for (j = i + 1; j < n; j++) ft.update(v[j], 1);
	}

	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 888
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
namespace AtCoder_Beginner_Contest_135
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Out.Flush();
        }
        static void Solve()
        {
            var N = Sarray()[0];
            var Ai = Sarray();
            var Bi = Sarray();
            var cnt = 0L;
            for (var i = N - 1; 0 <= i; --i)
            {
                var Bid = Math.Max(0, Bi[i] - Ai[i + 1]);//Ai+1を退治して残り戦力
                cnt += Bi[i] - Bid;//Ai+1での討伐数
                var Aid = Math.Max(0, Ai[i] - Bid);//Aiを退治
                cnt += Ai[i] - Aid;//Aiでの討伐数
                Ai[i] = Aid;//Ai残り
            }
            WriteLine(cnt);
        }
    }
}


Measured memory_bytes: 33784
#include <iostream>

using namespace std;

int main() {
	int N;

	cin >> N;

	N = N % 10;

	if (N == 3) cout << "bon" << endl;
	else if (N == 0 || N == 1 || N == 6 || N == 8) cout << "pon" << endl;
	else cout << "hon" << endl;

	return 0;
}


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

using namespace std;

int main (){

  int n;
  int b;
  cin>>n;
  vector <tuple <int,int>> a;
  
  for(int i=0; i<n;i++){
  	int d = i+1;
    cin>>b;
    a.push_back(tie(b,d));
  }
  sort(a.begin(), a.end());
  
  for(tuple<int ,int> t :a){
  	int x,y;
    tie(x,y)=t;
    cout<<y<<" ";
  }
   
}

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

//--> definitions
#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--)

//--> typedef
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<pii,int> piii;
typedef tuple<int,int,int> tiii;

#define MP make_pair
#define PB push_back
#define fi first
#define se second
#define INF 1e9

const int maxN = 1e4+11;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
    
    int n,l;
    cin>>n>>l;
    string s[111];
    FOR(i,0,n){
        cin>>s[i];
    }
    
    sort(s,s+n);
    
    string res="";
    FOR(i,0,n)
        res+=s[i];
    
    cout<<res<<"\n";


	return 0;
}

Measured memory_bytes: 3672
#include <stdio.h>
#include <stdlib.h>
int cmp(const void*a,const void*b){
    return *(int*)b-*(int*)a;
}
int main(){
    int n,a,b,c,d[10000],i,cost,calorie;
    scanf("%d%d%d%d",&n,&a,&b,&c);
    for (i=0; i<n; i++) {
        scanf("%d",&d[i]);
    }
    qsort(d, n, sizeof(int), cmp);
    cost=a;
    calorie=c;
    for (i=0;calorie*b<d[i]*cost; i++) {
        cost+=b;
        calorie+=d[i];
    }
    printf("%d\n",calorie/cost);
    return 0;
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define si short int
#define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pill pair<ll,ll>
#define f first
#define s second
#define pilc pair<ll,char>
#define all(a) (a).begin(),(a).end()
#define rep(s,e,step) for(int i = (s); i < (e) ; i += step)
#define vrep(s,e,step) for(int j = (s); j < (e) ; j += step)
#define ex exit(0)
#define sz(a) (a).size()
#define ld long double


using namespace std;

const ll N = 1;
const ll big = 1e18;
const ll block = 800;
const ll mod = 1e6;
const ld pi = acos(-1.0);

ld rd(ld ang) {
	return ang / 180.000 * pi;
}

int main() {
	speed;
	ld a, b, h, m;
	cin >> a >> b;
	cin >> h >> m;
	ld angle1 = h * 30 + m / 2 ;
	ld angle2 = m * 6;
	ld hm = min(abs(angle1 - angle2),  abs(angle2 - angle1));
	ld ans = a * a + b * b - 2.0 * a * b * cos(rd(hm));
	cout << fixed << setprecision(9) << sqrt(ans);
}

/*
*/



Measured memory_bytes: 4160
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

h,a = LI()
print(math.ceil(h/a))

Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    char c[3][3];
    rep(i, 3) rep(j, 3) cin >> c[i][j];
    rep(i, 3) {
        cout << c[i][i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main(){
  int n[28];
  int cn[30];
  for(int j=0;j<28;j++){
    cin >> n[j];
  }
  for(int i=0;i<30;i++){
    cn[i] = i+1;
    cin >> cn[i];
  }
  for(int i=0;i<30;i++){
    for(int j=0;j<28;j++){
      if(cn[i]==n[j]){
	cn[i] = 0;
      }
    }
  }
  for(int i=0;i<30;i++){
	if(cn[i]>0){
	  cout << cn[i] << endl;
	}
  }
  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>

using namespace std;

int main(){

  long long m=1000000007;
  long long int r=0,b=0,g=0;//それぞれ赤、青、緑の帽子の数

  int n;
  cin >> n;

  long long int l=1;

  //0人目は必ず0と言う
  long long a;
  cin >>a;
  if(a!=0){
    cout << 0 << endl;
    return 0;
  }
  r++;
  l*=3;
  for(int i=1;i<n;i++){
    cin >> a;
    //i人目の色としてあり得る色の数をlにかけていく
    if(r==a){
      if(b==a){
        if(g==a){
          l*=3;
          l%=m;
          r++;
        }
        else{
          l*=2;
          l%=m;
          r++;
        }
      }
      else{
        if(g==a){
          l*=2;
          l%=m;
          r++;
        }
        else{
          r++;
        }
      }
    }
    else{
      if(b==a){
        if(g==a){
          l*=2;
          l%=m;
          b++;
        }
        else{
          b++;
        }
      }
      else{
        if(g==a){
          g++;
        }
        else l=0;
      }
    }
  }

  cout << l%m << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<pair<int, int>> p(n);
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        int l, r;
        cin >> l >> r;
        p[i] = {--l, -r};
    }
    sort(p.begin(), p.end());
    vector<int> x;
    for (int i = 0; i < n; ++i) {
        p[i].second = -p[i].second;
        while (!x.empty() && p[x.back()].second >= p[i].second)
            x.pop_back();
        x.push_back(i);
    }
    vector<bool> used(n);
    for (int i : x)
        used[i] = true;
    if (x.size() < n) {
        int l = 0, r = 1E9;
        for (int i = 0; i < x.size(); ++i) {
            l = max(l, p[x[i]].first);
            r = min(r, p[x[i]].second);
        }
        ans += max(0, r - l);
        l = 0;
        for (int i = 0; i < n; ++i) {
            if (used[i])
                continue;
            l = max(l, p[i].second - p[i].first);
        }
        ans += l;
    }
    for (int i = 0; i + 1 < x.size(); ++i)
        ans = max(ans, max(0, p[x[0]].second - p[x[i]].first) + max(0, p[x[i + 1]].second - p[x.back()].first));
    for (int i = 1; i + 1 < x.size(); ++i)
        ans = max(ans, p[x[i]].second - p[x[i]].first + max(0, p[x[0]].second - p[x.back()].first));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1660
#pragma GCC optimize ("O3")
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cstdlib>
#include <utility>
#include <cctype>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#define LL long long
#define LB long double
#define x first
#define y second
#define Pair pair<int,int>
#define pb push_back
#define pf push_front
#define mp make_pair
#define LOWBIT(x) x & (-x)
using namespace std;

const int MOD=1e9+7;
const LL LINF=2e16;
const int INF=2e9;
const int magic=348;
const double eps=1e-10;
const double pi=3.14159265;

inline int getint()
{
    char ch;int res;bool f;
    while (!isdigit(ch=getchar()) && ch!='-') {}
    if (ch=='-') f=false,res=0; else f=true,res=ch-'0';
    while (isdigit(ch=getchar())) res=res*10+ch-'0';
    return f?res:-res;
}

int n,m,k;
int need_pos[28],need_dir[28];
LL dp[2][1500048];
int nxt[21][1100048];

inline LL mod(LL x)
{
	while (x>=MOD) x-=MOD;
	return x;
}

int main ()
{
	int i,Mask,toMask,pos,x,y,c,step,cur;
	n=getint();m=getint();k=getint();n--;
	for (i=1;i<=k;i++)
	{
		x=getint();y=getint();c=getint();
		need_pos[x]|=(1<<(y-1));need_dir[x]|=(1<<(y-1))*c;
	}
	for (i=0;i<=n-1;i++)
		for (Mask=0;Mask<=(1<<n)-1;Mask++)
		{
			if (Mask&(1<<i))
			{
				nxt[i][Mask]=-1;
				continue;
			}
			toMask=Mask;toMask|=(1<<i);pos=i;
			while (pos<=n-1 && !(Mask&(1<<pos))) pos++;
			if (pos<=n-1) toMask^=(1<<pos);
			nxt[i][Mask]=toMask;
		}
	memset(dp,0,sizeof(dp));
	dp[0][0]=1;
	for (step=1,cur=1;step<=m;step++,cur^=1)
	{
		for (Mask=0;Mask<=(1<<n)-1;Mask++)
			dp[cur][Mask]=dp[cur^1][Mask];
		for (i=0;i<=n-1;i++)
			for (Mask=0;Mask<=(1<<n)-1;Mask++)
				if (nxt[i][Mask]!=-1)
					dp[cur][nxt[i][Mask]]=mod(dp[cur][nxt[i][Mask]]+dp[cur][Mask]);
		for (Mask=0;Mask<=(1<<n)-1;Mask++)
			if ((Mask&need_pos[step])!=need_dir[step])
				dp[cur][Mask]=0;
		//if (step==1)
		//for (Mask=0;Mask<=(1<<n)-1;Mask++)
		//	cout<<Mask<<' '<<dp[cur][Mask]<<endl;
	}
	LL ans=0;
	for (Mask=0;Mask<=(1<<n)-1;Mask++)
		ans=mod(ans+dp[cur^1][Mask]);
	printf("%lld\n",ans);
	return 0;
}

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

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> v(n);
  for(int i=0;i<n;i++){
    cin >> v[i];
  }
  sort(v.begin(),v.end());
  reverse(v.begin(),v.end());
  int ret = 0;
  for(int i=0;i<k;i++){
    ret+=v[i];
  }
  cout << ret << endl;
  return 0;
}


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

using namespace std;

int main(void) {
    int n;
    cin >> n;
    
    vector<int> next(n+2), prev(n+2);
    vector<int> idx(n);
    iota(next.begin(), next.end(), 1);
    iota(prev.begin(), prev.end(), -1);
    next.back() = n+1;
    prev.front() = 0;

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

    long r = 0;
    for(int i=0; i<n; i++) {
        long j = idx[i];
        r += (next[next[j]] - next[j]) * (j - prev[j]) * (i+1);
        r += (prev[j] - prev[prev[j]]) * (next[j] - j) * (i+1);
        prev[next[j]] = prev[j];
        next[prev[j]] = next[j];
    }

    
    cout << r << endl;
}


Measured memory_bytes: 1408
use proconio::input;

fn main() {
  input! { 
    n: usize,
    m: usize,
    a: [isize; n],
  }
  let total: isize = a.iter().sum();
  let count =  a.iter().filter(|e| 4 * (m as isize) * **e >= total).count();
  println!("{}", if count >= m { "Yes" } else { "No" });
}


Measured memory_bytes: 2140
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
#define eps 1e-6
#define ll long long
using namespace std;
const int N = 1e3+5;
int a[N];
int c(int x,int y)
{
  int a=1,b=1;
  for(int i=y;i>y-x;i--)a*=i;
  for(int i=1;i<=x;i++)b*=i;
  return a/b;
}
int main()
{
  int n,m;
  cin>>n>>m;
  if(n==1&&m==1)cout<<0<<endl;
  else if(n==1&&m>1)cout<<c(2,m)<<endl;
  else if(n>1&&m==1)cout<<c(2,n)<<endl;
  else cout<<c(2,m)+c(2,n)<<endl;
  return 0;
}


Measured memory_bytes: 256
program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,asum
    integer(int32), allocatable:: a(:), adf(:)

    read*, n
    allocate(a(0:n+1), source=0)
    read*, a(1:n)
    allocate(adf(0:n))
    do i=0,n
        adf(i) = a(i+1) - a(i)
    end do
    deallocate(a)
    asum = sum(abs(adf))
    do i=1,n
        print'(i0)', asum - sum(abs(adf(i-1:i))) + abs(sum(adf(i-1:i)))
    end do
end program name

Measured memory_bytes: 2168
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
int n,m;
int h[200001];
vector<int> vc[200001];
bool help(int i)
{
    for(int j=0;j<vc[i].size();j++)
        if(h[i]<=h[vc[i][j]]) return false;
     //cout<<i<<endl;
    return true;
}
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        cin>>h[i];
    for(int i=1;i<=m;i++)
    {
        int j,k;
        cin>>j>>k;
        vc[j].push_back(k);
        vc[k].push_back(j);    }
    int res=0;
    for(int i=1;i<=n;i++)
        if(help(i))
            res++;
    cout<<res;
}

Measured memory_bytes: 11468
#include<iostream>
#include<cstdio>
#include<stack>
#include<string>
#include<cstdlib>
using namespace std;

stack<int>sta;

int main(){
  char n[11111];
  
  while(scanf(" %s",n)!=EOF){

    if(n[0]=='+'){
      int a=sta.top(); sta.pop();
      int b=sta.top(); sta.pop();
      a=a+b;
      sta.push(a);
    }else if(n[0]=='-'){
      int b=sta.top(); sta.pop();
      int a=sta.top(); sta.pop();
      a=a-b;
      sta.push(a);
    }else if(n[0]=='*'){
      int a=sta.top(); sta.pop();
      int b=sta.top(); sta.pop();
      a=a*b;
      sta.push(a);
    }else{
      sta.push(atoi(n));
    }
    
    //cout << sta.top() << endl;

  }
  
  cout << sta.top() << endl;
  
  return 0;
  
}

Measured memory_bytes: 3208
#アルゴリズム関数-サイコロを回転させる
def dice_rotation(list1, str1):
    if str1 == "S":
        list1[0],list1[1],list1[4],list1[5] = list1[4],list1[0],list1[5],list1[1]
    elif str1 == "E":
        list1[0],list1[2],list1[3],list1[5] = list1[3],list1[0],list1[5],list1[2]
    elif str1 == "N":
        list1[0],list1[1],list1[4],list1[5] = list1[1],list1[5],list1[0],list1[4]
    elif str1 == "W":
        list1[0],list1[2],list1[3],list1[5] = list1[2],list1[5],list1[0],list1[3]
    return list1

#アルゴリズム関数-上面・前面の番号を指定番号へサイコロを回転させる
def dice_find(list1, int1, int2):
    position_numnber = list1.index(int2)
    if position_numnber == 0:
        list1 = dice_rotation(list1, "S")
    elif position_numnber == 2:
        list1 = dice_rotation(list1, "W")
        list1 = dice_rotation(list1, "S")
    elif position_numnber == 3:
        list1 = dice_rotation(list1, "E")
        list1 = dice_rotation(list1, "S")
    elif position_numnber == 4:
        list1 = dice_rotation(list1, "S")
        list1 = dice_rotation(list1, "S")
    elif position_numnber == 5:
        list1 = dice_rotation(list1, "N")
    position_numnber = list1.index(int1)
    if position_numnber == 2:
        list1 = dice_rotation(list1, "W")
    elif position_numnber == 3:
        list1 = dice_rotation(list1, "E")
    elif position_numnber == 5:
        list1 = dice_rotation(list1, "W")
        list1 = dice_rotation(list1, "W")
    return list1

#インプットdataの格納
input_number = list(map(int, input().split()))
input_count = int(input())
result = list()

#処理の実行
for count in range(input_count):
    check_number = list(map(int, input().split()))
    input_number = dice_find(input_number, check_number[0], check_number[1])
    result.append(input_number[2])

#結果表示
[print(i) for i in result] 



Measured memory_bytes: 5612
#include <iostream>
#include <cstdio>
#include <string.h>
#include <vector>
#include <limits>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <assert.h>
#include <sstream>
#include <type_traits>
#define SET(x,y) x |= (1 << y)
#define CLEAR(x,y) x &= ~(1<< y)
#define READ(x,y) ((0u == (x & (1<<y)))?0u:1u)
#define TOGGLE(x,y) (x ^= (1<<y))
#define watch(x) cout << (#x) << " is " << (x) << endl
#define pb push_back
#define mp make_pair
#define si(n) scanf("%d",&n)
#define sf(n) scanf("%f",&n)
#define sl(n) scanf("%lld",&n)
#define slu(n) scanf("%llu",&n)
#define sd(n) scanf("%lf",&n)
#define ss(n) scanf("%s",n)
#define pnl printf("\n")
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pF first
#define pS second
#define CL(a,b) memset(a,b,sizeof(a))
#define sqr(x) ((x)*(x))
#define intLIMIT numeric_limits<int>
#define longLIMIT numeric_limits<long long>
#define GCD(a,b) __gcd((a),(b))
#define dbl(x) (double)(x)
#define vi vector <int>
#define vii vector < pair <int, int> >
#define vll vector <long long>
#define allof(x) (x).begin(), (x).end()
#define fastCin cin.sync_with_stdio(0);cin.tie(0)
#define scanUnsigned(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
#define printArr(a,l) cout<<#a<<": ";for(int i=0;i<(l);i++){cout<<a[i]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(int i=0;i<(r);i++){for(int j=0;j<(c);j++){cout<<a[i][j]<<" ";}cout<<endl;}
char _;
using namespace std;
void PRINT (int x, int y) { for (int i = y-1; i >= 0; i--) { cout << READ(x,i); } cout << endl; }

vector<string>vec_splitter(string s){s+=',';vector<string>res;while(!s.empty()){res.push_back(s.substr(0,s.find(',')));s=s.substr(s.find(',')+1);}
return res;}
void debug_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM){cerr<<endl;}
template<typename Head,typename...Tail>void debug_out(vector<string>args,int idx,int LINE_NUM,Head H,Tail...T){if(idx>0)cerr<<", ";else cerr<<"Line("<<LINE_NUM<<") ";stringstream ss;ss<<H;cerr<<args[idx]<<" = "<<ss.str();debug_out(args,idx+1,LINE_NUM,T...);}
#ifdef LOCAL_DBG
#define dbg(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define dbg(...) 42
#endif

int main () {
	fastCin;
	bool n;
	cin >> n;
	cout << !n << "\n";
	return 0;
}

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

int main() {
    ll n;cin>>n;
    string s;
    while (n) {
        n--;
        s+='a'+n%26;
        n/=26;
    }
    reverse(s.begin(),s.end());
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 3604
r = Array.new 1000000,1
(2..1000).each{|i|
	next if r[i] == 0
	j = i * i
	while j < 1000000
		r[j] = 0
		j += i
	end
}
r[0] = r[1] = 0
(2..1000000).each{|i|
	r[i] = r[i] == 1 ? r[i-1] + 1 : r[i - 1]
}
while gets
	p r[$_.to_i]
end

Measured memory_bytes: 13932
#include <stdio.h>
#include <string.h>
int main(){
    char s[101], p[101], n[201];
    scanf("%s", s);
    scanf("%s", p);
    strcpy(n, s);
    strcat(n, s);
    if (strstr(n, p) != NULL)
    {
        printf("Yes\n");
    }else
    {
        printf("No\n");
    }
    return 0;
          
}


Measured memory_bytes: 2112
#pragma GCC optimize("Ofast")

#include <algorithm>      //sort,二分探索,など
#include <bitset>         //固定長bit集合
#include <cmath>          //pow,logなど
#include <complex>        //複素数
#include <deque>          //両端アクセスのキュー
#include <functional>     //sortのgreater
#include <iomanip>        //setprecision(浮動小数点の出力の誤差)
#include <iostream>       //入出力
#include <iterator>       //集合演算(積集合,和集合,差集合など)
#include <map>            //map(辞書)
#include <numeric>        //iota(整数列の生成),gcdとlcm(c++17)
#include <queue>          //キュー
#include <set>            //集合
#include <stack>          //スタック
#include <string>         //文字列
#include <unordered_map>  //イテレータあるけど順序保持しないmap
#include <unordered_set>  //イテレータあるけど順序保持しないset
#include <utility>        //pair
#include <vector>         //可変長配列

using namespace std;


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


    char a;
    cin >> a;

	if(isupper(a)){
		cout << "A\n";
	}else{
		cout << "a\n";
	}
    
	return 0;
}

Measured memory_bytes: 3652
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int  n= sc.nextInt();
		ArrayList<Integer> v = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {

			v.add(sc.nextInt());
		}
		ArrayList<Integer> c = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			c.add(sc.nextInt());
		}
		int sum=0;
		int plus=0;
		for(int i=0;i<n;i++) {
			plus = v.get(i)-c.get(i);
			if(plus>0) {
				sum+=plus;
			}
		}
		System.out.println(sum);
	}
}


Measured memory_bytes: 23380
gets.to_i.times do
  b, c = [], []
  gets.split.map(&:to_i).each do |x|
    case
    when !b.last
      b << x
    when b.last < x
      b << x
    when !c.last || c.last < x
      c << x
    else
      break
    end
  end
  puts b.size + c.size == 10 ? 'YES' : 'NO'
end

Measured memory_bytes: 8648
/*
 *    FileName:
 *      Source:
 *        Date:
 *      Author: Mew
 *	  Function:
 */
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iomanip>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<ctime>
using namespace std;
int a[100002],n;
int main()
{
	cin >> n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	int ans = 0;
	for(int i=1;i<=n;i++){
		if(a[i] < i && a[a[i]] == i)
			ans ++;
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 768
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
bool h[1000010]={false};
int main(){
	string s;
	while(getline(cin,s)){
		while(s.find("this")==string::npos&&s.find("that")==string::npos&&s.find("the")==string::npos){
			rep(i,s.size())if(isalpha(s[i])){
				if(s[i]=='z')s[i]='a';
				else s[i]++;
			}
		}
		cout<<s<<endl;
	}
}

Measured memory_bytes: 1180
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <utility>

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

bool func()
{
    int n;
    cin >> n;
    
    vi a(n);
    rep(i, n) cin >> a[i];
    
    sort(a.begin(), a.end());
    
    int mi = a[0];
    int ma = a[n-1];
    
    vi hist(n);
    rep(i, n) hist[a[i]]++;
    
    if(mi != (ma+1)/2) return false;
    if(hist[mi] != 1+ma%2) return false;
    
    reps(i, mi+1, ma){
        if(hist[i] <= 1) return false;
    }
    
    return true;
}


signed main()
{
    cout << (func() ? "Possible" : "Impossible") << endl;
}


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

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define endl '\n'
#define mod 1000000007
#define maxN 1e5
const int inf=0x3f3f3f3f;

int main() {
	Omar45
	ll n, k;
	cin >> n >> k;
	int a[n+3];
	for (int i=0; i<n; i++)
        cin >> a[i];
    ll ans = (n+k-3)/(k-1);
    cout << ans << endl;
}


Measured memory_bytes: 640
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

MOD = 10 ** 9 + 7

def factorial(n):
    global fct
    global invfct
    fct = [0] * (n + 1)
    fct[0] = 1
    for i in range(1, n+1):
        fct[i] = fct[i-1] * i % MOD
    invfct = [0] * (n + 1)
    invfct[n] = pow(fct[n], MOD - 2, MOD)
    for i in range(n-1, -1, -1):
        invfct[i] = invfct[i+1] * (i + 1) % MOD

factorial(N)

def binomial(n, k):
    return fct[n] * invfct[n-k] % MOD * invfct[k] % MOD

answer = 0

for i in range(N):
    if N - i - 1 < K - 1:
        break
    answer -= A[i] * binomial(N-i-1, K-1) % MOD
    answer %= MOD

for i in range(N-1, -1, -1):
    if i < K - 1:
        break
    answer += A[i] * binomial(i, K-1) % MOD
    answer %= MOD

print(answer)


Measured memory_bytes: 63472
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,l,sum=0,maxv=0;
  cin>>n;
  for(int i=0; i<n; i++){
    cin>>l;
    sum+=l;
    maxv=max(maxv,l);
  }
  sum-=maxv;
  if(sum>maxv){
    cout<<"Yes"<<'\n';
  }else{
    cout<<"No"<<'\n';
  }
  return 0;
}


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

using ll = long long;
using pii = pair<int, int>;

template <typename T> constexpr T inf;
template <> constexpr int inf<int> = 1e9;
template <> constexpr ll inf<ll> = 1e18;
template <> constexpr double inf<double> = 1e18;

using graph = std::vector<std::vector<int>>;

bool dfs(graph const& g, int v, std::vector<int>& match, std::vector<bool>& used) {
    used[v] = true;
    for(auto u : g[v]) {
        int w = match[u];
        if(w < 0 || !used[w] && dfs(g, w, match, used)) {
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    return false;
}

int bipartite_matching(graph const& g) {
    const int V = g.size();
    std::vector<int> match(V, -1);
    std::vector<bool> used(V);
    int res = 0;
    for(int v = 0; v < V; ++v) {
        if(match[v] < 0) {
            std::fill(used.begin(), used.end(), false);
            if(dfs(g, v, match, used)) {
                ++res;
            }
        }
    }
    return res;
}

int main() {
    int N; cin >> N;
    vector<int> a(N), b(N), c(N), d(N);
    for(int i = 0; i < N; ++i) {
        cin >> a[i] >> b[i];
    }
    for(int i = 0; i < N; ++i) {
        cin >> c[i] >> d[i];
    }

    graph g(2 * N);
    for(int i = 0; i < N; ++i) {
        for(int j = 0; j < N; ++j) {
            if(a[i] < c[j] && b[i] < d[j]) {
                g[i].push_back(j + N);
                g[j + N].push_back(i);
            }
        }
    }

    cout << bipartite_matching(g) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;

int n;
vector<int> ls;

void solve(){
  cin >> n;
  rep(i,n){
    int l;cin >> l;
    ls.push_back(l);
  }
  sort(ls.begin(),ls.end());
  ll ans=0;
  rep(b,n-1){
    rep(a,b){
      int s=lower_bound(ls.begin(),ls.end(),ls[a]+ls[b])-ls.begin();
      ans+=s-b-1;
    }
  }
  cout << ans << endl;
}

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

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define WRAP(y,x,h,w) (0<=y && y<h && 0<=x && x<w)

typedef long long ll;
typedef unsigned long long ull;
typedef string str;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vd> vvd;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1,0,1,0 }; const int dy[] = { 0,1,0,-1 };

int main() {
	ll n, a, b;
	cin >> n >> a >> b;
	if (n == 1) {
		if (a != b) {
			cout<< 0<<endl;
			return 0;
		}
		else {
			cout << 1 << endl;
			return 0;
		}
	}
	if (a > b) {
		cout << 0 << endl;
		return 0;
	}
	ll mi = b + (n - 1)*a;
	ll ma = a + (n - 1)*b;
	cout <<ma-mi+1<< endl;
	return 0;
}

Measured memory_bytes: 256
// ------------------------------------
// Date:2018/ 4/14
// Problem:/ / / d.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

ll fact[MAX_N];

int N;

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

  fact[0] = 1ll;
  FOR(i, 1, MAX_N) {
    fact[i] = fact[i - 1] * i;
  }
  
  cin >> N;
  vector< ll > a(N);
  REP(i, N)
    cin >> a[i];

  sort(ALL(a));

  ll n = a.back();
  a.pop_back();

  ll dist = INF;
  int r = 0;
  REP(i, a.size()) {
    ll tmp = n - a[i];
    if (abs(tmp - a[i]) < dist) {
      r = a[i];
      dist = abs(tmp - a[i]);
    }
  }

  cout << n << " " << r << endl;

  return 0;
}



Measured memory_bytes: 1792
import math

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    V = float(N[l])
    ans = math.ceil((V*V/19.6 + 5.0)/5.0)
    print(ans)


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

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

fn main(){
    let n: usize = read();

    let mut time = 0;

    for _ in 0..n {
        let a: u8 = read();
        let b: u8 = read();

        if a != b {
            time = 0;
            continue;
        }

        time += 1;

        if time >= 3 {
            println!("Yes");
            return;
        }
    }

    println!("No");
}


Measured memory_bytes: 2132
s = input()
flag = True
for i, j in enumerate(s):
    if ( i+1) % 2 == 0:
        if not(j == "L" or j =="U" or j == "D"):
            flag = False
    else:
        if not(j == "R" or j =="U" or  j == "D"):
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.NoSuchElementException;

public final class Main {
	public static void main(String[] args) throws java.lang.Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] arg = br.readLine().split(" ");
		int w = Integer.parseInt(arg[0]);
		int h = Integer.parseInt(arg[1]);
		int n = Integer.parseInt(arg[2]);
		int wa[] = new int[n];
		int ha[] = new int[n];
		int aa[] = new int[n];
		for (int i = 0; i < n; i++) {
			arg = br.readLine().split(" ");
			wa[i] = Integer.parseInt(arg[0]);
			ha[i] = Integer.parseInt(arg[1]);
			aa[i] = Integer.parseInt(arg[2]);
		}

		Solver sol = new Solver();
		System.out.println(sol.solve(wa, ha, aa, w, h));
	}

}

class Solver {

	int solve(int[] wa, int[] ha, int[] aa, int w, int h) {

		int xLT = w, xGT = 0, yLT = h, yGT = 0;
		for (int i = 0; i < wa.length; i++) {
			int tempXLT = 0, tempXGT = 0, tempYLT = 0, tempYGT = 0;
			if (aa[i] == 1) {
				tempXGT = wa[i];
				if (xGT < tempXGT)
					xGT = tempXGT;

			} else if (aa[i] == 2) {
				tempXLT = wa[i];
				if (xLT > tempXLT)
					xLT = tempXLT;

			} else if (aa[i] == 3) {
				tempYGT = ha[i];
				if (yGT < tempYGT)
					yGT = tempYGT;
			} else if (aa[i] == 4) {
				tempYLT = ha[i];
				if (yLT > tempYLT)
					yLT = tempYLT;

			}
		}
		return xLT >= xGT && yLT >= yGT ? (xLT - xGT) * (yLT - yGT) : 0;

	}

}


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

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

    int N = S.size();
    int ans = N;
    for(int i = 1; i < N; ++i){
        if(S[i] != S[i - 1]){
            ans = min(ans, max(i, N - i));
        }
    }
    cout << ans << endl;
}

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


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    int tot=0;
    rep(i,n)tot+=a[i];
    if(tot%10!=0){
        cout<<tot<<endl;
        return 0;
    }
    sort(all(a));
    rep(i,n){
        if((tot-a[i])%10!=0){
            cout<<tot-a[i]<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String[] cut = input.split(" ");
		int a = Integer.parseInt(cut[0]);
		int b = Integer.parseInt(cut[1]);
		
		int d =a/b;
		int r = a%b;
		double f =(double)a/(double)b;
		
		String g = String.format("%.5f",f);
		System.out.println(d+" "+r+" "+g);
	}
}

Measured memory_bytes: 24688
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < int(n); i++)
#define rep1(i,n) for (int i = 1; i <= int(n); i++)
#define repR(i,n) for (int i = int(n)-1; i >= 0; i--)
#define rep1R(i,n) for (int i = int(n); i >= 1; i--)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define cauto const auto
#ifdef LOCAL
#define dump(...) cerr << "[" << __LINE__ << ":" << __FUNCTION__ << "] ", _dmp_(#__VA_ARGS__, __VA_ARGS__);
void _dmp_(const char*) { cerr << endl; }
template <class T, class... U>
void _dmp_(const char *s, T const& x, U const& ...y) { const char *o = "({[", *e = "]})"; for (int i = 0; *s != '\0'; cerr << *s++) { if (count(o,o+3,*s)) i++; if (count(e,e+3,*s)) i--; if (!i && *s == ',') break; } cerr << " = " << x; if (*s == ',') cerr << ", ", s++; _dmp_(s, y...); }
#else
#define dump(...)
#endif
using ll = long long;
#define int ll
template <class T> using pque_max = priority_queue<T>;
template <class T> using pque_min = priority_queue<T, vector<T>, greater<T> >;
#define CONAINER_OUTPUT os << "{"; for (auto const& x : v) os << " " << x; return os << " }";
template <class T> ostream& operator<<(ostream& os, vector<T> const& v) { CONAINER_OUTPUT }
template <class T> ostream& operator<<(ostream& os, deque<T> const& v) { CONAINER_OUTPUT }
template <class T> ostream& operator<<(ostream& os, set<T> const& v) { CONAINER_OUTPUT }
template <class T, class U> ostream& operator<<(ostream& os, map<T,U> const& v) { CONAINER_OUTPUT }
#undef CONAINER_OUTPUT
template <class T> istream& operator>>(istream& is, vector<T>& v) { for (auto& x : v) is >> x; return is; }
template <class T, class S> ostream& operator<<(ostream& os, pair<T,S> const& p) { return os << "(" << p.first << ", " << p.second << ")"; }
template <class T, class S> istream& operator>>(istream& is, pair<T,S> const& p) { return is >> p.first >> p.second; }
struct _Init_ { _Init_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); } } _init_;

template <class T> void quit(T const& x) { cout << x << endl; exit(0); }
template <class T> bool chmin(T& x, T const& y) { if (x > y) { x = y; return true; } return false; }
template <class T> bool chmax(T& x, T const& y) { if (x < y) { x = y; return true; } return false; }
#define YesNo(c) ((c) ? "Yes" : "No")
////////////////////////////////

int32_t main() {
    int n,k; cin >> n >> k;
    vector<int> v(n); cin >> v;
    int ma = 0;
    rep (x,n+1) rep (y,n+1) if (x+y <= min(n,k)) {
        vector<int> a;
        rep (i,x) a.push_back(v[i]);
        rep (i,y) a.push_back(v[n-1-i]);
        sort(all(a));
        int sum = accumulate(all(a),0);
        rep (i,min((int)a.size(),k-(x+y))) if (a[i] < 0) sum -= a[i];
        chmax(ma,sum);
    }
    cout << ma << endl;
}


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

using namespace std;

int main(){
  int N,temp=0,sum=0;
  cin >> N;
  int A[N+2];
  A[0]=0;
  A[N+1]=0;
  for(int i=1;i<N+1;i++){
    cin >> A[i];
    sum+=abs(A[i]-temp);
    temp=A[i];
  }
  sum+=abs(A[N+1]-temp);

  for(int i=1;i<N+1;i++){
    if(((A[i-1]<=A[i]) && (A[i]<=A[i+1])) || ((A[i-1]>=A[i]) && (A[i]>=A[i+1]))){
      cout << sum << endl;
    }else if(abs(A[i+1]-A[i])>abs(A[i]-A[i-1])){
      cout << sum-2*(abs(A[i-1]-A[i])) << endl;
    }else{
      cout << sum-2*(abs(A[i]-A[i+1])) << endl;
    }
  }
}


Measured memory_bytes: 1664
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#define M 1000000007
#define pi 3.141592653589793
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    printf("%d\n",3*n*n);
    return 0;
}


Measured memory_bytes: 128
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		String t = sc.next();
		
		// 計算
		long result = 0;
		int currentIndex = -1;
		long loop = 0;
		ArrayList<TreeSet<Integer>> alphabet = new ArrayList<TreeSet<Integer>>();
		for(int i = 0; i < 26; i++){
		    TreeSet<Integer> list = new TreeSet<Integer>();
		    alphabet.add(list);
		}
		for(int i = 0; i < s.length(); i++){
	        TreeSet<Integer> list = alphabet.get(s.charAt(i) - 'a');
	        list.add(i);
		}
		//System.out.println(alphabet.toString());
		for(int i = 0; i < t.length(); i++){
		    TreeSet<Integer> list = alphabet.get(t.charAt(i) - 'a');
		    if(list.isEmpty()){
		        result = -1;
		        break;
		    }
		    Integer index = list.higher(currentIndex);
		    if(index == null){
		        loop++;
		        currentIndex = list.first();
		    }else{
		        currentIndex = index;
		    }
		}
		//System.out.println(loop);
		//System.out.println(currentIndex);
		if(result != -1) result = loop * s.length() + currentIndex + 1;
		
		// 出力
		System.out.println(result);
		
	}
}


Measured memory_bytes: 34536
n,m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]
 
for i in range(1000):
    s = str(i)
    if len(s) != n:
      continue
    if all(s[a - 1] == str(b) for a, b in sc):
        print(i)
        exit()
 
print(-1)

Measured memory_bytes: 3060