akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, m, x;
  cin >> n >> m >> x;
  int INF = 1010101010;
  int res = INF;

  vector<int> c(n);
  vector<vector<int>> a(n, vector<int>(m));

  for (int i = 0; i < n; i++) {
    cin >> c[i];
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }

  for (int bit = 0; bit < (1 << n); ++bit) {
    int total = 0;
    vector<int> p(m);
    for (int i = 0; i < n; ++i) {
      if (bit & (1 << i)) {
        for (int j = 0; j < m; j++) {
          p[j] += a[i][j];
        }
        total += c[i];
      }
    }
    bool ok = true;
    for (int i = 0; i < m; i++) {
      if (p[i] < x) ok = false;
    }
    if (ok) res = min(res, total);
  }
  if (res == INF)
    cout << -1 << endl;
  else
    cout << res << endl;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vp;
string s;
int main(int argc,char const* argv[])
{
  cin >> s;
  int year;
  int month;
  year=int(s[0]-'0')*10+int(s[1]-'0');
  month=int(s[2]-'0')*10+int(s[3]-'0');
  if((month==0 && year>12) || (month==0 && year==0) || (month>12 && year>12)|| (month>12 && year==0))
    {
      cout << "NA" << endl;
    }
  else if(month>12 || month==0)
    {
      cout << "MMYY" << endl;
    }
  else if(year>12 || year==0)
    {
      cout << "YYMM" << endl;
    }
  else
    {
      cout << "AMBIGUOUS" << endl;
    }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//datatypes
	#define int long long
	#define vi vector<int>
	#define si set<int>
	#define vii vector<ii>
	#define ii pair<int,int>
	#define mii map<int,int>
	#define M 1000000007
	#define pi 3.141592653589793
	#define in(x) int x; cin>>x;
	#define sz(x) (int)x.size()
	#define fr first
	#define sc second
	#define pb push_back
	#define mkp make_pair
	#define inputFile \
	    freopen("input.txt", "r", stdin); 
	#define outputFile \
	    freopen("output.txt", "w", stdout)
	#define rep(i,a,b) for(int i=a; i<b; i++)
	#define trav(a) for(auto &x:a)
	#define test cout<<"hello\n";
	#define all(x) (x).begin(),(x).end()
	#define mem0(x) memset(x, 0, sizeof(x))
	#define mem1(x) memset(x, -1, sizeof(x))
	#define sa(x) std::sort(all(x))
	#define sd(x) std::sort(all(x),greater<int>())

signed solve()
{
	int n; cin>>n;
	double p[n+1], dp[n+1][n+1], ans=0;
	rep(i,1,n+1)cin>>p[i];
	dp[1][0]=1-p[1], dp[1][1]=p[1];
	rep(i,2,n+1) rep(j,0,n+1) dp[i][j] = p[i]*dp[i-1][j-1] + (1-p[i])*dp[i-1][j];
	rep(i, n/2+1, n+1) ans+=dp[n][i];
	cout<<fixed<<setprecision(9)<<ans;
	return 0;
}

signed main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--) solve();
	//cout << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}

Measured memory_bytes: 70528
#include<iostream>
#include<stdio.h>

using namespace std;


struct data{
	int num;
	double weight,height;
};

int main(){

	int num;
	double weight,height,bmi;
	
	while(scanf("%d,%lf,%lf",&num,&weight,&height)!=EOF){
		
		bmi=weight/(height*height);
		
		if(bmi>=25.0){
			cout<<num<<endl;
		}
	}

}

Measured memory_bytes: 1232
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);

  for (int i = 0; i < N; i++) {
    cin >> A[i];
    A[i] -= i + 1;
  }
  sort(begin(A), end(A));
  auto ans = accumulate(begin(A), end(A), 0ll, [&](long long x, int y) {
    return x + abs(y - A[(N - 1) / 2]);
  });
  cout << ans << endl;
}


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

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  int d[102],o=0;
  for(int i=0;i<n;i++){
    cin>>d[i];
  }
  sort(d,d+n);
  for(int i=1;i<n;i++){
    if(d[i]==d[i-1]){
      o++;
    }
  }
  cout<<n-o<<"\n";
  return 0;
}

Measured memory_bytes: 3588
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;


int main() {
	int N;
	int d[50];

	cin >> N;

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

	int ans = 0;

	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			ans = ans + d[i] * d[j];

		}
	}

	cout << ans;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

ll dp[105][100005];

