akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define vvll vector<vll>
#define mll map<ll,ll>
#define f(i,m,n) for(i=m;i<n;i++)
#define ee endl
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define take(v,n) for(i=0;i<n;i++) cin>>v[i];
#define NO() cout<<"NO"<<endl
#define YES() cout<<"YES"<<endl
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sot(v) sort(v.begin(),v.end());
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}

ll powe(ll x, ll y){
    ll res = 1;
    while (y > 0){
        if (y & 1) res = res*x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve()
{
    ll i,j,k=0,n,l;
    char c;
    cin>>c;
    if(c>=65 && c<97) cout<<"A";
    else cout<<"a";


}

int main() {
    fast;
    ll i,j,l,k,t,n;
    t=1;
    while(t--)
    solve();
}


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

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

    if(k>=a){
		k-=a;
		a=0;
    }
    else{
		a-=k;
		printf("%lld %lld", a, b);
		return 0;
    }

    if(k>=b){
		b=0;
		printf("%lld %lld", a, b);
		return 0;
    }
    else{
		b-=k;
		printf("%lld %lld", a, b);
		return 0;
    }

    printf("%lld %lld", a, b);
    return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<functional>
#define INF 1e16
#define N (1000000000+7)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> Q;
 


int main(void){
    ll a;
    string b;
    cin>>a>>b;
    ll x1=0,x2=0,x3=0;
    x1 = b[0]-'0';
    x2 = b[2]-'0';
    x3 = b[3]-'0';
    ll x = 100*x1+10*x2+x3;
    ll y = a*x;
    ll ans = y/100;
    cout<<ans<<endl;

    return 0;
}

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

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

int main() {
    int a, b; cin >> a >> b;
    int ans;
    cout << ((a*b)%2==1 ? "Yes" : "No") << endl;
    return 0;
}


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

LL a[maxn],b[maxn],n;

int main()
{
    scanf("%lld",&n);
    for(int i=0;i<n;i++)
        scanf("%lld",&a[i]);
    for(int i=0;i<n;i++)
        scanf("%lld",&b[i]);
    LL temp = 0;
    for(int i=0;i<n;i++)
    {
        if(a[i]>b[i])
            temp=temp-(a[i]-b[i]);
        else if(a[i]<b[i])
            temp=temp+(b[i]-a[i])/2;
    }
    if(temp>=0)
        printf("Yes\n");
    else
        printf("No\n");

    return 0;
}


Measured memory_bytes: 384
import sys
sys.setrecursionlimit(10 ** 7)


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


def main():
    _, A, B, C, D = LI()
    S = SI()

    M = [0 for _ in range(A)]
    a = 0
    for s in S[A:max(C, D)]:
        if s == ".":
            a = 0
            M.append(0)
        else:
            if a == 1:
                print("No")
                return
            a = 1
            M.append(1)
    if D > C:
        print("Yes")
        return
    if M[B-2] == 0 and M[B] == 0:
        print("Yes")
        return
    if M[D-2] == 0 and M[D] == 0:
        print("Yes")
        return
    a = 0
    for m in range(B-1, D):
        if M[m-1]+M[m]+M[m+1] == 0:
            print("Yes")
            return
    print("No")


main()


Measured memory_bytes: 5172
/*
				C++
				encoding: UTF-8
				Modified: <27/Jul/2019 05:34:08 PM>

				✪ H4WK3yE乡
				Mohd. Farhan Tahir
				Indian Institute Of Information Technology (IIIT), Gwalior
*/

#include <bits/stdc++.h>
#ifdef LOCAL_PROJECT
#	include <prettyprint.hpp>
#endif

using namespace std;

// clang-format off

#define         ll                     long long
#define         mod                    1000000007
#define         ve                     vector
#define         pb                     push_back
#define         endl                   "\n";
#define         ff                     first
#define         ss                     second
#define         pii                    pair<int, int>
#define         len(v)                 int(v.size())
#define         all(v)                 v.begin(), v.end()
#define         reset(a, b)            memset(a, b, sizeof(a));
#define         fr(i, s, n)            for (ll i = s ; i < n ; ++i)
#define         dfr(i, s, n)           for (ll i = s ; i > n ; --i)

void print (string sep = "\n") {
    cout << sep;
}

template < typename T, typename... TAIL > void print (const T& t, TAIL... tail) {
    cout << t << " ";
    print (tail...);
}

// clang-format on

signed main () {
	ios_base::sync_with_stdio (false), cin.tie (nullptr);
	ll a, b;
	cin >> a >> b;
	if (b > a) swap (a, b);
	ll c = (a + b) / 2;
	if (a - c == c - b)
		print (c);
	else
		print ("IMPOSSIBLE");
	return 0;
}


Measured memory_bytes: 256
predictions_S = gets.chars
predictions_T = gets.chars

hit = 0

if predictions_S[0] == predictions_T[0] then
  hit += 1
end

if predictions_S[1] == predictions_T[1] then
  hit += 1
end

if predictions_S[2] == predictions_T[2] then
  hit += 1
end

puts hit


Measured memory_bytes: 1788
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double D1, D2, D3, Dx;
		long sum1 = 0, sum2 = 0, sum3 = 0, max = 0;
		int[] x = new int[n];
		int[] y = new int[n];
		for (int i = 0; i < n; i++) {
			x[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			y[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			sum1 += Math.abs(x[i] - y[i]);
			sum2 += Math.pow(Math.abs(x[i] - y[i]), 2);
			sum3 += Math.pow(Math.abs(x[i] - y[i]), 3);
			max = Math.max(max, Math.abs(x[i] - y[i]));
		}
		D1 = sum1;
		D2 = Math.sqrt(sum2);
		D3 = Math.cbrt(sum3);
		Dx = max;
		System.out.printf("%f%n", D1);
		System.out.printf("%f%n", D2);
		System.out.printf("%f%n", D3);
		System.out.printf("%f%n", Dx);
		sc.close();
	}
}


Measured memory_bytes: 26652
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools



sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N, K = map(int,input().split())
A = [int(i) for i in input().split()]
Temp = [0]*N
imp = [0]*3
ans = [0]

def rec(next, kore):
    #print(kore)
    #print(next)
    if(kore==K):
        ans[0] = next
        return
    if(Temp[next-1] == 0):
        Temp[next-1] = kore
        rec(A[next-1], kore+1)
    else:
        imp[0] = kore-Temp[next-1]
        imp[1] = kore
        imp[2] = next
    return
#Temp[0] = 1
rec(A[0],1)
#print(imp)
#print("fin")
for i in range(N):
    Temp[i] = 0

if(ans[0] != 0):
    print(ans[0])
else:
    K -= imp[1]
    K = K%imp[0]
    #print(K)
    if(K==0):
        print(imp[2])
    else:
        #print("a", K)
        rec(A[imp[2]-1], 1)
        print(ans[0])


Measured memory_bytes: 213780
import java.util.*
import kotlin.math.acos
import kotlin.math.cos
import kotlin.math.round
import kotlin.math.sin

fun main(args: Array<String>) {
    val (a, b, x) = readLongList()

    val l = a / x + if (a % x != 0L) 1 else 0
    val r = b / x
    println(r - l + 1)
}

// read
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

Measured memory_bytes: 36476
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ft first
#define sd second
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

long double f(long double t,vector<vector<ll>>& k){
    long double tmp=0,r[4];
    fr(i,4) r[i]=max({k[i][0]+t,k[i][1]-t,(long double)k[i][2]});
    return (r[0]+r[2])*(r[1]+r[3]);
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n,x,y;
    vector<vector<ll>> k(4,vector<ll>(3,-1e10));
    char d;
    cin>>n;
    fr(i,n){
        cin>>x>>y>>d;
        if(d=='R'){
            k[0][0]=max(k[0][0],x);
            k[1][2]=max(k[1][2],-y);
            k[2][1]=max(k[2][1],-x);
            k[3][2]=max(k[3][2],y);
        }
        if(d=='D'){
            k[0][2]=max(k[0][2],x);
            k[1][0]=max(k[1][0],-y);
            k[2][2]=max(k[2][2],-x);
            k[3][1]=max(k[3][1],y);
        }
        if(d=='L'){
            k[0][1]=max(k[0][1],x);
            k[1][2]=max(k[1][2],-y);
            k[2][0]=max(k[2][0],-x);
            k[3][2]=max(k[3][2],y);
        }
        if(d=='U'){
            k[0][2]=max(k[0][2],x);
            k[1][1]=max(k[1][1],-y);
            k[2][2]=max(k[2][2],-x);
            k[3][0]=max(k[3][0],y);
        }
    }
    long double ans=f(0,k);
    fr(i,4){
        if(k[i][2]-k[i][0]>0) ans=min(ans,f(k[i][2]-k[i][0],k));
        if(k[i][1]-k[i][2]>0) ans=min(ans,f(k[i][1]-k[i][2],k));
        if(k[i][1]-k[i][0]>0) ans=min(ans,f((long double)(k[i][1]-k[i][0])/2.0,k));
    }
    cout<<setprecision(20)<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<queue>
using namespace std;

typedef long long ll;

int main() {
  int N, Y; cin >> N >> Y;
  int x = -1,y = -1,z = -1;
  for ( int i = 0; i <= N; i++ ) {
    for ( int j = 0; j <= N; j++ ) {
      int rem = N - (i+j);
      int tmp = Y;
      tmp -= 1000*i+5000*j;
      if (rem >= 0 && tmp >= 0 && tmp == rem*10000 ) {
	x = rem;
	y = j;
	z = i;
	break;
      }
    }
  }

  if( x == -1 && y == -1 && z == -1 ) cout << -1 << " " << -1 << " "
					   <<-1 << endl;
  else cout << x << " " << y << " " << z << endl;
  return 0;
}


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

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = int_fast64_t;
using pll = pair<ll,ll>;
constexpr ll INF = 1LL<<60;
constexpr ll MOD = 1e9+7;
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}
#if loc||local
void dump(){cerr<<endl;}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){cerr<<h<<", ";dump(forward<Ts>(t)...);}
#else
void dump(){}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){}
#endif
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T> ostream &operator<<(ostream& os,vector<T>const& v){for(auto const& vi:v)os<<vi<<" ";return os;}
template<class T,class U> ostream &operator<<(ostream& os,pair<T,U>const& p){os<<p.first<<","<<p.second;return os;}
template<class T>vector<T> vec(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto vec(size_t a, Ts... ts){return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...));}

