akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,s,n) for(int i = s; i < (int)(n); i++)

int main() {
  int h,w,n;
  cin >> h >> w >> n;
  int ans = n/max(h,w);
  if(n%max(h,w) != 0) ans++;
  cout << ans << endl;
}

Measured memory_bytes: 3496
n, k = map(int, input().split())
s = input()

nums = []
count = 0
prev = '1'
for c in list(s):
    if prev != c:
        nums.append(count)
        count = 1
    else:
        count += 1
    prev = c
nums.append(count)
if prev == '0':
    nums.append(0)

cml = [0]
for i in range(len(nums)):
    cml.append(cml[-1] + nums[i])

ans = 0
lencml = len(cml)
for l in range(0,lencml,2):
    r = l + (2 * k + 1)
    if r >= lencml:
        r = lencml - 1
    tmp = cml[r] - cml[l]
    if ans < tmp:
        ans = tmp

print(ans)

Measured memory_bytes: 8548
H, W = map(int, input().split())
grid = [list(input()) for i in range(H)]

rout = [False]*H
for i in range(H):
    for j in range(W):
        if grid[i][j] == '#':
            rout[i] = True
            break

cout = [False]*W
for i in range(W):
    for j in range(H):
        if grid[j][i] == '#':
            cout[i] = True
            break

for i in range(H):
    for j in range(W):
        if rout[i] and cout[j]:
            print(grid[i][j], end="")
    if rout[i]:
        print("")


Measured memory_bytes: 4596
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <map>
#include <stack>
#include <string>
#include <list>
#include <set>
#include <queue>
#include <deque>
#include <math.h>
#include <string.h>
using namespace std;

typedef pair<int, int> P;
#define ll long long
#define int ll
#define INF (1LL<<60)
#define mod 1000000007


int X, Y;

signed main(){

	cin >> X >> Y;
	cout << X + Y/2 << endl;

	return 0;
}


Measured memory_bytes: 256
#define P(s) {printf(s"\n");continue;}
main(m,f,r,s){for(;;){scanf("%d%d%d",&m,&f,&r);if((s=m+f)+r==-3)exit(0);if((m==-1)|(f==-1)|(s<30))P("F")if(s>=80)P("A")if(s>=65)P("B")if((s>=50)|(r>=50))P("C") P("D")}}

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

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

  vector<int> E(N + 1), W(N + 1);
  for (int i = 0; i < N; i++) if (S[i] == 'E') E[i + 1]++; else W[i + 1]++;
  for (int i = 2; i <= N; i++) {
    E[i] += E[i - 1];
    W[i] += W[i - 1];
  }

  int ans = N;
  for (int i = 1; i <= N; i++) ans = min(W[i - 1] + E[N] - E[i], ans);

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3076
def solve():
    N = int(input())
    t_i, x_i, y_i = 0, 0, 0
    for i in range(N):
        t_j, x_j, y_j = map(int, input().split())
        dt = t_j - t_i
        dxy = x_j - x_i + y_j - y_i
        if (dxy < -dt) | (dxy > dt):
            return "No"
        if ((t_i - t_j) % 2) != (dxy % 2):
            return "No"
        t_i, x_i, y_i = t_j, x_j, y_j
    return "Yes"


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

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m;i<n;i++)
#define c(n) cin>>n
#define co(n) cout<<n<<endl
using namespace std;

int main(){
  int a,b,c=0,d=0,e,n,m,x,y;
  c(n);
  int aa[n];
  rep(i,0,n) c(aa[i]);
  sort(aa,aa+n);
  rep(i,0,n-1) c+=aa[i];
  if(aa[n-1]<c) co("Yes");
  else co("No");
  
  return 0;
}

Measured memory_bytes: 256
n,a,b = map(int,input().split())
mod = 10**9+7
beki = pow(2,n,mod) - 1

MAX = 2*10**5
bikkuri=[1]
for i in range(1,MAX+1):
    bikkuri.append((bikkuri[-1]*i)%mod)

tmpN = n
tmp = 1
for _ in range(a):
    tmp *= tmpN
    tmp %= mod
    tmpN -= 1
#%print(tmp)
A = (tmp*pow(bikkuri[a],mod-2,mod))%mod

tmpN = n
tmp = 1
for _ in range(b):
    tmp *= tmpN
    tmp %= mod
    tmpN -= 1
B = (tmp*pow(bikkuri[b],mod-2,mod))%mod

#print(beki,A,B)
print((beki-A-B)%mod)

Measured memory_bytes: 52720
#include<stdio.h>

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


Measured memory_bytes: 580
#include<iostream>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
using namespace std;
using ll=long long;

const ll MOD=1e9+7;
int main(){
    string s;
    cin>>s;
    reverse(s.begin(),s.end());
    vector<vector<ll>> dp(s.size()+1,vector<ll>(13));
    dp[0][0]=1;
    int tmp=1;
    for(int i=0;i<s.size();i++){
        for(int j=0;j<13;j++){
            if(s[i]=='?'){
                for(int k=0;k<10;k++){
                    int piyo=(j+k*tmp)%13;
                    dp[i+1][piyo]+=dp[i][j];
                }
            }
            else{
                int piyo=(j+(s[i]-'0')*tmp)%13;
                dp[i+1][piyo]+=dp[i][j];
            }
        }
        for(int j=0;j<13;j++){
            dp[i+1][j]%=MOD;
        }
        tmp=tmp*10%13;
    }

    cout<<dp[s.size()][5]<<endl;
    return 0;
}