int main(){
	int n; ll wmax;
	cin >> n >> wmax;
	vector<ll> v(n);
	vector<ll> w(n);
	for( int i = 0; i < n; ++i ) cin >> w[i] >> v[i];
	ll vsm = accumulate( v.begin(), v.end(), 0ll );
	for( int i = 0; i <= n; ++i ){
		dp[i][0] = 0;
		for( int j = 1; j <= vsm; ++j ){
			dp[i][j] = INF;
		}
	}
	
	for( int i = 0; i < n; ++i ){
		for( int j = 0; j <= vsm; ++j ){
			dp[i+1][j] = dp[i][j];
			if( j >= v[i] && dp[i][j-v[i]] + w[i] <= wmax ){
				dp[i+1][j] = min(dp[i][j], dp[i][j-v[i]] + w[i]);
			}
		}
	}
	ll ans = 0;
	for( ll j = vsm; j >= 0; --j ){
		if( dp[n][j] <= wmax ){
			ans = j;
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 80128
#include <stdio.h>

main() {
  
  int r, tmp;
  int x, y; //これらの最大公約数を求める

  scanf(" %d %d", &x, &y);

  if( x < y) {
    tmp = x;
    x = y;
    y = tmp;
  }

  while( y > 0) {
    r = x % y;
    x = y;
    y = r;
  }

  printf("%d\n", x);

  return 0;

}

Measured memory_bytes: 592
#include <stdio.h>
#include <string.h>

void swap(char a[2],char b[2]){
  char c[2];
  for(int i=0;i<2;i++){
    c[i]=a[i];
    a[i]=b[i];
    b[i]=c[i];
  }
}

void BubbleSort(char C[36][2],int N){
  int i,j;
  for(i=0;i<N;i++){
    for(j=N-1;j>i;j--){
      if(C[j][1]<C[j-1][1]){
	swap(C[j],C[j-1]);
      }
    }
  }
}

void SelectionSort(char C[36][2],int N){
  int i,j,minj;
  for(i=0;i<N;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(C[j][1]<C[minj][1]){
	minj=j;
      }
    }
    swap(C[i],C[minj]);
  }
}

int isStable(char C[36][2],char sorted[36][2],int N){
  int i,j;
  for(i=0;i<N;i++){
    if(sorted[i][1]==sorted[i+1][1]){
      if(sorted[i][1]!=sorted[i-1][1]) j=0;
      else j++;
      for(;j<N;j++){
	if(sorted[i][1]==C[j][1]){
	  if(sorted[i][0]==C[j][0]){
	    break;
	  }
	  else if(sorted[i][0]!=C[j][0]){
	    return 1;
	  }
	}
      }
    }
  }
  return 0;
}

int main(void){
  int n,i,j;
  char c[36][2],bu[36][2],se[36][2];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",c[i]);
    strcpy(bu[i],c[i]);
    strcpy(se[i],bu[i]);
  }
  BubbleSort(bu,n);
  SelectionSort(se,n);
  for(j=0;j<2;j++){
    for(i=0;i<n;i++){
      if(j==0){
	printf("%.2s",bu[i]);
      }
      else if(j==1){
	printf("%.2s",se[i]);
      }
      if(i<n-1) printf(" ");
      else printf("\n");
    }
    if((j==0 && isStable(c,bu,n)==0) || (j==1 && isStable(c,se,n)==0)){
      puts("Stable");
    }
    else puts("Not stable");
  }
  return 0;
}



Measured memory_bytes: 2868
a=list(input())
count=0
kekka=[]
for i in range(len(a)):
    if a[i]=="A" or a[i]=="T" or a[i]=="C" or a[i]=="G":
        count+=1
    else:
        count=0
    kekka.append(count)
        
print(max(kekka))

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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    bool check = 0;
    int s = 0;
    for (int i = 0; i < 10000; i++){
        s += a;
        if (s%b == c) check = 1;
        if (check == 1) break;
    }
    if (check == 1) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

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

int main() {
    long long n, m;
    cin >> n >> m;
    if(n >= 2 && m >= 2) {
        cout << (n - 2) * (m - 2);
    } else if(n == 1 && m == 1) {
        cout << 1;
    } else {
        cout << max(n, m) - 2;
    }
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	int X, A;
	cin >> X >> A;
	if (X >= A) cout << 10 << endl;
	else cout << 0 << endl;
}


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

        long res = fact(N);

        System.out.println(res);
    }

    public static long fact(long N){
        if(N==1) return 1;
        else {
            long r = (N * fact(N-1)) % ((long)Math.pow(10,9)+7);
            return r ;
        }
    }
}

Measured memory_bytes: 44292
package main

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

////////////////////////////////////////
///        templates                 ///
////////////////////////////////////////

var sc = bufio.NewScanner(os.Stdin)

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

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readBigLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func strSprit(str string) []string {
	cols := strings.Split(str, " ")
	return cols
}

func parseInt(str string) int64 {
	n, _ := strconv.ParseInt(str, 10, 64)
	return int64(n)
}

func intSprit(str string) []int {
	strs := strSprit(str)
	cols := make([]int, len(strs))
	for i, v := range strs {
		cols[i] = int(parseInt(v))
	}
	return cols
}

type SortSlice []int

func (s SortSlice) Len() int {
	return len(s)
}

func (s SortSlice) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

func (s SortSlice) Less(i, j int) bool {
	return s[i] < s[j]
}

func reverseString(str string) string {
	buf := []rune(str)
	for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 {
		buf[i], buf[j] = buf[j], buf[i]
	}
	return string(buf)
}

////////////////////////////////////////
///        end templates             ///
////////////////////////////////////////

func main() {
	line := nextLine()

	loopCount := uint(len(line) - 1)
	sum := int64(0)
	for bit := 0; bit < (1 << loopCount); bit++ {
		tmpsum := int64(0)
		cutindex := 0
		for i := 0; i < int(loopCount); i++ {
			if 1&(bit>>uint(i)) == 1 {
				tmpsum += parseInt(line[cutindex : i+1])
				cutindex = i + 1
			}
		}
		tmpsum += parseInt(line[cutindex:])
		sum += tmpsum
	}
	fmt.Println(sum)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
/*
#ifndef ONLINE_JUDGE
    #define cin f
    #define cout g
    ifstream cin("a.in");
    ofstream cout("a.out");
#endif
*/
int n,k=2,v[1<<17],dp[1<<17];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n>>k;
    for(int i=1;i<=n;++i) cin>>v[i];
    for(int i=2;i<=n;++i)
    {
        int ans=1e9;
        for(int j=max(i-k,1);j<i;++j) ans=min(ans,dp[j]+abs(v[i]-v[j]));
        dp[i]=ans;
    }
    cout<<dp[n];
    return 0;
}


