akhauriyash/Code-Regression huggingface dataset:
#include<cmath>
#include<cstdio>
#include<vector>

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

using namespace std;

const double EPS=1e-7;
const double PI=acos(-1);

template<class T>
struct point{
	T x,y;
	point operator+(const point &a)const{ return (point){x+a.x,y+a.y}; }
	point operator-(const point &a)const{ return (point){x-a.x,y-a.y}; }
};

template<class T>
point<T> operator*(T c,const point<T> &a){ return (point<T>){c*a.x,c*a.y}; }

point<double> &operator/=(point<double> &a,double c){ a.x/=c; a.y/=c; return a; }

template<class T>
T cross(const point<T> &a,const point<T> &b){ return a.x*b.y-a.y*b.x; }

template<class T>
double abs(const point<T> &a){ return sqrt(a.x*a.x+a.y*a.y); }

point<double> rot(const point<double> &a,double theta){
	return (point<double>){a.x*cos(theta)-a.y*sin(theta),a.x*sin(theta)+a.y*cos(theta)};
}

template<class T>
struct line{
	point<T> a,b;
	operator line<double>()const{ return (line<double>){a,b}; }
};

template<class T>
struct polygon:vector< point<T> >{
	polygon(){}
	polygon(int n):vector< point<T> >(n){}
};

enum {CCW=1,CW=-1,ON=0};
int ccw(const point<double> &a,const point<double> &b,const point<double> &c){
	double rdir=cross(b-a,c-a);
	if(rdir> EPS) return CCW;
	if(rdir<-EPS) return CW;
	return ON;
}

point<double> get_intersect(const line<double> &L1,const line<double> &L2){
	double a1=cross(L1.b-L1.a,L2.b-L2.a);
	double a2=cross(L1.b-L1.a,L1.b-L2.a);
	if(abs(a1)<EPS) return L1.a;
	return L2.a+a2/a1*(L2.b-L2.a);
}

template<class T>
polygon<double> convex_cut(const polygon<T> &G,const line<T> &L){
	int n=G.size();
	polygon<double> H;
	rep(i,n){
		int d1=ccw(L.a,L.b,G[i]);
		int d2=ccw(L.a,L.b,G[(i+1)%n]);
		if(d1!=CW) H.push_back(G[i]);
		if(d1==CCW && d2==CW || d1==CW && d2==CCW){
			H.push_back(get_intersect(L,(line<T>){G[i],G[(i+1)%n]}));
		}
	}
	return H;
}

int main(){
	for(int n;scanf("%d",&n),n;){
		polygon<double> G(n);
		rep(i,n) scanf("%lf%lf",&G[i].x,&G[i].y);

		double lo=0,hi=1e5;
		rep(_,50){
			double mi=(lo+hi)/2;
			polygon<double> F=G;
			rep(i,n){
				point<double> vec=G[(i+1)%n]-G[i];
				vec/=abs(vec);
				vec=rot(vec,PI/2);
				F=convex_cut(F,(line<double>){G[i]+mi*vec,G[(i+1)%n]+mi*vec});
			}
			if(F.empty()) hi=mi; else lo=mi;
		}

		printf("%.9f\n",(lo+hi)/2);
	}

	return 0;
}

Measured memory_bytes: 876
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as UV

r2 [a,b]=(a,b)
main = do
    [n,w]<-map read.words<$>getLine::IO [Int]
    wvs<-replicateM n $ r2.unfoldr (B.readInt.B.dropWhile(<'!'))<$>B.getLine
    print $ f n w wvs

f n w = (UV.! w).foldl' p (UV.replicate (w+1) 0) where
    p v0 (wi,vi) = UV.zipWith max v0 (UV.replicate wi 0 UV.++ UV.map (+vi) v0)

Measured memory_bytes: 6652
//
//  main.cpp
//  CoderProj
//
//  Created by Minoru Hayashi on 2020/03/12.
//  Copyright © 2020 Minoru Hayashi. All rights reserved.
//
//  ABC132
//
//

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

#define REP(i,n) for (int i=0; i<(n); i++)
#define REP2(i,x,n) for (int i=x; i<(n); i++)
#define ALL(n) begin(n), end(n)

using ll = long long;

