akhauriyash/Code-Regression huggingface dataset:
use std::io;

fn main() {
    loop {
        let input = input_number();
        let n = input[0];
        let x = input[1];
        if (n, x) == (0, 0) { break }
        let mut answer = 0;

        for i in 1..n - 1 {
            for j in i+1..n {
                for k in j+1..n + 1 {
                    if i + j + k == x {
                        answer += 1;
                    }
                }
            }
        }
        println!("{}", answer);
    }
}

#[allow(dead_code)]
fn input_number() -> Vec<i64> {
    let mut input = String::new();
    io::stdin()
        .read_line(&mut input)
        .expect("Failed to read line");
    let vec: Vec<i64> = input
        .split_whitespace()
        .map(|x| x.parse().unwrap_or(0))
        .collect();
    vec
}

#[allow(dead_code)]
fn input() -> (char, usize) {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    let mut iter = s.trim().split_whitespace();
    let c: char = iter.next().unwrap().chars().nth(0).unwrap();
    let n: usize = iter.next().unwrap().parse().unwrap();
    (c, n)
}



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

#ifdef LOCAL
#define debug(var) cerr << #var << " = " << var << endl;
#else
#define debug(var)
#endif

void init() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}

void solve() {
	string s; cin >> s;
	set<char> z;
	for (char c: s) {
		z.insert(c);
	}
	if (z.size() == s.size()) cout << "yes";
	else cout << "no";
}

int main() {
	init();
	int t = 1; //scanf("%d", &t);
	while (t--) {
		solve();
	}
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#define FOR(i, n) for(int i = 0; i < n; i++) 
using namespace std;

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

const int MAXN = 200100;

char s[MAXN];
int n;

void load() {
	scanf("%s", s);
	n = strlen(s);
}

vector<int> v[26];
int par[MAXN], dest[MAXN];

ll sol = 0;

vector<int> merge(vector<int> v1, vector<int> v2) {
	vector<int> ret;
	int id1 = 0, id2 = 0;
	while (true) {
		if (id1 < (int)v1.size()) {
			if (id2 < (int)v2.size()) {
				if (v1[id1] < v2[id2]) {
					ret.push_back(v1[id1++]);
				}
				else {
					sol += v1.size() - id1;
					ret.push_back(v2[id2++]);
				}
			}
			else {
				ret.push_back(v1[id1++]);
			}
		}
		else if (id2 < (int)v2.size()) {
			ret.push_back(v2[id2++]);
		}
		else break;
	}
	return ret;
}

vector<int> divide(vector<int> v) {
	if (v.size() == 1) return v;
	int mid = v.size() / 2;
	vector<int> v1, v2;
	FOR(i, mid) v1.push_back(v[i]);
	for (int i = mid; i < (int)v.size(); i++) v2.push_back(v[i]);
	v1 = divide(v1);
	v2 = divide(v2);
	return merge(v1, v2);
}

bool solve() {
	FOR(i, n) v[s[i]-'a'].push_back(i);
	int brOdd = 0;
	FOR(i, n) dest[i] = -1;
	FOR(i, 26) if (v[i].size() & 1) ++brOdd;
	if (brOdd > 0 && n % 2 == 0) return false;
	if (brOdd != 1 && n & 1) return false;
	FOR(i, 26) {
		int id1 = 0, id2 = v[i].size() - 1;
		while (id1 < id2) {
			par[v[i][id1]] = v[i][id2];
			par[v[i][id2]] = v[i][id1];
			++id1; --id2;
		}
		if (id1 == id2) {
			par[v[i][id1]] = -1;
			dest[v[i][id1]] = n / 2;
		}
	}
	int ind = 0;
	FOR(i, n) {
		if (dest[i] != -1) continue;
		int para = par[i];
		dest[i] = ind;
		dest[para] = n - ind - 1;
		ind++;
	}
	//FOR(i, n) printf("%d ", dest[i]); printf("\n");
	divide(vector<int>(dest, dest + n));
	printf("%lld\n", sol);
	return true;
}

int main() {
	load();
	if (!solve()) printf("-1\n");
	return 0;
}


Measured memory_bytes: 7924
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<set>
#include<map>

using namespace std;

#define x first
#define y second
#define ll long long
#define NMAX 200005

char s[NMAX];
int n, frec[30];
long long answer;

int main () {
    
    scanf("%s", s + 1);
    n = strlen(s + 1);
    for(int i = 1; i <= n; i++) {
        answer += (i - 1) - frec[s[i] - 'a'];
        frec[s[i] - 'a']++;
    }
    
    printf("%lld\n", answer + 1);
    return 0;
}



Measured memory_bytes: 384
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
r, s, p = map(int, input().split())
T = list(input())[: -1]
#print(T)
res = 0
for i in range(N):
  if T[i] == "r":
    res += p
  if T[i] == "s":
    res += r
  if T[i] == "p":
    res += s
#print(res)
for i in range(N - K):
  if T[i] == T[i + K]:
    T[i + K] = "x"
    if T[i] == "r":
      res -= p
    if T[i] == "s":
      res -= r
    if T[i] == "p":
      res -= s
print(res)

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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
const ll zero=0;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}