Measured memory_bytes: 13696
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N=5e5+5;
char s[N],ss[5];
int f[N][26];
int n,q;
void update(int id,int pos,int val) {
	for(int i=pos;i<=n;i+=(i&-i)) {
		f[i][id]+=val;
	}
}
int query(int id,int pos) {
	int ans=0;
	for(int i=pos;i;i-=(i&-i)) {
		ans+=f[i][id];
	}
	return ans;
}
int main() {
	//freopen("in.txt","r",stdin);
	scanf("%d%s%d",&n,s+1,&q);
	for(int i=1;i<=n;i++) {
		int x=s[i]-'a';
		update(x,i,1);
	}
	for(int i=0,op,x,y;i<q;i++) {
		scanf("%d",&op);
		if(op==1) {
			scanf("%d%s",&x,ss);
			update(s[x]-'a',x,-1);
			update(ss[0]-'a',x,1);
			s[x]=ss[0];
		}
		else {
			scanf("%d%d",&x,&y);
			int ans=0;
			for(int j=0;j<26;j++) {
				if(query(j,y)-query(j,x-1)) ans++;
			}
			printf("%d\n",ans);
		}
	}
	return 0;
}

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

#define rep( i, n ) for( int i = 0; i < ( n ); i++ )
#define PI 3.14159265

int main( void ) {
    int a, b;
    while( 1 ) {
        cin >> a >> b;
        rep( i, a ) {
            for( int j = 0; j < b; j++) {
                if( i == 0 || i == a - 1 )
                    cout << '#';
                else if( j == 0 || j == b - 1 )
                    cout << '#';
                else
                    cout << '.';
            }
            cout << endl;
        }
        if( a == 0 ) break;
        cout << endl;
    }
}



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

#define DFS_ITEM 3
#define DEPTH 4
int N, M, Q, ans=0;
vector<int> a(100), b(100), c(100), d(100);

void calc(vector<int> v) {
    int tmp = 0;
    for(int i=0; i<Q; i++){
	if(v[b[i]] - v[a[i]] == c[i])
	    tmp += d[i];
    }

    ans = max(tmp, ans);
}
void DFS(int depth, vector<int> v) {    
    if(depth == N){
	calc(v);
	return;
    }
    int tmp=0;
    if(depth==0)
	tmp=1;
    else
	tmp = v[depth-1];
    
    for(int i=tmp; i<=M; i++){
	v[depth] = i;
	DFS(depth+1, v);	
    }
}


int main() {
    cin >> N >> M >> Q;
    vector<int> v(1000);    
    for(int i=0; i<Q; i++){
	cin >> a[i] >> b[i] >> c[i] >> d[i];
	a[i]--;
	b[i]--;
    }

    DFS(0, v);			    
    
    cout << ans << endl;
} 




Measured memory_bytes: 3660
package main

import (
	"fmt"
	"sort"
)

var N, K int
var arr []int