template<class T> inline bool chmin(T& a, T b){ if(a>b){a=b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b){ if(a<b){a=b; return 1;} return 0;}

// const ll INF = 1LL<<60;
// const int INF = 1<<29;
// const ll MOD = 1000000007;
//#define __DBG__




void solve(void){
  
  int N;
    
  cin >> N;
  
  vector<int> p(N);
  
  REP(i,N){
    cin >> p[i];
  }
  
  int count=0;
  
  REP2(i,1,N-1){
    if((p[i-1]>=p[i] && p[i]>p[i+1]) || ((p[i-1]<p[i] && p[i]<=p[i+1]))){
      count++;
    }
  }
  
  cout << count << endl;
  
  return;
}

#define TESTCASES 1

int main(int argc, const char * argv[]) {

    cin.tie(0);
    ios::sync_with_stdio(false);

    REP(i,TESTCASES){
      solve();
    }
 
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef long double ld;

const ll INFL = 1e18;
const int INF = 1000000007;
const ld PI = acos(-1);
const ld EPS = 1e-13;
const ll MOD = 1000000007;

void add(ll& a, ll b) {
    a += b;
    while (a >= MOD) {
        a -= MOD;
    }
}

void mul(ll& a, ll b) {
    a = (a * b) % MOD;
}

ll todeg(ll x, ll d) {
    if (d < 0LL) {
        d += MOD - 1;
    }
    if (d == 0LL) {
        return 1LL;
    }
    ll ans = todeg(x, d / 2LL);
    mul(ans, ans);
    if (d % 2 == 1) {
        mul(ans, x);
    }
    return ans;
}

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

    ll n;
    cin >> n;
    
    ll ans = todeg(10LL, n);
    add(ans, MOD - todeg(9LL, n));
    add(ans, MOD - todeg(9LL, n));
    add(ans, todeg(8LL, n));

    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll N, M;
  std::cin >> N >> M;

  std::map< ll, bool > m1;
  std::map< ll, bool > mn;
  for (ll i = 0; i < M; i++) {
    ll a, b;
    std::cin >> a >> b;
    if (a == 1) m1[b] = true;
    if (b == 1) m1[a] = true;
    if (a == N) mn[b] = true;
    if (b == N) mn[a] = true;
  }

  bool judge = false;
  for (auto p : m1) {
    if (mn[p.first] == true) judge = true;
  }

  if (judge) print("POSSIBLE");
  else print("IMPOSSIBLE");

  return 0;
}


Measured memory_bytes: 19072
#include <cstdio>
using namespace std;

#define fr(i, s, t) for (int i = s, i##end = t; i <= i##end; ++ i)
typedef long long LL;

const int N = 610;
const LL mod = 1e9 + 7;

int n, m, s, t;
int p[N], sum[N];

LL fac[N];
LL f[N][N], g[N][N];

int main()
{
	scanf("%d %d", &n, &m);
	fr (i, 1, m)
	{
		scanf("%d %d", &s, &t);
		p[s] = t, p[t] = s;
	}
	fr (i, 1, n << 1)
		sum[i] = sum[i - 1] + (p[i] == 0);
	fac[0] = 1;
	for (int i = 2; i <= n << 1; i += 2) fac[i] = fac[i - 2] * (i - 1) % mod;
	
	LL ans = 0;
	fr (len, 1, n << 1) fr (i, 1, (n << 1) - len)
	{
		int j = i + len;
		bool flag = j - i + 1 & 1;
		fr (k, i, j)
			if (p[k] && (p[k] < i || p[k] > j)) flag = 1;
		if (flag) continue;
		f[i][j] = fac[sum[j] - sum[i - 1]];
		fr (k, i + 1, j - 1)
			(f[i][j] += - f[i][k] * fac[sum[j] - sum[k]] % mod + mod) %= mod;
		(ans += f[i][j] * fac[(n - m << 1) - (sum[j] - sum[i - 1])]) %= mod;
	}
	printf("%lld\n", ans);
}

Measured memory_bytes: 3840
n,k =  map(int,input().split())
A = list(map(int,input().split()))

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    if m==0:
        m=1
        break

    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)

Measured memory_bytes: 30544
import java.util.*;
import static java.lang.System.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(in);
        
        long n = sc.nextLong();
        long m = sc.nextLong()+1L;

        String mstr = Long.toBinaryString(m);
        int num = mstr.length();

        long base = 2;
        String ans = "";
        for(int i=num-1; i>=0; i--) {
            long count = 0;
            
            long mquo = m / base;
            count += mquo * base / 2;
            long mmod = m % base;
            if(mmod > base/2) count += mmod - base/2;
            
            long nquo = n / base;
            count -= nquo * base / 2;
            long nmod = n % base;
            if(nmod > base/2) count -= nmod - base/2;
            
            if(count % 2 == 0) ans = "0" + ans;
            else ans = "1" + ans;
            
            base *= 2;
        }
        
        out.println(Long.parseLong(ans, 2));
    }
}


Measured memory_bytes: 22868
import java.util.Scanner;