Measured memory_bytes: 1024
from heapq import heappush, heappop

# 入力
N = int(input())
a, b, c = (
    zip(*(map(int, input().split()) for _ in range(N - 1))) if N else
    ((), ())
)
Q, K = map(int, input().split())
x, y = (
    zip(*(map(int, input().split()) for _ in range(Q))) if Q else
    ((), ())
)

# K から各頂点への最短距離を求める。
INF = 10**18

G = [{} for _ in range(N + 1)]
for u, v, w in zip(a, b, c):
    G[u][v] = w
    G[v][u] = w


def dijkstra(G, s):
    dp = [INF for _ in range(len(G))]
    q = []
    heappush(q, (0, s))
    while q:
        c, i = heappop(q)
        if dp[i] == INF:
            dp[i] = c
            for j, w in G[i].items():
                heappush(q, (c + w, j))
    return dp


dp = dijkstra(G, K)

# j 番目のクエリの解は dp[x_j] + dp[y_j] である
ans = '\n'.join(
    str(dp[i] + dp[j])
    for i, j in zip(x, y)
)

# 出力
print(ans)


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

int main(void){
  int N,M,C;
  cin >> N >> M >> C;
  vector<int> B(M);
  for(int i=0;i<M;i++){
    int b;
    cin >> b;
    B.at(i)= b;
  }
  int Ans=0;
  
  for(int i=0;i<N;i++){
    int code=C;
    for(int j=0;j<M;j++){
      int a;
      cin >> a;
      code+= a*B.at(j);
    }
    if(code>0) Ans++;
  }
  cout << Ans << endl;
}
  
  
  
  

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

int n, m, d;
string s = "RYGB";

int main()
{
    cin >> n >> m >> d;
    for(int i = 1; i <= n; ++i){
        for(int j = 1; j <= m; ++j){
            int x = i+j+m, y = i-j+m;
            putchar(s[((x/d)&1)*2 + ((y/d)&1)]);
        }
        putchar('\n');
    }

    return 0;
}

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

