akhauriyash/Code-Regression huggingface dataset:
use std::cmp::{max, min};
use std::error::Error;
use std::io;

const m: i64 = 1_000_000_007;

fn main() {
    if let Err(e) = run() {
        panic!("failed.");
    }
}

fn run() -> Result<(), Box<Error>> {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer)?;
    let first_line: Vec<usize> = buffer.split_whitespace()
        .map(|x| x.parse::<usize>().unwrap())
        .collect();
    let n = first_line[0];
    let k = first_line[1];

    buffer.clear();
    io::stdin().read_line(&mut buffer)?;
    let candies: Vec<i32> = buffer.split_whitespace()
        .map(|x| x.parse::<i32>().unwrap())
        .collect();

    let mut dp = vec![vec![0; k + 1]; n + 1];
    println!("{}", calculate(&mut dp, &candies, n, k));
    Ok(())
}

fn calculate(dp: &mut Vec<Vec<i64>>, candies: &Vec<i32>, n: usize, k: usize) -> i32 {
    for i in 0..n + 1 {
        dp[i][0] = 1;
    }

    for i in 1..n + 1 {
        for j in 1..k + 1 {
            dp[i][j] = (dp[i][j - 1] + dp[i - 1][j]) % m;
            if j - 1 >= candies[i - 1] as usize {
                dp[i][j] = (dp[i][j] + m - dp[i - 1][j - candies[i - 1] as usize - 1]) % m;
            }
        }
    }
    dp[n][k] as i32
}


Measured memory_bytes: 106748
#include <array>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
constexpr int mod = 1e9 + 7;

template <int N>
constexpr array<uint64_t, N + 1> pow_table() {
  array<uint64_t, N + 1> ans;
  ans[0] = 1;
  for (int i = 1; i <= N; ++i) {
    ans[i] = (ans[i - 1] * 3) % mod;
  }
  return ans;
}

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

  string s;
  cin >> s;

  vector<int> asum(s.size() + 1), csum(s.size() + 1), qsum(s.size() + 1);
  for (size_t i = 0; i < s.size(); ++i) {
    switch (s[i]) {
    case 'A':
      asum[i]++;
      break;
    case 'C':
      csum[i]++;
      break;
    case '?':
      qsum[i]++;
      break;
    }
  }
  for (size_t i = 1; i <= s.size(); ++i) {
    asum[i] += asum[i - 1];
    csum[i] += csum[i - 1];
    qsum[i] += qsum[i - 1];
  }

  auto pow = pow_table<100000>();
  uint64_t ans = 0;
  for (size_t i = 1; i < s.size() - 1; ++i) {
    if (s[i] == 'A' || s[i] == 'C') {
      continue;
    }
    uint64_t aq = qsum[i - 1];
    uint64_t as = (asum[i - 1] * pow[aq]) % mod;
    if (0 < aq) {
      as = (as + pow[aq - 1] * aq) % mod;
    }
    uint64_t cq = qsum[s.size()] - qsum[i];
    uint64_t cs = ((csum[s.size()] - csum[i]) * pow[cq]) % mod;
    ;
    if (0 < cq) {
      cs = (cs + pow[cq - 1] * cq) % mod;
    }
    // cout << i << " " << as << "*" << cs << "\n";
    ans = (ans + as * cs) % mod;
  }
  cout << ans << "\n";
}


Measured memory_bytes: 2496
#include<iostream>
#include<stack>
#include<cstring>
using namespace std;
const int MAXN=10010,MAXM=100010;
int n,m;
int to[MAXM],head[MAXN],nex[MAXM],top;
int sum[MAXN],dfn[MAXN],top1,hash[MAXN];
stack<int> s;
void add(int x,int y)
{
	nex[top]=head[x];
	head[x]=top;
	to[top++]=y;
	sum[y]++;
}

void input()
{
	memset(nex,-1,sizeof(nex));
	memset(head,-1,sizeof(head));
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int x,y;
		cin>>x>>y;
		add(x,y);
	}
}

void tuopu()
{
	for(int i=0;i<n;i++)
	    if(!sum[i]) {s.push(i);dfn[top1++]=i;hash[i]=1;}
	while(!s.empty())
	{
		int tmp=s.top();
		s.pop();
		int u=head[tmp];
		while(u!=-1)
		{
			int tt=to[u];
			u=nex[u];
			if(hash[tt]) continue;
			sum[tt]--;
			if(sum[tt]==0) {s.push(tt);hash[tt]=1;dfn[top1++]=tt;}
		}
	}
}

void xxj()
{
	tuopu();
}

void output()
{
	for(int i=0;i<top1;i++)
	    cout<<dfn[i]<<'\n';
}

int main()
{
	input();
	xxj();
	output();
	return 0;
}

Measured memory_bytes: 3856
use std::io::{self, BufRead};
use std::cmp;