/**
 * Cleaning Robot
 *  URL:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1020&lang=jp
 *
 * @author Igari Kazuya
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO ツ篠ゥツ督ョツ青カツ青ャツつウツづェツつスツδソツッツドツ・ツスツタツブ
		Scanner sc = new Scanner(System.in);

		while(true){
			int n = sc.nextInt();

			if(n == 0){
				break;
			}

			String s,t,b;
			s = sc.next();
			t = sc.next();
			b = sc.next();

			int[][] map = new int[5][5];
			int[][] scoremap = new int[3][3];
			int[][] bufmap = new int[3][3];
			for(int i=0;i<3;i++){
				for(int j=0;j<3;j++){
					scoremap[i][j] = 0;
					bufmap[i][j] = 0;
					map[i+1][j+1] = 0;
				}
			}

			for(int i=0;i<5;i++){
				map[i][0] = 1;
				map[0][i] = 1;
				map[i][4] = 1;
				map[4][i] = 1;
			}

			int ss = s.charAt(0) - 'A';
			int tt = t.charAt(0) - 'A';
			int bb = b.charAt(0) - 'A';

			map[bb/3+1][bb%3+1] = 1;
			scoremap[ss/3][ss%3] = 1;//ツ機ツ械ツつソツづ。ツづア

			for(int i=0;i<n;i++){
				for(int y=0;y<3;y++){
					for(int x=0;x<3;x++){
						if(map[y+1][x] == 0){
							bufmap[y][x-1] += scoremap[y][x];
						}else{
							bufmap[y][x] += scoremap[y][x];
						}

						if(map[y+1][x+2] == 0){
							bufmap[y][x+1] += scoremap[y][x];
						}else{
							bufmap[y][x] += scoremap[y][x];
						}

						if(map[y][x+1] == 0){
							bufmap[y-1][x] += scoremap[y][x];
						}else{
							bufmap[y][x] += scoremap[y][x];
						}

						if(map[y+2][x+1] == 0){
							bufmap[y+1][x] += scoremap[y][x];
						}else{
							bufmap[y][x] += scoremap[y][x];
						}
					}
				}
				for(int x=0;x<3;x++){
					for(int y=0;y<3;y++){
						scoremap[y][x] = bufmap[y][x];
						bufmap[y][x] = 0;
					}
				}
			}

			int count=0;
			for(int i=0;i<3;i++){
				for(int j=0;j<3;j++){
					count += scoremap[i][j];
				}
			}
			System.out.printf("%.8f\n",(double)scoremap[tt/3][tt%3]/(double)count);
		}
	}
}

Measured memory_bytes: 0
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using ll = long long;
#define MAX_N 1010
#define MAX_M 100010
const long long mod = pow(10,9)+7;
#define vec vector<int>
#define vecll vector<ll>
#define vecllvec vector<vector<ll>>
#define vecb vector<bool>
#define vecBvec vector<vector<bool>>
#define vecst vector<string>
#define veche vector<char>
#define vecd vector<double>
#define vecvec vector<vector<int>>
#define vecDvec vector<vector<double>>
#define vecHvec vector<vector<char>>
#define all(x) (x).begin(),(x).end()
#define ent cout<<endl
#define printvec(vec) for(int aqw=0;aqw<vec.size();aqw++){cout<<vec[aqw]<<" ";}ent;
#define rep1(n) for(ll i = 0; i < (n); ++i)
#define rep2(i, n) for(ll i = 0; i < (n); ++i)
#define rep3(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep4(i, a, b, c) for(ll i = (a); i < (b); i += (c))
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; }
#define INF 1e+9
#define print(x) cout<<x<<endl;
using P = pair<int, int>;
#define PLL pair<ll, ll>;
#define MAX_V 10010
#define PI 3.141592653589793
#define vecP vector<P>
// cout << setprecision(15) << std::fixed;


int main() {
	string s,t="";
	cin >> s;
	for (int i = 0;i < s.size();i++)t += "x";
	print(t);

} 




Measured memory_bytes: 256
using System;

using System .Linq;


namespace ConsoleApplication2
{
    using System;

    public class Dice
    {

        public static void Main( String[] args )
        {

            string yesNo = "No";
             string dataA = Console .ReadLine();
             string dataB = Console .ReadLine();
         //   string dataA = "1 2 3 4 5 6";
          string[] diceA = dataA .Split();
            // string dataB = "4 5 6 1 2 3";
         //   string dataB = "6 4 5 2 3 1";
              string[] diceB = dataB .Split();

            //test??¨
             //string[] diceA = { "1" , "2" , "3" , "4" , "5" , "6" };
            //string[] diceB = { "6" , "2" , "4" , "3" , "5" , "1" };

            string[] diceTemp =  dataB .Split();
            
              
            string[] diceTemp1 = dataB .Split();

            int i = 0;
            int j = 0;
            do
            {
                do
                {
                    //??????
                    for ( int k = 0 ; k < diceA .Length ; k++ )
                    {
                        if ( !diceA[k] .Equals( diceB[k] ) )
                        {
                            yesNo = "No";
                            break;

                        }
                        if ( k == diceA .Length - 1 )
                        {
                            yesNo = "Yes";

                        }
                    }
                    if ( yesNo == "Yes" )
                    {
                        break;
                    }
                    //?????????????¨??????¢???east??¨??????

                    diceB = turn( 3 , 5 , 2 , 0 , diceB );
                   
                    j++;
                } while ( j < 4 );

                if ( yesNo == "Yes" )
                {
                    break;
                }
                j = 0;
                //??????????????????????????¢ south??¨???


                
                 if ( i == 3 )
                {
                    //east???south
                    diceB = diceTemp;
                    diceB = turn( 2 , 5 , 3 , 0 , diceB );

                    
                }
                else if ( i == 4 )
                {
                    //west ???south
                    diceB = diceTemp1;
                    diceB = turn( 3 , 5 , 2 , 0 , diceB );
                    
                    
                }

                diceB = turn( 4 , 5 , 1 , 0 , diceB );
         
                i++;
            } while ( i < 6 );



            Console .WriteLine( yesNo );
           


        }

        public static string[] turn( int a , int b , int c , int d , string[] dice )
        {
            string temp = dice[a];
            dice[a] = dice[b];
            dice[b] = dice[c];
            dice[c] = dice[d];
            dice[d] = temp;
            return dice;
        }
    }


}

Measured memory_bytes: 8904
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ve vector
#define chmin(x,y) x = min(x,y)

int main(){
    ll n;
    cin >> n;
    if(n==0)cout << 0 << endl;
    if(n>0){
        ve<ll> s = {};
        ll j = 0;
        while(n >= 1<<j){
            if((n>>j) & 1)s.push_back(1);
            else s.push_back(0);
            j++;
        }
        rep(i,10)s.push_back(0);
        
        rep(i,s.size()-2){
            if(s[i] >= 2){
                s[i+1] += (s[i]- s[i]%2)/2;
                s[i] = s[i]%2;
            }
            if(i%2 != 0){
                s[i+1]+=s[i];
            }
        }
        reverse(s.begin(),s.end());
        bool fl = false;
        rep(i,s.size()){
            if(fl)cout << s[i];
            else{
                if(s[i] == 0)continue;
                else{
                    cout << 1;
                    fl = true;
                }
            }
        }
        cout << endl;
    }
    if(n<0){
        n *= -1;
        ve<ll> s = {};
        ll j = 0;
        while(n >= 1<<j){
            if((n>>j) & 1)s.push_back(1);
            else s.push_back(0);
            j++;
        }
        rep(i,10)s.push_back(0);
        
        rep(i,s.size()-2){
            if(s[i] >= 2){
                s[i+1] += (s[i]- s[i]%2)/2;
                s[i] = s[i]%2;
            }
            if(i%2 == 0){
                s[i+1]+=s[i];
            }
        }
        reverse(s.begin(),s.end());
        bool fl = false;
        rep(i,s.size()){
            if(fl)cout << s[i];
            else{
                if(s[i] == 0)continue;
                else{
                    cout << 1;
                    fl = true;
                }
            }
        }
        cout << endl;
    }
    return 0;
}


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

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < n; i++)
#define REP(n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
using INT64 = long long;
using UINT64 = unsigned long long;
#define MOD 1000000007

int main(void)
{
    IOS
    int n; cin >> n;
    vector<int> v(n);
    REP(n) cin >> v[i];

    vector<int> dp(n,0);
    FOR(i,1,n) {
        if (i == 1){
            dp[i] = abs(v[0]-v[1]);
        } else {
            dp[i] = min(dp[i-1] + abs(v[i]-v[i-1]), dp[i-2] + abs(v[i]-v[i-2]));
        }
    }

    cout << dp[n-1] << endl;

    return 0;
}


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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

using namespace std;
using ll = long long;

template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T> constexpr T INF = numeric_limits<T>::max() / 2;

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

  int n;
  cin >> n;
  vector<int> arr(n);
  REP(i, n) cin >> arr.at(i);
  int nswap = 0;
  bool swapped = true;
  while (swapped) {
    swapped = false;
    REP(i, n - 1) {
      if (arr.at(i) > arr.at(i + 1)) {
        swap(arr.at(i), arr.at(i + 1));
        nswap++;
        swapped = true;
      }
    }
  }
  REP(i, n) cout << (i ? " " : "") << arr.at(i);
  cout << endl << nswap << endl;

  return 0;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B,C,D;
  cin >> A >> B >> C >> D;
  if( (A + B) > (C + D)){
    cout << "Left" << endl;
  }else if((A + B) == (C + D)){
    cout << "Balanced" << endl;
  }else{
    cout << "Right" << endl;
  }

}

Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	s := getString()

	r := 0
	for i := 0; i < N; i++ {
		if s[i] == ')' {
			if r != 0 {
				r--
			}
		}
		if s[i] == '(' {
			r++
		}
	}
	l := 0
	for i := N - 1; i >= 0; i-- {
		if s[i] == '(' {
			if l != 0 {
				l--
			}
		}
		if s[i] == ')' {
			l++
		}
	}

	ans := ""
	for i := 0; i < l; i++ {
		ans += "("
	}
	ans += s
	for i := 0; i < r; i++ {
		ans += ")"
	}
	out(ans)
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC118A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            var word = Console.ReadLine().Split(' ');
            a = int.Parse(word[0]);
            b = int.Parse(word[1]);
            if (b % a==0)
              Console.WriteLine(a+b)  ;
            else
                Console.WriteLine(b-a);
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 


using namespace std;

int main(){

    int a,b;
    cin >> a >> b;

    bool ans = false;

    rep(i, 3){
        if((a * b * (i + 1)) % 2 == 1){
            ans = true;
            break;
        }
    }

    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
import math

a, b, C = map(float, input().split())
C = C / 180 * math.pi  # convert to radian

h = b * math.sin(C)
S = a * h / 2
c = math.sqrt((a - b * math.cos(C)) ** 2 + h ** 2)
L = a + b + c

print(S)
print(L)
print(h)



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

int main() {
	int N, X; cin >> N >> X;
	vector<int> D(N + 1);
	D[0] = 0;
	for (int i = 0; i < N; ++i) {
		int x; cin >> x;
		D[i + 1] = D[i] + x;
	}
	int ans = 0;
	for (int i = 0; i <= N; ++i) {
		if (D[i] <= X) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


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

const int MAXN = 200005;

int n, k;

int T[MAXN];
int a[MAXN];

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> k;
        if (k == 1 || k == 2*n-1) cout << "No" << endl;
	else {
		cout << "Yes" << endl;
		if (n == 2) {
			cout << 1 << endl << 2 << endl << 3 << endl;
		} else if (k > 2) {
			T[1] = T[2] = T[k] = T[k+1] = 1;
			a[n] = k, a[n-1] = 1, a[n+1] = k+1, a[n+2] = 2;
			for (int i = 1, j = 1; i <= n*2-1; i++) {
				while (T[j]) j++;
				if (!a[i]) a[i] = j++;
				cout << a[i] << endl;
			}
		} else {
			T[1] = T[k] = T[k+1] = T[k+2] = 1;
			a[n] = k, a[n-1] = 1, a[n+1] = k+1, a[n-2] = k+2;
			for (int i = 1, j = 1; i <= n*2-1; i++) {
				while (T[j]) j++;
				if (!a[i]) a[i] = j++;
				cout << a[i] << endl;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 2432
// IO
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm
#include <algorithm>
#include <cmath>
#include <numeric>

// container
#include <vector>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>

// others
#include <random>
#include <limits>
#include <functional>
#include <ctime>
#include <cassert>

// type alias
using lint = long long;
using ldouble = long double;
template <class T>
using greater_priority_queue = std::priority_queue<T, std::vector<T>, std::greater<T>>;


/* ----- class ----- */

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