signed main(){

  string s,t;
  cin>>s>>t;
  t.pop_back();
  cout<<(s==t?"Yes":"No")<<endl;

}

Measured memory_bytes: 3572
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
    NodePointer x;
    x = nil->next;
    while ((x != nil) && (x->key != key)) {
        x = x->next;
    }
    return x;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
    t->prev->next = t->next;
    t->next->prev = t->prev; 
}

void deleteFirst(){
  NodePointer t = nil->next;
  if (t == nil) return;
  deleteNode(t);
}

void deleteLast(){
    NodePointer t = nil->prev;
   if(t == nil)  return;
    deleteNode(t);
}

void delete(int key){
    NodePointer x;
    if((x = listSearch(key)) != NULL) {
        if(x == nil) return;
        deleteNode(x);
    }
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);          // 命令数
  init();                   // 初期化
  for ( i = 0; i < n; i++ ){        // コマンド,キー
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}   // insert 
    else if ( com[0] == 'd' ) {     // which delete
      if (strlen(com) > 6){         // 6文字以上
	if ( com[6] == 'F' ) deleteFirst();     // first
	else if ( com[6] == 'L' ) deleteLast();     // last
      } else {
	delete(key); nd++;          // delete
      }
      size--;
    }
  }

  printList();
  return 0;
}