func main() {
	fmt.Scan(&N, &K)
	drf(0, 1)
	sort.Ints(arr)
	fmt.Println(arr[0])
}
func drf(n int, w int) {
	if n == N {
		arr = append(arr, w)
		return
	}
	drf(n+1, w*2)
	drf(n+1, w+K)
	return
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

int main(){
    int n;
    cin>>n;
    int mn=INF;
    int ans=0;
    for(int i=0;i<n;i++){
        int p;
        cin>>p;
        if(p<mn){
            ans++;
            mn=p;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
// C - Many Requirements
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	int N,M,Q,ans;
	cin>>N>>M>>Q;
	vi a,b,c,d;
	a = b = c = d = vi(Q);
	rep(i, Q) cin>>a[i]>>b[i]>>c[i]>>d[i];

	vi bin(N+M-1, 1);
	rep(i, M-1) bin[i] = 0;
	ans = 0;
	do{
		vi A(1);
		int count = 0;
		rep(i, N+M-1){
			if(bin[i]) A.push_back(count);
			else count++;
		}
		int now = 0;
		rep(i, Q){
			int x = A[b[i]] - A[a[i]];
			if(x == c[i]) now += d[i];
		}
		ans = max(ans, now);
		// for(auto x:bin){cout<<x<<" ";}
		// puts("");
		// // cout<<"A.size "<<A.size()<<"\n";
		// for(auto a:A){cout<<a<<" ";}
		// puts("");
	} while(next_permutation(bin.begin(), bin.end()));
	cout<< ans <<endl;
}


Measured memory_bytes: 3592
#include <iostream>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(){
    double N, x[15], ans = 0;
    string u[15];
    cin >> N;
    REP(i, N) cin >> x[i] >> u[i];
    REP(i, N) if(u[i] == "BTC") x[i] = x[i] * 380000.0;
    REP(i, N) ans += x[i];
    cout << ans << endl;
}


Measured memory_bytes: 256
using System;

class Program
{
    static void Main()
    {
        string[] si = Console.ReadLine().Split(' ');
        int[] ar=new int[3];
        for (int i = 0; i < 3; i++)
        {
            ar[i] = int.Parse(si[i]);
        }
        Array.Sort(ar);
        Console.WriteLine("{0} {1} {2}", ar[0], ar[1], ar[2]);
    }
}

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

int main(){
  int N, prev_x=0, prev_y=0, prev_t=0, x, y, t;
  cin >> N;
  bool ans = true;
  rep(i,N){
    cin >> t >> x >> y;
    int diff = (t-prev_t) - (abs(x-prev_x)+abs(y-prev_y));
    if(diff % 2 == 0 && diff >= 0){
      prev_x = x;
      prev_y = y;
      prev_t = t;
    }else{
      ans = false;
      break;
    }
  }
  puts(ans ? "Yes" : "No");
}
  

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

int main(){
  	int a,b;
  	cin >> a >> b;
  	if(a>=13){
    	cout << b;
    }else if(a<=12 && a>=6){
    	cout << b/2;
    }else{
    	cout << 0;
    }
  	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rip(a,b,c) for(int (a)=(c);(a)<(b);(a)++)
const long long INF= 1LL << 60;
int main(){
    int N;
    cin >> N;
    vector<long long>h(N);
    rip(i,N,0){
        cin >> h[i];
    }
    long long dp[100010];
    rip(i,100010,0){
        dp[i]=INF;
    }
    dp[0]=0;
    rip(i,N,1){
        dp[i]=min(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
        if(i>1){
            dp[i]=min(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
        }
    }

    cout << dp[N-1] << endl;
}



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

int main() {
    //
    int num,k;
    int rPoint, sPoint, pPoint;
    long long sumPoint = 0;

    string roboTe;

    cin >> num >> k;
    cin >> rPoint >> sPoint >> pPoint;
    cin >> roboTe;

    vector<int> vec(num, 0);
    for (int i = 0; i < roboTe.size(); i++) {
        if(roboTe.at(i) == 'r'){
            if (i >= k && roboTe.at(i - k) == 'r' && vec.at(i-k) == 1) continue;
            sumPoint += pPoint;
            vec.at(i) = 1;
        } else if (roboTe.at(i) == 's') {
            if (i >= k && roboTe.at(i - k) == 's'&& vec.at(i-k) == 1) continue;
            sumPoint += rPoint;
            vec.at(i) = 1;
        } else if (roboTe.at(i) == 'p') {
            if (i >= k && roboTe.at(i - k) == 'p'&& vec.at(i-k) == 1) continue;
            sumPoint += sPoint;
            vec.at(i) = 1;
        }
    }

    cout << sumPoint;
    //
}


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

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        ArrayList<String> strList = new ArrayList<String>();
        while(sc.hasNext()){
            String str = sc.next();
            if(str.equals("-")){
                break;
            }
            int m = sc.nextInt();
            for(int i = 0; i < m; i++){
                int h = sc.nextInt();
                str = str.substring(h) + str.substring(0, h);
            }
            strList.add(str);
        }
        for(int i = 0; i < strList.size(); i++){
            System.out.println(strList.get(i));
        }
    }
}


Measured memory_bytes: 26556
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

main() {
    int64_t m;
    cin >> m;

    int64_t s = 0, n = 0;
    for (auto _ : irange(0L, m)) {
        int64_t c, d;
        cin >> d >> c;

        s += d * c;
        n += c;
    }

    cout << n - 1 + (s - 1) / 9 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    int n,m,k;
    cin >> n >> m >> k;
    vector<int>a(n);
    vector<int>b(m);
    rep(i,n)cin >> a[i];
    rep(i,m)cin >> b[i];
    ll t = 0;
    int ans = 0;
    int j = m-1;
    rep(i,m)t += b[i];
    for(int i = 0;i < n+1;i++){
        while(t>k && j >= 0){
            t -= b[j];
            j--;
        }
        if(t>k)break;
        ans = max(ans,i+j+1);
        if(i == n)break;
        t += a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4836
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,a,b;
  cin>>n>>a>>b;
  int d,r;
  d=ceil(n/4);
  r = n*a;
  if(r<=(b))
    cout<<r;
  else
    cout<<b;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final boolean answer = IntStream.range(0, scanner.nextInt())
                .mapToObj(i -> scanner.nextLong())
                .mapToLong(Long::longValue)
                .allMatch(i -> i % 2 == 0);

        if (answer) {
            System.out.println("second");
        } else {
            System.out.println("first");
        }
    }
}


Measured memory_bytes: 50236
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long int
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define mii map<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MOD 998244353
#define all(v) v.begin(), v.end()

using namespace std;
using namespace __gnu_pbds;

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

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin>>n;
    string name="";
    while (n)
    {
        name+=char('a'+(n-1)%26);
        n=(n-1)/26;
    }
    reverse(all(name));
    cout<<name;
}


Measured memory_bytes: 3624
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int cont1 = 0, cont2 = 0;
		int n1 = scn.nextInt();
		if(n1==5)cont1++;
		else if(n1==7)cont2++;
		 n1 = scn.nextInt();
		if(n1==5)cont1++;
		else if(n1==7)cont2++;
		n1 = scn.nextInt();
		if(n1==5)cont1++;
		else if(n1==7)cont2++;
		if(cont1==2&cont2==1)System.out.println("YES");
		else System.out.println("NO");
		scn.close();
	}
}

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<bool> AC(n,0);
  vector<int> WA(n,0);

  rep(i,m) {
    int p;
    string s;
    cin >> p >> s;
    p--;
    if(AC[p] == 1) continue;
    if(s=="AC") AC[p] = 1;
    if(s=="WA") WA[p] += 1;
  }
  
  int total_AC=0, total_WA=0;
  rep(i,n){
    total_AC += AC[i];
    if(AC[i]) total_WA += WA[i];
  }
  cout << total_AC << " " << total_WA << endl;
  
  
}


Measured memory_bytes: 3776
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
 
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  rep(i,n) cin>>a[i];
  int nxt=1,ans=0;
  rep(i,n){
    if(nxt==a[i])nxt++;
    else ans++;
  }
  if(ans==n)ans=-1;
  cout<<ans<<endl;
}

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

using namespace std;

#define INF 210000000
#define int long long

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

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

signed main() {
    map<int,int> cnt;
    for(int i=0;i<3;i++){
        int tmp;
        cin >> tmp;
        cnt[tmp]++;
    }
    for(auto& a : cnt){
        if(a.second == 1){
            cout << a.first << endl;
            break;
        }
    }
}



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

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); i++)