template <class Cost = int>
using Graph = std::vector<std::vector<Edge<Cost>>>;


/* ----- debug ----- */

#if __has_include("../setting/source/debug.hpp")
#include "../setting/source/debug.hpp"
#endif


/* ----- short functions ----- */

template <class T>
inline T sq(T a) { return a * a; }

template <class T>
inline T iceil(T n, T d) { return (n + d - 1) / d; }

template <class T>
T gcd(T a, T b) {
    while (b > 0) {
        a %= b;
        std::swap(a, b);
    }
    return a;
}

template <class T, class U>
T ipow(T b, U n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= b;
        n >>= 1;
        b *= b;
    }
    return ret;
}

// 0-indexed
template <class T, class U>
inline T kthbit(T a, U k) { return (a >> k) & 1; }

template <class T, class U>
inline T mask(T a, U k) { return a & ((1 << k) - 1); }

template <class T>
std::map<T, int> compress(std::vector<T>& v) {
    std::sort(v.begin(), v.end());
    v.erase(std::unique(v.begin(), v.end()), v.end());

    std::map<T, int> rev;
    for (int i = 0; i < v.size(); ++i) rev[v[i]] = i;
    return rev;
}

template <class T>
T Vec(T v) { return v; }

template <class T, class... Ts>
auto Vec(size_t l, Ts... ts) {
    return std::vector<decltype(Vec<T>(ts...))>(l, Vec<T>(ts...));
}


