akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
#define TIMER_S(start) chrono::system_clock::time_point start = chrono::system_clock::now();
#define TIMER_E(end) chrono::system_clock::time_point end = chrono::system_clock::now();
#define TIME(start, end) cout << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count()) << "ms" << "\n";
/* clang-format on */

int main() {
  ll n;
  cin >> n;
  ll c = 0, len;
  for (ll i = 1; c < n; i++) {
    c += pow(26, i);
    len = i;
  }
  n = n - c + pow(26, len)-1;
  //DEBUG(len);
  vector<char> name(len, 'a');
  REP(i, len) {
    if (n == 0) break;
    ll d = floor(n / pow(26, len - i - 1));
    if (pow(26, len - i - 1) <= n) {
      //DEBUG(n / floor(pow(26, len - i - 1)));
      name[i] += d;
      n -= d * (ll)pow(26, len - i - 1);
    }
  }
  REP(i, len) { cout << name[i]; }
  cout << "\n";
  return 0;
}


Measured memory_bytes: 4012
import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.lang.Math;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
       int r = sc.nextInt();
       int D = sc.nextInt();
       int x = sc.nextInt();
       int ans = x*r-D;
       System.out.println(ans);
       for (int i = 0; i < 9; i++) {
           System.out.println(ans*r-D);
           ans = ans*r-D;
       }
    }

}


Measured memory_bytes: 22612
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextInt();
        }
        
        int max = 0;
        int second = 0;
        int maxNum = 0;
        boolean multiMax = false;
        
        for(int i = 0; i < n; i++){
            if(a[i] > max){
                second = max;
                max = a[i];
                maxNum = i;
                multiMax = false;
            }else if(a[i] == max){
                multiMax = true;
            }else if(a[i] > second){
                second = a[i];
            }
        }
        
        StringBuilder sb = new StringBuilder();
        String br = System.lineSeparator();
        if(multiMax){
            for(int i = 0; i < n; i++){
                sb.append(max).append(br);
            }
        }else{
            for(int i = 0; i < n; i++){
                if(i == maxNum){
                    sb.append(second).append(br);
                }else{
                    sb.append(max).append(br);
                }
            }
        }
        
        System.out.println(sb);
    }
}

Measured memory_bytes: 68416
#include<bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
const int N=2e5+10;
int H[N],idx[N],D[N];
int main()
{
	//freopen("/home/zz7/CFInput","r",stdin);
	int n;scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",&D[i]),idx[D[i]]=i;
	int ans=INF,l=1,M=-1;
	for(int i=1;i<=n;i++){
		if(idx[i]<M){
			for(l;l<i;l++){
				H[l]=n-i+1;
			}
		}
		M=idx[i];
	}H[n+1]=0;
	for(int i=0;i<=n;i++){
		int sum=0;
		if(i>0){
			if(i<D[0])sum+=i;
			else if(i==D[0])sum+=i-1;
			else sum+=i;
		}
		ans=min(ans,sum+H[i+1]);
	}cout<<ans<<'\n';
}


Measured memory_bytes: 2560
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <cinttypes>
#include <string.h>
#include <bits/stdc++.h>

#define countof(a) (sizeof(a)/sizeof(*a))

#define vi vector<int>
#define vvi vector<vector<int> >
#define pi pair<int,int>
#define fi first
#define se second

#define FOR(var, to)          for (register s64 var = 0; var < (s64)to; var++)
#define FROMTO(var, from, to) for (register s64 var = from; var <= (s64)to; var++)

#define INIT(var) FOR(i,countof(var)) var[i] = 0
#define INPUT(var) FOR(i,countof(var)) var[i] = ri()

#define SORT(v) qsort(v,countof(v),sizeof(*v),int_less)
#define SORTT(v) qsort(v,countof(v),sizeof(*v),int_greater)

#define MOD 1000000007
#define INF (1 << 30)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

using namespace std;

static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}

static inline s64 rs64() {
  s64 a;
  scanf("%" SCNd64, &a);
  return a;
}

static inline void wi(int a) {
  printf("%d", a);
}

static inline void wu64(u64 a) {
  printf("%" PRIu64, a);
}

static inline void ws64(s64 a) {
  printf("%" PRId64, a);
}

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

typedef struct {
    int x;
    int y;
    bool used;
} Point;

int x_less(const void *a, const void *b) {
  return (((const Point*)a)->x - ((const Point*)b)->x);
}
int y_greater(const void *a, const void *b) {
  return (((const Point*)b)->y - ((const Point*)a)->y);
}