vector<int> solve(vector<int> a, vector<int> b, int n){
  REP(i, n){
    b.push_back(b[i]);
  }
  a.push_back(2);
  vector<int> e;
  vector<int> t(n + 1);
  t[0] = -1, t[1] = 0;
  int p = 2;
  int q = 0;
  while(p < n + 1){
    if(a[p - 1] == a[q]){
      t[p++] = ++q;
    }else if(q > 0){
      q = t[q];
    }else{
      t[p++] = 0;
    }
  }
  int m = 0;
  p = 0;
  while(m + p < 2 * n){
    if(a[p] == b[m + p]){
      ++p;
    }else{
      m += p - t[p];
      if(p > 0){
        p = t[p];
      }
    }
    if(p == n){
      e.push_back(m);
    }
  }
  return e;
}

int main(){
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  REP(i, n) cin >> a[i];
  REP(i, n) cin >> b[i];
  vector<int> A(n), B(n);
  vector<bool> r0[30];
  vector<bool> r1[30];
  REP(p, 30){
    REP(i, n){
      A[i] = (a[i] >> p) & 1;
      B[i] = (b[i] >> p) & 1;
    }
    vector<int> e;
    e = solve(B, A, n);
    r0[p].resize(n, false);
    for(auto x: e) r0[p][x] = true;
    REP(i, n){
      B[i] = ((b[i] >> p) & 1) ^ 1;
    }
    e = solve(B, A, n);
    r1[p].resize(n, false);
    for(auto x: e) r1[p][x] = true;
  }
  REP(i, n){
    bool ok = true;
    int d = 0;
    REP(p, 30){
      if(r0[p][i]){
        ;
      }else if(r1[p][i]){
        d |= 1 << p;
      }else{
        ok = false;
      }
    }
    if(ok){
      cout << i << " " << d << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 10084
import math

a, b, h, m = map(int, input().split())
m_ang = 360 * m / 60
h_ang=360*h/12+30*m/60
angle = abs(m_ang-h_ang)
if angle > 180:
    angle = 360 - angle
# elif angle > 90:
#     angle -= 90

d=math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(angle)))

print(d)

Measured memory_bytes: 9504
#include <iostream>
#include <string>

using namespace std;

string UOP(string str){
  string ans="";
  if('a' <= str[0] && str[0] <= 'z') str[0] = toupper(str[0]);
  for(int i = 0 ; i < str.size() ; i++){
    if(str[i] == '_'){
      if('a' <= str[i+1] && str[i+1] <= 'z') str[i+1] = toupper(str[i+1]);
    }
    else ans += str[i];
  }
  return ans;
}

string LOP(string str){
  string ans="";
  if('A' <= str[0] && str[0] <= 'Z') str[0] = tolower(str[0]);
  for(int i = 0 ; i < str.size() ; i++){
    if(str[i] == '_'){
      if('a' <= str[i+1] && str[i+1] <= 'z') str[i+1] = toupper(str[i+1]);
    }
    else ans += str[i];
  }
  return ans;
}

string DOP(string str){
  string ans="";
  for(int i = 0 ; i < str.size() ; i++){
    if('A' <= str[i] && str[i] <= 'Z') str[i] = tolower(str[i]);
    ans += str[i];
    if('A' <= str[i+1] && str[i+1] <= 'Z') ans += '_';
  }
  return ans;
}

int main(){
  string str;
  char op;
  while(cin >> str >> op, op != 'X'){
    if(op == 'U'){
      cout << UOP(str) << endl;
    }
    else if(op == 'L'){
      cout << LOP(str) << endl;
    }
    else if(op == 'D'){
      cout << DOP(str) << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 0
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	a := scanInts(n)
	sort.Ints(a)
	if a[0] == 0 {
		fmt.Fprintln(wr, 0)
		return
	}

	ans := 1
	for i := 0; i < n; i++ {
		if a[i]*ans < ans || a[i]*ans > 1e18 {
			fmt.Fprintln(wr, -1)
			return
		}
		ans *= a[i]
	}
	fmt.Fprintln(wr, ans)
}


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

int main() {
    int n;
    cin >> n;
    vector<int> p(n), q(n), r(n);
    for (int i = 0; i < n; i++) cin >> p[i];
    for (int i = 0; i < n; i++) cin >> q[i];
    iota (r.begin(), r.end(), 1);
    bool pf = true, qf = true;
    int a, b;
    for (int i = 1; pf || qf; i++) {
        if (p == r) {
            a = i;
            pf = false;
        }
        if (q == r) {
            b = i;
            qf = false;
        }
        next_permutation (r.begin(), r.end());
    }
    cout << abs(a-b) << endl;
}

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

public class Program {
  public static void Main() {
	var list = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
	var K = list[0];
	var S = list[1];
	
	var ans = 0;
	for(int x = 0; x <= K; x++)
	{
			for(int y = 0; y <= K; y++)
			{
				int z = S - x - y;
				if (0 <= z && z <= K) ans++; 
			}
	}
	Console.WriteLine(ans);  
  }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e2 + 10;
int a[N];
int main()
{
    int n;
    cin >> n;
    for(int i = 0;i < n;i++)cin >> a[i];
    sort(a,a+n);
    ll ans = 0x3f3f3f3f;
    for(int i = 1;i <= a[n-1];i++)
    {
        ll temp = 0;
        for(int j = 0;j < n;j++)
        {
            temp += (a[j] - i) * (a[j] - i) ;
        }
        ans = min(temp,ans);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.ArrayDeque;
import java.util.StringTokenizer;

class Main{
	static int H,W;
	static int[][] meiro,bfs;
	static int before=0;
	static int kaihou=0;
	static final int INF=1000000007;
	static int[] x= {0,1,0,-1};
	static int[] y= {1,0,-1,0};
	static int area=0;
	static int kuro=0;
	public static void main(String[] args) {
		SC sc=new SC(System.in);
		H=sc.nextInt();
		W=sc.nextInt();
		area=H*W;
		String s="";
		meiro=new int[H][W];
		bfs=new int[H][W];
		ArrayDeque<Integer> queue=new ArrayDeque<Integer>();
		for(int i=0; i<H; i++) {
			s=sc.next();
			for(int j=0; j<W; j++) {
				if(s.charAt(j)=='.') {
					meiro[i][j]=0;
					bfs[i][j]=INF;
				}
				else if(s.charAt(j)=='#') {
					meiro[i][j]=1;
					kuro++;
					bfs[i][j]=INF;
				}
			}
		}
		if(meiro[0][0]==0) {
			bfs[0][0]=1;
			queue.addLast(0);
			while(true) {
				if(queue.size()>0) {
					int tmp=queue.poll();
					int coord_x=tmp%100;
					int coord_y=tmp/100;
					if(coord_y*100+coord_x==(H-1)*100+W-1) {
						pl((area-kuro-bfs[coord_y][coord_x]));
						System.exit(0);
					}
					for(int i=0; i<4; i++) {
						if(coord_x+x[i]>=0 && coord_x+x[i]<W) {
							if(coord_y+y[i]>=0 && coord_y+y[i]<H) {
								if(meiro[coord_y+y[i]][coord_x+x[i]]==0) {
									if(bfs[coord_y+y[i]][coord_x+x[i]]!=bfs[coord_y][coord_x]+1) {
										bfs[coord_y+y[i]][coord_x+x[i]]=Math.min(bfs[coord_y+y[i]][coord_x+x[i]], bfs[coord_y][coord_x]+1);
										if(bfs[coord_y+y[i]][coord_x+x[i]]==bfs[coord_y][coord_x]+1) {
											queue.addLast((coord_y+y[i])*100+coord_x+x[i]);
										}
									}
								}
							}
						}
					}
				}
				else {
					pl(-1);
					System.exit(0);
				}
			}
		}
		else {
			pl(-1);
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}

Measured memory_bytes: 22996
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  ll n, k;
  cin >> n >> k;
  ll ans = 0;
  REP(i, n){
    ll b = i+1;
    ll p = n/b;
    ll r = n%b;
    ans += p * max(0ll, (b-k));
    ans += max(0ll, r-k+1);
  }
  if(k == 0) ans -= n;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#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 n;
    ll k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<int> x;
    vector<int> visit(n+1,-1);
    x.push_back(1);
    visit[1] = 0;
    ll z = 0;
    rep(i,n){
        int y=a[x.back()-1];
        if(visit[y]!=-1){
            z=visit[y];
            break;
        }else{
            visit[y]=i+1;
            x.push_back(y);
        }
    }
    if(k<z) cout << x[k] << endl;
    else{
        ll ans_idx = (k-z) % ll(x.size()-z);
        cout << x[z+ans_idx] << endl;
    }
    return 0;
}


Measured memory_bytes: 5828
package main
import "fmt"

func main() {
  var n, p, q int;
  fmt.Scan(&n)
  for i := 0; i < n; i++ {
    var k int;
    fmt.Scan(&k)
    if k & 1 == 1 {
      q++
    } else {
      p++
    }
  }
  if (q % 2 == 0) || (p == 0 && q == 1) {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}

Measured memory_bytes: 5504
#include<iostream>
#include<cctype>
#include<string>
using namespace std;
int main(){
    string s;
    getline(cin,s);
    for(int i=0;i<s.size();i++){
        if(s[i]>='a'&&s[i]<='z')s[i]-='a'-'A';
        else if(s[i]>='A'&&s[i]<='Z')s[i]+='a'-'A';
    }   
    cout<<s<<"\n";
    return 0;
}      


Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, K, A=1;
  cin >> N >> K;
  
  for(int i=0; i<N; i++){
    
    if( A+K < 2*A )
      A += K;
    else
      A *= 2;
  }
  
  cout << A << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <string.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
// sort(vec.begin(), vec.end()); std::greater<>()
// reverse(vec.begin(), vec.end());
// scanf("%s",s);
// printf("%d\n",end-start+1);
using namespace std;
template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

int main(){
    int H,W;cin >> H >> W;
    rep(i,H*2){
        string s; cin >> s;
        pr(s);
        pr(s);
    }
}


Measured memory_bytes: 256
use std::collections::VecDeque;

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

fn main() {
    let k = read::<usize>();

    let mut queue: VecDeque<i64> = VecDeque::new();
    for i in 1..10 {
        queue.push_back(i);
    }
    let mut x: i64 = 0;

    for _ in 0..k {
        x = queue.pop_front().expect("failed to pop");
        if x % 10 != 0 {
            queue.push_back(10 * x + x % 10 - 1);
        }
        queue.push_back(10 * x + x % 10);
        if x % 10 != 9 {
            queue.push_back(10 * x + x % 10 + 1);
        }
    }
    println!("{}", x);
}

Measured memory_bytes: 6396
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

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

int main() {
	int n, u, v, m;
	cin >> n >> u >> v >> m;

	map<int, vector<P> > ma[2];
	vector<vector<int> > a(n, vector<int>(n)), b(n, vector<int>(n));

	rep(i, n) {
		rep(j, n) {
			cin >> a[i][j];
			ma[0][a[i][j]].push_back(mp(i, j));
		}
	}

	rep(i, n) {
		rep(j, n) {
			cin >> b[i][j];
			ma[1][b[i][j]].push_back(mp(i, j));
		}
	}

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

	if(n == 1) {
		rep(i, m) {
			int sum[2];
			memset(sum, 0, sizeof(sum));

			rep(j, 2) {
				vector<P> res = ma[j][x[i]];
				if(res.size() >= 1) sum[j]++;
			}

			bool f1 = (sum[0] >= u);
			bool f2 = (sum[1] >= v);

			if(f1 && f2) {
				cout << "DRAW" << endl;
				return 0;
			} else if(f1) {
				cout << "USAGI" << endl;
				return 0;
			} else if(f2) {
				cout << "NEKO" << endl;
				return 0;
			}
		}

		cout << "DRAW" << endl;
		return 0;
	}


	int cy[2][505], cx[2][505], cross[2][2];
	memset(cy, 0, sizeof(cy));
	memset(cx, 0, sizeof(cx));
	memset(cross, 0, sizeof(cross));

	rep(i, m) {

		rep(j, 2) {
			vector<P> res = ma[j][x[i]];
			rep(k, res.size()) {
				int f = res[k].first, s = res[k].second;
				cy[j][f]++;
				cx[j][s]++;

				if(f == s) cross[j][0]++;
				if(f == n - 1 - s) cross[j][1]++;
			}
		}

		int sum[2];
		memset(sum, 0, sizeof(sum));

		rep(j, 2) {
			rep(k, 2) {
				sum[j] += (cross[j][k] == n);
			}
		}

		rep(j, 2) {
			rep(k, n) {
				sum[j] += (cy[j][k] == n);
				sum[j] += (cx[j][k] == n);
			}
		}

		bool f1 = (sum[0] >= u), f2 = (sum[1] >= v);
		if(f1 && f2) {
			cout << "DRAW" << endl;
			return 0;
		} else if(f1) {
			cout << "USAGI" << endl;
			return 0;
		} else if(f2) {
			cout << "NEKO" << endl;
			return 0;
		}
	}

	cout << "DRAW" << endl;

	return 0;
}

Measured memory_bytes: 35692
#include<bits/stdc++.h>
using namespace std;
#define reg register
typedef long long ll;
#define INF 0X3F3F3F3F

const int MAXS=1000000+5;

int n;
char str[MAXS];
int a[MAXS],sum[MAXS];
int sMin[MAXS];

inline int Solve(reg int Min){
	reg int base=0;
	static int tmp[MAXS];
	for(reg int i=1;i<=n;++i)
		if(str[i]=='?')
			if(sMin[i]-base-2>=Min){
				base+=2;
				tmp[i]=-1;
			}
			else
				tmp[i]=1;
		else
			tmp[i]=(str[i]=='0')?(-1):(1);
	int Max=0,sum=0;
	for(reg int i=1;i<=n;++i){
		sum+=tmp[i];
		Max=max(Max,sum);
	}
	return Max-Min;
}

int main(void){
	scanf("%s",str+1);
	n=strlen(str+1);
	for(reg int i=1;i<=n;++i)
		a[i]=(str[i]=='0')?(-1):(1);
	for(reg int i=1;i<=n;++i)
		sum[i]=sum[i-1]+a[i];
	sMin[n]=sum[n];
	for(reg int i=n-1;i>=0;--i)
		sMin[i]=min(sMin[i+1],sum[i]);
	printf("%d\n",min(Solve(sMin[0]),Solve(sMin[0]-1)));
	return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int x,t;
    cin>>x>>t;
    if(x<t)
    {
        cout<<"0";
    }
    else
    {
        cout<<"10";
    }
    
       
	return 0;
}

Measured memory_bytes: 256
/*
  Vivek Rathi
  CSE 2nd Year
  MNNIT
*/
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long int
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define present(c,x) ((c).find(x) != (c).end())
#define null NULL
#define mp make_pair
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define inf 1e18
#define flush fflush(stdout);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}
//-------------------------------Template--Above------------------------------------------------


int main()
{
	boost
	ll n,a,b,c,d;
	cin>>n>>a>>b>>c>>d;
	string s;
	cin>>s;
	ll flag=0;
	for(ll i=0;i<s.length()-1;i++)
	{
		if(s[i]==s[i+1]&&s[i]=='#'&&i<=max(c-1,d-1)&&i>=min(a-1,b-1))
		{
			cout<<"No"<<endl;
			return 0;
		}
		if(i>=b-1&&i<=d-1&&s[i-1]=='.'&&s[i+1]=='.'&&s[i]=='.')
		{
			flag=1;
		}
	}
	if((a<b&&c>=d))
	{
		if(flag==0||(c==d))
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}


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

int main()
{
	vector<int> a(5);
	for (int i = 0; i < 5; i++)
		cin >> a.at(i);
	int k;
	cin >> k;
	for (int i = 0; i < 4; i++)
	{
		for (int j = 1; j < 5 - i; j++)
		{
			if (abs(a.at(i) - a.at(i + j)) > k)
			{
				cout << ":(" << endl;
				return 0;
			}
		}
	}
	cout << "Yay!" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7;

int n, p;

int qpow(int a, int b) {
	if(b == 0) return 1;
	int t = qpow(a, b/2);
	t = t * t % p;
	if(b & 1) return t * a % p;
	else return t;
}
int cnt[10003];

signed main()
{
	IO_OP;
	
	string s;
	cin >> n >> p >> s;	
	if(p == 2) {
		ll ans = 0;
		for(int i=0;i<n;i++)
			if((s[i]-'0')%2==0)
				ans += i + 1;
		cout<< ans << endl;
		return 0;
	} 
	if(p == 5) {
		ll ans = 0;
		for(int i=0;i<n;i++)
			if((s[i]-'0')%5==0)
				ans += i + 1;
		cout<< ans << endl;
		return 0;
	}
	ll ans = 0;
	int cur = 0;
	cnt[0] = 1;
	for(int i=0;i<n;i++) {
		cur = (cur * 10 + s[i] - '0') % p;
		int tt = cur * qpow(10, n - i - 1) % p;
		ans += cnt[tt];
		cnt[tt]++;
	}
	cout << ans << endl;
}





Measured memory_bytes: 720
N, M, K = list(map(int, input().split()))

MOD = int(1e9 + 7)
NM = N * M

def su(n):
  return n * (n + 1) // 2
class comb():
  F = [1, 1]
  Fi = [1, 1]
  I = [0, 1]
  def __init__(self, num, mod):
    self.MOD = mod
    for i in range(2, num + 1):
      self.F.append((self.F[-1] * i) % mod)
      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
      self.Fi.append(self.Fi[-1] * self.I[i] % mod)
  def com(self, n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD

co = comb(NM, MOD)
times = co.com(NM - 2, K - 2)
Ans = 0
for i in range(N):
  for j in range(M):
    k = (su(i) + su(N - i - 1)) * M
    k = k + (su(j) + su(M - j - 1)) * N
    k = k * times
    Ans += k

print(Ans // 2 % MOD)



Measured memory_bytes: 27036
#include<bits/stdc++.h>
using namespace std;
#define forn(i, n)             for(int i = 0; i < n; i ++)
#define forn1(i, n)            for(int i = 1; i <= n; i ++)
#define pb push_back
#define ll long long int
#define fi first
#define se second
#define ii  pair<long long int, long long int>
#define vi  vector <long long int>
#define vii vector <pair <long long int, long long int > >
#define all(cont)  cont.begin(), cont.end()
#define EPS 1e-9
#define MOD 1000000007
#define range 
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#pragma GCC optimize ("Ofast")
int main(){

   // freopen("input.txt","r",stdin);
    IOS;
    clock_t clk = clock();
        
    int n; cin >> n;
    vector <long long int > a(n);
    long long int ans = 0;
    forn(i, n) cin >> a[i];
    forn(i, n) {
        forn(j, n) {
            if(j >= i) continue;
            ans += (a[i] * a[j]) ;
        }
    }

    cout << ans << endl;
    cerr << endl << setprecision(10) << fixed << (double)(clock() - clk) / CLOCKS_PER_SEC;
    return 0;
}


Measured memory_bytes: 256
package main

import (
  "fmt"
  "strings"
)

func main() {
  var n int
  var s string
  fmt.Scan(&n)
  fmt.Scan(&s)
  strings.Split(s, "")

  r:=0
  b:=0
  
  for i := 0; i<n; i++ {
    if s[i] == 82 {
      r++
    } else {
      b++
    }
  }
  
  if r>b {
    fmt.Println("Yes") 
  } else {
   fmt.Println("No") 
  }

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
void chmax(int &a,int b){if(a<b) a = b;}

using P = pair<int,int>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vvec<int> g(N);
    vec<int> dep(N);
    vec<int> par(N,-1);
    for(int i=0;i<N;i++){
        int a = 0;
        par[i] = (i-1)/2;
        for(int k=0;k<18;k++) if(i>=(1<<k)-1) a = k;
        dep[i] = a;
        if(2*i+1<N) g[i].push_back(2*i+1);
        if(2*i+2<N) g[i].push_back(2*i+2);
    }
    vec<int> V(N),W(N);
    int H = 9;
    for(int i=0;i<N;i++) cin >> V[i] >> W[i];
    int M = 1e5;
    int inf = 1e9;
    vvec<int> dp((1<<H)-1,vec<int>(M+1,-inf));
    dp[0][0] = 0;
    dp[0][W[0]] = V[0];
    auto dfs = [&](auto&& self,int cur)->void{
        for(auto& to:g[cur]){
            for(int i=0;i<=M;i++){
                chmax(dp[to][i],dp[cur][i]);
                if(i+W[to]<=M) chmax(dp[to][i+W[to]],dp[cur][i]+V[to]);
            }
            if(dep[to]+1<H) self(self,to);
        }
    };
    dfs(dfs,0);
    for(int i=0;i<(1<<H)-1;i++) for(int j=0;j<M;j++) chmax(dp[i][j+1],dp[i][j]);
    auto calc = [&](int v,int l){
        vec<P> A = {{0,0}};
        int now = v;
        while(dep[now]>=H){
            vec<P> ne;
            for(auto& x:A){
                ne.push_back(x);
                if(x.first+W[now]<=l) ne.push_back({x.first+W[now],x.second+V[now]});
            }
            A.swap(ne);
            now = par[now];
        }
        int res = dp[now][l];
        for(auto& x:A){
            res = max(res,x.second+dp[now][l-x.first]);
            res = max(res,x.second);
        }
        return res;
    };
    
    int Q;
    cin >> Q;
    while(Q--){
        int v,L;
        cin >> v >> L;
        v--;
        if(dep[v]<H) cout << dp[v][L] << "\n";
        else cout << calc(v,L) << "\n";
    }
}

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

int main() {
	int n; cin >> n;
	map<int, int>a;
	for (int i = 0, tmp; i < n; i++) {
		cin >> tmp; a[tmp]++;
	}
	int ans = 1;
	for (auto&& x : a) {
		if (x.first == 0) {
			if (n % 2 == 0) {
				if (x.second > 0) { cout << 0 << endl; return 0; }
			}
			else {
				if (x.second != 1) { cout << 0 << endl; return 0; }
			}
		}
		else {
			if (x.second != 2) { cout << 0 << endl; return 0; }
			else (ans *= 2) %= (int)1e9 + 7;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3200
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <unordered_map>
//#include"testlib.h"
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define sz(s)    (int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
#define watch(x) cout << (#x)<<" = "<<x<<endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("street.in", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}
int mod = 1e9 + 7;
int n, k;
vector<ll> v1;
ll gt() {
	ll ret = 1;
	for (int i = 0; i < k; i++) {
		ret *= v1[i];
		ret %= mod;
	}
	ret += mod;
	return ret % mod;
}

int main() {
	file();
	fast();
	cin >> n >> k;
	v1 = vector<ll>(n);
	for (auto& it : v1)
		cin >> it;
	if (n == k)
		RT(gt() << endl);
	auto cmp = [](const ll& a, const ll& b)->bool {
		return abs(a) > abs(b);
	};
	sort(all(v1), cmp);
	int ok = 0, neg = -1, pos = -1;
	for (int i = 0; i < k; i++) {
		if (v1[i] < 0)
			ok = 1 - ok, neg = i;
		else pos = i;
	}

	if (!ok)
		RT(gt() << endl);
	if (pos == -1) {
		bool s = 0;
		for (int i = k; i < n; i++)
			if (v1[i] >= 0) {
				s = 1;
				swap(v1[neg], v1[i]);
				break;
			}
		if (!s)
			reverse(all(v1));
		RT(gt() << endl);
	}
	ok = 0;
	for (int i = k; i < n; i++) {
		if (v1[i] >= 0) {
			ok = 1;
			break;
		}
	}
	if (!ok) {
		swap(v1[pos], v1[k]);
		RT(gt() << endl);
	}
	ll onePos = INT_MIN, oneNeg = INT_MIN;
	for (int i = k; i < n; i++)
		if (v1[i] >= 0) {
			onePos = v1[i];
			break;
		}
	for (int i = k; i < n; i++) {
		if (v1[i] < 0) {
			oneNeg = v1[i];
			break;
		}
	}
	if (oneNeg == INT_MIN) {
		v1[neg] = onePos;
		RT(gt() << endl);
	}
	if (v1[pos] * onePos > v1[neg] * oneNeg)
		v1[neg] = onePos;
	else
		v1[pos] = oneNeg;
	RT(gt() << endl);
	return 0;
}


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

int main() {
	int n, x, Min = INT_MAX, Max = INT_MIN;
	long long Sum = 0;

	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> x;
		Min = (Min > x) ? x : Min;
		Max = (Max < x) ? x : Max;
		Sum += x;
	}
	cout << Min << " " << Max << " " << Sum << endl;

	return 0;
}

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

int main(){
int a,b;
int c[25000];
while(scanf("%d%d",&a,&b),a|b){
	int s=0;
	for(int d=0;d<a;d++)scanf("%d",&c[d]);
	sort(c,c+a);
	for(int e=0;e<a-1;e++){
		s+=c+a-lower_bound(c+e+1,c+a,b-c[e]+1);
	}
	printf("%d\n",s);
}
}

Measured memory_bytes: 3188
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,m,n) for(int i=m;i<n;i++)
#define endre getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define INF 1000000007

signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a*c <= b)cout << c << endl;
	else {
		cout << b / a << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
typedef long long ll;
 
int main() {
  char a;cin>>a;
  if (a=='A') cout<<"T";
  else if (a=='T') cout<<"A";
  else if (a=='C') cout<<"G";
  else if (a=='G') cout<<"C";
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LOCAL
using namespace std;
int main()
{
    //input
    stack<int> s;
	char tem[7];
	int a,b,tem2;
    while(cin>>tem)
    {
    	//algorithm 如何区分运算符和数 并转化？？？ 遇到数进栈 遇到运算符出栈两个数并运算 再将结果入栈 重复
    	if(tem[0]=='+')
    	{
			a=s.top();
			s.pop();
			b=s.top();
			s.pop();
			tem2=b+a;
		}
    	else if(tem[0]=='-')
    	{
			a=s.top();
			s.pop();
			b=s.top();
			s.pop();
			tem2=b-a;
		}
    	else if(tem[0]=='*')
    	{
			a=s.top();
			s.pop();
			b=s.top();
			s.pop();
			tem2=b*a;
		}
    	else
		{
			stringstream ss;
			ss<<tem;
			ss>>tem2;
		}
		s.push(tem2);
    }
    //output
    cout<<s.top()<<'\n';
    return 0;
}


Measured memory_bytes: 3204
#include <bits/stdc++.h>
#define pb push_back
#define Int long long
using namespace std;

const int MAXN=500005;
const long MOD=(long)(1e9+7);
vector<int> adj[MAXN];
vector<pair<int,int>> G[MAXN];

Int N,M,K;
Int B,C,H,W;
Int X,Y,Z;
vector<Int> A;

Int ceilS(Int x,Int y){
    return (x+y-1)/y;
}
using D=long double;

Int perform(Int x){
    return (x*(x+1))/2LL;
}

D getExpectation(D x) {
   return perform(x)/x;
}

int main()
{
        cin>>N>>M;
        cout<<(N>8||M>8 ? ":(":"Yay!")<<"\n";
    
}

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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef long long lli;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, str>> vpls;
typedef vector<tuple<str, ll, ll>> vtsl;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

//実行部
void Main()
{
  ll n; cin >> n;
  ll ans = n / 2;
  if(n % 2 == 0) ans--;
  fin(ans)
  return;
}

//前処理
int main()
{
  //ios::sync_with_stdio(false);
  //cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>

using namespace std;

typedef long long ll;
typedef long double ld;

#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect
#define no {cout << -1; return;}
#define mkp make_pair
#define cerr if (0) cerr

void solve() {
    int a, b;
    cin >> a >> b;
    cout << a * b;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}


Measured memory_bytes: 3688