/* ----- constants ----- */

// const int INF = std::numeric_limits<int>::max() / 3;
// const lint INF = std::numeric_limits<lint>::max() / 3;
// const ldouble PI = acos(-1);
// const ldouble EPS = 1e-10;
// std::mt19937 mt(int(std::time(nullptr)));


using namespace std;

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    for(int i = 0; i < B; ++i) {
        if (A * i % B == C) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
L,R = map(int,input().split())

def rem(L, R):
  if (R//2019) - (L//2019) > 0:
    return 0
  L = L % 2019
  R = R % 2019
  res = 2018
  for i in range(L, R):
    for j in range(i+1, R+1):
      m = (i*j)%2019
      if res > m:
        res = m
  return res

print(rem(L, R))

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long int ll;

int main(){
	int n; cin >>n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	int ans=0;
	for(int i=0;i<n-1;i++){
		int cnt=0;
		if(a[i]==a[i+1]){
			cnt++;
			while(a[i]==a[i+1]){
				i++;
				cnt++;
			}
			ans+=cnt/2;
			i--;
		}
		
	}
	cout << ans << endl;
}

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

int main(){
    
    int a,b,sumA = 0,sumB = 0;
    
    rep(i,0,4){
        cin >> a;
        sumA += a;
    }
    
    rep(i,0,4){
        cin >> b;
        sumB += b;
    }
    
    cout << max(sumA,sumB) << endl;
    return 0;
}


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

/**
 * Built using CHelper plug-in Actual solution is at the top
 */

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int N = in.nextInt();
			int D = in.nextInt();
			if(N % (D * 2 + 1) == 0) {
				out.println(N / (D * 2 + 1));
			} else {
				out.println(N / (D * 2 + 1) + 1);	
			}
			
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;	

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public char nextChar() {
			return next().charAt(0);
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


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

#define ll unsigned long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
#define inf 998244353
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> d(n);
    
    rep(i,0,n) cin >> d[i];
    if(d[0] != 0){
        cout << 0 << endl;
        return 0;
    }
    sort(all(d));
    ll cnt=1;
    if(d[0] != 0 || d[1] == 0){
        cout << 0 << endl;
        return 0;
    }
    ll pnt = 1;
    ll pcnt = 0;
    ll ppnt = 1;
    rep(i,1,n){
        if(pnt == d[i]) pcnt++;
        else if(pnt == d[i]-1){
            ll tmp = pcnt;
            while(tmp!=0){
                cnt = ppnt*cnt;
                cnt %= inf;
                tmp--;
            }
            //cnt *= pow(ppnt,pcnt);
            ppnt = pcnt;
            cnt %= inf;
            pcnt=1;
            pnt++;
           // cout << cnt << endl;
        }
        else{
            cout << 0 << endl;
            return 0;
        }
    }
    //cout << pow(ppnt,pcnt) << endl;
    //cnt *= pow(ppnt,pcnt);
    ll tmp = pcnt;
    while(tmp!=0){
        cnt = ppnt*cnt;
        cnt %= inf;
        tmp--;
    }
    cnt %= inf;
    cout << cnt << endl;
}


Measured memory_bytes: 1024
S = list(input())
for i in range(len(S)):
    S[i] = int(S[i])
    if S[i] == 0:
        S[i] = -1

now = S[0]
cnt = 1
ans = 0
for i in range(1, len(S)):
    #print(i, S[i], now, cnt, ans)
    if cnt > 0:
        if S[i] != now:
            ans += 2
            cnt -= 1
            now = S[i] * -1
        else:
            cnt += 1
            now = S[i]
    else:
        now = S[i]
        cnt += 1

print(ans)

Measured memory_bytes: 3956
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
#include<unordered_set>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int a[100010];
signed main(void)
{
	int n;
	cin >> n;
	REP(i, n) cin >> a[i];

	bool f = true, up = true;
	int ret = 1;
	FOR(i, 1, n) {
		if(f) {
			if(a[i] > a[i-1]) {up = true; f = false;}
			if(a[i] < a[i-1]) {up = false; f = false;}
		} else {
			if(up) {
				if(a[i] < a[i-1]) {f = true; ret++;}
			} else {
				if(a[i] > a[i-1]) {f = true; ret++;}
			}
		}
	}
	cout << ret << endl;
	return 0;
}


Measured memory_bytes: 764
s = input()

if "N" in s and "S" not in s:
  print("No")
elif "S" in s and "N" not in s:
  print("No")
elif "W" in s and "E" not in s:
  print("No")
elif "E" in s and "W" not in s:
  print("No")
else:
  print("Yes")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
ll n,m,l,r;
const int MAXN=1e6+3;
ll fact[MAXN];
ll inv[MAXN];
ll modp(ll a, ll b)
{
	if(b==0)return 1;
	ll u=modp(a, b/2);
	u=(u*u)%mod;
	if(b&1)return (a*u)%mod;
	return u;
}
ll ncr(ll n, ll r)
{
	if(n<r)return 0;
	ll res=(fact[n]*inv[n-r])%mod;
	res=(res*inv[r])%mod;
	return res;
}
ll calc()
{	ll uni=ncr(n,m);
	ll right=ncr(r+n, n);l--;
	ll left=ncr(l+n,n);
	//right calc
	for(int i=1;i<=r;i++)
	{
		ll md=r-m*i;
		if(md<0)break;
		for(int j=0;j*i<=md;j++)
		{
			ll chk=(ncr(n-m, j)*ncr(md-(j*i)+n, n))%mod;
			chk=(chk*uni)%mod;
			if(!(j&1))chk=-chk;
			right=(right+chk+mod)%mod;
		}
		md-=m;
		for(int j=0;j*i<=md;j++)
		{
			ll chk=(ncr(n-m, j)*ncr(md-(j*i)+n, n))%mod;
			chk=(chk*uni)%mod;
			if((j&1))chk=-chk;
			right=(right+chk+mod)%mod;
		}
		
	}
	
	for(int i=1;i<=l;i++)
	{
		ll md=l-m*i;
		if(md<0)break;
		for(int j=0;j*i<=md;j++)
		{
			ll chk=(ncr(n-m, j)*ncr(md-(j*i)+n, n))%mod;
			chk=(chk*uni)%mod;
			if(!(j&1))chk=-chk;
			left=(left+chk+mod)%mod;
		}
		md-=m;
		for(int j=0;j*i<=md;j++)
		{
			ll chk=(ncr(n-m, j)*ncr(md-(j*i)+n, n))%mod;
			chk=(chk*uni)%mod;
			if((j&1))chk=-chk;
			left=(left+chk+mod)%mod;
		}
		
		
	}
	
	return (right-left+mod)%mod;
}
void init_fact()
{
	fact[0]=1;inv[0]=modp(fact[0], mod-2);
	for(int i=1;i<MAXN-1;i++)
	{fact[i]=(fact[i-1]*i)%mod;
		inv[i]=modp(fact[i], mod-2);
	}
}

int main()
{
	cin>>n>>m>>l>>r;
	init_fact();
	cout<<calc()<<"\n";
	
	
}

Measured memory_bytes: 15872
a, b, c, x, y = gets.chomp.split(" ").map(&:to_i)

sum = a * x + b * y
ans = sum
while(x>0 || y>0)
    if x > 0
        sum -= a
        x -= 1
    end

    if y > 0
        sum -= b
        y -= 1
    end
    
    sum += c * 2
    ans = sum if sum < ans
end
puts ans

Measured memory_bytes: 1788
program ABC051C
    implicit none
    integer(8)::i,sx,sy,tx,ty
    read(5,*)sx,sy,tx,ty
    do i=1,tx-sx
        write(*,fmt='(A)',advance='no')"R"
    end do

    do i=1,ty-sy
        write(*,fmt='(A)',advance='no')"U"
    end do

    do i=1,tx-sx
        write(*,fmt='(A)',advance='no')"L"
    end do

    do i=1,ty-sy+1
        write(*,fmt='(A)',advance='no')"D"
    end do

    do i=1,tx-sx+1
        write(*,fmt='(A)',advance='no')"R"
    end do

    do i=1,ty-sy+1
        write(*,fmt='(A)',advance='no')"U"
    end do

    write(*,fmt='(A)',advance='no')"L"
    write(*,fmt='(A)',advance='no')"U"

    do i=1,tx-sx+1
        write(*,fmt='(A)',advance='no')"L"
    end do

    do i=1,ty-sy+1
        write(*,fmt='(A)',advance='no')"D"
    end do

    print'(A)',"R"
end program ABC051C

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

int main(){
  int D,N;
  cin>>D>>N;
  
  if(D==0){
    if(N==100){
      cout<<101<<endl;
    }else{
      cout<<N<<endl;
    }
  }else if(D==1){
    if(N==100){
      cout<<10100<<endl;
    }else{
      cout<<100*N<<endl;
    }
  }else{
    if(N==100){
      cout<<1010000<<endl;
    }else{
      cout<<10000*N<<endl;
    }
  }
}

Measured memory_bytes: 256
def solve():
  N, K = map(int, input().split())
  A = [int(i) for i in input().split()]
  B = [0] * 40
  for i in range(40):
    for a in A:
      if a & (1 << i): B[i] += 1

  X = 0
  for i in range(39, -1, -1):
    if X + (1 << i) > K: continue
    if B[i] < N - B[i]: X += 1 << i

  ans = 0
  for a in A:
    ans += a ^ X

  return ans

print(solve())


Measured memory_bytes: 14700
h, w, n = map(int, input().split())

dic = {}

for i in range(n):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    for i in range(-1, 2):
        for j in range(-1, 2):
            if a + i <= 0 or a + i >= h - 1 or b + j <= 0 or b + j >= w - 1:
                continue
            if (a+i, b+j) in dic:
                dic[(a+i, b+j)] += 1
            else:
                dic[(a+i, b+j)] = 1

count = [0]*10
for i in dic.values():
    count[i] += 1
count[0] = (h-2)*(w-2)-sum(count)
for i in range(10):
    print(count[i])


Measured memory_bytes: 166500
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

template< typename T >
struct Edge {
  int from, to;
  T cost;
  Edge() {}
  Edge(int f, int t) : from(f), to(t), cost(1) {}
  Edge(int f, int t, T c) : from(f), to(t), cost(c) {}
  friend bool operator < (const Edge& lhs, const Edge& rhs) { return lhs.cost < rhs.cost; };
  friend bool operator > (const Edge& lhs, const Edge& rhs) { return rhs < lhs; };
  friend bool operator <= (const Edge& lhs, const Edge& rhs) { return !(lhs > rhs); };
  friend bool operator >= (const Edge& lhs, const Edge& rhs) { return !(lhs < rhs); };
};

template< typename T >
using Edges = vector< Edge< T > >;
template< typename T >
using Graph = vector< Edges< T > >;

using graph = Graph<int>;

int du[100001];
int dv[100001];

void bfs(graph& g, int s) {
  queue<int> q;
  q.push(s);
  for (int i = 0; i < 100001; ++i) du[i] = -1;
  du[s] = 0;
  while (!q.empty()) {
    int f = q.front(); q.pop();
    for (auto e: g[f]) { 
      if (du[e.to] >= 0) continue;
      du[e.to] = du[f] + 1;
      q.push(e.to);
    }
  }
}
void bfs2(graph& g, int s) {
  queue<int> q;
  q.push(s);
  for (int i = 0; i < 100001; ++i) dv[i] = -1;
  dv[s] = 0;
  while (!q.empty()) {
    int f = q.front(); q.pop();
    for (auto e: g[f]) { 
      if (dv[e.to] >= 0) continue;
      dv[e.to] = dv[f] + 1;
      q.push(e.to);
    }
  }
}

int main() {
  int n, u, v;
  cin >> n >> u >> v;
  --u; --v;
  graph g(n);
  for (int i = 0; i < n-1; ++i) {
    int a, b;
    cin >> a >> b; --a; --b;
    g[a].emplace_back(a, b);
    g[b].emplace_back(b, a);
  }
  bfs(g, u);
  bfs2(g, v);
  int ans = 0;
  int ans1 = 100001;
  for (int i = 0; i < n; ++i) {
    if (du[i] > dv[i]) continue;
    // cout << i << " " << du[i] << " " << dv[i] << endl;
    if (du[i] == dv[i]) {
      ans1 = min(ans1, du[i]);
      continue;
    }
    ans = max(ans, dv[i]-1);
    // if (dv[i] % 2 == 1) ans = max(ans, dv[i]-1);
    // else {
    //   if (du[i] % 2 == 1) ans = max(ans, dv[i]-1);
    //   else ans = max(ans, dv[i]-1);
    // }
  }
  if (ans1 < 100001) {
    cout << max(ans, ans1) << endl;
  }
  else cout << ans << endl;
}



Measured memory_bytes: 7680
import sys
sys.setrecursionlimit(1000000000)
input=lambda : sys.stdin.readline().rstrip()

dx=[1,1,0,-1,1,1,0,-1,-1,-1,0,1,0]
dy=[0,1,1,1,0,1,1,1,0,-1,-1,-1,0]
dz=[0,0,0,0,1,1,1,1,1,1,1,1,1]

while True:
    n,m,q=map(int,input().split())
    if n==m==q==0:
        break
    field=[[[-1 for i in range(n)]for i in range(n)]for i in range(n)]
    d=True
    turn=1
    for t in range(q):
        x,y=map(int,input().split())
        if d==False:
            continue
        x,y=x-1,y-1
        z=n
        while z>0:
            if field[x][y][z-1]==-1:
                z-=1
            else:
                break
        field[x][y][z]=turn
        for i in range(13):
            tx,ty,tz=x,y,z
            count=0
            while 0<=tx<n and 0<=ty<n and 0<=tz<n:
                if field[tx][ty][tz]==turn:
                    count+=1
                else:
                    break
                tx,ty,tz=tx+dx[i],ty+dy[i],tz+dz[i]
            tx,ty,tz=x,y,z
            while 0<=tx<n and 0<=ty<n and 0<=tz<n:
                if field[tx][ty][tz]==turn:
                    count+=1
                else:
                    break
                tx,ty,tz=tx-dx[i],ty-dy[i],tz-dz[i]
            count-=1
            if count>=m:
                print('Black' if turn else 'White',t+1)
                d=False
                break
        turn=(turn+1)%2
    if d:
        print('Draw')




Measured memory_bytes: 5688
import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val abcd = sc.next().toCharArray().map { it.toString().toInt() }.toIntArray()
  val a = abcd[0]
  val b = abcd[1]
  val c = abcd[2]
  val d = abcd[3]

  val bcd = IntArray(3) { 0 }
  bcd[0] = b
  bcd[1] = c
  bcd[2] = d

  val op = Array(3) { "" }

  var ans = ""
  for (i in 0..(1 shl 4)-1) {
    var tmp = a

    for (j in 0 until 3) {
      if ((i shr j) and 1 == 0) {
        tmp += bcd[j]
        op[j] = "+"
      } else {
        tmp -= bcd[j]
        op[j] = "-"
      }
    }
    if (tmp == 7) {
      ans += a.toString()
      for (k in 0 until 3) {
        ans += op[k]
        ans += bcd[k]
      }
      break
    }
  }
  println(ans + "=7")

}


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

int main()
{
    int N;
    cin >> N;
    int hun = int(N/100);
    int ten = int((N%100)/10);
    int one = int(N%10);
    if (hun == 7 || ten ==7 || one ==7 ) {
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
}

Measured memory_bytes: 3580
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		int m = saori.saori_hayami();
		Set<Integer> hs = new HashSet<>();
		int ac = 0;
		int[] wa = new int[n];
		int answa = 0;
		for(int i = 0;i <m;i++){
			int p = saori.saori_hayami();
			String s = saori.nextHayami();
			if(hs.contains(p) || ac == n){
				continue;
			}
			if(s.equals("AC")){
				hs.add(p);
				answa += wa[p-1];
				ac++;
			} else {
				wa[p-1]++;
			}
		}
		System.out.println(ac + " " + answa);
		saori.close();
    }
}

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