Measured memory_bytes: 34976
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const ll LINF = 1LL << 50;
const int VMAX = 1e+5;
/* global variables */
/* function */
/* main */
int main(){
    int N, W;
    cin >> N >> W;
    vector<ll> w(N), v(N);
    for (int i = 0; i < N; i++) cin >> w[i] >> v[i];

    vector<ll> dp(VMAX+1, LINF);
    dp[0] = 0;
    for (int i = 0; i < N; i++) {
        for (int j = VMAX; j >= 0; j--) {
            if (j - v[i] >= 0) dp[j] = min(dp[j], dp[j - v[i]] + w[i]);
            if (j) dp[j-1] = min(dp[j-1], dp[j]);
        }
    }
    int ans = 0;
    for (int i = 0; i <= VMAX; i++) if (dp[i] <= W) ans = i;
    cout << ans << '\n';
}


Measured memory_bytes: 4008
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long unsigned int ll;

ll calc_sad(vector<int> A, int b) {
    ll sad = 0;
    rep(i, A.size()) {
        sad += abs(A[i] -b);
    }
    return sad;
}

int main() {
    int N;
    vector<int> A;
    cin >> N;
    rep(i, N) {
        int a;
        cin >> a;
        a -= (i + 1);
        A.push_back(a);
    }

    sort(A.begin(), A.end());
    int b = A[N>>1];

    ll result = calc_sad(A, b);

    cout << result << endl;
    return 0;
}

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

using vi = std::vector<int>;
using vvi = std::vector<vi>;

const int INF = (int)1e9;

int main() {
    std::string s; std::cin >> s;
    const int n = (int)s.size();
    s = "0" + s;
    vvi dp(2, vi(n+1, INF));
    dp[0][0] = 0;
    dp[1][0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int d = 0; d <= 1; d++) {
            dp[d][i] = std::min(dp[0][i-1] + (s[i] - '0' + d), dp[1][i-1] + 10 - (s[i] - '0' + d));
        }
    }
    std::cout << dp[0][n] << std::endl;
    return 0;
}

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

int main(){
    long long n;
    cin >> n;
    
    vector<pair<int, int>> p(n);
    rep(i, n){
        cin >> p.at(i).second >> p.at(i).first;
    }
    sort(p.begin(), p.end());
    
    string res = "Yes";
    long long sum = 0;
    rep(i, n){
        sum += p.at(i).second;
        if(sum > p.at(i).first){
            res = "No";
            break;
        }
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

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

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

    int n;
    cin >> n;
    int sz = n * n;
    vector<int> p(sz);
    for(int i = 0; i < sz; ++i) cin >> p[i];
    vector<P> pos(sz + 1);
    int cur = 1;
    vector<vector<int>> board(n, vector<int>(n));
    vector<vector<int>> dist(n, vector<int>(n, INF));
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < n; ++j){
            board[i][j] = cur;
            pos[cur++] = P(i, j);
            chmin(dist[i][j], i);
            chmin(dist[i][j], n - 1 - i);
            chmin(dist[i][j], j);
            chmin(dist[i][j], n - 1 - j);
        }
    }
    
    int ans = 0;
    for(int val : p){
        int sx = pos[val].first, sy = pos[val].second;
        ans += dist[sx][sy]--;
        board[sx][sy] = 0;
        deque<P> deq;
        deq.push_back(P(sx, sy));
        while(!deq.empty()){
            P point = deq.front();
            deq.pop_front();
            int x = point.first, y = point.second;
            for(int i = 0; i < 4; ++i){
                int nx = x + dx[i], ny = y + dy[i];
                if(nx < 0 || nx >= n || ny < 0 || ny >= n)  continue;
                if(board[nx][ny]){
                    if(dist[nx][ny] > dist[x][y] + 1){
                        dist[nx][ny] = dist[x][y] + 1;
                        deq.push_back(P(nx, ny));
                    }
                }
                else{
                    if(dist[nx][ny] > dist[x][y]){
                        dist[nx][ny] = dist[x][y];
                        deq.push_front(P(nx, ny));
                    }
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 9104
import java.util.*;
import java.util.stream.IntStream;

public class Main {
    static long[] dp;

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        char[] s = scan.nextLine().toCharArray();
        int a = Integer.parseInt(s[0] + "");
        int b = Integer.parseInt(s[1] + "");
        int c = Integer.parseInt(s[2] + "");
        int d = Integer.parseInt(s[3] + "");
        char[] ops = new char[]{'+', '-'};
        int ans = 7;
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                for (int k = 0; k < 2; k++) {
                    int sum = a;
                    sum += op(b, ops[i]);
                    sum += op(c, ops[j]);
                    sum += op(d, ops[k]);
                    if (sum == ans) {
                        System.out.println(a + "" + ops[i] + "" + b + "" + ops[j] + "" + c + "" + ops[k] + "" + d + "=7");
                        return;
                    }
                }
            }
        }
    }

    static int op(int num, int op) {
        if (op == '+') {
            return num;
        } else {
            return -num;
        }
    }
}

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

ll a[18];
map<pair<int,int>,ll> mem[18][18];
ll rec(int l, int r, int xl, int xr) {
  if (r-l == 1) return (ll)xl*a[l]+(ll)xr*a[r];
  assert(l != r);
  ll&memo = mem[l][r][{xl,xr}];
  if (!memo) {
    ll ans = 1e18;
    for (int m = l+1; m < r; m++) {
      ans = min(ans, rec(l,m,xl,xl+xr)+rec(m,r,xl+xr,xr)-a[m]*(xl+xr));
    }
    memo = ans+1;
  }
  return memo-1;
}

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> a[i];
  cout << rec(0,n-1,1,1) << endl;
}