int main(){
    vector<int>vec(5, 0);
    for(int i = 0; i < 3; i++){
        int a, b;
        cin >> a >> b;
        vec[a]++;
        vec[b]++;
    }
    sort(vec.begin(), vec.end());
    if(vec[1]==1 && vec[2]==1 && vec[3]==2 && vec[4]==2){
        cout << "YES"<<endl;
    }
    else cout << "NO" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <array>
#include <queue>
#include <map>
#include <stack>
typedef long long int llint;

int main(void){
  std::string s;
  std::cin >> s;
  int count = 0;
  for(int i=0; i<s.size()/2; i++){
    if(s[i]!=s[s.size()-i-1]) count++;
  }

  std::cout << count << std::endl;
  return 0;
}


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

int main() {
  int D;
  cin >> D;
  if (D == 25)
    cout << "Christmas" << endl;
  else if (D == 24)
    cout << "Christmas Eve" << endl;
  else if (D == 23)
    cout << "Christmas Eve Eve" << endl;
  else
    cout << "Christmas Eve Eve Eve" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#define INF 200000
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define MAX 100
int n;
int color[MAX];
int M[MAX][MAX];
int d[MAX];
int p[MAX];
void Dij(){
        int u,Minv;
        int i,v;
        int sum=0;
        for(i=0; i<n; i++) {
                color[i]=WHITE;
                d[i]=INF;
                p[i]=-1;

        }
        d[0]=0;
        while(1) {
                Minv=INF;
                for(i=0; i<n; i++) {
                        if(color[i]!=BLACK && d[i]<Minv) {
                                Minv = d[i];
                                u=i;
                        }
                }
                if (Minv == INF) {
                        break;
                }
                color[u]=BLACK;
                for(v=0; v<n; v++) {
                        if(color[v]!=BLACK && M[u][v]!=INF) {
                                if(d[u]+M[u][v]<d[v]) {
                                        d[v]=d[u]+M[u][v];
                                        p[v]=u;
                                        color[v]=GRAY;
                                }
                        }
                }

        }
        for(i=0;i<n;i++){
          printf("%d %d\n",i,d[i]);
        }

}
int main(){
        int i,j;
        int k,c,u,v;
        scanf ("%d",&n);
        for(i=0; i<n; i++) {
                for(j=0; j<n; j++) {
                        M[i][j]=INF;
                }
        }

        for(i=0; i<n; i++) {
                scanf("%d%d",&u,&k);
                for(j=0; j<k; j++) {
                        scanf("%d%d",&v,&c);
                        M[u][v]=c;
                }
        }
        Dij();
        return 0;
}

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

using ll = long long;
using namespace std;
constexpr ll inf = 1e15;
constexpr ll mod = 1e9+7;

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

    int N;
    cin>>N;
    map<int, int> reds, blues;
    for (int n = 0; n < N; n++) {
        int A, B;
        cin>>A>>B;
        reds[A] = B;
    }
    for (int n = 0; n < N; n++) {
        int C, D;
        cin>>C>>D;
        blues[C] = D;
    }

    int count = 0;
    for (auto CD : blues) {
        auto it = reds.lower_bound(CD.first);
        if (it == end(reds)) it--;
        if (CD.first <= it->first) {
            if (it == begin(reds)) continue;
            else it--;
        }

        auto mx = end(reds);
        while (1) {
            if (it->second < CD.second) {
                if (mx == end(reds)) mx = it;
                else if (mx->second < it->second) mx = it;
            }
            if (it == begin(reds)) break;
            it--;
        }
        if (mx == end(reds)) continue;
        reds.erase(mx);
        count++;
        if (reds.size() == 0) break;
    }

    cout<<count<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  int b;
  cin >> a;
  cin >> b;
  
  if (a*b%2 == 1){
    cout << "Odd" << endl; // 2
  }else{
    cout << "Even" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
typedef pair<ll, ll> P;
const ll INF = 1LL << 60;
//const int MOD = 1000000007;
const ll MOD=998244353;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

struct mint {
  long long x; // typedef long long ll;
  mint(long long x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime MOD
  mint inv() const { return pow(MOD-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

mint dp[202020];
mint dprui[202020];
int main(){
  ll n,k;
  cin>>n>>k;
  vector<pair<int,int>>h(k);
  rep(i,k){
    int l,r;
    cin>>h[i].first>>h[i].second;
  }
  dp[1]=1;
  dprui[1]=1;
  for(int i=2;i<=n;i++){
    rep(j,k){
      int li=i-h[j].second;
      int ri=i-h[j].first;
      if(ri<0)continue;
      li=max(li,1);
      dp[i]+=dprui[ri]-dprui[li-1];
    }
    dprui[i]=dprui[i-1]+dp[i];
  }
  cout<<dp[n]<<endl;
  return 0;
}

Measured memory_bytes: 6756
/*
Author - Glitched
Yeet!!
*/
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define loop(i,x,n) for(ll i = x;i<n;i++)

int main()
{
    ll k,ans = 0;
    cin>>k;
    loop(a,1,k+1){
        loop(b,1,k+1){
            loop(c,1,k+1){
                ans+= __gcd(a,__gcd(b,c));
            }
        }
    }
    cout<<ans;
}

Measured memory_bytes: 3600
while True:
    n, w = map(int, input().split())
    if n is 0 and w is 0:
        break

    l = [int(input()) for i in range(n)]

    max_num = 0
    for i in  range(n):
        max_num = max(max_num, l[i])
    hist_size = int((max_num/w) + 1)
    hist = [0.0] * int(hist_size)

    for i in  range(n):
        hist[int(l[i]/w)] += 1

    max_height=  0
    for i in range(hist_size):
        max_height = max(max_height,hist[i])

    ans = 0.0
    for i in range(hist_size-1):
        ans += hist[i]/max_height*(hist_size - 1 - i)/(hist_size-1)

    ans += 0.01
    print(ans)



Measured memory_bytes: 5632
#include<bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin>>s;
  int a=0;
  int b=0;
  for(auto x:s){
    if(x=='1'){
        a++;
    }else{
        b++;
    }
  }
  int ans=min(a,b);
  cout<<ans*2<<endl;
  return 0;
}


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

using namespace std;

int main()
{
  long N;
  cin >> N;
  long S = 0;
  vector <long> a(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    S ^= a[i];
  }
  for (int i = 0; i < N; ++i) {
    if (i < N - 1) {
      cout << (S ^ a[i]) << " ";
    } else {
      cout << (S ^ a[i]) << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 4672
h=Hash.new
loop do
  break unless gets
  k,v=$_.chomp.split
  h.key?(k) ? h[k]<<" "+v : h.store(k,v)
end
h.sort.each do |k,v|
  puts "#{k}\n#{v.split.map(&:to_i).sort.join(" ")}"
end

Measured memory_bytes: 8656
unittest
{
	assert( [ "6 3" ].parse.expand.solve == "9" );
	assert( [ "6 4" ].parse.expand.solve == "error" );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto ab = input.front.split.to!( long[] );
	return tuple( ab[ 0 ], ab[ 1 ] );
}

auto solve( long a, long b )
{
	auto r = a + b;
	return ( r < 10 ) ? r.to!string : "error";
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = System.Console.ReadLine().Trim().Split(' ');
            int iA = int.Parse(sS[0]);
            int iB = int.Parse(sS[1]);

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            List<int> lstInp = new List<int>();
            lstInp.Add(iA + iB);
            lstInp.Add(iA - iB);
            lstInp.Add(iA * iB);
            lstInp.Sort(delegate (int mca1, int mca2) { return mca2 - mca1; });     // 降順

            // 出力
            System.Console.WriteLine("{0}", lstInp[0].ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  string S;
  
  cin >> N >> S;
  S.push_back('#');
  int ans = 0;
  for(int i=0; i+1 < S.size();i++)
  {
    if(S[i] != S[i+1]) ans++;
  }

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

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

#define ll long long
#define debug(x) cout<<":["<<x<<"DE]"<<endl;
#define debug2(x,y) cout<<"["<<x<<" "<<y<<"DE]"<<endl;

using namespace std;

ll father[100005],n,sz[100005],cen1=0,cen2=0,mx=-1,mn=1e18;
vector<ll>adj[100005];

void dfs(int child,int parent)
{
    father[child]=parent,sz[child]=1,mx=0;
    for(int i:adj[child]){
        if(i==parent)continue;
        dfs(i,child);
        sz[child]+=sz[i];
        mx=max(mx,sz[i]);
    }
    mx=max(mx,n-sz[child]);
    if(mx<mn)mn=mx,cen1=child,cen2=0;
    else if(mx==mn)cen2=child;
}
ll nibo;
void dfs2(int child,int parent)
{
    if(adj[child].size()==1){
        nibo=child;return;
    }
    for(int i:adj[child]){
        if(i==parent)continue;
        dfs2(i,child);
    }
}

int main()
{
    ll n;
    cin>>n;
    if(n)cout<<0<<endl;
    else cout<<1<<endl;
}


Measured memory_bytes: 5972
#include<bits/stdc++.h>
using namespace std;
int a[101],n,x=1e6+7;
int main()
{
   
  	cin>>n;
  	for(int i=1;i<=n;i++)
      cin>>a[i],a[i]+=a[i-1];
  	for(int i=0;i<=n;i++)
    {
      x=min(abs(a[n]-2*a[i]),x);
    }
  cout<<x;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep
#define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for
#define rfor(i,a,b) for(int (i) = (b); (i) >= (a); --(i)) //Reversi for
#define ll long long
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int desc(const void *a, const void *b) {
    return *(int *)b - *(int *)a;
}

int main()
{
    int a,b;
    cin >> a >> b;
    if (a + b == 15) {
        cout << "+" << endl;
    }else if (a * b == 15){
        cout << "*" << endl;
    }else{
        cout << "x" << endl;
    }
    return 0;
}


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

char mm[6][6];
char m2[6][6];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  freopen("in", "r", stdin);
  freopen("out", "w", stdout);
#endif

  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) cin >> mm[i][j];

  int ans = 0;
  for (int i = 0; i < (1 << n); ++i) {
    for (int j = 0; j < (1 << m); ++j) {
      for (int q = 0; q < n; ++q) for (int qq = 0; qq < m; ++qq) m2[q][qq] = mm[q][qq];

      for (int q = 0; q < n; ++q) {
        if ((i & (1 << q))) {
          for (int qq = 0; qq < m; ++qq) {
            m2[q][qq] = 'R';
          }
        }
      }
      for (int q = 0; q < m; ++q) {
        if ((j & (1 << q))) {
          for (int qq = 0; qq < n; ++qq) {
            m2[qq][q] = 'R';
          }
        }
      }

      int cnt = 0;
      for (int q = 0; q < n; ++q) for (int qq = 0; qq < m; ++qq) if (m2[q][qq] == '#') ++cnt;
      if (cnt == k) ++ans;
    }
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 3604
#include "bits/stdc++.h"
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int MOD = 1e9+7;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


int A,B,C,N;
int l[8];
int dfs(int curr, int a, int b, int c){
	if(curr == N) {
		if(a*b*c == 0) return 1e9;
		else return abs(A-a)+abs(B-b)+abs(C-c)-30;
	}
	int dfs1 = dfs(curr + 1, a, b, c);
	int dfs2 = dfs(curr + 1, a + l[curr], b, c) + 10;
	int dfs3 = dfs(curr + 1, a, b + l[curr], c) + 10;
	int dfs4 = dfs(curr + 1, a, b, c + l[curr]) + 10;
	return min(min(dfs1, dfs2),min(dfs3, dfs4));
}

int main() {
	cin >> N >> A >> B >> C;
	rep(i, N) cin >> l[i];
	cout << dfs(0, 0, 0, 0);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    cin>>s;
    if (s=="abc"||s=="acb"||s=="bac"||s=="bca"||s=="cab"||s=="cba") {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }
}


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

#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

using namespace std;

const int INF = 1e18 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int w,h;
int d[200][200];
int dy[]={-1,-1,1,0,1,0},dx[]={-1,0,-1,1,0,-1};
int xx[]={0,1,1,1,0,-1};
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int w,h;cin >> w >> h;
    int ans=0;
    rep(i,0,105){
        rep(j,0,105){
            d[i][j]=0;
        }
    }
    rep(i,1,h+1){
        rep(j,1,w+1){
            cin >> d[i][j];
        }
    }
    bool used[105][105];
    rep(i,0,105)rep(j,0,105)used[i][j]=false;
    queue<pii> que;
    que.push(mp(0,0));
    while(!que.empty()){
        pii q=que.front();que.pop();
        int y=q.first;
        int x=q.second;
        if(!used[y][x]){
        used[y][x]=true;
        rep(i,0,6){
            int ddx,ddy;
            if(!(y&1)){
                ddx=x+dx[i];
            }else{
                ddx=x+xx[i];
            }
            ddy=y+dy[i];
            if(ddx>=0&&ddy>=0&&ddx<=(w+2)&&ddy<=(h+2)){
                if(d[ddy][ddx]){
                    //cout << ddy << " " << ddx << endl;
                    ans++;
                }else{
                    que.push(mp(ddy,ddx));
                }
            }
        }
        //cout << x << " " << y << " " << ans << endl;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3392
#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

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

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    double n;
    while(cin>>n){
        if(n<0)break;
        int ans[8]={};
        int ans_[4]={};
        for(int i=7;i>=0;i--){
            if(n>=(1<<i)){
                ans[i]=1;
                n-=(1<<i);
            }
            else ans[i]=0;
        }
        for(int i=1;i<=4;i++){
            if(n>=(double)1/(1<<i)){
                ans_[i-1]=1;

                n-=(double)1/(1<<i);
            }
            else ans_[i-1]=0;
        }
        if(n==0){
            for(int i=7;i>=0;i--){
                cout<<ans[i];
            }
            cout<<".";
            rep(i,4){
                cout<<ans_[i];
            }
            cout<<endl;
        }
        else{
            cout<<"NA"<<endl;
        }
        
    }
    
}

Measured memory_bytes: 1224
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

struct UnionFind {
    vector<int> par;
    
    //要素nで初期化
    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }
    
    //xが属する集合の根を返す
    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    //xとyが同じ集合に属しているかを判定
    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    //xが属する集合とyが属する集合をマージ
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // 計算量が減るよ
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    //xが属する集合のサイズ
    int size(int x) {
        return -par[root(x)];
    }
};

int main(){
	int n,m;cin>>n>>m;
	vector<pair<int,int>> a(m);
	int ans = 0;
	for(int i = 0; i < m; i++) {
		int x,y;cin>>x>>y;
		a[i] = mp(x - 1,y - 1);
	}
	for(int i = 0; i < m; i++) {
		UnionFind uf(n);
		for(int j = 0; j < m; j++) {
			if (i != j){
				uf.merge(a[j].fs,a[j].sc);
			}
		}
		if (uf.size(1) != n){
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int A, B;
    cin >> A >> B;
    if (A <= 8 && B <= 8)
    {
        cout << "Yay!" << endl;
    }
    else
    {
        cout << ":(" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#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 rep(i, a, b) for (__typeof((b)) i = (a); i < (b); i++)
#define nrep(i, a, b) for (__typeof((b)) i = (a); i > (b); i--)
#define all(a) (a).begin(), (a).end()
#define ff first
#define ss second
#define ppi pair<int, int>
#define pppi pair<ppi, int>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define bitcount __builtin_popcount //count no's of ones in a set bit
#define prq priority_queue
#define mp make_pair
#define mem(x, val) memset((x), (val), sizeof(x));
#define sz(x) (int)x.size()
#define M_PI 3.14159265358979323846
#define rootdada                      \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define debug(a)          \
    cerr << #a << ": ";   \
    for (auto i : a)      \
        cerr << i << " "; \
    cerr << '\n';
#define trace(a) cerr << #a << ": " << a << "\n"
#define print(ar, n)            \
    for (int u = 0; u < n; u++) \
    {                           \
        cout << ar[u] << " ";   \
    }                           \
    cout << endl;
#define int long long
#define M 1000000007
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
signed main()
{
    rootdada;
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //  //   freopen("output.txt", "w", stdout);
    //  //  freopen("error.txt", "w", stderr);
    // #endif
    int n;
    cin >> n;
    map<int, int> m;
    int ans = 0;
    for (int i = 1; i * i <= n; i++)
    {
        for (int j = 1; j * j <= n; j++)
        {
            for (int k = 1; k * k <= n; k++)
            {
                m[i * i + j * j + k * k + i * j + j * k + k * i]++;
            }
        }
    }
    for (int l = 1; l <= n; l++)
    {
        cout << m[l] << endl;
    }
}

Measured memory_bytes: 6036
#include<cstdio>
#include<iostream>
using namespace std;
const int CN = 110000;
int read(){int s;scanf("%d",&s);return s;}
int n,m,k,a[CN],line[CN]; int main() {n = read(); m = read(); k = read(); for(int i=1;i<=k;i++) a[i] = read();
int p = 1; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++) {line[j] = p; if(!(--a[p])) p++;}
if(i % 2) for(int j=m;j;j--) printf("%d ",line[j]); else for(int j=1;j<=m;j++) printf("%d ",line[j]);
printf("\n");}}

Measured memory_bytes: 384
import math

N, A, B = map(int, input().split())
v = list(map(int, input().split()))

v.sort()
max_avg = sum(v[-A:]) / A

min_selected = v[- A]
selected = 0
for i in range(len(v) - A, len(v)):
    if v[i] == min_selected:
        selected += 1
    else:
        break
        
not_selected = 0
for i in range(0, len(v) - A):
    if v[i] == min_selected:
        not_selected +=  1
        
case_num = 0
if selected != A:        
    case_num = math.factorial(selected + not_selected) // (math.factorial(selected) * math.factorial(not_selected))
else:
    for i in range(A, min(B, selected + not_selected) + 1):
        case_num += math.factorial(selected + not_selected) // (math.factorial(i) * math.factorial(selected + not_selected - i))
print(max_avg)
print(case_num)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

int findsumofDigits(int n){
        int sum = 0;
        while(n >0){
            sum += n%10;
            n /= 10;
        }
        return sum;
    }

int main()
{
    int n,k,ans;
    cin >> n >> k;
    ans = 0;
    std::vector<int> vec(n);
    
    for(int i = 0; i < n; i++)
    {
        cin >> vec[i];
    }
    
    sort(vec.begin(),vec.end(),greater<int>());

    
    
    for(int i = 0; i < k; i++)
    {
        ans += vec[i];
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 256
dirs = { 'N': (0, 1), 'E': (1, 0), 'S': (0, -1), 'W': (-1, 0)}

while True:
	area = [[False for j in range(21)] for i in range(21)]

	n = int(input())
	if n == 0:
		break
	for i in range(n):
		x, y = map(int, input().split())
		area[x][y] = True

	(x, y) = (10, 10)
	count = 0
	for i in range(int(input())):
		d, l = input().split()
		for j in range(int(l)):
			x += dirs[d][0]
			y += dirs[d][1]
			if area[x][y]:
				area[x][y] = False
				count += 1
	if count == n:
		print("Yes")
	else:
		print("No")

Measured memory_bytes: 7724
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;
int read(){
	int f=1,x=0; char c=getchar();
	while (c>'9' || c<'0') {if (c=='-') f=-1; c=getchar();}
	while (c>='0'&&c<='9') {x=x*10+c-'0'; c=getchar();}
	return f*x;
}
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if((abs(a-c)<=d)||((abs(a-b)<=d)&&abs(b-c)<=d))cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
string s;
long long ans = 0;
void solve(int head, int tail, long long val) {
	if( tail == s.length() ) {
		long long res = 0;
		while(head < tail) {
			res = res*10 + (s[head]-'0');
			head++;
		}
		ans += val + res;
		return;
	}
	solve(head, tail+1, val);
	long long res1 = 0;
	while(head < tail) {
		res1 = res1*10 + (s[head]-'0');
		head++;
	}
	solve(head, tail+1, val + res1);
}
 
int main() {
	cin >> s;
	solve(0, 1, 0);
	cout << ans << endl;
	system("pause");
	return 0;
}

Measured memory_bytes: 504
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = long long;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;
constexpr int MAX_V = 575;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout <<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr << #x << ":" << (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

int V;
vector< int > G[MAX_V];
int match[MAX_V];
bool used[MAX_V];

void add_edge(int from, int to) {
  G[from].push_back(to);
  G[to].push_back(from);
}

bool dfs(int v) {
  used[v] = true;
  
  for (int i = 0; i < (int)G[v].size(); ++i) {
    int to = G[v][i], w = match[to];
    if (w < 0 || (!used[w] && dfs(w))) {
      match[v] = to;
      match[to] = v;
      return true;
    }
  }
  return false;
}

signed main() {
  INIT;

  VAR(int, X, Y, E);
  REP(ei, E) {
    VAR(int, from, to);
    add_edge(from, X + to);
  }
  V = X + Y;

  // 二部グラフの最大マッチング
  auto bipartie_matching = []() {
    int res = 0;
    memset(match, -1, sizeof(match));
    for (int v = 0; v < V; ++v) {
      if (match[v] < 0) {
	memset(used, 0, sizeof(used));
	if (dfs(v) > 0) {
	  res++;
	}
      }
    }
    return res;
  };
  
  OUT(bipartie_matching())BR;

  
  return 0;
}



Measured memory_bytes: 3356
import java.util.Scanner;

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

		int a=sc.nextInt();
		int b=sc.nextInt();

		if((a*b)%2==0) {
			System.out.println("Even");
		}else {
			System.out.println("Odd");
		}
	}
}

Measured memory_bytes: 35660
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;
 
#define MOD 1000000007
#define ll int
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
 
 
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
 
  bool a[8080];
  bool b[8080];
 
  rep(i,8080){
    a[i] = b[i]  = false;
  }
  a[0]= b[0] = true;
 
  
  string str;cin >> str;
  str+='T';
  vector<ll>s;
  ll x,y ; cin >> x >> y;
 
  vector<ll> xx, yy;
 
  ll co=0;
  rep(i,str.size()){
    if(str[i]!='T')co++;
    else {s.pb(co); co=0;}
  }
  
  //そもその入力なしの時
  if(s.size()==0){
    if((x==0)&&(y==0)) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
  }
  
 
  //上下方向と左右方向によって分ける.
  rep(i,s.size()){
    if(i%2==0) xx.pb(s[i]);
    else yy.pb(s[i]);
  }
  
  //初期はxの正に向いてる
  x -= xx[0];
  xx.erase(xx.begin()+0);
 
  //正も負も足せばいいので
  x = abs(x), y = abs(y);
  xx.pb(x); yy.pb(y);
  
  sort(rall(xx));
  sort(rall(yy));
 
 
  ll sumx = 0; rep(i,xx.size()) sumx += xx[i];
  ll sumy = 0; rep(i,yy.size()) sumy += yy[i];
 
  x = 0;
  rep(i,xx.size()){
    for(ll j = x ; j >= 0; j-- ){
      if(a[j]) {
	if((j+xx[i]) > sumx/2+5) continue;//見たいのがど真ん中の点だけなので
	a[j+xx[i]] = true;
      }
    }
    x+= xx[i];
  }
 
  y = 0;
  rep(i,yy.size()){
    for(ll j  = y;  j >= 0; j--){
      if(b[j]){
	if((j+yy[i]) > sumy/2+5) continue;//見たいのがど真ん中の点だけなので
	b[j+yy[i]] = true;
      }
    }
    y+=yy[i];
  }
 
  if(((sumx%2)==0) && ((sumy%2)==0)){
    if(a[sumx/2] && b[sumy/2]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
 
  cout << "No" << endl;
  
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 384
N, M, Q = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]
PQ = [list(map(int, input().split())) for _ in range(Q)]

table = [[0 for _ in range(N + 2)] for _ in range(N + 2)]

for l, r in LR:
	table[l][r] += 1

#for line in table:
#	print(*line)
#print()

for i in range(1, N + 1):
	for j in range(1, N + 1):
		table[i][j] += table[i][j - 1]
for i in range(1, N + 1):
	for j in range(1, N + 1):
		table[i][j] += table[i - 1][j]

#for line in table:
#	print(*line)
#print()

for p, q in PQ:
	#print(table[q][q], table[p - 1][q], table[q][p - 1], table[p - 1][p - 1])
	print(table[q][q] - table[p - 1][q] - table[q][p - 1] + table[p - 1][p - 1])


Measured memory_bytes: 110168
#include "bits/stdc++.h"
using namespace std;
#define INF 1000000000
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(x) (x).begin(), (x).end()  //昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
#define SZ(x) ((int)(x).size)
const long long mod = 1e9+7;
typedef priority_queue<int> PQ;
typedef vector<long long> Vl;
typedef vector<int> VI;  // VI a(n);
typedef vector<string> VS;  
typedef vector<VS> VSS;  
typedef vector<VI> VVI;   // VVI a(n,vector<int>(m)) n * m 
typedef vector<Vl> VVl;
typedef pair<int, int> PII;
typedef vector<pair<int, int> > PS;
typedef long long ll;  //ll とdoubleは違う
// cout << << endl;
// cin >> ;

int main(){
    ll x=0,g=0,n,k,w,l,ans,ptr=0;
    string s,s1,s2;
    cin >> n >> k;
    VI h(n);
    VI dp(n,INF);
    dp[0] = 0;
    rep(i,n){
        cin >> h[i];
	}
    for(int i=0;i<n-1;i++){
        for(int j=0;j<k;j++){
            if(i+j+1 < n)
                dp[i+j+1] = min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1]);
            else break;
        }
    }
    cout << dp[n-1] << endl;
    return 0;
}


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

int main(){
	int N,Q;
	string S;
	cin >> N >> Q;
	cin >> S;
	int code[N];
	int nan=0;
	for(int i=0;i<N-1;i++){
		if(S[i]=='A'&&S[i+1]=='C'){
			nan++;
		}code[i]=nan;
	}code[N-1]=code[N-2];

	for(int i=0;i<Q;i++){
		int l,r;
		cin >> l >> r;
		cout << code[r-2]-code[l-2] << endl;
	}
	
}


Measured memory_bytes: 1408
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>

using namespace std;

int main(void){
    int N, M; cin >> N >> M;
    //std::vector<int> A(N);
    //std::vector<int> B(N);
    vector<pair<int, int>> AB(N);

    int a, b;
    for(int i=0; i<N; i++){
        cin >> a >> b;
        AB[i] = make_pair(a, b);
    }
    sort(AB.begin(), AB.end());

    int i = 0;
    long long ans = 0;
    int rest = M;
    while (rest) {
        long long t = min(AB[i].second, rest);
        rest -= t;
        ans += t * AB[i].first;
        i++;
    }

/*
    int m;
    long long int s;
    s = 0; m = M;
    for(int i=0; i<N; i++){ 
        if(m <= AB[i].second){
            s += m * AB[i].first; break;
        }
        s += AB[i].second * AB[i].first;
        m -= AB[i].second;
    }
*/
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int a[305][305];
bool v[305][305];
long long sum;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	for(int j=1;j<=n;j++)
	cin>>a[i][j];
	for(int k=1;k<=n;k++)
	for(int i=1;i<=n;i++)
	for(int j=1;j<=n;j++)
	if(k!=j&&k!=i&&i!=j)
	{
		if(a[i][j]==a[i][k]+a[k][j])
		v[i][j]=1;
		if(a[i][j]>a[i][k]+a[k][j])
		{
			cout<<-1;
			return 0 ;
		}
	}
	for(int i=1;i<=n;i++)
	for(int j=i;j<=n;j++)
	{
		if(!v[i][j])
		sum+=a[i][j];
	}
	cout<<sum;
	return 0;
}

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


void pattern1() {
  int n;
  cin >> n;
  int A[n+1];
  for (int i = 1; i <=n; i++) cin >> A[i];

  int L[n+1]; //{A[1]~A[i]}までを選択肢として使い、A[i]を最後に選択した場合のLIS
  int P[n+1]; //上の場合に、LISに含まれる一つ前の要素を記録する配列

  L[0] = 0;
  A[0] = -1;
  P[0] = -1;

  for (int i = 1; i <= n; i++) {
    int k = 0;
    for (int j = 0; j <= i-1; j++) {
      if (A[j] < A[i] && L[j] > L[k]) k = j;
    }
    L[i] = L[k] + 1;
    P[i] = k;
  }

  int maxVal = L[1];
  for (int i = 1; i <= n; i++) maxVal < L[i] ? maxVal = L[i] : maxVal = maxVal;
  cout << maxVal << endl;
}

void pattern2() {
  const int MAX = 100000;
  int n;
  cin >> n;
  int A[n+1], L[n+1];
  for (int i = 0; i < n; i++) cin >> A[i];

  L[0] = A[0];
  int length = 1;

  for (int i = 1; i < n; i++) {
    L[length - 1] < A[i] ? L[length++] = A[i] : *lower_bound(L, L+length, A[i]) = A[i];
    //lower_bound は L[0]~L[i]の内でA[i]以上である一番最初の要素のイテレータを返す
  }


  cout << length << endl;

}

int main() {

  pattern2();
  return 0;
}



Measured memory_bytes: 3816
#include<bits/stdc++.h>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, ans = 0; string s; cin >> n >> s;

    for(int i = 0; i < n - 2; i++){
        int count = 0;
        for(int x = int('a'); x <= int('z'); x++){
            bool k_f = 0, l_f = 0;
            for(int k = 0; k <= i; k++) if(s[k] == x) k_f = 1;
            for(int l = i + 1; l < n; l++) if(s[l] == x) l_f = 1;
            if(k_f & l_f) count++;
        }ans = max(ans, count);
    }cout << ans;
}


Measured memory_bytes: 256