fn main() {
    let mut n = String::new();
    let mut line = String::new();
    let _ = io::stdin().read_line(&mut n);
    let _ = io::stdin().read_line(&mut line);
    line = line.split_whitespace().collect();
    let mut openCnt = line.match_indices("(").count();
    let mut closeCnt = line.match_indices(")").count();
    let mut misMatch = 0;
    let mut matchCnt = 0;
    for c in line.chars(){
        if (c == '('){
            misMatch += 1;
        }
        else if (misMatch > 0){
            misMatch -= 1;
            matchCnt += 1;
        }
    }
    openCnt -= matchCnt;
    closeCnt -= matchCnt;
    for _ in 0..closeCnt{
        line = "(".to_string() + line.as_str();
    }
    for _ in 0..openCnt{
        line.push_str(")");
    }
    println!("{}",line);
}


Measured memory_bytes: 4352
using System;

class C{
  public static void Main(){
    int n = int.Parse(Console.ReadLine());
    string[] bublearray = new string[n];
    string[] selectarray = new string[n];

    string[] str = Console.ReadLine().Split(' ');
    string[] str2 = new string[n];
    for(int i = 0;i < n;i++){
      str2[i] = str[i];
    }
    bublearray = BubbleSort(str,n);
    selectarray = SelectionSort(str2,n);

    for(int i = 0;i < n - 1;i++){
      Console.Write(bublearray[i] + " ");
    }
    Console.Write(bublearray[n - 1]);
    Console.WriteLine("");

    Console.WriteLine("Stable");

    for(int i = 0;i < n - 1;i++){
      Console.Write(selectarray[i] + " ");
    }
    Console.Write(selectarray[n - 1]);
    Console.WriteLine("");

    if(Judgh(bublearray,selectarray,n) == true) Console.WriteLine("Stable");
    else Console.WriteLine("Not stable");
  }

    static bool Judgh(string[] b_array,string[] s_array,int n){
      bool judgh = true;
      for(int i = 0;i < n;i++){
        if(b_array[i].CompareTo(s_array[i]) != 0) judgh = false;
      }
    return judgh;
  }

  static string[] BubbleSort(string[] array,int n){
    string[] newarray = new string[n];
    for(int i = 0;i < n;i++){
      newarray[i] = array[i].Substring(1);
    }

    for(int i = 1;i < n;i++){
      for(int j = n - 1;j >= i;j--){
        if(newarray[j].CompareTo(newarray[j-1]) < 0){
          Swap(ref array[j],ref array[j-1]);
          Swap(ref newarray[j], ref newarray[j-1]);
        }
      }
    }
    return array;
  }

  static string[] SelectionSort(string[] array,int n){
    string[] newarray =  new string[n];
    for(int i = 0;i < n;i++){
      newarray[i] = array[i].Substring(1);
    }
    for(int i = 0;i < n;i++){
      int min = i;
      for(int j = i;j < n;j++){
        if(newarray[min].CompareTo(newarray[j]) > 0)
        min = j;
      }
      if(min != i) {
          Swap(ref array[i],ref array[min]);
          Swap(ref newarray[i],ref newarray[min]);
        }
    }
    return array;
  }

  static void Swap(ref string x,ref string y){
    string temp;
    temp = x;
    x = y;
    y =temp;
  }
}


Measured memory_bytes: 9912
fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val s = (1..m).map { readLine()!!.split(" ").map { it.toInt()-1 }.drop(1) }
    val p = readLine()!!.split(" ").map { it.toInt() }

    var count=0
    for(bit in 0 until 1.shl(n)){
        val switch = BooleanArray(n){bit.shr(it).and(1)==1}
        val init = p.map { it==0 }.toBooleanArray()
        for(i in s.indices) {
            s[i].forEach {
                init[i] = init[i].xor(switch[it])
            }
        }
        if(init.all { it })count++
    }
    println(count)

}

Measured memory_bytes: 39928
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

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

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int A, B, C;
    cin >> A >> B >> C;
    int Sum = A + B + C;
    if (Sum >= 22) {
        cout << "bust" << endl;
    } else {
        cout << "win" << endl;
    }

    return 0;
}


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

int main(void){
 
    int data[3];
    int v;
    for(int i=0;i<3;i++){
        cin >> data[i];
    }
    
    v = data[0] * 100 + data[1] * 10 + data[2];
    
    if(v % 4 == 0){
        cout << "YES" <<endl;
    }
    else{
        cout << "NO" <<endl;
    }
    
}

Measured memory_bytes: 3596
/// Kazuki Hoshino


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define f first
#define ss second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
//#define endl '\n'
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

int n, m, x, y, a[10101], b[1010];

int32_t main(){

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

//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);

cin >> n >> m >> x >> y;

rep(i,1 ,n){
    cin >> a[i];
}

rep(i, 1, m){
    cin >> b[i];
}

rep(i, x+1, y){
    bool f1 = true , f2 = true;
    rep(j, 1, n){
    if(a[j]<i)continue;
    else f1 = false;
    }
    rep(j, 1, m){
    if(b[j]>=i)continue;
    else f2 = false;
    }

    if(f1&&f2){
        cout << "No War" << endl;
        return 0;
    }

}


cout << "War" << endl;






return 0;}
///....