int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0,buf1=0,buf2=0,buf3=0,buf4=0,sum=0;
  bool judge = true;
  ll n,k;cin>>n>>k;
  vector<ll>a(n);
  for(i=0;i<n;i++)cin>>a[i];
  buf=a[0];
  res=a[0];
  for(i=1;i<n;i++){
    buf=gcd(buf,a[i]);
    chmax(res,a[i]);
  }
  ans(k<=res&&k%buf==0,"POSSIBLE","IMPOSSIBLE");


  return 0;
}

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

int main() {
  string divide[4] = {"dream", "dreamer","erase","eraser"};
  string S;
  cin >> S;
  reverse(S.begin(),S.end());
  for (int i = 0; i < 4; i++) {
    reverse(divide[i].begin(),divide[i].end());
  }
    bool can = true;
    for (int i = 0; i < S.size();) {   
         bool can2 = false;
      for (int j = 0; j < 4; j++) {
        string d = divide[j];
        if (S.substr(i, d.size()) == d) {
          can2 = true;
          i += d.size();
        } 
      }
    if (!can2) {
      can = false;
      break;
    }
       }

  if (can) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 512
#include <iostream>                                                                                                       

int main(){
   int A, B;
   std::string  S;  
   std::cin >> A >> B >> S;

   for(int i=0; i<S.size(); ++i){
      if(i==A){
         if(S[i]!='-'){
            std::cout << "No" << std::endl;
            return 0;
         }
      }else{
         bool flag = false;
         for(char j='0'; j<='9'; ++j){
            if(S[i]==j) flag = true;
         }
         if(!flag){
            std::cout << "No" << std::endl;
            return 0;
         }
      }   
   }   
   std::cout << "Yes" << std::endl;

   return 0;
}

Measured memory_bytes: 256
#define TEMPLATE_USED
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) for(ll i=0;i<(n);++i)
#define _rep3(i,a,b) for(ll i=(ll)(a);i<(ll)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2)(__VA_ARGS__)
#define _repe2(i,n) for(ll i=0;i<=(ll)(n);++i)
#define _repe3(i,a,b) for(ll i=(ll)(a);i<=(ll)(b);++i)
#define repe(...) _overload3(__VA_ARGS__,_repe3,_repe2)(__VA_ARGS__)
#define _rrep2(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define _rrep3(i,a,b) for(ll i=(ll)(b)-1;i>=(ll)(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2)(__VA_ARGS__)
#define _rrepe2(i,n) for(ll i=(ll)(n);i>=0;i--)
#define _rrepe3(i,a,b) for(ll i=(ll)(b);i>=(ll)(a);i--)
#define rrepe(...) _overload3(__VA_ARGS__,_rrepe3,_rrepe2)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
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;}


void solve();

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

void solve(){
    ll N;cin>>N;
    string c;cin>>c;

    ll cntR=0;
    rep(i,N){
        if(c[i]=='R')cntR++;
    }

    ll ans=0;
    rep(i,cntR){
        if(c[i]=='W')ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3684
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using piii = pair<int, pair<int, int>>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

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

    int N, X, Y;
    cin >> N >> X >> Y;
    X--, Y--;

    vector<int> ans(N);
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int tmp = 1e9;
            tmp = min(tmp, j - i);
            tmp = min(abs(i - X) + abs(j - Y) + 1, tmp);
            ans[tmp]++;
        }
    }

    for (int i = 1; i < N; ++i)
        cout << ans[i] << endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

class Program
{
    static void Main(string[] args)
    {
        var H = sc.ReadInt();
        var W = sc.ReadInt();
        var C = sc.ReadStrArray(H);
        for (int i = 0; i < H; i++)
        {
            Console.WriteLine(C[i]);
            Console.WriteLine(C[i]);
        }
    }

    static Scanner sc = new Scanner();
}

class Scanner
{
    string[] S = new string[0];
    int Index = 0;
    char[] Separators = new char[] { ' ' };

    public string Next()
    {
        if (this.Index < this.S.Length) return this.S[this.Index++];
        var line = "";
        while (line == "") line = Console.ReadLine();
        this.S = line.Split(this.Separators, StringSplitOptions.RemoveEmptyEntries);
        if (this.S.Length == 0) return this.Next();
        this.Index = 0;
        return this.S[this.Index++];
    }
    public string ReadStr()
    {
        return this.Next();
    }
    public char ReadChar()
    {
        return this.Next()[0];
    }
    public int ReadInt()
    {
        return int.Parse(this.Next());
    }
    public uint ReadUInt()
    {
        return uint.Parse(this.Next());
    }
    public long ReadLong()
    {
        return long.Parse(this.Next());
    }
    public double ReadDouble()
    {
        return double.Parse(this.Next());
    }
    public int[] ReadIntArray(int n)
    {
        var array = new int[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadInt();
        }
        return array;
    }
    public long[] ReadLongArray(int n)
    {
        var array = new long[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadLong();
        }
        return array;
    }
    public double[] ReadDoubleArray(int n)
    {
        var array = new double[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadDouble();
        }
        return array;
    }
    public char[] ReadCharArray(int n)
    {
        var array = new char[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadChar();
        }
        return array;
    }
    public string[] ReadStrArray(int n)
    {
        var array = new string[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadStr();
        }
        return array;
    }
}