Measured memory_bytes: 16640
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a % 2 == 0 || b % 2 == 0) {
            System.out.println("Even");
        } else {
            System.out.println("Odd");
        }

    }

}

Measured memory_bytes: 22868
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long K = sc.nextLong();
		sc.close();
		int N = 50;
		long ans[] = new long[N];  
		Arrays.fill(ans, 49);
		long quo = K/N;
		long rem = K%N;
		for(int i=0;i<N;i++)ans[i]+=quo;
		for(int i=0;i<rem;i++) {
			ans[i]+=rem;
			for(int j=0;j<N;j++) {
				if(j==i)continue;
				ans[j]--;
			}
		}
		System.out.println(N);
		for(long t:ans) {
			System.out.print(t+ " ");
		}
		System.out.println();
			
	}
}

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
	int n,r; cin>>n>>r;
  if (n>=10) out(r);
  
  int res = r+100*(10-n);
  out(res);
  
  
  

  return 0;
}
// don't forget to read in the input :^)


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

int main()
{
    int id;
    double weight, height;
    vector<int> table;
    while(scanf("%d,%lf,%lf", &id, &weight, &height)!=EOF){
        double bmi = weight/(height*height);
        if(bmi>=25) table.push_back(id);
    }

    vector<int>::iterator i;
    for(i=table.begin(); i!=table.end(); i++) cout << *i << endl;
    
    return 0;
}

Measured memory_bytes: 1252
#include <bits/stdc++.h>
#include <string>
  
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)
typedef long long ll;

const ll MOD=1000000007ll;
const int MAX=5100000;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

ll fact[MAX], fact_inv[MAX];