Measured memory_bytes: 256
def warshal_floyd(d):
  for k in range(10):
    for i in range(10):
      for j in range(10):
        d[i][j] = min(d[i][j], d[i][k]+d[k][j])
  return d

h, w = map(int, input().split())
d = [[float('inf') for i in range(10)] for j in range(10)]
for i in range(10):
  l = list(map(int, input().split()))
  for j in range(10):
    d[i][j] = l[j]
d = warshal_floyd(d)
#print(d)

ans = 0
for i in range(h):
  l = list(map(int, input().split()))
  for j in range(w):
    if l[j] != -1:
      ans += d[l[j]][1]
print(ans)
    

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

int main() {
  string S;
  cin >> S;
  
  if ( S.at(0) != S.at(1) && S.at(1) != S.at(2) &&S.at(0) != S.at(2) ) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

}


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

int main() {
  
    string s;
    cin>>s;
    long long int z=0;
    for(int i=0;i<s.size();i++)
    {
        z+=(s[i]-'0');
    }
    
    if(z%9==0)
    {
        cout<<"Yes";
    }else{
        cout<<"No";
    }
}

Measured memory_bytes: 3720
#include<iostream>
using namespace std;
int main(){
	int *a=new int[1000000001]; 
	int n;
	cin>>n;
	while(n--){
		int x;
		cin>>x;
		a[x]=1;
	}
	int cnt=0;
	cin>>n;
	while(n--){
		int x;
		cin>>x;
		if(a[x])
			cnt++;
			
	}
	cout<<cnt<<endl;
	delete[]a;
	return 0;
}