Measured memory_bytes: 11220
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define   sz(s)         s.size()
#define   ll            long long int
#define   ull           unsigned ll
#define   ld            long double
#define   print(v)      for(ll i=0;i<v.size();i++)cout<<v[i]<<" "
#define   printpair(v)  for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<"\n"
#define   bmd           1000000007
#define   bmd1          998244353
#define   umll          unordered_map<ll,ll>
#define   mll           map<ll,ll>
#define   mcl           map<char,ll>
#define   pll           pair<ll,ll>
#define   F             first
#define   S             second
#define   setp(x)       setprecision(x)
#define   pb            push_back
#define   all(v)        v.begin(),v.end()
#define   tr(a)         for(auto it=a.begin();it!=a.end();it++)
#define   trr(a)        for(auto it1=a.begin();it1!=a.end();it1++)
#define   vll           vector<long long int>
#define   sorty(v)      sort(v.begin(),v.end())
#define   rsort(v)      sort(v.rbegin(),v.rend())
#define   PI            3.1415926535897932384626
#define   db()          cout<<"\n"<<"here"<<"\n"
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;


//---------------------------------------------------------------------------
const int MOD = bmd;
const int N=1e6+100;
inline  ll sqr(ll x){return x*x;}
inline  void normal(ll &a) { a = (a+MOD)%MOD; }
inline  ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline  ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline  ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline  ll modPow(ll b, ll p) { ll r = 1;b=b%MOD; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline  ll modInv(ll a) { return modPow(a, MOD-2); }
inline  ll modDiv(ll a,ll b) { return modMul(a, modInv(b)); }
//---------------------------------------------------------------------------
void solve()
{
    ll n;
    cin>>n;
    ll a[n];
    ll ee=1e18;
    ll prod=1;
    ll res=1;
    for(ll i=0;i<n;i++){
        cin>>a[i];

    }
    for(ll i=0;i<n;i++){
        if(a[i]==0){
            cout <<0<<"\n";
            return;
        }
    }
    for(ll i=0;i<n;i++){
        ll z=ee/prod;
        if(a[i]>z){
            cout <<-1<<"\n";
            return;
        }
        prod*=a[i];
    }
    cout <<prod<<"\n";


}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);//first give all input then gives output
    ll t=1;
    //cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


Measured memory_bytes: 4388
S = input()

if S == 'MON':
    print("6")

elif S == 'TUE':
    print("5")

elif S == 'WED':
    print("4")

elif S == 'THU':
    print("3")

elif S == 'FRI':
    print("2")

elif S == 'SAT':
    print("1")

elif S == 'SUN':
    print("7")


Measured memory_bytes: 8988
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
  string s;
  cin >> s;
  int q;
  cin >> q;
  string t;
  rep(qi,q) {
    int ty;
    cin >> ty;
    if (ty == 1) {
      swap(s,t);
    } else {
      int f; char c;
      cin >> f >> c;
      if (f == 1) {
        t += c;
      } else {
        s += c;
      }
    }
  }
  reverse(t.begin(), t.end());
  t += s;
  cout << t << endl;
  return 0;
}

Measured memory_bytes: 1128
list = input().split()
N = int(list[0])
K = int(list[1])
i = K
s = 0

def sum(a,b):
    i=0
    i = (a + b)*(b - a + 1)/2
    return i

while i <= N + 1:
    #print(sum(N-i+1,N) + sum(0,i-1))
    s = s + sum(N-i+1,N) - sum(0,i-1) + 1
    i += 1
print(int(s % (10**9+7)))

Measured memory_bytes: 9200
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <unordered_map>
//#include"testlib.h"
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout << (#x)<<" = "<<x<<endl
#define sz(s)    (int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> row;
typedef vector<row> matrix;
typedef pair<double, double> point;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };

void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}

int main() {
	fast();
	string str; cin >> str;
	deque<char> clear;
	for (auto& it : str)
		clear.push_back(it);
	int n = sz(str);
	bool isreverse = 0;
	int q; cin >> q;
	while (q--) {
		int t; cin >> t;
		if (t == 1) {
			isreverse = 1 - isreverse;
			continue;
		}
		int f; cin >> f;
		char ch; cin >> ch;
		f--;
		if (isreverse)
			f = 1 - f;
		if (f) clear.push_back(ch);
		else clear.push_front(ch);
	}
	if (isreverse)
		reverse(all(clear));
	for (auto& it : clear)
		cout << it;
	cout << endl;
	return 0;
}

Measured memory_bytes: 976
H,W,N = map(int, input().split())
st = [int(i) for i in input().split()]
S = input()
T = input()


def simu(dim1):
    now = [st[0],st[1]]

    if dim1 == 'U':
        dim2,L,step,dim = 'D',H,1,0
    if dim1 == 'D':
        dim2,L,step,dim = 'U',H,-1,0
    if dim1 == 'L':
        dim2,L,step,dim = 'R',W,1,1
    if dim1 == 'R':
        dim2,L,step,dim = 'L',W,-1,1

    for i in range(N):
        if S[i] == dim1:
            now[dim] -= step
        if now[dim] < 1 or now[dim] >= L+1:
            return True
        if T[i] == dim2:
            if step == 1:
                if now[dim] < L:
                    now[dim] += step
            else:
                if now[dim] > 1:
                    now[dim] += step
    return False
        