int main() {
    int n = ri();
    Point a[n];
    Point b[n];
    FOR(i,n) a[i].x = ri(), a[i].y = ri(), a[i].used = false;
    FOR(i,n) b[i].x = ri(), b[i].y = ri();
    
    Point b_x[n];
    FOR(i,n) b_x[i] = b[i];
    qsort(b_x, n, sizeof(Point), x_less);
    
    Point a_y[n];
    FOR(i,n) a_y[i] = a[i];
    qsort(a_y, n, sizeof(Point), y_greater);
    
    int res = 0;
    FOR(i,n) {
        int x = b_x[i].x;
        int y = b_x[i].y;
        FOR(j,n) {
            if (a_y[j].used) continue;
            if (a_y[j].x >= x || a_y[j].y >= y) continue;
            a_y[j].used = true;
            res++;
            break;
        }
    }
    cout << res << endl;
 return 0;
}


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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    cin >> n >> k;
    const int MOD = 1e9 + 7;
    vector<int> inv(n + 1);
    inv[1] = 1;
    for (int i = 2; i <= n; ++i) {
        inv[i] = (long long)(MOD - MOD / i) * inv[MOD % i] % MOD;
    }
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    sort(a.begin(), a.end());
    int ans = 0;
    vector<int> C(n + 1, -1);
    int div = 1, mul = 1;
    for (int i = 1; i <= k; ++i) {
        div = (long long)div * inv[i] % MOD;
        mul = (long long)mul * i % MOD;
    }
    for (int i = 0; i <= n; ++i) {
        if (i < k) continue;
        C[i] = (long long)mul * div % MOD;
        mul = (long long)mul * (i + 1) % MOD * inv[i - k + 1] % MOD;
    }
    for (int i = 1; i < n; ++i) {
        int d = a[i] - a[i - 1];
        int tmp = C[n];
        if (i >= k) tmp = (tmp + MOD - C[i]) % MOD;
        if (n - i >= k) tmp = (tmp + MOD - C[n - i]) % MOD;
        ans = (ans + (long long)d * tmp % MOD) % MOD;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 2e+9 + 10;
typedef pair<ll, ll> P;

int main() {
    cin>>N>>K;
    ll ans = K;
    rep(i, N - 1) ans *= K - 1;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const long mod=(long)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		long ans=0;
		var hs=new Dictionary<string,long>();
		for(long i = 0;i<n;i++) {
			var t=sc.S.ToCharArray();
			t=t.OrderBy(x=>x).ToArray();
			string st=String.Join("",t);
			if(hs.ContainsKey(st)){hs[st]++;}
			else{hs.Add(st,1);}
		}
		foreach(var e in hs){
			ans+=e.Value*(e.Value-1)/2;
		}
		Console.WriteLine("{0}",ans);
	}
}