Measured memory_bytes: 6704
/*
Author : N_o_o_B
Created : May 02 2020 18:01:58 
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

ll ans = -1e18;
int n, m, q;
int a[50],b[50],c[50],d[50];
void f(int ind,int prev,vi foo){
    if(ind == n){
        ll score = 0;
        fori(i,q){
            if(foo[b[i]]-foo[a[i]] == c[i]) score += d[i];
        }
        ans = max(ans,score);
        return;
    }
    rep(i,prev,m){
        foo.pb(i);
        f(ind+1,i,foo);
        foo.pop_back();
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    
    cin >> n >> m >> q;

    fori(i,q){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--;
        b[i]--;
    }

    f(0,1,{});

    cout << ans << endl;
    time_taken();
    return 0;
}

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

main()
{
long long int a[100000],b[1000],c[1000],n,aaa,k,i,r=0,rr=0,d1,dd=0,d2,d3,ck=0,m,j,aa,bb,cc;
//char cr[1000];
float aaf,bbf,ccf,rf,kf;
//scanf("%lld",&n);
cin>>n>>k;

for(i=0;i<n;i++){

cin>>a[i];

}
sort(a,a+n);

for(i=0;i<n;i++){

r=r+a[i];

}
////////////////////
rf=r;
kf=k;
//if(r>(4*k))
aaf=rf/(4*kf);



//cout<<ck<<endl;

for(i=0;i<n;i++){
        ccf=a[i];

if(ccf>=aaf){
    dd++;
}

}








  if(dd>=k){
    cout<<"Yes";
  }
  else{
    cout<<"No";
  }
//printf("%lld",dd);

    return 0;
}

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

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

void solve() {
  string s; cin >> s;
  int ans=0;
  for(int i=0; i<s.size(); ++i) {
    ans+=(int)s.at(i)-48;
  }
  ans%=9;
  if(ans) drop("No");
  cout << "Yes" << endl;

  return;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  //cin >> T;
  while(T--) solve();

  return 0;
}


Measured memory_bytes: 3896
#include<bitset>
#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<list>
#include<queue>
#include<algorithm>
#include<functional>
#include<map>
#include<set>
#include<utility>
#include<initializer_list>
#include<tuple>
#include<regex>
using namespace std;
#define ull unsigned long long
#define ll long long
#define rep(i, a, n) for(int i=(a);i<(int)(n);i++)
#define repc(i, a, n) for(int i=(a);i<=(int)(n);i++)
#define all(t) t.begin(), t.end()
#define rall(t) t.rbegin(), t.rend()
#define mat(type, row, col, init) vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout<<(cond? "Yes":"No")<<endl;
#define YES(cond) cout<<(cond? "YES":"NO")<<endl;
#define DBG(str) cerr<<(str)<<endl;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	vector<int> d = { a,b,c };
	sort(all(d));
	int da = d[2] - d[0];
	int db = d[2] - d[1];
	int dc = da - db;
	int cnt = 0;
	if (dc == 0) {
		cnt = da;
	}
	else if (dc % 2 == 0) {
		cnt = db + dc / 2;
	}
	else {
		cnt = db + dc / 2 + 2;
	}
	cout << cnt;


	return 0;
}





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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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; }

const ll INF = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  ll ans=0;
  irep(i,1,n-1){
    if(a[i-1]<a[i]&&a[i]<a[i+1]) ans++;
    if(a[i-1]>a[i]&&a[i]>a[i+1]) ans++;
  }
  cout<<ans<<endl;
}

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

int N;

int dfs(ll num, bool nana, bool go, bool san) {
  if (num > N)
    return 0;
  int res = 0;
  if (nana && go && san)
    res++;
  res += dfs(num * 10 + 7, true, go, san);
  res += dfs(num * 10 + 5, nana, true, san);
  res += dfs(num * 10 + 3, nana, go, true);
  return res;
}

int main() {
  cin >> N;
  cout << dfs(0, 0, 0, 0) << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] defargs) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int taro = 0;
		int hana = 0;
		for (int i = 0; i < n; i++) {
			String card1 = scanner.next();
			String card2 = scanner.next();
			if(card1.compareTo(card2) > 0){
				taro = taro + 3;
			}else if (card1.compareTo(card2) < 0) {
				hana = hana + 3;
			}else {
				taro = taro + 1;
				hana = hana + 1;
			}
		}
		System.out.println(taro +" "+ hana);
	}
}


Measured memory_bytes: 29992
#include "bits/stdc++.h"
 
using namespace std;
 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
using ll = long long;
using ld = long double;
 
constexpr int nax = 200 * 1000 + 105;
constexpr int infty = 1000 * 1000 * 1000 + 5;
constexpr int mod = 1000 * 1000 * 1000 + 7;
 
int n;
int tab[nax];
 
map<int, int> dp;
 
int Get(int x) {
  auto it = dp.find(x);
  if (it == dp.end()) return n + 100;
  return it->second;
}
 
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  n = s.size();
  for (int i = 1; i <= n; i++) {
    tab[i] = (1 << (int) (s[i - 1] - 'a'));
    tab[i] ^= tab[i - 1];
  }
  dp[0] = 0;
  int last = 0;
  for (int i = 1; i <= n; i++) {
    int wynik = Get(tab[i]);
    debug() << imie(i) imie(tab[i]);
    debug() << "poc" imie(i) imie(wynik);
    for (int j = 0; j < 'z' - 'a' + 1; j++) {
      const int mabyc = tab[i] ^ (1 << j);
      wynik = min(wynik, Get(mabyc));
    }
    wynik++;
    debug() << imie(i) imie(wynik);
    last = wynik;
    wynik = min(Get(tab[i]), wynik);
    dp[tab[i]] = wynik;
    debug() << imie(dp);
  }
  cout << last << endl;
  return 0;
}


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

int main() {
  long long e;

  while (true) {
    cin >> e;
    if (e == 0) {
      break;
    }
    long long min = 999999999;
    for (int y = 0; y*y <= e; y++) {
      for (int z = 0; z*z*z <= e; z++) {
        long long x = e - y*y - z*z*z;
        if (x >= 0 && min > x + y + z) {
          min = x + y + z;
        }
      }
    }
    cout << min << endl;
  }

  return 0;
}



Measured memory_bytes: 3008
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<vector<int> > vec;
    
    for(int i = 0; i< n; i++) {
        vector<int> tmp;
        for(int j = 0; j< 3; j++) {
                int num;
                cin >> num;
                tmp.push_back(num);
        }
        vec.push_back(tmp);
    }

    int A[n];
    int B[n];
    int C[n];
    for(int i = 0; i< n; i++){
        if(i==0){
            A[i] = vec[0][0];
            B[i] = vec[0][1];
            C[i] = vec[0][2];
        }
        else {
            A[i] = vec[i][0] + max(B[i-1], C[i-1]);
            B[i] = vec[i][1] + max(A[i-1], C[i-1]);
            C[i] = vec[i][2] + max(B[i-1], A[i-1]);
        }
    }
    // cout << 
    cout << max(A[n-1], max(B[n-1], C[n-1]));
    

}

Measured memory_bytes: 9884
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef int ll;
typedef long double ld;
const ll N = 100005;
char en = '\n';
ll inf = 1e16;
ll mod = 1e9 + 7;
ll power(ll x, ll n, ll mod) {
  ll res = 1;
  x %= mod;
  while (n) {
    if (n & 1)
      res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}

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

  ll a, b;
  cin >> a >> b;

  cout << max(a + b, max(a - b, a * b)) << en;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    double r;
    cin>>r;
    double pi=3.1415926;
    pi=2*pi*r;
    cout<<pi<<endl;
    return 0;
}


Measured memory_bytes: 3780
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        double max = 0;

        if(X==1){
            System.out.println(1);
        }
        else{
            for(int i=1; i<40; i++){
                for(int j=2; j<=10; j++){
                    if(Math.pow(i, j)<=X){
                        max = Math.max(max, Math.pow(i, j));
                    }
                    else{
                        break;
                    }
                }
            }
            System.out.println((int)max);
        }
    }
}

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

int main(){
	int X;
	cin >> X;
	int Mx=pow(1,2);
	for(int b=2;b<=31;b++){
		for(int p=2;p<=9;p++){
			int value=pow(b,p);
			if(Mx<value && value<=X){
				Mx=value;
			}
		}
	}
	cout << Mx;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int i,n;
    char s[6];
    while(~scanf("%s",s))
    {
        n=0;
        for(i=0; i<4; i++)
        {

            if(s[i]=='+')
                n=n+1;
            else if(s[i]=='-')
                n=n-1;
        }
        printf("%d\n",n);
    }
    return 0;
}




Measured memory_bytes: 128
a, b, c= map(int,input().split())
if a==1. and b==0. and c==0:
    print("Close")
elif a==0. and b==1. and c==0:
    print("Close")
elif a==1. and b==1. and c==0:
    print("Open")
elif a==0. and b==0. and c==1:
    print("Open")
else:
    print("Close")


Measured memory_bytes: 5612
n = int(input())
event = []
for _ in range(n):
    event.append(list(map(int,input().split())))

dp = [[0] * 3 for i in range(n)]
dp[0] = event[0]

for i in range(1,n):
    for j in range(3):
        dp[i][j] = max([event[i][j] + dp[i-1][k] for k in range(3) if k != j])

print(max(dp[-1]))

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

vector<int> g[100005];
int color[100005]={0};
vector<int> black;
int dfs(int s,int t,int f=-1) {
  if(s==t) return 1;
  for(int i : g[s]) {
    if(i==f) continue;
    int x = dfs(i,t,s);
    if(x>=0) {
      black.push_back(s);
      return x+1;
    }
  }
  return -1;
}
void dfsc(int s,int f=-1) {
  //cout << "s " << s <<endl; 
  for(int i : g[s]) {
    if(i==f) continue;
    if(color[i]==0) {
      color[i] = color[s];
    }
    dfsc(i,s);
  }
}
int main() {
int n;
cin >> n;
for(int i = 0; i < n-1; i++) {
  int x,y;
  cin >> x >> y;
  x--; y--;
  g[x].push_back(y);
  g[y].push_back(x);
}
int t = dfs(0,n-1);
color[0] = 1;
color[n-1]=2;
reverse(black.begin(),black.end());
for(int i = 0; i < black.size(); i++) {
  if(i<(t+1)/2) {
    color[black[i]] = 1;
    //cout << "-> " << black[i] << endl;
  } else color[black[i]] = 2;
}
dfsc(0);
int x,y;
x = y = 0;
for(int i = 0; i < n; i++) {
//cout << "- " << color[i] << endl;
if(color[i]==1) x++; else y++;
}
//cout << x << " " << y << endl;
if(x<=y) cout << "Snuke" << endl;
else cout << "Fennec" << endl;
return 0;
}

Measured memory_bytes: 12920
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const lint INF = 1LL << 60;

int main() {
    int n;
    cin >> n;
    vec a(n);
    rep(i, n) cin >> a[i];

    lint l = 0;
    lint r = accumulate(all(a), 0LL);
    lint mi = INF;

    rep(i, n-1) {
        l += a[i];
        r -= a[i];
        mi = min(mi, abs(l-r));
    }

    cout << mi << endl;
    return 0;
}

Measured memory_bytes: 4028
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        v: [usize1; n]
    }
    let mut count = vec![0; n];
    for &x in &v {
        count[x] += 1;
    }
    let mut pair = vec![0; n];
    for i in 0..n {
        if count[i] != 0 {
            pair[i] = count[i] * (count[i] - 1) / 2;
        }
    }
    let tot: usize = pair.iter().cloned().sum();
    for i in 0..n {
        println!("{}", tot + 1 - count[v[i]]);
    }
}


Measured memory_bytes: 12796
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class AtCoderA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();

            out.println(a * b - (a + b - 1));
        }

    }
}



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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i=0;i<n;i++){
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int alice = 0;
  int bob = 0;
  for (int i=0;i<n;i++){
    if (i%2==0){
      alice += a.at(i);
    }else{
      bob += a.at(i);
    }
  }
  cout << alice - bob << endl;
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
long long fac(ll a){
    long long ans=1;
    while(a>1){
        ans*=a;
        ans%=1000000007;
        a--;
    }
    return ans;
}
int main(){
    int n;
    cin >> n;
    vector<vector<pair<int,int>>> v(n);
    rep(i,n){
        int a;cin >> a;
        rep(j,a){
            int b,c;
            cin >> b >> c;
            pair<int,int> p =mp(b-1,c);
            v[i].push_back(p);
        }
    }
    int ans=0;
    for(int bit=0;bit<(1<<n);bit++){
        int a=0;
        rep(i,n){
            if((1<<i)&bit){
                rep(j,v[i].size()){
                    int c = (bit&(1<<v[i][j].fi));
                    if(c!=0&&v[i][j].se==0)a=1;
                    if(c==0&&v[i][j].se==1)a=1;
                }
            }
        }
        if(a==0){
            int b = __builtin_popcount(bit);
            ans = max(ans,b);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define int long long

using namespace std;

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

const int N = 200000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 25;

int a, v, b, w, T;

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> a >> v >> b >> w >> T;
	if (a < b){
		a += T * v;
		b += T * w;
		if (a >= b) return cout << "YES", 0;
		else return cout << "NO", 0;
	}
	a -= T * v;
	b -= T * w;
	if (a <= b) return cout << "YES", 0;
	cout << "NO";











	return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<stdlib.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<string.h>
#include<map>
#include<set>
//#include <boost/multiprecision/cpp_int.hpp>

//namespace mp = boost::multiprecision;

using namespace std;
int main() {
	int p1 = 0; int p2=0, p3=0, p4=0;
	for (int i = 0; i < 6; i++) {
		int a;
		cin >> a;
		if (a == 1) {
			p1++;
		}
		else if (a == 2) {
			p2++;
		}
		else if(a==3) {
			p3++;
		}
		else {
			p4++;
		}
	}
	int ans1=0, ans2 = 0;
	if (p1 == 1) {
		ans1++;
	}
	 if (p2 == 1) {
		ans1++;
	}
   if (p3 == 1) {
		ans1++;
	}
	 if (p4 == 1) {
		ans1++;
	}
	if (p1 == 2) {
		ans2++;
	}
	if (p2 == 2) {
		ans2++;
	}
	if (p3 == 2) {
		ans2++;
	}
	if (p4 == 2) {
		ans2++;
	}
	if (ans1 == 2 && ans2 == 2) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}


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

#define FOR(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'

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

  while(true) {
    int n, m;
    int s1[110];
    int s2[110];
    int sumS1 = 0;
    int sumS2 = 0;
    int min = 999999999;
    int hozi = -1, hozj = -1, hozsum1, hozsum2;
    cin >> n >> m;
    if(n + m == 0) break;

    rep(i, n) {
      cin >> s1[i];
      sumS1 += s1[i];
    }
    hozsum1 = sumS1;
    rep(i, m) {
      cin >> s2[i];
      sumS2 += s2[i];
    }
    hozsum2 = sumS2;

    rep(i, n) {
      rep(j, m) {
        sumS1 -= s1[i];
        sumS1 += s2[j];

        sumS2 -= s2[j];
        sumS2 += s1[i];

        if(sumS1 == sumS2) {
          if(s1[i] + s2[j] < min) {
            min = s1[i] + s2[j];
            hozi = i;
            hozj = j;
          }
        } else {
          sumS1 = hozsum1;
          sumS2 = hozsum2;
        }
      }
    }
    if(hozi + hozj == -2) {
      cout << hozi << endl;
    } else {
      cout << s1[hozi] << " " << s2[hozj] << endl;
    }
    hozi = -1;
    hozj = -1;
  }
}



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

int main()
{
  int A, B, C;
  cin >> A >> B >> C;
  int ans = max(10 * A + B + C, 10 * B + C + A);
  ans = max(ans, 10 * C + A + B);

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import itertools

N, M = map(int, input().split())
lights = []
for i in range(M):
    lights.append([int(x) for x in input().split()])
p = [int(x) for x in input().split()]

ans = 0
switches = 0b1111111111 >> (10 - N)
for _ in range(0, switches + 1):
    flag = True
    for i in range(M):
        s = 0
        for j in range(1, lights[i][0] + 1):
            s += (_ & (0b1 << (lights[i][j] - 1))) >> (lights[i][j] - 1)
        if s % 2 != p[i]:
            flag = False
    if flag:
        ans += 1

print(ans)


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

using namespace std;

#ifndef ONLINE_JUDGE
  #define pr_debug(...) do { printf("DEBUG: line %d: %s: ", __LINE__, __PRETTY_FUNCTION__); printf(__VA_ARGS__); } while(0)
  #define pr_vars(...) do { pr_debug(" "); pr_var(split(#__VA_ARGS__, ',').begin(), __VA_ARGS__); } while(0)
#else
  __attribute__ ((constructor)) static void fast_cin() { ios_base::sync_with_stdio(false); cin.tie(0); }
  #define pr_debug(...) do { } while(0)
  #define pr_vars(...) do { } while(0)
#endif /* ONLINE_JUDGE */