Dim = ['U','D','L','R']
for d in Dim:
    if simu(d):
        print('NO')
        exit()
print('YES')


Measured memory_bytes: 42192
cnt = gets.chomp.to_i
count_ac = 0
count_wa = 0
count_tle = 0
count_re = 0

for i in 1..cnt
  result = gets.chomp
  case result
    when "AC" then
      count_ac += 1
    when "WA" then
      count_wa += 1
    when "TLE" then
      count_tle += 1
    when "RE" then
      count_re += 1
  end
    i += 1
end
  
puts "AC x #{count_ac}"
puts "WA x #{count_wa}"
puts "TLE x #{count_tle}"
puts "RE x #{count_re}"


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

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )
#define fore( x , j ) for( auto x : j )
#define se second
#define fr first
//#define c_b fflush(stdin);

const ll Long_max = numeric_limits < ll > :: max() ;
const int Int_max = numeric_limits < int > :: max() ;

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

void File_input( string pathIn ) {
    freopen( pathIn.c_str(), "r", stdin ) ;
}

void File_output( string pathOut ) {
    freopen( pathOut.c_str(), "w", stdout ) ;
}

int msg() {
    srand( time( 0 ) ) ;
    vector < string > st = {
        "Wish everyone high ratings!",
        "Good luck!",
        "Have fun!",
        "Please, read all the problems!",
        "Go Go fight!"
    } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}


void FastInputOutput() {
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

ll a , b , c , d ;
ll cnt = 0 ;

int main(){

   cin >> a >> b >> c >> d ;
   ll bb = c * ( d / __gcd( c , d ) ) ;
   cnt = abs( ( ( a - 1 ) / c + 1 + ( a - 1 ) / d + 1 - ( a - 1 ) / bb + 1 ) - ( ( b / c + 1 + b / d + 1 - b / bb + 1 ) ) ) ;
   cout << ( b - a + 1 ) - cnt ;

   return 0 ;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		long C = Long.parseLong(sc.next());
		long D = Long.parseLong(sc.next());
		sc.close();

		long formerSquare = A * B;
		long latterSquare = C * D;
		if(formerSquare >= latterSquare) {
			System.out.println(formerSquare);
		}else {
			System.out.println(latterSquare);
		}
	}
}

Measured memory_bytes: 22868
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

int main(void) {
  int N;
  scanf("%d", &N);
  int a[MAX];
  rep(i, 0, N) scanf("%d", &a[i]);

  int max = 0;
  int count[10] = {0};
  rep(i, 0, N) {
    int ok = 1;
    for ( int s = 0; s < 3200; s += 400) {
      if ( s <= a[i] && a[i] < s+400 ) {
        count[s/400]++;
        ok = 0;
        break;
      }
    }
    if ( ok ) max++;
  }
  int min = 0;
  rep(i, 0, 10) if (count[i] > 0) min++;
  printf("%d %d\n", min ? min : 1, min + max);
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main() 
{
  int i,n,m,sum=0,count=0;
  cin>>n>>m;
  int a[n];
  for(i=0;i<n;i++)
  {
  	cin>>a[i];
  	sum+=a[i];
  }
  double threshold = ((double) sum) / (4 * m);
  for(i=0;i<n;i++)
  {
  	if(a[i]>=threshold)
  	count++;
  }
  if(count>=m)
  cout<<"Yes\n";
  else
  cout<<"No\n";
}

Measured memory_bytes: 256
h,w,k=map(int, input().split())
L=[]
for i in range(h):
	S=list(input())
	for j in range(w):
		L.append(S[j])
import itertools
import copy
t=[1,0]
cnt=0

for v in itertools.product(t, repeat=h+w):
	LL=copy.copy(L)
	for i in range(h+w):
		if v[i]==1 and i<h:
			for j in range(w):
				LL[w*i+j]='r'
		if v[i]==1 and i>=h:
			for j in range(h):
				LL[w*j+(i-h)]='r'
	s=LL.count('#')
	if s==k:
		cnt+=1
print(cnt)


Measured memory_bytes: 9148
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <functional>
#include <queue>
using namespace std;

typedef int weight;
typedef pair<weight, int> P;
const weight INF = (1 << 29);

struct edge {
	int to;
	int cap;
	weight cost;
	int rev;
	edge(int to_, int cap_, weight cost_, int rev_) :to(to_), cap(cap_), cost(cost_), rev(rev_) {};
};

vector<vector<edge>> G;

void init(int V) {
	G.assign(V, vector<edge>());
}

void add_edge(int from, int to, int cap, weight cost) {
	G[from].emplace_back(to, cap, cost, G[to].size());
	G[to].emplace_back(from, 0, -cost, G[from].size() - 1);
}

weight min_cost_flow(int s, int t, weight f) {
	const int n = G.size();
	weight res = 0;
	vector<int> prevv(n), preve(n);
	while(f > 0) {
		vector<weight> dist(n, INF);
		dist[s] = 0;

		while(true) {
			bool update = false;
			for(int v = 0; v < n; ++v) {
				for(unsigned i = 0; i < G[v].size(); ++i) {
					const auto &e = G[v][i];
					if(e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
						dist[e.to] = dist[v] + e.cost;
						prevv[e.to] = v;
						preve[e.to] = i;
						update = true;
					}
				}
			}
			if(!update) break;
		}

		if(dist[t] == INF) return -1;

		int d = f;
		for(int v = t; v != s; v = prevv[v]) {
			d = min(d, G[prevv[v]][preve[v]].cap);
		}

		f -= d;
		res += d * dist[t];
		for(int v = t; v != s; v = prevv[v]) {
			edge &e = G[prevv[v]][preve[v]];
			e.cap -= d;
			G[v][e.rev].cap += d;
		}
	}

	return res;
}


typedef long long ll;
ll w[10000];
int a[10000];

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

	int M, N, K;
	cin >> M >> N >> K;

	for(int i = 0; i < N; i++) {
		cin >> w[i];
	}

	init(K);

	ll sum = 0;
	for(int i = 0; i < K; i++) {
		cin >> a[i];
		a[i]--;
		if(i > 0 && a[i - 1] == a[i]) continue;
		sum += w[a[i]];
	}

	for(int i = 0; i < K - 1; i++) {
		add_edge(i, i + 1, 1000000, 0);
	}
	vector<int> prev(N, -1);
	for(int i = 0; i < K; i++) {
		if(prev[a[i]] != -1 && prev[a[i]] + 1 != i) {
			add_edge(prev[a[i]] + 1, i, 1, -w[a[i]]);
		}
		prev[a[i]] = i;
	}


	ll res = min_cost_flow(0, K - 1, M - 1);
	//assert(res != -1);
	cout << sum + res << endl;
}

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