public class Sc{
	public long I{get{return long.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public long[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public long[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] Ia3(long a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] Ia3(bool a,long b,bool c,long d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(long a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,long b,bool c,long d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(long n,Func<T> f){var a=new T[n];for(long i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(long n,Func<long,T> f){var a=new T[n];for(long i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(long n,Func<string[],T> f){var a=new T[n];for(long i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(long n,Func<long,string[],T> f){var a=new T[n];for(long i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 30212
#include <iostream>
#include<algorithm>
using namespace std;
int main(void){
    // Your code here!
    int a,b;
    cin>>a>>b;
    if(a<=5){
        cout<<0<<endl;
    }
    
    else if(5<a && a<=12){
        cout<<b/2<<endl;
    }
    
    else if(a>=13){
        cout<<b<<endl;
    }
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long int
#define INF INT_MAX
#define mod
#define chutiyaap ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b){return (a.second < b.second);}
ll gcd(ll a, ll b){if(a==0)return b;return gcd(b % a, a);}
int main()
{
	chutiyaap;
	ll n;cin>>n;
	vector<pair<ll,ll> >v;
	for(ll i=0;i<n;i++)
	{
		ll a,b;cin>>a>>b;
		v.pb(mp(a,b));
		if(a>b)
		{
			cout<<"No";
			return 0;
		}
	}
	sort(v.begin(),v.end(),sortbysec);
	ll x=0,cnt=0;
	for(ll i=0;i<n;i++)
	{
		x+=v[i].first;
		if(x<=v[i].second)cnt++;
	}
	if(cnt==n)cout<<"Yes";
	else cout<<"No";
}


Measured memory_bytes: 6256
#include<bits/stdc++.h>
using namespace std;
int n;
char ed;
vector<string>V[11];
int main()
{
	cin >> n;
	V[1].push_back("a");
	for (int i = 1; i < n; i++)
	{
		for (int j = 0; j < V[i].size(); j++)
		{
			ed = 'a';
			for (int k = 0; k < V[i][j].size(); k++)
			{
				ed = max(ed, V[i][j][k]);
			}
			for (char k = 'a'; k < ed + 2; k++)
			{
				V[i + 1].push_back(V[i][j] + k);
			}
		}
	}
	for (int i = 0; i < V[n].size(); i++)
	{
		cout << V[n][i] << endl;
	}
	return 0;
}

Measured memory_bytes: 11380
import sys
# input = sys.stdin.readline

def main():
    s = input()
    total = 0

    for i in range(len(s)-1):
        if s[i] == "B":
            total += 1
            if s[i] == "B" and s[i+1] == "W":
                yield total
        else:
            if s[i] == "W" and s[i+1] == "W":
                yield total

print(sum(main()))

Measured memory_bytes: 3500
s = input()

if len(s) < 26:
    a = [0 for _ in range(26)]

    for i in range(len(s)):
        a[ord(s[i]) - ord("a")] += 1

    ans = s
    for i in range(26):
        if a[i] == 0:
            ans += chr(i+ord("a"))
            break

    print(ans)
    exit()


for i in range(24,-1,-1):
    for j in range(25,i,-1):
        if s[i]<s[j]:
            print(s[:i]+s[j])
            exit()

print(-1)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

// トポソ
// O(V + E)
// [入力] 重みなし有効グラフ
// [出力] ソートされた頂点列(0-indexed) DAG じゃ無い場合は空列を返す
vector<int> toposort(vector<vector<int>> &g){
    int n = (int)g.size();
    vector<int> d(n, 0);     // 入次数
    for(int i = 0; i < n; i++){
        for(int j = 0; j < (int)g[i].size(); j++){
            d[g[i][j]]++;
        }
    }
     
    // 入次数が 0 の頂点を queue に入れる
    queue<int> que;
    for(int i = 0; i < n; i++){
        if(d[i] == 0) que.push(i);
    }
 
    vector<int> ret;
    while(!que.empty()){
        int cur = que.front();
        que.pop();
        ret.push_back(cur);
 
        for(int i = 0; i < (int)g[cur].size(); i++){
            int nxt = g[cur][i];
            d[nxt]--;
            if(d[nxt] == 0) que.push(nxt);
        }
    }
 
    // DAG じゃなかったら、頂点列が不足しているはず
    if(ret.size() == n) return ret;
    else return vector<int>();
 
}

signed main(){
    
    int n, m; cin >> n >> m;
    vector<vector<int>> g(n);
    for(int i = 0; i < m; i++){
        int a, b; cin >> a >> b;
        g[a].push_back(b);
    }

    auto ret = toposort(g);
    for(auto x : ret) cout << x << endl;
    return 0;
}



Measured memory_bytes: 3912
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<iostream>
#include<vector>
#include<string.h>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
priority_queue<ll> q;

int main() {
	ll n, m, x;
	cin >> n >> m;
	for (ll i = 0; i < n;i++) {
		cin >> x;
		q.push(x);
	}
	while (m--) {
		x = q.top(); q.pop();
		x /= 2;
		q.push(x);
	}
		ll ans = 0;
		while (!q.empty()) {
			x = q.top(); q.pop();
			ans += x;
		}
		cout << ans << '\n';
	
	return 0;
}



Measured memory_bytes: 1400
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == 1)return;for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(std::vector<T>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

 
void solve(void)
{
  int N,K;
  cin>>N>>K;
  int ANS = 0;
  while(N > 0)
  {
    N  /= K;
    ANS++;
  }
  
  cout<<ANS<<endl;;
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 256
h, w = gets.chomp.split(' ').map(&:to_i)
s = []
h.times do
  s << gets.chomp + '.'
end
s << '.' * (w + 1)

h.times do |i_h|
  w.times do |i_w|
    next if s[i_h][i_w] == '#'
    n = 0
    (-1..1).each do |j_h|
      (-1..1).each do |j_w|
        n += s[i_h - j_h][i_w - j_w] == '#' ? 1 : 0
      end
    end
    s[i_h][i_w] = n.to_s
  end
end

h.times do |i_h|
  puts s[i_h][0...w]
end


Measured memory_bytes: 1788
// prakhsri_
#include<iostream>
#include<bits/stdc++.h>
#include<string>
#include<time.h>
using namespace std;
#define ll long long int
#define pb push_back
#define fi first i
#define se second
#define mod 1000000007
#define PI 3.1415926535897

int main(){
    int x,n;
    cin>>x>>n;
    if(n==0)
    {
        cout<<x;
        return 0;
    }
    int low = x,high = x;
    set<int> st;
    int i,j;
    for(i=0;i<n;i++){
        cin>>j;
        st.insert(j);
    }
    if(st.find(x)==st.end())
    {
        cout<<x;
        return 0;
    }
    int ans = 0;
    while(true)
    {
        low = low-1;
        if(st.find(low)==st.end())
        {
            cout<<low;
            return 0;
        }
        high = high+1;
        if(st.find(high)==st.end())
        {
            cout<<high;
            return 0;
        }
    }
}   


Measured memory_bytes: 3600
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
#define infinity 2000000000
struct node{
	char pat;
	int num;
};

node A[100010],B[100010];
node L[50010],R[50010];
int n;

void merge(int left,int mid,int right){
	int n1=mid-left,n2=right-mid;
	for(int i=0;i<n1;i++) L[i]=B[left+i];
	for(int i=0;i<n2;i++) R[i]=B[mid+i];
	L[n1].num=infinity;R[n2].num=infinity;
	int i=0,j=0;
	for(int x=left;x<right;x++){
		if(L[i].num<=R[j].num) {B[x]=L[i++];}
		else B[x]=R[j++];
	}
	return ;
}

void merge_sort(int left,int right){

	if(left+1<right){
		int mid=(left+right)/2;
		merge_sort(left,mid);
		merge_sort(mid,right);
		merge(left,mid,right);
	}

	return ;
}

int partition(int left,int right){
	int i =left-1;
	for(int j=left;j<right;j++){
		if(A[j].num<=A[right].num) {
			swap(A[i+1],A[j]);
			i++;
		}
	}
	swap(A[i+1],A[right]);
	return i+1;
}

void quicksort(int left,int right){
	if(left<right){
		int p=partition(left,right);
		quicksort(left,p-1);
		quicksort(p+1,right);
	}
	return ;
}

int main (){
	scanf("%d", &n);
	getchar();
	for (int i = 0; i < n; i++) {
			scanf("%c %d", &A[i].pat, &A[i].num);
			getchar();
			B[i] = A[i];
		}
	quicksort(0,n-1);
	merge_sort(0,n);
	bool stable=true;
	for(int i=0;i<n;i++) if(A[i].pat!=B[i].pat) stable=false;
	if(stable==false) cout<<"Not stable"<<endl; else cout<<"Stable"<<endl;
	for(int i=0;i<n;i++) cout<<A[i].pat<<" "<<A[i].num<<endl;

	return 0;
}


Measured memory_bytes: 5468
import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.math.*;
import java.io.*;


public class Main {

    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();

        long[][] itemValue = new long[R][C];
        for(int k=0; k<K; k++){
            int r = sc.nextInt()-1;
            int c = sc.nextInt()-1;
            itemValue[r][c] = sc.nextLong();
        }

        long[][][] dp = new long[4][R][C];
        dp[1][0][0] = itemValue[0][0];

        for(int r=0; r<R; r++) for(int c=0; c<C; c++) for(int i=0; i<=3; i++){
            if(c>0) dp[i][r][c] = Math.max(dp[i][r][c], dp[i][r][c-1]);
            if(r>0) dp[0][r][c] = Math.max(dp[0][r][c], dp[i][r-1][c]);
            if(c>0 && i>0) dp[i][r][c] = Math.max(dp[i][r][c], dp[i-1][r][c-1]+itemValue[r][c]);
            if(r>0)dp[1][r][c] = Math.max(dp[1][r][c], dp[i][r-1][c]+itemValue[r][c]);
        }

        long ans = 0;
        for(int i=0; i<=3; i++) ans = Math.max(ans, dp[i][R-1][C-1]);

        System.out.println(ans);
        //System.err.println(Arrays.deepToString(dp));

    }
}


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

void pro(int x);

int N;
int D[100010] = {0};
bool visit[100010] = {0};
vector<int> G[100010];
bool O = false;

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N - 1; i++)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        D[a]++;
        D[b]++;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 1; i < N + 1; i++)
    {
        if(D[i] == 1)
        {
            pro(i);
        }
    }
    if(!O)
    {
        printf("Second\n");
    }
    return 0;
}

void pro(int x)
{
    visit[x] = true;
    D[x] = 0;
    for(int i = 0; i < G[x].size() + 1; i++)
    {
        if(i == G[x].size())
        {
            if(!O)
            {
                O = true;
                printf("First\n");
            }
            return;
        }
        if(visit[G[x][i]] == false)
        {
            D[G[x][i]] = 0;
            visit[G[x][i]] = true;
            for(int j = 0; j < G[G[x][i]].size(); j++)
            {
                if(D[G[G[x][i]][j]] == 1)
                {
                    if(!O)
                    {
                        O = true;
                        printf("First\n");
                    }
                    return;
                }
                D[G[G[x][i]][j]]--;
                if(D[G[G[x][i]][j]] == 1 && visit[G[G[x][i]][j]] == false)
                {
                    pro(G[G[x][i]][j]);
                }
            }
            return;
        }
    }
    return;
}


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

int n, m;

int main() {
    cin >> n >> m;
    int a[m*n], b[m], c[n];
    for (int i=0; i<n; i++) c[i]=0;
    for (int i=0; i<(m*n); i++) cin >> a[i];
    for (int i=0; i<m; i++) cin >> b[i];
    for (int i=0; i<n; i++) {
        for (int j=0; j<m; j++) {
            c[i]+=a[m*i+j]*b[j];
        }
    }
    for (int i=0; i<n; i++) cout << c[i] << endl;
}


Measured memory_bytes: 3136
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

int main()
{
  double a, b, x;
  cin >> a >> b >> x;
  
  double ans;
  double pi = acos(-1);
  if (x / a >= a * b / 2)
  {
    ans = atan((2 * b / a) - (2 * x / (a * a * a))) * (180 / pi);
  }
  else
  {
    ans = atan(a * b * b / (2 * x)) * (180 / pi);
  }
  
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}

Measured memory_bytes: 256
// inputに入力データ全体が入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split('\n');
    tmp = input[1].split(' ');
    //文字列から10進数に変換するときはparseIntを使います
    var N = parseInt(input[0], 10);
    var A = parseInt(input[1], 10);
    N = N % 500;
    if (N <= A) {
      console.log('Yes');
    } else {
      console.log('No');
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21064
// ABC075C - Bridge

#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;

struct UnionFind {
	vector<int> par;
	vector<int> rank;
	vector<int> count;

	// n要素で初期化
	UnionFind(int n) {
		par.resize(n);
		rank.resize(n, 0);
		count.resize(n, 1);
		for (int i = 0; i < n; i++) {
			par[i] = i;
		}
	}

	// 木の根を求める。
	int find(int x) {
		if (par[x] == x) {
			return x;
		} else {
			return par[x] = find(par[x]);
		}
	}

	// xとyの属する集合を併合
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) {
			return;
		}
		
		count[x] += count[y];
		count[y] = count[x];
		if (rank[x] < rank[y]) {
			par[x] = y;
		} else {
			par[y] = x;
			if (rank[x] == rank[y]) {
				rank[x]++;
			}
		}
	}

	// xとyが同じ集合に属するか否か
	bool same(int x, int y) {
		return find(x) == find(y);
	}

	// xと同じ集合の要素数を返す。
	int getCount(int x) {
		return count[x];
	}
};

int main() {
	int N, M;
	cin >> N >> M;

	int A[M], B[M];
	for (int i = 0; i < M; i++) {
		cin >> A[i] >> B[i];
	}

	int ans = 0;
	for (int i = 0; i < M; i++) {
		UnionFind tree(N+1);
		for (int j = 0; j < M; j++) {
			if (i != j) {
				tree.unite(A[j], B[j]);
			}
		}
//		cout << tree.getCount(1) << endl;
//		if (tree.getCount(1) != N) {
//			ans++;
//		}
		set<int> s;
		for (int j = 1; j <= N; j++) {
			if (tree.find(j) == j) {
				s.insert(j);
			}
		}
		if (s.size() > 1) {
			ans++;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3600
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class CWhenIHitMyPocket {
public:
    void solve(std::istream &in, std::ostream &out) {
        int k, a, b;
        in >> k >> a >> b;
        ll res = b - a >= 2 ? a + (ll) (k - a + 1) / 2 * (b - a) + (k - a + 1) % 2 : k + 1;
        out << res << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    CWhenIHitMyPocket solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


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

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

struct Node
{
    int node, len;
    Node() {node = len = 0;}
    Node(int node, int len) {this -> node = node, this -> len = len;}
};
typedef vector<Node> vg;

#define MAX 1
#define NON 0
#define MOD 1000000007

#define FOR(type, i, a, b) for(type i = a; i < b; i++)
#define FORR(type, i, b, a) for(type i = b; i > a; i--)
#define FORE(type, i, a, b) for(type i = a; i <= b; i++)
#define FORRE(type, i, b, a) for(type i = b; i >= a; i--)

#define testBit(n, bit) ((n >> bit) & 1)
#define flipBit(n, bit) (n ^ (1ll << bit))
#define randomize mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int turn1 = a / d + !!(a % d), turn2 = c / b + !!(c % b);
    cerr << turn1 << ' ' << turn2;
    if (turn1 >= turn2) cout << "Yes"; else cout << "No";
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;

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

long long modinv(long long a, long long m=MOD) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
    /*MODの割り算の際に
    a/＝b;
    を
    a *= modinv(b,MOD);
    とする。
        */
}


int N;
#define MAXN 8
int P[MAXN],Q[MAXN];


int main(){
    cin >> N;
    rep(i,N){
        cin >> P[i];
    }   
    rep(i,N)cin >> Q[i];
    int sample[MAXN];
    rep(i,N)sample[i] = i+1;
    sort (sample,sample+N);
    int numP,numQ;
    int count = 0;
    do {
        int countP = 0;
        int countQ = 0;
        count++;
        for(int i=0;i<N;i++){
            if(sample[i]==P[i]){
                countP++;
            }else{
                countP = 0;
            }
            if(sample[i]==Q[i]){
                countQ++;
            }else{
                countQ = 0;
            }
            if(countP==N)numP = count;
            if(countQ==N)numQ = count;
        }
    } while ( next_permutation(sample,sample+N) );
    
    cout << abs(numP-numQ) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
    	Scanner sc = new Scanner(System.in);
		// 整数の入力
		String str = sc.nextLine();
        int count=0;
		for(int i=0;i<3;i++){
		    if(str.charAt(i)=='o'){
		        count++;
		    }
		}
		System.out.println(700+count*100);
		
    }
}


Measured memory_bytes: 21716
#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 li          long
#define ll          long long
#define ull         unsigned long long
#define ff          first
#define ss          second
#define pii         pair<int,int>
#define pli         pair<li,li>
#define pll         pair<ll,ll>
#define pb          push_back
#define fo(i,k,n)   for(int i = k;i<n; i++)
#define ro(i,k,n)   for(int i = k; i>=n; i--)
#define tc          int t;cin>>t;while(t--)
#define all(v)      v.begin(),v.end()
#define inf         INT_MAX
#define ninf        INT_MIN
#define W(x)        cout<<x<<endl
#define WW(x,y)     cout<<x<<' '<<y<<endl;
#define in(x)       cin>>x
#define v(x)        vector<x>
#define int         long long
#define ar(x,y)       array<x,y>
const ll mod1 = 99844353;
const ll mod2 = 1e9+7;
template <class T>
using oset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

void fastio()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

template<class T>
T power(T a,T b){
    T res = (T)1;
    while(b>0){
        if(b&1)res = res*a;
        b>>=1;
        a*=a;
    }
    return res;
}
struct dsu{
  map<int,int> pr,sz;
  dsu(){
    (this->pr).clear();
    (this->sz).clear();
  }
  void make(int x){
    pr[x] = x;
    sz[x] = 1;
  }
  int getpar(int x){
    if(pr[x] == x)return x;
    return pr[x] = getpar(pr[x]);
  }
  void merge(int x,int y){
    x = getpar(x);
    y = getpar(y);
    if(x!=y){
      if(x>y)swap(x,y);
      pr[y] = x;
      sz[x]+=sz[y];
      sz.erase(y);
    }
  }
};


void solve(){
  int n;
  cin>>n;
  v(int)a(n);
  for(int i = 0; i<n; i++)cin>>a[i];
  v(int)prexor(n),postxor(n);
  prexor[0] = a[0],postxor[n-1] = a[n-1];
  fo(i,1,n)prexor[i] = prexor[i-1]^a[i];
  for(int i = n-2; i>=0; i--)postxor[i] = postxor[i+1]^a[i];
  vector<int> ans(n);
  for(int i = 0; i<n; i++){
    if(i == 0)ans[i] = postxor[1];
    else if(i == n-1)ans[i] = prexor[n-2];
    else ans[i] = prexor[i-1]^postxor[i+1];
  }
  for(int i = 0; i<n; i++){
    cout<<ans[i]<<' ';
  }
  cout<<"\n";
}

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


Measured memory_bytes: 9480
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

#define rep(i,x,y) for(int i=(x); i<(y); ++i)

template <typename T>
void vec_print(vector<T> VEC){
  rep(i, 0, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  rep(i, 0, MAT.size()){
    rep(j, 0, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

template <typename CLASS1, typename CLASS2>
class HOGE{
  public:
    CLASS1 key;
    CLASS2 value;
    HOGE(ll key, ll value){
      this->key = index;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "key : " << key << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  string A, B, C;
  cin >> N;
  cin >> A;
  cin >> B;
  cin >> C;

  ll ans = 0;
  rep(i, 0, N){
    if(A[i] == B[i] && B[i] == C[i]) continue;
    if(A[i] == B[i] || B[i] == C[i] || C[i] == A[i]){
      ans++;
    }else{
      ans+=2;
    }
  }

  cout << ans << "\n";

  return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll;
#define rep(i, a, b) for (int i = a; i <= b; ++ i)
using namespace std;
int n, m[2], fa[3][200010], h[200010];
struct epoch { int x, y, id; } a[200010];
int getfa(int c, int x) {
	if (fa[c][x] == x) return x;
	return fa[c][x] = getfa(c, fa[c][x]);
}
void merge(int c, int x, int y) {
	x = getfa(c, x), y = getfa(c, y);
	if (x != y) fa[c][x] = y;
}
bool cmp(epoch a, epoch b) { return (a.x < b.x || (a.x == b.x && a.y < b.y)); }
int main() {
	scanf("%d%d%d", &n, &m[0], &m[1]); int x, y;
	rep(i, 1, n) fa[0][i] = fa[1][i] = fa[2][i] = i;
	rep(i, 1, m[0]) scanf("%d%d", &x, &y), merge(0, x, y);
	rep(i, 1, m[1]) scanf("%d%d", &x, &y), merge(1, x, y);
	rep(i, 1, n) a[i].x = getfa(0, i), a[i].y = getfa(1, i), a[i].id = i;
	sort(a + 1, a + n + 1, cmp);
	for (int i = 1, j; i <= n; i = j) {
		for (j = i + 1; j <= n && a[i].x == a[j].x && a[i].y == a[j].y; ++ j);
		rep(k, i, j - 1) h[a[k].id] = j - i;
	}
	rep(i, 1, n - 1) printf("%d ", h[i]); printf("%d", h[n]);
	return 0;
}

Measured memory_bytes: 6144
import sys
input = sys.stdin.readline
def main():
    N, M = map(int, input().split())
    L_max, R_min = 0, 10**100
    for _ in range(M):
        l, r = map(int, input().split())
        L_max = max(L_max, l)
        R_min = min(R_min, r)
    delta = R_min - L_max + 1
    if delta <= 0:
        delta = 0
    print(delta)
main()

Measured memory_bytes: 3060
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        k: usize,
        a: usize, b: usize,
    }

    let mut flag = false;

    for n in a..=b {
        if n % k == 0 {
            flag = true;
        }
    }

    match flag {
        true => print!("OK"),
        false => print!("NG"),
    };
}


Measured memory_bytes: 2140
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a=0;
    string s;
    cin>>s;
    if(s[0]==s[1]){
        if(s[2]==s[3]&&s[2]!=s[0]) cout<<"Yes"<<endl;
        else cout<<"No";
    }
    else if(s[0]==s[2]){
        if(s[1]==s[3]&&s[1]!=s[0]) cout<<"Yes"<<endl;
        else cout<<"No";
    }
    else if(s[0]==s[3]){
        if(s[1]==s[2]&&s[1]!=s[0]) cout<<"Yes"<<endl;
        else cout<<"No";
    }
    else cout<<"No"<<endl;
}


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

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

    int count = 0;
    for(int i = 0; i < 3; i++) {
        if(S[i] == 'o') {
            count += 1;
        }
    }

    cout << 700+count*100 << endl;

    return 0;
}

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

struct S {
	int ly, lx, ry, rx;

	S(int _ly, int _lx, int _ry, int _rx) :ly(_ly), lx(_lx), ry(_ry), rx(_rx) {};
};

const int MAX = 52;
const int ldy[4] = { 0,1,0,-1 };
const int ldx[4] = { 1,0,-1,0 };
const int rdy[4] = { 0,1,0,-1 };
const int rdx[4] = { -1,0,1,0 };

char l_grid[MAX][MAX];
char r_grid[MAX][MAX];
int visited[MAX][MAX][MAX][MAX];
bool goal;

int main()
{
	while (true) {
		int W, H;
		cin >> W >> H;

		if (W == 0 && H == 0) {
			break;
		}

		goal = false;

		for (int i = 0; i < MAX; i++) {
			for (int j = 0; j < MAX; j++) {
				l_grid[i][j] = '#';
				r_grid[i][j] = '#';
			}
		}

		for (int i = 0; i < MAX; i++) {
			for (int j = 0; j < MAX; j++) {
				for (int k = 0; k < MAX; k++) {
					for (int l = 0; l < MAX; l++) {
						visited[i][j][k][l] = false;
					}
				}
			}
		}

		int ly, lx, ry, rx;

		for (int y = 1; y <= H; y++) {
			for (int x = 1; x <= W; x++) {
				cin >> l_grid[y][x];
				
				if (l_grid[y][x] == 'L') {
					ly = y;
					lx = x;
					l_grid[y][x] = '.';
				}
			}

			for (int x = 1; x <= W; x++) {
				cin >> r_grid[y][x];

				if (r_grid[y][x] == 'R') {
					ry = y;
					rx = x;
					r_grid[y][x] = '.';
				}
			}
		}

		queue<S> q;
		q.push(S(ly, lx, ry, rx));
		visited[ly][lx][ry][rx] = true;

		while (q.empty() == false) {
			int size = q.size();

			for (int i = 0; i < size; i++) {
				S now = q.front();
				q.pop();

				for (int j = 0; j < 4; j++) {
					int nly, nlx, nry, nrx;

					if (l_grid[now.ly + ldy[j]][now.lx + ldx[j]] == '#') {
						nly = now.ly;
						nlx = now.lx;
					}
					else {
						nly = now.ly + ldy[j];
						nlx = now.lx + ldx[j];
					}

					if (r_grid[now.ry + rdy[j]][now.rx + rdx[j]] == '#') {
						nry = now.ry;
						nrx = now.rx;
					}
					else {
						nry = now.ry + rdy[j];
						nrx = now.rx + rdx[j];
					}

					if (l_grid[nly][nlx] == '%'&&r_grid[nry][nrx] == '%') {
						goal = true;
						goto End;
					}
					else if (l_grid[nly][nlx] == '%' || r_grid[nry][nrx] == '%') {
						continue;
					}

					if (visited[nly][nlx][nry][nrx] == false) {
						q.push(S(nly, nlx, nry, nrx));
						visited[nly][nlx][nry][nrx] = true;
					}
				}
			}
		}

	End:

		if (goal == true) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}

	}

	return 0;
}

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


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n, m = input_to_int_map()

    ret = "No"
    if n == m:
        ret = "Yes"

    return ret


if __name__ == "__main__":
    print(main())


Measured memory_bytes: 3064
#２つの整数 x, y を読み込み、それらを値が小さい順に出力するプログラム

while True:
    list = input().split()
    x = int(list[0]); y = int(list[1])

    if x == 0 and y == 0:
        break
    if x > y:
        prv = x; x = y; y = prv
    
    print(x, y)


Measured memory_bytes: 5608
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cctype>
using namespace std;
int main()
{
	int x,t;
	cin>>x>>t;
	int ans=x-t;
	if(ans>0)cout<<ans<<endl;
	else cout<<0<<endl;
	return 0;
}


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

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    cout << max({10*a+b+c,10*b+a+c,10*c+a+b});
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;


int main() {

	Int L, R;
	cin >> L >> R;

	Int ans = INF;
	Int flag = 0;
	Int res = 0;
	for (Int i = L; i <= R; i++) {
		for (Int j = i + 1; j <= R; j++) {
			if (ans == 0) {
				flag = 1;
				break;
			}
			res = i * j % 2019;
			ans = min(ans, res);
		}
		if (flag)break;
	}

	cout << ans << endl;

}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
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; }

const ll INF=1e18;
const int mx=200005;
//abc174
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int x;
    cin>>x;
    if(x>=30)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
//ペナルティ出しても焦らない　ACできると信じろ！！！
//どうしてもわからないときはサンプルで実験　何か見えてくるかも
//頭で考えてダメなら紙におこせ！！
/*
V,P(大文字)使用不可
乗算などの際にオーバーフローに注意せよ！
(適切にmodをとれ　にぶたんで途中で切り上げろ)
制約をよく読め！
{
    ・全探索できるなら全探索しろ
    ・異常な制約ならそこに注目
}
stringの計算量(扱い)注意
コーナー注意！(特に数値が小さいものについては要検証)
N行出力のときは'¥n'
グリッド上では行先が範囲内におさまるかif文で確認(RE注意)
if文ではちゃんと比較演算子==を使え('='でもエラー出ない)
配列(vector)の大きさが0か1以上かで場合分けせよ(RE注意)
(vector<int> a(m)でm==0というものはできない)
modはなるべく最後に取れ！
doubleを扱うときには(abs)ではなく'fabs'!!!
*/

Measured memory_bytes: 3648
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
main(){
  int n,a,b,A,B;
  while(1){
    cin >> n;
    if(!n)break;
    A = B = 0;
    for(int i=0;i<n;i++){
      cin >> a >> b;
      if(a>b){
	A += (a + b);
      }else if(a==b){
	A += a;
	B += b;
      }else {
	B += (a+b);
      }
    }
    cout << A << " " << B << endl;
  }
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i< (n);i++)
using namespace std;
int main(){
    int n,ans=0;
    cin >> n;
    for(int i=1;i < 10;i++){
        if(i*111 >= n){
             ans = i*111;
            break;
        }
    }
    cout << ans << endl; 
}
/*abc112
int main(){
    int n,t,ans = 0;
    cin >> n >> t;
    vector<pair<int,int>> v(n);
    rep(i,n) cin >> v[i].first >> v[i].second;
    sort(v.begin(),v.end());
    rep(i,n){
        if(v[i].second <= t) {
            ans = v[i].first;
            break;
        }
    }
    if(ans == 0) cout << "TLE\n";
    else cout << ans << endl;
}
*/
/*abc114
int main(){
    int ans = 1e9;
    string s;
    cin >> s;
    int l = s.size();
    for(int i=0;i+2 < l;i++) {
        string c = s.substr(i,3);
        int n = stoi(c);
        int cl = abs(753-n);
        ans = min(ans,cl);
    }
    cout << ans << endl;
}*/
/*abc115
int main(){
    int n;
    cin >> n;
    vector<int> v(n,0);
    rep(i,n) cin >> v.at(i);
    sort(v.rbegin(),v.rend());
    v.at(0) /= 2;
    int ans = accumulate(v.begin(),v.end(),0);
    cout << ans << endl;   
}*/

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

signed main() {
  int h,w,a,b;
    scanf("%d%d%d%d",&h,&w,&a,&b);
    	std::string s(a,'0');
    	std::string t(w-a,'1');
        std::string ans=s+t;
  		std::string S(a,'1');
  		std::string T(w-a,'0');
  		std::string Ans=S+T;
  for(int i=0;i<h;i++){
    if(i<b){
    	printf("%s\n",ans.c_str());
    }
    else{
    	printf("%s\n",Ans.c_str());
    }
  }
}

Measured memory_bytes: 1280
using System.Linq;
using System;
using static System.Math;

class E { static void Main() => new J(); }
class J
{
	int[] G() => Console.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
	public J()
	{
		var I = G();
		Console.WriteLine(Max(0, Abs(I[1] - I[2]) - I[0]));
	}
}

Measured memory_bytes: 13268
#include <iostream>

using namespace std;

int main() {
    int N;
    string S;
    string T;
    cin >> N >> S;
    T = S.substr(N / 2);
    if (T + T == S) {
        cout << "Yes";
    } else {
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 3616
let () =
  let s = read_line () in
  Array.init (String.length s - 1) (fun i ->
    if s.[i] <> s.[i + 1] then max (i + 1) (String.length s - i - 1)
    else max_int)
  |> Array.fold_left min (String.length s)
  |> Printf.printf "%d\n"


Measured memory_bytes: 3456
import java.io.*;
import java.util.*;
import java.lang.reflect.Array;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
import java.util.Stack;


class Main {
	public static void main(String[] a) throws IOException {
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			String inputs = scan.nextLine();
			String[] datas = inputs.split(",",0);
			int stuid = new Integer(datas[0]).intValue();
			double weight = (Double.parseDouble(datas[1]));
			double height = (Double.parseDouble(datas[2]));
			
			double bmi = weight / (height * height);
			
			if(bmi >= 25.0){
				System.out.println(stuid);
			}
	}
 }
}

Measured memory_bytes: 26272