using ll = int64_t;
using ull = uint64_t;

template<typename T> ostream &operator<< (ostream &fout, const vector<T> &vec)
{ for (const auto &el : vec) fout << el << ' '; return fout; }

template<typename T> istream &operator>> (istream &fin, vector<T> &vec)
{ for (size_t i = 0; i < vec.size(); i++) fin >> vec[i]; return fin; }

vector<string> split(const string &s, char c) { vector<string> v; ull st = 0, fn = 0, lvl = 0;
for ( ; fn < s.size(); fn++ ) { if (s[fn] == c && lvl == 0) { v.push_back(s.substr(st, fn - st)); st = fn + 1; }
if (s[fn] == '(') { lvl++; } if (s[fn] == ')') { lvl--; } } v.push_back(s.substr(st, fn - st)); return v; }

void pr_var(vector<string>::iterator it) { (void) it; cout << endl; }
template<typename T, typename... Args> void pr_var(vector<string>::iterator it, T a, Args... args)
{ cout << *it << "=" << a << "  "; pr_var(++it, args...); }

ll div_ceil(ll n, ll d) { ll res = n / d; if (res >= 0) res += n % d ? 1 : 0; return res; }
ll gcd(ll a, ll b) { a = llabs(a); b = llabs(b); while (a && b) a > b ? a %= b : b %= a; return a + b; }
ll lcm(ll a, ll b) { ll c = gcd(a, b); return c == 0 ? 0 : llabs(a / c * b); }