string s="", t, kmpinp="", inps, inp2="";
int selfkmptmp;

vector<int> KMP(string S)
{
	vector<int> pi(S.length()+1, 0);
	for(int i = 1; i < S.length(); i++)
	{
		int j = pi[i-1];
		while(S[j]!=S[i] && j)
		{
			j=pi[j-1];
		}
		pi[i]= j + (S[i]==S[j]);
	}
	vector<int> occ;
	for(int i = 0; i < S.length(); i++)
	{
		if(pi[i]==t.length())
		{
			occ.pb(i);
		}
	}
	return occ;
}
int solve(vector<int> occ)
{
	vector<int> dp(occ.size() + 1);
	int ptr=0;
	int ret = (occ.size()>0);
	dp[0] = (occ.size()>0);
	for(int i = 1; i < occ.size(); i++)
	{
		while(occ[i]-occ[ptr]>t.length()) ptr++;
		if(occ[i]-occ[ptr]==t.length())
		{
			dp[i]=dp[ptr]+1;
			ret=max(ret, dp[i]);
		}
		else
		{
			dp[i] = 1;
		}
	}
	return ret;
}
int main()
{
	cin >> inps >> t;
	while(inp2.length() < t.length())
	{
		inp2+=inps;
	}
	s+=inp2;
	s+=inp2;
	kmpinp+=t;
	kmpinp+="#";
	kmpinp+=s;
	kmpinp+=inp2;
	//cout << kmpinp << endl;
	vector<int> occ1 = KMP(kmpinp);
	// for(auto v: occ1) cout << v << " ";
	// 	cout << endl;
	kmpinp+=inp2;
	//cout << kmpinp << endl;
	vector<int> occ2 = KMP(kmpinp);
	// for(auto v: occ2) cout << v << " ";
	// 	cout << endl;
	int pow1=solve(occ1), pow2=solve(occ2);
	if(pow2>pow1) 
	{	
		cout << -1;
		return 0;
	}
	cout << pow1;
}

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

int pts[100005];

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n,k,q;
  cin>>n>>k>>q;

  for(int i=0;i<q;i++){
    int t;
    cin>>t;t--;
    pts[t]++;
  }
  for(int i=0;i<n;i++){
    if(k-q+pts[i]>0){
      puts("Yes");
    }else{
      puts("No");

    }
  }

  return 0;
}


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

int main(){
  int n; cin>>n;
  vector<pair<pair<string,int>,int>> sp(n);
  for(int i=0; i<n; ++i){
    string s; int p; cin>>s>>p;
    sp[i]=make_pair(make_pair(s,100-p), i+1);
  }

  sort(sp.begin(),sp.end());

  for(int i=0; i<n; ++i)cout<<sp[i].second<<endl;
  
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int n,k,i;
	char s[15],c;
	scanf("%d",&n);
	scanf("%s",s);
	scanf("%d",&k);
	
	c = s[k-1];
	
	for(i=0;i<n;i++){
		if(s[i]!=c) s[i]='*';
	}
	printf("%s",s);
	return 0;
}

Measured memory_bytes: 128
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int i = 0;       
        
        while(sc.hasNext()){
            StringBuilder sb = new StringBuilder();
            int x = Integer.parseInt(sc.next());
            if(x == 0)break;
            else{
                i++;
                sb.append("Case ").append(i).append(": ").append(x);
                System.out.println(sb);
            }
            
        }

    }

}