Measured memory_bytes: 45656
//
// Created by 李青坪 on 2018/10/31.
//

#include <cstdio>
#include <algorithm>

#define MAXN 101
using namespace std;

int graph[MAXN][MAXN];

void init(){
    for (int i = 0; i < MAXN; ++i) {
        fill(graph[i], graph[i]+MAXN, 0);
    }
}

int main(){
    int n;
    scanf("%d", &n);
    int v, dgr;
    for (int i = 0; i < n; ++i) {
        scanf("%d %d", &v, &dgr);
        int node;
        for (int j = 0; j < dgr; ++j) {
            scanf("%d", &node);
            graph[v][node] = 1;
        }
    }
    for (int k = 1; k <= n; ++k) {
        for (int i = 1; i <= n; ++i) {
            if (i-1) printf(" ");
            printf("%d", graph[k][i]);
        }
        printf("\n");
    }
}
/*
4
1 2 2 4
2 1 4
3 0
4 1 3

 */


Measured memory_bytes: 2732
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#include <set>
#include <climits>
#include <bitset>

#define mod 1e9+7
#define mp make_pair
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, a, b;
    cin >> n >> a;
    if(n>a) swap(n,a);
    rep(i, a){
    cout << n;
    }
    return 0;
}

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

using ll=long long;
using namespace std;

#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

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

const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

char BigAlphaToSmall(char a){
    if (a >= 65 && a <= 90){
        return a + 32;
    }
    return a;
}

char SmallAlphaToBig(char a){
    if (a >= 97 && a <= 122){
        return a - 32;
    }
    return a;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    int a, b;cin >> a >> b;
    if(b == 1){
        say(0)
        return 0;
    }

    int ans = 0;
    while(true){
        ans += 1;
        b -= a;
        if(b <= 0){
            say(ans);
            return 0;
        }
        b += 1;
    }
}

Measured memory_bytes: 3648
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int a[3];

int main(){
    rep(i,3){
        cin>>a[i];
    }
    if(a[1]-a[0]==a[2]-a[1]){
        out("YES");
    }
    else{
        out("NO");
    }
}


Measured memory_bytes: 256