#define setp(a) fixed << setprecision(a)
const double PI = acos(-1.0);
constexpr double EPS = 1e-9;
constexpr double INF = 2e18;

using mp = pair<ll, ll>;
using mt = tuple<ll, ll, ll>;    // unpack: tie(ll, ll, ll) = mt;

constexpr ll MAX = 1e5 + 5;

const int mod = 1e9 + 7;

int main()
{
    ll n; cin >> n;
    vector<ll> c(n - 1), s(n - 1), f(n - 1);
    for (ll i = 0; i < n - 1; i++)
        cin >> c[i] >> s[i] >> f[i];

    for (ll i = 0; i < n - 1; i++) {
        ll res = 0;
        for (ll j = i; j < n - 1; j++) {
            if (res < s[j]) { res = s[j]; }
            else {
                ll t = res;
                t -= s[j];
                t %= f[j];
                if (t)
                    res += f[j] - t;
            }
            res += c[j];
        }
        cout << res << '\n';
    }
    cout << 0 << endl;

    return 0;
}


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

using namespace std;

typedef long long ll;

#define db(m)  cout<<#m<<" = "<<m<<"\n"

void bang(){

    ll a, b, c, d;
    cin>>a>>b>>c>>d;
    cout<<max({a*c, a*d, b*c, b*d})<<"\n";
    
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    // int q; cin>>q;
    // while(q--)
        bang();

    return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>
#include <math.h>

int main(void)
{
	int number;   // 標準入力からの 4 桁の整数を格納
  	int each[4];  // 各桁の数字を保存
  	int i;
  
  	scanf("%d", &number);  // 4 桁の整数を取得
  	for( i=3; i>-1; i-- ){
    	each[i] = number/pow(10, i);
      	number = number - pow(10, i)*each[i];
    }
  
  	for( i=0; i<3; i++ ){
       	if( each[i]==each[i+1] ){
			printf("Bad\n");
           	return 0;
          }
    }
  	
  	printf("Good\n");
  
  	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<cmath>
#include<iomanip>
using namespace std;

int main()
{
	long double PI = 3.14159265359;
	long double   A, B, H, M;
	cin >> A >> B >> H >> M;

	long double  h[2];
	long double  m[2];
	
	long double  omega_h, omega_m;
	
	omega_h = PI/6;
	omega_m = PI/30;

	
	h[0] = A*cos(PI/2 -omega_h * (H + M/60));
	h[1] = A*sin(PI/2 -omega_h * (H + M/60));
	m[0] = B*cos(PI/2 -omega_m * M);
	m[1] = B*sin(PI/2 -omega_m * M);

	
	long double  distance = (h[0] - m[0]) * (h[0] - m[0]) + (h[1] - m[1]) *(h[1] - m[1]);
	long double answer = sqrtl(distance);
	cout << setprecision(12) << answer << endl;
	
	return 0;
	

}

Measured memory_bytes: 4168
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
typedef long long ll;
typedef priority_queue<int> PQI;
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30);
const int INF = (1LL << 60);
const double EPS = (1 >> 30);

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;}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int a,b,c;
    cin>>a>>b>>c;
    if(a<b&&b<c){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    
}