Measured memory_bytes: 41076
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main(void) {
	int N, K, T, U, V, L;
	cin>>N>>K>>T>>U>>V>>L;
	vector<int> D(N);
	REP(i, N) cin>>D[i];
	double ans = 0;
	int roc = 0;
	int stock = 0;
	int rem = T;
	while(roc < L) {
		int nroc;
		if(stock >= 1) {
			nroc = min(roc + V, L);
			--rem;
			int nstock = min(stock + (int)(upper_bound(ALL(D), nroc) - lower_bound(ALL(D), roc + 0.0000001)), K + 1);
			if(stock + (int)(upper_bound(ALL(D), nroc) - lower_bound(ALL(D), roc + 0.0000001)) > K + 1) {
				rem = T;
				nroc = *(upper_bound(ALL(D), nroc) - 1);
			}
			stock = nstock;
			ans += (nroc - roc) / (double)V;
			if(rem == 0) {
				--stock;
				rem = T;
			}
		} else {
			nroc = min(roc + U, L);
			if(0 < (upper_bound(ALL(D), nroc) - lower_bound(ALL(D), roc + 0.0000001))) {
				nroc = *lower_bound(ALL(D), roc + 0.0000001);
				++stock;
				rem = T;
			}
			ans += (nroc - roc) / (double)U;
		}
		//cout<<ans<<" "<<nroc<<endl;
		roc = nroc;
	}
	cout<<fixed<<showpoint<<setprecision(10)<<ans<<endl;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

// 多重vector
// auto dp=make_v<int>(4,h,w) みたいに使える
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// 多重vectorのためのfill
// fill_v(dp,0) みたいに使える
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//main code

int main(int argc, char *argv[])
{
	LL n,k,r,s,p;
	string t;
	cin >> n >> k >> r >> s >> p >> t;
	LL ans = 0;
	for (int i = 0; i < t.size(); ++i) {
		if (i >= k and t[i] == t[i-k]) {
			t[i] = 'x';
			continue;
		}
		if (t[i] == 'r') {
			ans += p;
		} else if (t[i] == 's') {
			ans += r;
		} else {
			ans += s;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>

int main() {
  int n, a, min_a = 1000000, max_a = -1000000;
  long long sum = 0;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> a;
    max_a = std::max(a, max_a);
    min_a = std::min(a, min_a);
    sum += a;
  }
  std::cout << min_a << " " << max_a << " " << sum << std::endl;
}


Measured memory_bytes: 3092
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {
	int a,b,k;
	cin>>a>>b>>k;
	while(k>0) {
		if(a&1)a--;
		a/=2;
		b+=a;
		--k;
		if(k>0){
			if(b&1)b--;
			b/=2;
			a+=b;
			--k;
		}
	}
	cout<<a<<" "<<b;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3608
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    w = [input() for i in range(n)]
    d = defaultdict(lambda : 1)
    p = w[0][0]
    for i in w:
        if not d[i]:
            print("No")
            return
        d[i] = 0
        if p != i[0]:
            print("No")
            return
        p = i[-1]
    print("Yes")
    return

#Solve
if __name__ == "__main__":
    solve()


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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define ALL(x) x.begin(),x.end()
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

typedef long long ll;
bool LTE(double a,double b) { return equals(a,b) || a < b; }
bool LT(double a,double b) { return !equals(a,b) && a < b; }

void compute() {

}

int main() {
  vector<string> vec(4);
  rep(i,4) cin >> vec[i];
  sort(ALL(vec));
  string s = "";
  rep(i,4) s += vec[i];
  if( s == "1479" ) puts("YES");
  else puts("NO");
  compute();
  return 0;
}


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

int main(){
  char a, b, c;
  char A, B ,C;
  int n = 0;
  
  cin >> a >> b >> c;
  cin >> A >> B >> C;
  
  if (a == A) n++;
  if (b == B) n++;
  if (c == C) n++;
  
  cout << n << endl;
}

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

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    reverse(a.begin(), a.end());
    rep(i, n)
    {
        cout << a[i];
        if (i < n - 1)
        {
            cout << " ";
        }
        else
        {
            cout << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 3016
// Aizu 1106: Factorization of Quadratic Formula
// 2017.9.14 bal4u@uu

#include <stdio.h>
#include <math.h>

int pr[103][2], len;

int main()
{
	int a, b, c, p, q, r, s;
	int d, i, j, t, qq[2];
	long long d2, dd;

	while (scanf("%d%d%d", &a, &b, &c) && a) {
		d2 = b*b, dd = a*c; d2 -= dd << 2; if (d2 < 0) goto NG;
		if (d2 == 0) qq[0] = qq[1] = b;
		else {
			dd = (long long)sqrt((double)d2)+1; while (dd*dd > d2) dd--;
			if (dd*dd != d2) goto NG;
			d = (int)dd, qq[0] = b+d, qq[1] = b-d;
		}
		t = (int)sqrt(a)+1; while (t*t > a) t--;
		for (len = 0, r = 1; r <= t; r++)
			if (a % r == 0) pr[len][0] = a/r, pr[len++][1] = r;
		for (i = 0; i < len; i++) {
			p = pr[i][0], r = pr[i][1];
			for (j = 0; j < 2; j++) {
				if (qq[j] == 0) {
					q = 0; 
					if (b == 0) s = 0;
					else { if (b % p) continue;	s = b / p; }
				} else {
					if (qq[j] % (r<<1)) continue;
					q = qq[j] / (r<<1);
					if (c == 0) s = 0;
					else { if (c % q) continue;	s = c / q; }
				}
				if (p == r) if (q < s) continue;
				if (s*p + q*r == b) goto OK;
			}
		}
NG:		puts("Impossible"); continue;
OK:		printf("%d %d %d %d\n", p, q, r, s);
    }
	return 0;
}

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

using namespace std;
using ll=long long;

int main()
{
   int h,w;cin >>h >>w;
   char s[h][w];
   for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
        cin >>s[i][j];
    }
   }
   bool flg=true;
   int k[4]={0,0,1,-1};
   int l[4]={1,-1,0,0};
   for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
        bool tmp=false;
        if(s[i][j]=='#'){
            for(int q=0;q<4;q++){
                if(i+k[q]>=h||j+l[q]>=w||i+k[q]<0||j+l[q]<0)continue;
                if(s[i+k[q]][j+l[q]]=='#')tmp=true;
            }
            if(!tmp)flg=false;
        }
    }
   }
   if(flg)puts("Yes");
   else puts("No");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <map>
#include <set>
#include <deque>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main() {
  int N; cin >> N;
  vector<int> L(N);
  rep(i, N) cin >> L[i];
  sort(L.begin(), L.end());
  int ans = 0;
  rep(b, N) rep(a, b) {
    int ab = L[a]+L[b];
    int r = lower_bound(L.begin(), L.end(), ab) - L.begin();
    int l = b+1;
    ans += max(0, r-l);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() { 
  int time=0, x;  
  for(int i=0; i<4; i++) { 
    cin >> x;  
    time += x;  
  } 
  cout << time/60 << endl; 
  cout << time%60 << endl;  
  return 0;
}


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

using namespace std;

int main() {
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	sort(a.begin(), a.end());

	if (a[0] == 5 && a[1] == 5 && a[2] == 7) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}

	return 0;
}

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

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ull = unsigned long long;
using vl = vector<ll>;
using vi = vector<int>;
using vchar = vector<char>;
using vstr = vector<string>;
using pll =  pair<ll,ll>;

const ll mod = 1000000007;
const ll inf = 1000000000000000;

#define pi acos(-1)
#define pb push_back
#define test int TEST;cin>>TEST;while(TEST--)
#define vsort(xx) sort(xx.begin(),xx.end())
#define vrevsort(xx) sort(xx.rbegin(),xx.rend())


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll a,b;
    char c;
    cin>>a>>c>>b;
    //cout<<a<<c<<b;
    if(c=='+'){ cout<<a+b;}
    else if(c=='-'){cout<<a-b;}
    
   
    return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;

signed main(){
	ios_base::sync_with_stdio(0);
	string n;
	cin>>n;
	if(n.find('9')==-1) cout<<"No";
	else cout<<"Yes";
	re 0;
}

Measured memory_bytes: 3612
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
// bool operator<(const pair<int, int> &a, const pair<int, int> &b)
// {
//     if (a.first == b.first)
//         return a.second < b.second;
//     return a.first < b.first;
// };

/*unsigned int xor128(void)
{
    static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned int t = (x ^ (x << 11));
    x = y;
    y = z;
    z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
unsigned int xor128rnd(unsigned int m)
{
    return xor128() % m;
}*/

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}
int arr[110];
int N;
int dp[100010];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(8);

    int K;
    cin >> N >> K;
    for (int i = 0; i < N; ++i)
        cin >> arr[i];

    for (int i = 0; i <= K; ++i)
    {
        for (int j = 0; j < N; ++j)
        {
            if (i - arr[j] >= 0 && dp[i - arr[j]] == 0)
                dp[i] = 1;
        }
    }
    if (dp[K])
        cout << "First" << endl;
    else
        cout << "Second" << endl;
    return 0;
}


Measured memory_bytes: 640
/*input
2
3 4
*/
#include <bits/stdc++.h>
using namespace std;

#define el "\n"
#define mp make_pair
#define pb push_back
#define int long long

signed main() {
	int n,a[1005],d[1005];
	double sum=0;
	cin>>n;
	d[0]=1;
	for(int i=1;i<50;i++) {
		d[i] = d[i-1]*2;
	}
	for(int i=0;i<n;i++) {
		cin>>a[i];
	}
	sort(a,a+n);
	sum = (double)a[0]/d[n-1];
	for(int i=1;i<n;i++) {
		sum+=(double)a[i]/d[n-i];
	}
	cout<<sum;
}

Measured memory_bytes: 256
master = list(input())
change = 0
cn = 0
cn_r = 0
l = master.copy()
r = master.copy()
for i in range(len(l)-1):
    if l[i] == l[i+1]:
        if l[i] == "0":
            change = "1"
        else:
            change = "0"
        l[i+1] = change
        cn += 1
for i in reversed(range(1,len(l))):
    if r[i] == r[i-1]:
        if r[i] == "0":
            change = "1"
        else:
            change = "0"
        r[i-1] = change
        cn_r += 1

print(min(cn,cn_r))


Measured memory_bytes: 5544
import java.math.BigInteger;
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BigInteger a = scanner.nextBigInteger();
        BigInteger b = scanner.nextBigInteger();
        BigInteger x = scanner.nextBigInteger();
        BigInteger zero = new BigInteger("0");

        BigInteger leftEdge;
        if (a.mod(x).equals(zero)) {
            leftEdge = a;
        } else {
            leftEdge = a.add(x.subtract(a.mod(x)));
        }

        BigInteger rightEdge;
        if (b.mod(x).equals(zero)) {
            rightEdge = b;
        } else {
            rightEdge = b.subtract(b.mod(x));
        }

        if (leftEdge.compareTo(rightEdge) > 0) {
            System.out.println(0);
        } else {
            System.out.println(rightEdge.subtract(leftEdge).divide(x).add(new BigInteger("1")));
        }
    }
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    ll n;
    cin >> n;
    vector<pair<ll, pair<ll, ll>>> v(n);    
    rep(i, 0, n) {
        ll a, b;
        cin >> a >> b;
        v[i] = make_pair(b, make_pair(a, b));
    }
    sort(v.begin(), v.end());

    bool ok = true;
    ll t = 0;
    for(auto p : v) {
        t += p.second.first;
        if(t > p.second.second) {
            ok = false;
        }
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 4992
X = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

k = 0
for j in range(X,100005):
    a = factorization(j)
    if len(a) == 1 and a[0][1] == 1:
        k = j
        break

print(k)

Measured memory_bytes: 38640
//#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
//#include <intrin.h>  //AtCoder (gcc) 上ではこれがあると動かない。__popcnt用のincludeファイル。
using namespace std;

typedef long long ll;
typedef long double ld;


#define int long long
#define rep(i, n) for(long long i = 0; i < (n); i++)
#define sqrt(d) pow((long double) (d), 0.50)

const int INF = 2000000000; //2e9
const int large_P = 1000000007; //1e9 + 7



//繰り返し2乗法
//N^aの、Mで割った余りを求める。
ll my_pow(ll N, ll a, ll M) {
	ll tempo;
	if (a == 0) {
		return 1;
	}
	else {
		if (a % 2 == 0) {
			tempo = my_pow(N, a / 2, M);
			return (tempo * tempo) % M;
		}
		else {
			tempo = my_pow(N, a - 1, M);
			return (tempo * N) % M;
		}
	}
}



//N_C_a を M で割った余り
ll my_combination(ll N, ll a, ll M) {
	ll answer = 1;

	rep(i, a) {
		answer *= (N - i);
		answer %= M;
	}

	rep(i, a) {
		answer *= my_pow(i + 1, M - 2, M);
		answer %= M;
	}

	return answer;
}



ll my_gcd(ll& a, ll& b) {
	if (b == 0) return a;
	ll temp = a % b;
	return my_gcd(b, temp);
}



// base を底としたときの、n の i桁目を、v.at(i) に入れる。(桁数は n に応じて自動で設定する。)
void ll_to_vector(int base, long long n, vector<int>& v) {
	long long tempo = n;
	long long tempo2 = n;

	//ll n_digit = floor(log10(n) / log10(base)) + 1;  // 桁の計算を1行で。ただ誤差があるのでよくない。
	int n_digit = 1;
	while (tempo2 >= 10) {
		tempo2 /= 10;
		n_digit++;
	}

	v.assign(n_digit, 0);

	//ll n_digit = v.size();  // v のサイズをそのままにする場合。

	for (int i = 0; i < n_digit; i++) {
		v.at(i) = tempo / pow(base, n_digit - 1 - i);
		tempo -= v.at(i) * pow(base, n_digit - 1 - i);
	}
}



int char_to_int(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4;
	case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9;
	default: return 0;
	}
}