ll power(ll a, ll b){
	ll res=1;
	while(b>0){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

// nCr
ll comb(ll n, ll r){
	ll t=1000000;
	fact[0]=1;
	REP(i, t) fact[i+1]=fact[i]*(i+1)%MOD;
	fact_inv[t]=power(fact[t], MOD-2);
	FORR(i, 0, t) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;
	return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}
  
int main()
{
  string a,b; cin >> a >> b;
  int n,i,tmp;
  n = stoi(a+b);

  rep(i,1000){
      tmp = i * i;
      if(tmp == n){cout << "Yes" << endl; return 0;}
      if(tmp > n){cout << "No" << endl; return 0;}
  }
  cout << "No" << endl;

  return 0;
}


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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using ll=long long;
using ld=long double;
using pii=pair<int, int>;
using vi=vector<int>;
using vii=vector<vector<int>>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const int MOD=1e9+7;

template<typename T> bool chmin(T &a,const T b){if(a>b){a=b; return true;}return false;}
template<typename T> bool chmax(T &a,const T b){if(a<b){a=b; return true;}return false;}



int main(){
    ll r, D, x; cin >> r >> D >> x;
    for(int i=0; i<10; i++){
        x=r*x-D;
        cout << x << endl;
    }
    return 0;
}

Measured memory_bytes: 3640
#include <cstdio>

int main()
{
	int a, b, k;
	scanf("%d %d %d\n", &a, &b, &k);
	for (int i = 0; i < k; ++i)
	{
		if (i % 2 == 0)
		{
			if (a % 2 == 1)
			{
				--a;
			}
			a /= 2;
			b += a;
		}
		else
		{
			if (b % 2 == 1)
			{
				--b;
			}
			b /= 2;
			a += b;
		}
	}
	printf("%d %d\n", a, b);
	return 0;
}


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

bool has3(int p){
	while(p){
		if(p % 10 == 3) return true;
		p /= 10;
	}
	return false;
}

void call(int n){
	REP(i,1,n + 1){
		if(i % 3 == 0 || has3(i))
			cout << " " << i;
	}
}

int main(void){
	int a;
	cin >> a;
	call(a);
	cout << endl;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(100), 0);
//int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv ./prog.exe") >> 8), 0);
const Int MOD = 998244353;
const Int MAX = 10000;
Int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = finv[0] = finv[1] = inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
Int COM(int n, int k) {
    if (n < k || n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
Int memo[3010][6010];
Int f(int n, int sum) {
    if (sum > 2 * n || sum < 0) return 0;
    if (n == 0) return sum == 0;
    if (memo[n][sum] != -1) return memo[n][sum];
    Int ans = f(n - 1, sum) + f(n - 1, sum - 1) + f(n - 1, sum - 2);
    ans %= MOD;
    return memo[n][sum] = ans;
}
Int g(int k, int n, int m) {
    Int ans = 0;
    for (int a = 1; a <= n - k; a++) {
        ans += COM(n - a - 1, k - 1) * f(a, m);
        ans %= MOD;
    }
    return ans;
}
int main() {
    COMinit();
    memset(memo, -1, sizeof(memo));
    int N, X; cin >> N >> X;
    Int ans = 0;
    for (int t = 0; t <= N * 2; t++) {
        if (t < X) {
            ans += f(N, t);
            ans %= MOD;
        } else if (t == X) {
            // zero
        } else if (t % 2 != X % 2) {
            int k = (t - X + 1) / 2;
            int m = t - k * 4;
            if (m <= 0 && t % 2 == 0) {
                ans += COM(N, t / 2);
            }
            if (m > 0) {
                ans += g(k * 2, N, m);
            }
            ans %= MOD;
        }
    }
    cout << ans << endl;
    return 0;
}


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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

typedef long long ll;
typedef pair<int, int> p;

int main(){
  int n;
  int res = 0;
  cin >> n;
  vector<int> v(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }

  while(true) {
    bool flag = true;
    int l = 0;
    int r = n;
    for (int i = 0; i < n; i++) {
      if(v[i] > 0 && flag)
      {
        l = i;
        flag = false;
      }
      if(!flag && v[i] == 0 && i > l) {
        r = i;
        break;
      }
    }
    // cout << l << " : " << r << endl;
    for (int i = l; i < r; i++) {
      v[i]--;
    }
    // print(v);
    res++;
    if(flag) break;
  }

  cout << res-1 << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define STDIO
#define MOD 1000000007
#define testbit(mask,i) (((mask)>>(i))&1)
#define setbit(mask,i) ((mask)|(1<<i))
#define delbit(mask,i) ((mask)^(1<<i))
#define lowbit(x) ((x)&(-x))
#define INF MOD
using namespace std;
int n,m;
int val[300];
int s[6],c[6];
int delta[5]={-1,100,10,1};
int getw(int x,int bi){
	if(bi==1)
		return x%10;
	if(bi==2)
		return (x%100)/10;
	return x/100;
}
int main(){
	#ifndef STDIO
		freopen("input.in","r",stdin);
		freopen("output.out","w",stdout);
	#endif
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n>>m;
	int lb,rb;
	if(n==1){
		lb=0;
		rb=9;
	}
	if(n==2){
		lb=10;
		rb=99;
	}
	if(n==3){
		lb=100;
		rb=999;
	}
	for(int i=1;i<=m;i++)
		cin>>s[i]>>c[i];
	for(int i=lb;i<=rb;i++){
		bool ok=true;
		for(int j=1;j<=m;j++){
			if(getw(i,(n-s[j]+1))!=c[j])
				ok=false;
		}
		if(ok){
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}


Measured memory_bytes: 256
/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long lNsong for now.
Add something here.

*/
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;
typedef long long ll;

int mod = 1000000007;
ll dp[100005];;

ll gcd(long long a,long long b){

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

bool compare(pair<int,int>p1, pair<int,int>p2){

  return p1.second > p2.second;
 }

 // sorting the map when the first is string ans second is the integer
 bool sortbyval(pair<string,int>a, pair<string,int>b){
   return a.second < b.second;
 }

int main(){

  long long n,m,right=0,wrong=0;
  long long p;
  string a;
  cin>>n>>m;

  set<long long>ani;
  map<int,int>times;

    while(m--)
   {
       cin>>p>>a;
      // times[p]++;
        if(a == "WA")
            times[p]++;
        else if(a == "AC"){
            if(ani.find(p) == ani.end()){
              right++;
              wrong += times[p];
            ani.insert(p);
            }
        }

    }

    cout<<right<<" "<<wrong<<endl;

 return 0;
}


Measured memory_bytes: 12936
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )

#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

const int DIRECTION[][2] = {
	0, 1,
	1, 0,
	0, -1,
	-1, 0
};

struct Solver
{
	const int H, W, C;
	int res;

	Solver( int h, int w, int c ) : H( h ), W( w ), C( c ), res( 0 )
	{
		VVI board( h, VI( w, 0 ) );
		REP( i, 0, H )
		{
			REP( j, 0, W )
			{
				cin >> board[i][j];
			}
		}
		
		dfs( board, 0 );
		
		return;
	}

	operator int ()
	{
		return res;
	}

	void dfs( VVI board, int depth )
	{
		res = max( res, check( board ) );

		if ( 5 <= depth )
		{
			return;
		}

		REP( i, 1, 7 )
		{
			dfs( change( board, i ), depth + 1 );
		}
		return;
	}

	int check( VVI board )
	{
		int res = 0;
		queue< PII > que;
		que.push( MP( 0, 0 ) );
		while ( !que.empty() )
		{
			PII cur = que.front();
			que.pop();

			if ( board[ cur.fst ][ cur.snd ] != C )
			{
				continue;
			}

			res++;
			board[ cur.fst ][ cur.snd ] = 0;

			REP( d, 0, 4 )
			{
				PII next( cur );
				next.fst += DIRECTION[d][0];
				next.snd += DIRECTION[d][1];
				if ( 0 <= next.fst && next.fst < H && 0 <= next.snd && next.snd < W )
				{
					que.push( next );
				}
			}
		}

		return res;
	}

	VVI change( VVI board, int c )
	{
		set<PII> target;

		queue<PII> que;
		que.push( MP( 0, 0 ) );
		while ( !que.empty() )
		{
			PII cur = que.front();
			que.pop();

			if ( board[ cur.fst ][ cur.snd ] != board[0][0] || EXIST( target, cur ) )
			{
				continue;
			}

			target.insert( cur );

			REP( d, 0, 4 )
			{
				PII next( cur );
				next.fst += DIRECTION[d][0];
				next.snd += DIRECTION[d][1];
				if ( 0 <= next.fst && next.fst < H && 0 <= next.snd && next.snd < W )
				{
					que.push( next );
				}
			}
		}

		EACH( it, target )
		{
			board[ it -> fst ][ it -> snd ] = c;
		}
		return board;
	}
};

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

	while ( true )
	{
		int h, w, c;
		cin >> h >> w >> c;

		if ( !( h | w | c ) )
		{
			break;
		}

		cout << Solver( h, w, c ) << endl;
	}

	return 0;
}

Measured memory_bytes: 1236
S=input()+"R"
RLs=[]
Rpos=0
for i in range(len(S)):
    if S[i]=="L" and S[i+1]=="R":
        RLs.append(S[Rpos:i+1])
        Rpos=i+1
ans=[]
for RL in RLs:
    i=RL.find("RL")
    l=len(RL)
    for _ in range(i):
        ans.append(0)
    x=(l-(i+1))//2+i//2+1
    ans.append(x)
    ans.append(l-x)
    for _ in range(l-i-2):
        ans.append(0)
print(*ans)

Measured memory_bytes: 55024
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author @MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Dolphine solver = new Dolphine();
        solver.solve(1, in, out);
        out.close();
    }

    static class Dolphine {
        public void solve(int testNumber, FastReader fs, PrintWriter pw) {
            String s = fs.next();
            pw.println(s.replaceAll(",", " "));
        }

    }

    static class FastReader {
        BufferedReader bf;
        StringTokenizer st;

        public FastReader(InputStream is) {
            bf = new BufferedReader(new InputStreamReader(is));
            st = null;
        }

        public String next() {
            try {
                while (st == null || !st.hasMoreTokens()) {
                    String line = bf.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
            } catch (Exception e) {
            }

            return st.nextToken();
        }

    }
}



Measured memory_bytes: 8528
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (ll i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (ll i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    ll a;
    cin >> a;
    cout << a + a * a + a * a * a << endl;
}


Measured memory_bytes: 3640
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <cmath>
#include <cstring>
#include <assert.h>
#include <utility>
#include <tuple>
#include <array>
#include <bitset>
#include <cstdlib>

using int64 = long long;

template <typename T = int>
struct Range {
    struct RangeIterator {
        T i, step;

        RangeIterator(T i, T step): i{i}, step{step} {}

        T& operator*() { return i; }
        RangeIterator& operator++() {
            i += step;
            return *this;
        }
        bool operator!=(const RangeIterator& rhs) const {
            return (step > 0 && i < rhs.i) || (step < 0 && i > rhs.i);
        }
    };

    T start, stop, step;

    Range(T start, T stop, T step): start{start}, stop{stop}, step{step} {}
    Range(T start, T stop): Range(start, stop, 1) {}
    Range(T stop): Range(0, stop, 1) {}
    
    RangeIterator begin() const { return RangeIterator(start, step); }
    RangeIterator end() const { return RangeIterator(stop, step); }
};

using Square = std::pair<int, int>;

static constexpr int64 MOD = 1e9 + 7;

static int64 dp[3010], factorial[200005], inv_factorial[200005];

int64 powMod(int64 a, int64 n) {
    int64 res = 1,
          p = a % MOD;
    while (n > 0) {
        if (n & 1) (res *= p) %= MOD;
        (p *= p) %= MOD;
        n >>= 1;
    }
    return res;
}

void buildFactorialTable() {
    factorial[0] = 1;
    for (int n : Range<>(1, 200001)) {
        factorial[n] = (n * factorial[n - 1]) % MOD;
    }
    inv_factorial[200000] = powMod(factorial[200000], MOD - 2);
    for (int n : Range<>(200000, 0, -1)) {
        inv_factorial[n - 1] = (n * inv_factorial[n]) % MOD;
    }
}

int64 choose(int n, int k) {
    if (n < k) return 0;
    int64 res = factorial[n];
    (res *= inv_factorial[k]) %= MOD;
    (res *= inv_factorial[n - k]) %= MOD;
    return res;
}

int64 countWays(Square start, Square goal) {
    int dr = goal.first - start.first,
        dc = goal.second - start.second;
    return choose(dr + dc , dr);
}

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

    int h, w, n;
    std::cin >> h >> w >> n;

    std::vector<Square> squares(n);

    for (int i : Range<>(n)) {
        std::cin >> squares[i].first >> squares[i].second;
    }
    std::sort(squares.begin(), squares.end());

    buildFactorialTable();

    for (int i : Range<>(n)) {
        dp[i] = countWays(Square(1, 1), squares[i]);
        for (int j : Range<>(i)) {
            if (squares[j] <= squares[i]) {
                dp[i] -= (dp[j] * countWays(squares[j], squares[i])) % MOD;
                dp[i] += MOD;
                dp[i] %= MOD;
            }
        }
    }

    int64 ans = countWays(Square(1, 1), Square(h, w));

    for (int i : Range<>(n)) {
        ans -= (dp[i] * countWays(squares[i], Square(h, w))) % MOD;
        ans += MOD;
        ans %= MOD;
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 3456
#include<cstdio>
using namespace std;
int n,t,cost[105],time[105],ans=0x7fffffff;
int main()
{
	scanf("%d%d",&n,&t);
	for(int i=1;i<=n;++i) scanf("%d%d",&cost[i],&time[i]);
	for(int i=1;i<=n;++i) if(time[i]<=t&&cost[i]<ans) ans=cost[i];
	if(ans!=0x7fffffff) printf("%d\n",ans);else printf("TLE\n");
	return 0;
}

Measured memory_bytes: 256
/*The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

//PRABHJOT SINGH A.K.A. PRABHI
//~~~~~conquizztador~~~~~


#include<bits/stdc++.h>
using namespace std;
using lli = long long int;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
const int MOD = 1000000007;
const int MOD1 = 998244353;
const int maxn = 100010;
const int lim = (int)1e9;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin >> s;
	cout << (s[s.length() - 1] == 's' ? s + "es" : s + "s") << endl;
}

Measured memory_bytes: 3644
def main():
    s = input()

    spl = s.split("LR")

    for i, e in enumerate(spl):
        spl[i] = "R" + spl[i] + "L"

    spl[0] = spl[0][1:]
    spl[-1] = spl[-1][:-1]

    ans = []
    for es in spl:
        rl_i = es.find("RL")
        l = len(es)
        q, r = divmod(l, 2)
        for i, e in enumerate(es):
            if i == rl_i or i == rl_i + 1:
                tmp = q + r * ((i + 1) % 2)
                ans.append(tmp)
            else:
                ans.append(0)

    print(*ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9464
[N,K] = list(map(int,input().split()))
#[N,K] = [13,3]
S = str(input())
tmp = S[0]
num = []
num_tmp = 0
for i in range(N):
    if S[i] == tmp:
        num_tmp += 1
    else:
        tmp = S[i]
        num.append(num_tmp)
        num_tmp = 1
    if i == N-1:
        num.append(num_tmp)
ans = 0
for i in range(len(num)):
    ans += num[i] - 1
Kmax = len(num) // 2
if Kmax <= K:
    print(N-1)
else:
    print(2*K+ans)

Measured memory_bytes: 3956
import java.io.PrintWriter

val pw = PrintWriter(System.out)
fun main(args: Array<String>) {
    func()
    pw.flush()
}
fun println(value: Any) { pw.println(value) }

//ABC129_A
fun func() {
    val N = nextInt()
    val W = listOfInt()
    var Q = Array<Int>(N+1, { 0 })
    for (n in 1 .. N) Q[n] = Q[n - 1] + W[n - 1]
//println("${Q.toStringA()}")
    var ans = Int.MAX_VALUE
    for (n in 1 until N) {
        val l = Q[n] - Q[0]
        val r = Q[N] - Q[n]
        ans = Math.min(ans, Math.abs(r - l))
    }
    println("${ans}")
}

fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) } //{ it.toInt() }

fun Array<Int>.toStringA(): String {
    return this.joinToString(separator = ", ", prefix = "[", postfix = "]") { it.toString() }
}


Measured memory_bytes: 38036
#include <bits/stdc++.h>
using namespace std;
typedef long long lli;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<vector<lli> > mat;
typedef vector<vector<bool> > matb;
typedef vector<string> vst;
typedef pair<lli,lli> pll;
typedef pair<double,double> pdd;
typedef vector<map<lli,lli>> graph;

const lli MOD = 1000000007;

lli n;
string s1;
string s2;
vll a;
lli ans = 3;
int main(){
	cin >> n >> s1 >> s2;
	for(lli i = 0;i < n;i++){
		if(s1[i] == s2[i]) a.push_back(0);
		else{
			a.push_back(1);
			i++;
		}
	}
	if(a[0] == 0) ans = 3;
	else ans = 6;
	for(lli i = 1;i < a.size();i++){
		if(a[i-1] == 0 && a[i] == 0) ans = (ans*2)%MOD;
		if(a[i-1] == 0 && a[i] == 1) ans = (ans*2)%MOD;
		if(a[i-1] == 1 && a[i] == 0) ans = ans;
		if(a[i-1] == 1 && a[i] == 1) ans = (ans*3)%MOD;
	}
	cout << ans << endl;
	return 0;
}	

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		List<Sushi> sushi = new ArrayList<>(n);
		for (int i = 0; i < n; i++) {
			sushi.add(new Sushi(sc.nextInt(), sc.nextInt()));
		}
		Collections.sort(sushi, new SushiComparator());
		Set<Integer> kind = new TreeSet<>();
		List<Long> zatsu = new ArrayList<>();
		long dsum = 0;
		for (int i = 1; i <= k; i++) {
			dsum += sushi.get(n - i).oisi;
			if (kind.contains(sushi.get(n - i).kind)) {
				zatsu.add((long) sushi.get(n - i).oisi);
			}
			kind.add(sushi.get(n - i).kind);
		}
		long[] sum = new long[k + 1];
		int fir = kind.size();
		sum[fir] = dsum;
		long ans = dsum + (long) kind.size() * kind.size();
		int j = n - k - 1;
		for (int i = fir; i < k; i++) {
			for (; j >= 0; j--) {
				if (!kind.contains(sushi.get(j).kind)) {
					kind.add(sushi.get(j).kind);
					sum[i + 1] = sum[i] - zatsu.get(zatsu.size() - 1) + sushi.get(j).oisi;
					zatsu.remove(zatsu.size() - 1);
					break;
				}
			}
			ans = Math.max(sum[i + 1] + (long) kind.size() * kind.size(), ans);
		}
		System.out.println(ans);
	}
}

class Sushi {
	public int oisi;
	public int kind;
	public Sushi(int kind, int oisi) {
		this.oisi = oisi;
		this.kind = kind;
	}
}

class SushiComparator implements Comparator<Sushi> {
	@Override
	public int compare(Sushi s1, Sushi s2) {
		return s1.oisi - s2.oisi;
	}
}

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

const int maxn=1e5+10;
int n,x[maxn],y[maxn],t[maxn];

int main(){
	cin>>n;
	for(int i=1;i<=n;++i){
		cin>>t[i]>>x[i]>>y[i];
		if(t[i]+x[i]+y[i]&1){
			puts("No");
			return 0;
		}
		if(abs(x[i-1]-x[i])+abs(y[i-1]-y[i])>t[i]-t[i-1]){
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	return 0;
}

Measured memory_bytes: 1408
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w=sc.nextInt();
        int h=sc.nextInt();
        int x=sc.nextInt();
        int y=sc.nextInt();
        int r=sc.nextInt();

        if(x+r<=w && x-r>=0 && y+r<=h && y-r>=0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}



Measured memory_bytes: 26360
A, B, C, X, Y = map(int, input().split())

## min(Ax + By + Cz) = min((A+0.5C)x + (B+0.5C)y)
# Xyen = Ai + 2Cj, Yyen = Bk + 2Cj, X = i +2j, Y = k + 2j
# Xyen + Yyen = AX + BY + 2(C-A)j + 2(C-B)j, jを求めればok?

# l = []
# for j in range(max(X,Y)+1):
#     if j <= X+Y:
#         l.append(A*X + B*Y + (C-A*0.5-B*0.5)*j)

# print(int(min(l)))

X1 = X
Y1 = Y
price = []
for i in range(0, max(X,Y)+1):
    price.append(max(0,(X1-i))*A+max(0,(Y1-i))*B+2*i*C) 
print(min(price))

Measured memory_bytes: 7096
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define rep3(i, s, n) for (int i = s; i > (int)(n); i--)
#define all(obj) obj.begin(), obj.end()
#define db(x) cerr << #x << ":" << x << " "
#define dbl(x) cerr << #x << ":" << x << "\n"
#define dbv(vec) cerr << #vec << ":"; for (auto e : vec) cerr << e << " "; cout << "\n"
#define dbvv(vv) cerr << #vv << ":\n"; for (auto vec : vv) { for (auto e : vec) cerr << e << " "; cerr << "\n"; }
#define YN(f) cout << (f ? "YES" : "NO") << "\n"
#define Yn(f) cout << (f ? "Yes" : "No") << "\n"
#define yn(f) cout << (f ? "yes" : "no") << "\n"
using ll = long long;
using vi = vector<int>; using vl = vector<ll>; using vs = vector<string>;
using vvi = vector<vi>; using vvl = vector<vl>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using vpii = vector<pii>; using vpll = vector<pll>;
using ti3 = tuple<int, int, int>; using tl3 = tuple<ll, ll, ll>;

vector<vector<bool>> c;
vector<vector<bool>> r;

void dfs(int i, int j) {
	r[i][j] = true;	
	vi di = { 1, 1, 0, -1, -1, -1, 0, 1 };
	vi dj = { 0, 1, 1, 1, 0, -1, -1, -1 };
	rep(k, 8) {
		int in = i + di[k], jn = j + dj[k];
		if (c[in][jn] and !r[in][jn]) dfs(in, jn);
	}
}

int main() {
	while (true) {
		int w, h; cin >> w >> h;
		if (w == 0 and h == 0) break;
		c.assign(h + 2, {}); rep(i, h + 2) c[i].assign(w + 2, false);
		rep2(i, 1, h + 1) {
			rep2(j, 1, w + 1) {
				int cij; cin >> cij;
				c[i][j] = cij == 1;
			}
		}

		// dbvv(c);
		r.assign(h + 2, {}); rep(i, h + 2) r[i].assign(w + 2, false);
		int ans = 0;		
		rep2(i, 1, h + 1) rep2(j, 1, w + 1) {
			if (c[i][j] and !r[i][j]) {
				dfs(i, j);
				ans++;
			}
		}
		// dbl(ans);
		cout << ans << endl;
	}
}


Measured memory_bytes: 3436
#include <algorithm>
#include <functional>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = long long;
using ull = unsigned long long;

using vll = vector<ll>;

void solve();

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

  solve();

  return 0;
}

#define ini(...)   \
  int __VA_ARGS__; \
  in(__VA_ARGS__)

#define inl(...)  \
  ll __VA_ARGS__; \
  in(__VA_ARGS__)

#define ins(...)      \
  string __VA_ARGS__; \
  in(__VA_ARGS__);

void in() {}
template <typename T, class... U>
void in(T& t, U&... u) {
  cin >> t;
  in(u...);
}

void out() {
  cout << endl;
}
template <typename T, class... U>
void out(const T& t, const U&... u) {
  cout << t;
  if (sizeof...(u))
    cout << " ";
  out(u...);
}

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

void solve();
#ifndef ONLINE_JUDGE
#include "./lib.hpp"
#endif

void solve() {
  ini(A, B, C);

  for (int i = 1; i < B; i++) {
    if (A * i % B == C) {
      out("YES");
      return;
    }
  }

  out("NO");
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll MOD = 1e9 + 7;
ll H, N, M, L, K, W, X, Y, Z;
ll ans = 0;
int main() {
	int a, b;
	vector<int> flag(5, 0);
	set<int> s;
	for (int i = 1; i < 4; i++) {
		cin >> a >> b;
		s.insert(a);
		s.insert(b);
		flag[a]++;
		flag[b]++;
	}
	int tmp = 0;
	for (int i = 1; i <= 4; i++)if (flag[i] > 2)tmp++;
	if (s.size() == 4 && tmp == 0)cout << "YES" << endl;
	else cout << "NO" << endl;

}


Measured memory_bytes: 384