Measured memory_bytes: 3132
#include<iostream>
using namespace std;
int main(){
 int a , b , c ,t;
 cin >> a >> b >> c;
 if(a > b){
   t = a;
   a = b;
   b = t;
 }
 if (b > c){
   t = b;
   b = c;
   c = t;
 }
 if(a > b){
   t = a;
   a = b;
   b = t;
 }
 cout << a << " " << b << " " << c << endl;
 

  return 0;
}


Measured memory_bytes: 3092
#include<bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a),_b=(b);i<=_b;i=i+1)
#define FORD(i,b,a) for (int i=(b),_a=(a);i>=_a;i=i-1)
#define REP(i,n) for (int i=0,_n=(n);i<_n;i=i+1)
#define FORE(i,v) for (__typeof((v).begin()) i=(v).begin();i!=(v).end();i++)
#define ALL(v) (v).begin(),(v).end()
#define fi   first
#define se   second
#define MASK(i) (1LL<<(i))
#define BIT(x,i) (((x)>>(i))&1)
#define div   ___div
#define next   ___next
#define prev   ___prev
#define left   ___left
#define right   ___right
#define __builtin_popcount __builtin_popcountll
using namespace std;
template<class X,class Y>
    void minimize(X &x,const Y &y) {
        if (x>y) x=y;
    }
template<class X,class Y>
    void maximize(X &x,const Y &y) {
        if (x<y) x=y;
    }
template<class T>
    T Abs(const T &x) {
        return (x<0?-x:x);
    }

/* Author: Van Hanh Pham */

/** END OF TEMPLATE - ACTUAL SOLUTION COMES HERE **/

struct Query {
    int node, dist, color;