//エラトステネスの篩で、prime で ないところに false を入れる。
//true で初期化された vector を代入する必要がある。
void prime_judge(vector<bool>& prime_or_not) {

	prime_or_not.at(0) = false;
	prime_or_not.at(1) = false;

	ll n = prime_or_not.size() - 1;
	ll region = (ll)sqrt(n) + 1;

	for (ll i = 2; i <= n / 2; i++) {
		prime_or_not.at(2 * i) = false;
	}


	for (ll i2 = 1; i2 < n / 2; i2++) {
		ll i = 2 * i2 + 1;  //ここからは奇数のみ探索
		if (i < region && prime_or_not.at(i)) {
			ll j = i * i;
			while (j < n + 1) {
				prime_or_not.at(j) = false;
				j += 2 * i;
			}
		}
	}
};



map<ll, ll> divide_to_prime(int target) {
	map<ll, ll> res;

	//sqrt(target) まで調べる。
	ll upper_lim = ceil(sqrt(target));
	vector<bool> prime_or_not(upper_lim + 1, true);

	if (upper_lim < 20) prime_or_not.assign(25, true);
	prime_judge(prime_or_not);

	ll tempo = target;
	rep(i, (upper_lim + 1)) {
		if (prime_or_not.at(i)) {
			while (tempo % i == 0) {
				tempo /= i;
				res[i]++;
			}
		}
	}

	if (tempo != 1) res[tempo]++; //sqrt(target) より大きな素因数は高々1つしかない。



	return res;
}




signed main() {
	int N, K;
	cin >> N >> K;

	vector<bool> no_candies(N, true);

	rep(i, K) {
		int d; cin >> d;
		int tempo;

		rep(j, d) {
			cin >> tempo; tempo--;
			no_candies.at(tempo) = false;
		}
	}

	int res = 0;
	rep(i, N) {
		if (no_candies.at(i)) res++;
	}

	cout << res << endl;

	//rep(i, N) {
		//cout << no_candies.at(i) << endl;
	//}
}

Measured memory_bytes: 3624