    Query() {
        node = dist = color = 0;
    }

    void input(void) {
        scanf("%d%d%d", &node, &dist, &color);
    }
};

#define MAX   100100
#define MAX_DIST  15

int numNode, numEdge, numQuery;
vector<int> adj[MAX];
bool vst[MAX][MAX_DIST];
Query queries[MAX];
int res[MAX];

void loadGraph(void) {
    scanf("%d%d", &numNode, &numEdge);
    REP(love, numEdge) {
        int u, v; scanf("%d%d", &u, &v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    scanf("%d", &numQuery);
    FOR(i, 1, numQuery) queries[i].input();
}

void bfs(int node, int dist, int color) {
    if (vst[node][dist]) return;

    queue<pair<int, int> > q;
    vst[node][dist] = true;
    if (res[node] == 0) res[node] = color;
    if (dist > 0) q.push(make_pair(node, dist));

    while (!q.empty()) {
        int u = q.front().fi;
        int d = q.front().se;
        q.pop();

        FORE(it, adj[u]) if (!vst[*it][d - 1]) {
            vst[*it][d - 1] = true;
            if (res[*it] == 0) res[*it] = color;
            if (d > 1) q.push(make_pair(*it, d - 1));
        }
    }
}

void process(void) {
    FORD(i, numQuery, 1) bfs(queries[i].node, queries[i].dist, queries[i].color);
    FOR(i, 1, numNode) printf("%d\n", res[i]);
}

int main(void) {
    loadGraph();
    process();
    return 0;
}

/*** LOOK AT MY CODE. MY CODE IS AMAZING :D ***/


Measured memory_bytes: 10024
A, B, H, M = map(int, input().split())
import math

short_arrow = 360 / 12
long_arrow = 360 / 60

tmp = abs(short_arrow * H + short_arrow * (M / 60) - long_arrow * M)
kakudo = min(abs(360 - tmp), tmp)

tmp = B * B + A * A - 2 * B * A * math.cos(math.radians(kakudo))
ans = (tmp ** (1/2))
print(ans)

Measured memory_bytes: 62368
#include<iostream> 
#include<string> 
#include<vector> 
#include<algorithm> 
#include<cmath>
#include<set>
#include<utility>

using namespace std;


int main()
{
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	
	for (int i = 0; i < k; i++)
	{
		int aa = a * 2 + b + c;
		int bb = a + b * 2 + c;
		int cc = a + b + c * 2;
		int x = max(aa, bb);
		int y = max(x, cc);
		if (y == aa)
		{
			a *= 2;
		}
		else if (y == bb)
		{
			b *= 2;
		}
		else
		{
			c *= 2;
		}
		if (i == k - 1)
		{
			cout << y << endl;
			return 0;
		}
	}
	

}

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

using Lint=long long;

Lint func(Lint N)
{
   if(N<=1) return 0;
   if(N%2==1){
      return 0;
   }else{
      Lint M=N;
      Lint cnt2=0,cnt5=0;
      while(M/2>0){
         cnt2+=M/2; M/=2;
      }
      M=N;
      while(M/5>0){
         cnt5+=M/5/2;
         M/=5;
      }
      return min(cnt2,cnt5);
   }
}
int main()
{
   Lint N; cin>>N;
   cout<<func(N)<<endl;
   return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <list>
using namespace std;
 
int main() {
  int num_query; scanf("%d", &num_query);
  list<int> nums;
  list<int>::iterator it = nums.end();
   
  while (num_query--) {
    int command; scanf("%d", &command);
     
    switch (command) {
      case 0:
        int x; scanf("%d", &x);
        it = nums.insert(it, x);
        break;
      case 1:
        int d; scanf("%d", &d);
        if (d > 0) while(d--) it++;
        else while(d++) it--;
        break;
      case 2:
        it = nums.erase(it);
        break;
    }
  }
  
  for (it = nums.begin(); it != nums.end(); it++) printf("%d\n", *it);
}


Measured memory_bytes: 18296
eval"N,C,*H="+`dd`.split*?,;
*d=0;*q=0;
g=->i{1.0*(d[q[i-1]]-d[q[i]])/(H[q[i]]-H[q[i-1]])-H[q[i-1]]-H[q[i]]}
1.upto(N-1){|i|
	q.shift while q.size>1&&g[1]>-2*H[i];
	d<<d[q[0]]+(H[q[0]]-H[i])**2+C;
	q<<i
	q.delete_at(-2)while q.size>2&&g[-1]>g[-2];
}
p d[-1]

Measured memory_bytes: 41292
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
for z in range(-100, 101):
    if X < z and z <= Y and x[N - 1] < z and z <= y[0]:
        print("No War")
        exit()
print("War")

Measured memory_bytes: 3064
using System;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int a = sc.NextInt();
        int b = sc.NextInt();
        int c = sc.NextInt();
        if (a < c && c < b)
        {
            Console.WriteLine("Yes");
        }
        else if (b < c && c < a)
        {
            Console.WriteLine("Yes");
        }
        else
        {
            Console.WriteLine("No");
        }
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 13140