akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

//update 2019/12/13

public class Main{

  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {

    int[] a = new int[5];
    int[] b = new int[5];
    for(int i=0;i<5;i++){
      a[i] = nextInt();
      b[i] = (10- a[i]%10)%10;
    }

    int ans = 0;
    for(int i=0;i<5;i++){
      ans += a[i] + b[i];
      //System.out.println(ans);
    }

    Arrays.sort(b);

    ans -= b[4];

    System.out.println(ans);


/*
    for(int i=0;i<n;i++){
      System.out.println("a["+i+"]="+a[i]);
    }
*/

  }

  static String next(){
    return sc.next();
  }

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

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

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

  static String[] splitString(String s){
    return s.split("");
  }

  static char[] splitChar(String s){
    return s.toCharArray();
  }

  static int charToInt(char aaa){
    return aaa - 48;
  }

  public static int maxInt(int[] a,int lng){
    int max=a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }

  public static int minInt(int[] a,int lng){
    int min=a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }

  public static long maxLong(long[] a,int lng){
    long max=a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }

  public static long minLong(long[] a,int lng){
    long min=a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }

}


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

int N, A, B, C; 
vector<int> l;
const int INF = 1 << 30;

int dfs(int now, int a, int b, int c){
  if(now == N){
    if(a > 0 && b > 0 && c > 0)
      return (abs(A-a) + abs(B-b) + abs(C-c)) - 30;
    else return INF;
  }
  
  int res = dfs(now + 1, a, b, c);
  res = min(res, dfs(now + 1, a + l[now], b, c) + 10);
  res = min(res, dfs(now + 1, a, b + l[now], c) + 10);
  res = min(res, dfs(now + 1, a, b, c + l[now]) + 10);
  
  return res;
}

int main() {
  cin >> N >> A >> B >> C;
  l.resize(N);
  for(int i = 0; i < N; i++){
    cin >> l[i];
  }
  
  cout << dfs(0, 0, 0, 0) << endl;
  
}

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

int n, m, t, dp[100001];
bool a[100001];

int main() {
	cin >> n >> m;

	for (int i = 0; i < m; i++) {
		cin >> t;
		a[t] = true;
	}

	dp[0] = 1;
	for (int i = 0; i <= n; i++) {
		if (i + 1 <= n && !a[i + 1]) {
			dp[i + 1] += dp[i];
			if (dp[i + 1] > 1000000007) dp[i + 1] %= 1000000007;
		}
		if (i + 2 <= n && !a[i + 2]) {
			dp[i + 2] += dp[i];
			if (dp[i + 2] > 1000000007) dp[i + 2] %= 1000000007;
		}
	}

	cout << dp[n]<< endl;

	return 0;
}

Measured memory_bytes: 896
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

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

vector<vector<ll>> g;
vector<ll> x;

const ll x_max = 5050;
bool ok = true;
Pll dfs(ll now){
    if(!g[now].size()){
        return {x[now], 0};
    }
    vector<Pll> t;
    for(auto &to : g[now]){
        t.emplace_back(dfs(to));
    }

    bitset<x_max> bs[t.size()+1];
    bs[0] = 1;
    ll sum = 0;
    rep(j,0,t.size()){
        auto p = t[j];
        sum += p.first + p.second;
        rrep(i, x[now] + 1, 0){
            if(bs[j][i]){
                if(i + p.first <= x[now])bs[j+1][i+p.first] = 1;
                if(i + p.second <= x[now])bs[j+1][i+p.second] = 1;
            }
        }
    }

    ll ans = INF;
    rrep(i,x[now] + 1, 0)if(bs[t.size()][i]){
        ans = i;break;
    }
    if(ans == INF){
        ok = false;
        return {INF, INF};
    }
    debug(now, ans, sum, sum-ans);
    return {x[now], sum-ans};
}
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    g.resize(n);
    x.resize(n);
    
    rep(i,1,n){
        ll p; cin >> p;
        p--;
        g[p].emplace_back(i);
    }
    for(int i = 0; i < n; i++) cin >> x[i];


    dfs(0);
    debug(dfs(0));

    cout << (ok ? "POSSIBLE" : "IMPOSSIBLE") << "\n";
}

Measured memory_bytes: 4220
import math
from collections import Counter
import itertools
n = int(input())
al = list(map(int,input().split()))
C_al = Counter(al)

all = 0
for i in C_al.values():
    all += i*(i-1)/2

for i in al:
    k = C_al[i]
    print(int(all - (k * (k - 1) / 2) + (k - 1) * (k - 2) / 2))
    




Measured memory_bytes: 33920
#include<iostream>
#include<cstdio>
#include<queue>
#include<string>
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)

using namespace std;

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
int ans;
string island[20];

int dfs(int x,int y){
    island[y][x]='0';
    REP(i,4){
        int nx=x+dx[i];
        int ny=y+dy[i];
        if(nx>=0&&nx<12&&ny>=0&&ny<12&&island[ny][nx]=='1')dfs(nx,ny);
    }
    return 0;
}

int main(){
    while(1){
        REP(y,12){
            if(!(cin>>island[y]))return 0;
        }
        ans=0;
        REP(y,12){
            REP(x,12){
                if(island[y][x]=='1'){
                    dfs(x,y);
                    ans++;
                }
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 1192
/*
 ▓█████▄  ▄████▄  ▓██   ██▓ ██▓███   ██░ ██ ▓█████  ██▀███
▒██▀ ██▌▒██▀ ▀█   ▒██  ██▒▓██░  ██▒▓██░ ██▒▓█   ▀ ▓██ ▒ ██▒
 ░██   █▌▒▓█    ▄   ▒██ ██░▓██░ ██▓▒▒██▀▀██░▒███   ▓██ ░▄█ ▒
 ░▓█▄   ▌▒▓▓▄ ▄██▒  ░ ▐██▓░▒██▄█▓▒ ▒░▓█ ░██ ▒▓█  ▄ ▒██▀▀█▄
 ░▒████▓ ▒ ▓███▀ ░  ░ ██▒▓░▒██▒ ░  ░░▓█▒░██▓░▒████▒░██▓ ▒██▒
  ▒▒▓  ▒ ░ ░▒ ▒  ░   ██▒▒▒ ▒▓▒░ ░  ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
  ░ ▒  ▒   ░  ▒    ▓██ ░▒░ ░▒ ░      ▒ ░▒░ ░ ░ ░  ░  ░▒ ░ ▒░
  ░ ░  ░ ░         ▒ ▒ ░░  ░░        ░  ░░ ░   ░     ░░   ░
    ░    ░ ░       ░ ░               ░  ░  ░   ░  ░   ░
  ░      ░         ░ ░
*/
//focus less on how much problem you should solve within a fixed time and focus more on getting the problem solved and
//learning something from it
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define per(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define sedes set <ll, greater <ll> >
#define seasc set <ll>
#define pb push_back
#define mkp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define umap unordered_map<ll, ll>
#define map map<ll, ll>
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define mems(a, i) memset(a, i, sizeof(a))
#define endl '\n'
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define deba(a) cout << #a << " " << a << endl;
int main()
{
	fast;
#ifndef ONLINE_JUDGE
	freopen("/home/kushagra/Desktop/Kushagra/input.txt", "r", stdin);
	freopen("/home/kushagra/Desktop/Kushagra/output.txt", "w", stdout);
#endif
	char c;
	cin >> c;

	if (c == 'A')
		cout << "T";
	else if (c == 'T')
		cout << "A";
	else if (c == 'G')
		cout << "C";
	else
		cout << "G";
	return 0;
}

Measured memory_bytes: 3520
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
typedef long long ll;
using namespace std;
 
int main(){
    int N; cin >> N;
    vector <int> A(N);
    rep(i,N) cin >> A[i];
    sort(A.begin(),A.end(),greater<int>());
    
    int Alice=0;
    int Bob=0;
    
    for(int i=0; i<N; i+=2){
        Alice+=A[i];
        Bob+=A[i+1];
    }
    cout << Alice-Bob;
}

Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

class Main {
    public static void main(String[] args) throws IOException {
        int[] inputs = receiveIntArray(Delimiter.SPACE);
        int length = inputs[0];
        int limit = inputs[1];

        int[] arr = receiveIntArray(Delimiter.SPACE);

        int pow2 = powerOf2(arr[0]);
        for (int i : arr) {
            if (powerOf2(i) != pow2) {
                println(0);
                flush();
                return;
            }
        }

        arr = Arrays.stream(arr).map(i -> i / 2).toArray();
        BigInteger lcm = lcm(arr);

        int ans = lcm.intValue() <= limit ? ((limit / lcm.intValue()) + 1) / 2 : 0;

        println(ans);
        flush();
    }

    static BigInteger gcd(BigInteger x, BigInteger y) {
        if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        }
        if (y.equals(BigInteger.ZERO)) {
            return x;
        }
        return gcd(y, x.remainder(y));
    }
    static BigInteger gcd(int x, int y) {
        return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(int x, int y) {
        return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }
    static BigInteger lcm(BigInteger x, BigInteger y) {
        return x.multiply(y).divide(gcd(x, y));
    }
    static BigInteger lcm(int[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        }
        return lcm;
    }

    static int powerOf2(int x) {
        int ret = 0;
        while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        }
        return ret;
    }

    // 入出力関連
    static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static final PrintWriter pw = new PrintWriter(System.out);

    enum Delimiter {
        NONE(""), SPACE(" "), DOT("\\."), COMMA(",");

        private String regex;

        private Delimiter(String regex) {
            this.regex = regex;
        }

        public String getRegex() {
            return regex;
        }
    }

    static String receive() throws IOException {
        return br.readLine();
    }

    static int receiveInt() throws IOException {
        return Integer.parseInt(br.readLine());
    }

    static char receiveChar() throws IOException {
        return br.readLine().charAt(0);
    }

    static char[] receiveCharArray() throws IOException {
        return br.readLine().toCharArray();
    }

    static int[] receiveIntArray(Delimiter delimiter) throws IOException {
        return Stream.of(br.readLine().split(delimiter.getRegex())).mapToInt(Integer::parseInt).toArray();
    }

    static String[] receiveStringArray(Delimiter delimiter) throws IOException {
        return Stream.of(br.readLine().split(delimiter.getRegex())).toArray(String[]::new);
    }

    static void print(Object obj) {
        pw.print(obj);
    }

    static void println(Object obj) {
        pw.println(obj);
    }

    static void flush() {
        pw.flush();
    }
}

Measured memory_bytes: 68280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

struct mint {
    const int mod = 1e9 + 7;
    long long x;
    
    mint (long long x = 0) : x((x % mod + mod) % mod) {
        
    }
    
    mint& operator=(const long long a) {
        x = a % mod;
        return *this;
    }
    
    mint& operator=(const mint a) {
        x = a.x % mod;
        return *this;
    }
    
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    
    mint& operator-=(const mint a) {
        if ((x += (mod - a.x)) >= mod) x -= mod;
        return *this;
    }
    
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    
    mint inv() const {
        return pow(mod - 2);
    }
    
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    mint ans = 0LL;
    ll f = 0LL;
    bool updated;
    do {
        updated = false;
        vector<ll> cnt(2, 0LL);
        rep(i, n) {
            if (a[i] > 0LL) updated = true;
            cnt[a[i] % 2LL]++;
            a[i] >>= 1LL;
        }
        mint tmp = 1;
        tmp *= (1LL << f);
        tmp *= cnt[0];
        tmp *= cnt[1];
        ans += tmp;
        // printf("cnt[0]%lld, cnt[1]=%lld\n", cnt[0], cnt[1]);
        f++;
    }
    while (updated);
    cout << ans.x << endl;
    return 0;
}


Measured memory_bytes: 2560
a = [int(i) for i in input().split()]
k = a.pop()
ans = 0
for i in range(3):
    if i==0:
        if k<=a[i]:
            ans = k
            break
        else:
            ans += a[i]
            k -= a[i]
    elif i==1:
        if k<a[i]:
            break
        else:
            k -= a[i]
            continue
    else:
        if k<=a[i]:
            ans += (-1)*k
            
print(ans)

Measured memory_bytes: 61704
using System;
using System.Linq;

class Solution
{
    //static long almostSorted(int[] arr)
    //{
    //    
    //}



    static void Main(string[] args)
    {
        var arr = Console.ReadLine().Select(x=> long.Parse(x.ToString())).Sum(x=>x) % 9 == 0;
        //var result = almostSorted(arr);
        //var a = almostSorted(new[] { 10, 3 });
        Console.WriteLine(arr ? "Yes" : "No");
    }
}

Measured memory_bytes: 33456
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int main(void){
    int N;
    cin >> N;
    vector<int> h = vector<int>(N, 0);
    for(int cnt = 0; cnt < N; cnt++){
        cin >> h[cnt];
    }
    int result = 0;
    int count = 1;
    while(count < 101){
        bool once = false;
        bool continuous = false;
        for(int cnt = 0; cnt < N; cnt++){
            if(h[cnt] >= count){
                continuous = true;
                once = true;
            }else{
                if(continuous){
                    result++;
                }
                continuous = false;
            }
        }
        if(!once){
            break;
        }else if(continuous){
            result++;
        }
        count++;
    }
    cout << result << endl;

    return 0;
}



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

using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, a, b) for (int64_t i = (a); i < (b); ++i)
const int MOD = 1e9 + 7;
typedef long long ll;
// const long long INF = 1LL << 60;
const int INF = 1000000000;
using Graph = vector<vector<int>>;
typedef pair<int, int> P;

int main() {
  string s;
  cin >> s;
  int i = 0;
  int a[1000010];
  while (i < s.size()) {
    int l = 0, r = 0;
    while (i < s.size() && s[i] == 'R') r++, i++;
    int lp = i;
    while (i < s.size() && s[i] == 'L') l++, i++;
    a[lp] = (l + 1) / 2 + r / 2;
    a[lp - 1] = l / 2 + (r + 1) / 2;
  }
  rep(i, 0, s.size()) cout << a[i] << " ";
  cout << endl;
}


Measured memory_bytes: 3072
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    string K;
    int n = S.length();
    rep(i, n + 1) {
        REP(k, i + 1, n + 1) {
            string T = K;
            REP(j, k, n - 1) {
                T += S[j];
            }
            if(T == "keyence") {
                cout << "YES" << endl;
                return 0;
            }
            //cout << T << endl;
        }
        if(i < n)
        K += S[i];
    }
    cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 256
H,W,K=map(int,input().split())
C=[]
for _ in range(H):
    C.append(input())

A=2**W
B=2**H

M=0
for a in range(A):
    for b in range(B):

        X=0
        for y in range(H):
            for x in range(W):
                if (a>>x)%2==1 and (b>>y)%2==1 and C[y][x]=="#":
                    X+=1
        if X==K:
            M+=1
print(M)


Measured memory_bytes: 68292
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int dx[] = {0, 0, 1, -1};
constexpr int dy[] = {1, -1, 0, 0};

int main()
{
    int n;
    int a[212345];
    int p[50];
    map<int, int> mp;
    vector<int> v;

    cin >> n;
    REP(i, n)
    {
        cin >> a[i];
        if (!mp[a[i]])
            v.push_back(a[i]);
        mp[a[i]]++;
    }

    SORT(v);

    bool used[212345] = {false};

    p[0] = 1;
    REP(i, 32)
    p[i + 1] = p[i] * 2;

    int res = 0;

    for (int i = v.size() - 1; i >= 0; i--)
    {
        if (!mp[v[i]])
            continue;

        int t = 1;
        while (t <= v[i])
            t *= 2;

        if (!mp[t - v[i]])
            continue;

        if (t - v[i] == v[i])
        {
            res += mp[v[i]] / 2;
        }
        else
        {
            int t_ = min(mp[t - v[i]], mp[v[i]]);
            res += t_;
            mp[t - v[i]] -= t_;
        }
    }

    cout << res << endl;

    return 0;
}


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

using namespace std;

int main()
{
   char c;
   int s=0;
   while(scanf("%c",&c)&&c>='0'&&c<='9')
   {
        s+=c-'0';
   }
   if(s%9) cout<<"No"<<endl;
   else cout<<"Yes"<<endl;
}


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

int main()
{
    char a[11], b[11], c[11];
    scanf("%s %s %s", a, b, c);
    printf("%c%c%c\n", a[0] - 32, b[0] - 32, c[0] - 32);
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<pair<ll, ll>>> vvpll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    vl x(3);
    rep(i, 3) {
        cin >> x[i];
    }
    sort(all(x));
    out(x[0] + x[1] + 10*x[2]);
    re0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define PI 3.141592653589793


int main(void){
        int ang;
        double a,b,vol,hei,rou;
        scanf("%lf %lf %d",&a,&b,&ang);
        double radian = ang * PI / 180.0;
        hei=sin(radian)*b;
        vol=a*hei/2;
        rou=a+b+sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(radian));
        printf("%f\n%f\n%f\n",vol,rou,hei);

        return 0;
}

Measured memory_bytes: 652
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

//更新の頻度に着目

int main(){
    ios::sync_with_stdio(false);

    START:
    
    int H,W,N;
    cin >> H >> W >> N;
    if(H == 0) return 0;
    int state[1000][1000];
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            cin >> state[i][j];
        }
    }
    
    //N-1回目までの訪問回数を求める
    int c[1000][1000] = {};
    c[0][0] = N-1;
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            if(i == 0 && j == 0) continue;
            if(j != 0) c[i][j] += c[i][j-1] / 2;
            if(j != 0 && c[i][j-1]%2 == 1 && state[i][j-1] == 1) c[i][j]++;
            if(i != 0) c[i][j] += c[i-1][j] / 2;
            if(i != 0 && c[i-1][j]%2 == 1 && state[i-1][j] == 0) c[i][j]++;
        }
    }

    int x = 0; int y = 0;
    while(x < W && y < H){
        if((state[y][x] + c[y][x]) % 2 == 0) y++;
        else x++;
    }
    cout << y+1 << " " << x+1 << endl;

    goto START;

    return 0;
}



Measured memory_bytes: 10948
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef pair<pii,pii> pippi;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
typedef vector<vector<ll>> mat;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<61;
int iinf=1<<30;
double pi=3.14159265358979323846;
double pi2=pi/2.0;
double eps=1e-8;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define mrep(itr,mp) for(auto& itr:mp)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
//#define endl "\n"
int dh[4]={1,0,-1,0};
int dw[4]={0,1,0,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define umh unordered_map<int,int,custom_hash>
ll gcd(ll a,ll b){
    if(a<0)a=-a;
    if(b<0)b=-b;
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll c=gcd(a,b);
    return a*b/c;
}
ll Pow(ll n,ll k){
    if(k<0)return 0;
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
    now%=md;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}


int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,x,t;cin>>n>>x>>t;
    int ans=(n+x-1)/x*t;
    cout<<ans<<endl;
}


Measured memory_bytes: 3636
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] num = new int[n];
		long max=-1000000;
		long min=1000000;
		long sum=0;

		for(int t=0;t<n;t++) {
			num[t]=sc.nextInt();
			if(num[t]<=min)
			{
				min=num[t];}
			if(num[t]>=max) {
				max=num[t];
			}
			sum+=num[t];
			}
		System.out.println(min+" "+max+" "+sum);
	}
}



Measured memory_bytes: 42344
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
typedef long long int lli;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<pll> vop;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define REP(i,a,b) for( long long i=a;i<b;i++)
#define REPR(i,a,b) for(int i=a;i>=b;i--)
#define adb(a) for(auto ii:a) cout << ii << " "; cout << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
#define endl "\n"
#define mem(a,b) memset(a,b,sizeof(a))
#define mod 1000000007
#define PI 3.14159265358979323846
const ll MAXN = 100007;
const ll p = 1000000007;

struct LessSecond
{
    template<typename T, typename U>
    bool operator()(const std::pair<T, U> &x, const std::pair<T, U> &y) const
    {
        return x.second < y.second;
    }
};

ll power(ll a, ll b, ll m) { ll ans = 1; a = a % m; while (b) { if (b & 1) ans = (ans * a) % m; b /= 2; a = (a * a) % m; } return ans; }

ll lcm(ll a, ll b) { return (a * b) / __gcd(a, b); }

ll modInverse(ll a, ll m) { ll g = __gcd(a, m); return power(a, m - 2, m); }


int main()
{


    fastIO;
    int test = 1;
    //cin >> test;
    while (test--)
    {
        int l, r, d;
        cin >> l >> r >> d;
        int ans = 0, i = 1;
        while (1)
        {
            if (i * d > r)
                break;
            if (i * d >= l && i * d <= r)
                ans++;
            i++;
        }
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> void pr_vec(vector<T> &v, char ep=' '){int n=v.size();REP(ni,n){cout<<v[ni];if(ni!=n-1)cout<<ep;}cout<<endl;};
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int N,M;
    cin >> N >> M;
    vector<int> e(N);
    REP(i, M){
        int a,b;
        cin >> a >> b;
        a--;b--;
        e[a]++;
        e[b]++;
    }
    REP(i, N){
        if(e[i]&1){
            pr("NO");
            return 0;
        }
    }
    pr("YES");
}

Measured memory_bytes: 3784
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, read().split())
ans = 0
for i in range(1, n + 1):
    cnt = 0
    while i < k:
        cnt += 1
        i *= 2
    ans += (1 / n) * pow(0.5, cnt)
print(ans)


Measured memory_bytes: 3060
import itertools
n=int(input())
pp=input().split()
qq=input().split()
p=[]
q=[]
p.append(pp)
q.append(qq)
a=[]
for v in itertools.permutations(pp,n):
    a.append(v)
a=sorted(a)
for j in range(len(a)):
  a[j]=list(a[j])

b=0
c=0
for i in range(len(a)):
  if a[i]==pp:
    b+=i
    
for k in range(len(a)):
  if a[k]==qq:
    c+=k

print(max(b-c,c-b))


Measured memory_bytes: 49776
function main(input){
  var str = input.split(' ');
  N = parseInt(str[0]);//入っているお札の枚数:N
  Y = parseInt(str[1]);//合計金額:Y
  var result = '-1 -1 -1'
  
  money:
  for(let i=0;i<=N;i++){
    for(let j=0;j<=N;j++){
      var com = 9*i+4*j;
      if(com === Y/1000-N){
        var thou = N - (i+j);
      	if(thou >=0){
          result = `${i} ${j} ${thou}`
           break money;
        }else{
          continue;
        }
      }
    }
  }
  console.log(result);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 32160
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<long long>;
using vpii = vector<pair<int,int>>;
using vivi = vector<vector<int>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};



int main(void) {
  ll n;
  cin >> n;
  ll p = 1;
  ll q = 1;
  for(ll i = 1;i*i<=n;i++){
    if(n%i==0) p = i;
  }
  q = n/p;
  cout << p+q-2 << endl;
         
  
}


Measured memory_bytes: 256
import java.lang.StringBuilder

fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    val list = readLine()!!.split(" ").map { it.toInt() }
    val cnt = mutableMapOf<Int, Long>()
    for(i in list) {
        cnt[i] = (cnt[i]?:0L) + 1L
    }
    val total = cnt.map { (it.value * (it.value - 1))/2 }.sum()
    val ans = StringBuilder()
    for(i in list) {
        val subTotal = (cnt[i]!! * (cnt[i]!! - 1)) / 2
        val tmp = ((cnt[i]!! - 1) * (cnt[i]!! - 2)) / 2
        ans.appendln(total - subTotal + tmp)
    }
    print(ans.toString())
}


Measured memory_bytes: 81508
#include <iostream>
#include <string>

using namespace std;

int main(void)
{
	int a, b;
	string op;
	while (true){
		cin >> a >> op >> b;
		if (op == "?") break;
		else if (op == "+") cout << a + b << endl;
		else if (op == "-") cout << a - b << endl;
		else if (op == "*") cout << a * b << endl;
		else if (op == "/") cout << a / b << endl;
	}
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long x;
  cin >> x;
  for(int i = 0; i < 120; i++){
    for(int j = -65; j < 120; j++){
      if(i*i*i*i*i-j*j*j*j*j==x){
        cout << i << " " << j;
        return 0;
      }
    }
  }
}

Measured memory_bytes: 3632
import java.lang.Math.min

fun main(args: Array<String>) = yorukatsu22e()

fun yorukatsu22e() {
    operator fun List<Int>.component6() = this[5]
    val (a, b, c, d, e, f) = readLine()!!.split(' ').map { it.toInt() }

    val sugarPatterns = (0..f step c).map { cw -> (0..f step d).map { dw -> cw + dw } }
        .flatten().distinct().sorted().toIntArray()

    fun upperBound(list: IntArray, key: Int): Int {
        var ng = -1
        var ok = list.size

        while (ok - ng > 1) {
            val mid = (ok + ng) / 2
            if (list[mid] > key) ok = mid else ng = mid
        }
        return ok
    }

    var pair = a * 100 to 0
    var maxPercentage = 0.0

    for (aw in 0..f step a * 100) for (bw in 0..f step b * 100) {
        val waterWeight = aw + bw
        val maxOfSugarWeight = min(e * waterWeight / 100, f - waterWeight)
        if (maxOfSugarWeight < 0) continue

        val ub = upperBound(sugarPatterns, maxOfSugarWeight) - 1
        if (ub !in sugarPatterns.indices) continue

        val sugarWeight = sugarPatterns[ub]
        val sumWeight = sugarWeight + waterWeight

        val percentage = sugarWeight.toDouble() * 100 / sumWeight.toDouble()

        if (percentage > maxPercentage) {
            maxPercentage = percentage
            pair = sumWeight to sugarWeight
        }
    }

    val answer = "${pair.first} ${pair.second}"

    println(answer)
}


Measured memory_bytes: 72004
//verma_ankit484

#include<bits/stdc++.h>

typedef long long ll;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
const ll mod = (ll) 1e9+7;

using namespace std;

int main()
{
  IOS
  #ifdef AV
  freopen("int.txt", "r", stdin);
  #endif
  ll a, b;
  cin >> a >> b;
  cout << max({a+b, a-b, a*b}) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int N;
	scanf("%d", &N);
	int H[N];
	int i = 0;
	while (i < N)
		scanf("%d", &H[i++]);
	i = 0;
	int count = 0;
	int score = 0;
	while (i < N - 1)
	{
		if (H[i] >= H[i + 1])
			count++;
		else if (H[i] < H[i + 1])
		{
			if (count > score)
			{
				score = count;
				count = 0;
			}
			else
			{
				count = 0;
			}
		}
		i++;
	}
	if (count > score)
		score = count;
	printf("%d\n", score);
	return (0);
}

Measured memory_bytes: 512
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
long long read() {
  long long x = 0, w = 1;
  char ch = getchar();
  while (!isdigit(ch)) w = ch == '-' ? -1 : 1, ch = getchar();
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * w;
}
const int Max_n = 1e5 + 5, mod = 1e9 + 7;
int n, ans;
int a[Max_n], inv[Max_n];
void Mod(int &x) { x %= mod; }
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  for (int i = 2; i <= n; i++) Mod(inv[i] += inv[i - 1]);
  for (int i = 1; i <= n; i++)
    Mod(ans += 1ll * a[i] * (inv[i] + inv[n - i + 1] - 1) % mod);
  for (int i = 2; i <= n; i++) ans = 1ll * ans * i % mod;
  cout << ans;
}


Measured memory_bytes: 1024
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let k: i64 = sc.read();
    let a: i64 = sc.read();
    let b: i64 = sc.read();

    let ans = if k <= a {
        1
    } else if a - b <= 0 {
        -1
    } else {
        1 + (k - a + a - b - 1) / (a - b) * 2
    };
    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
#define bg begin()
#define ed end()
#define all(x) x.bg, x.ed
#define vi vector<int>
template <class t, class u>
void chmax(t &a, u b)
{
    if (a < b)
        a = b;
}
template <class t, class u>
void chmin(t &a, u b)
{
    if (b < a)
        a = b;
}

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    int g = __gcd(a, b);
    if(c%g==0){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
def chk(n):
    global dic
    cnt = 0
    while n%2==0:
        n = n//2
        cnt += 1
    dic.setdefault(cnt,0)
    dic[cnt] += 1
    return cnt

dic = {}
dic.setdefault(0,0)
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    tmp = chk(a[i])
#print(dic)
ans = 0
for item in dic.items():
    ans += item[0]*item[1]
print(ans)

Measured memory_bytes: 10144
import sys
import itertools

N,M = map(int, input().split())
AB = []
C = []
for _ in range(M):
    AB.append(tuple(map(int, input().split())))
    C.append(sum(1<<(int(x)-1) for x in map(int, input().split())))

INF = 10**18
dp = [INF]*(1<<N)
dp[0] = 0

for n,((a,b),c) in itertools.product(range(1<<N), zip(AB,C)):
    m = n|c
    x = dp[n] + a
    if dp[m] > x:
        dp[m] = x

ans = dp[-1]
if ans == INF:
    ans = -1
print(ans)

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

using namespace std;

int main(int argc, const char *argv[]) {
  array<long long, 256> cnts{0};
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    cnts[s[0]]++;
  }

  string chs = "MARCH";
  long long ans = 0;
  for (int i = 0; i < chs.size() - 2; ++i) {
    for (int j = i + 1; j < chs.size() - 1; ++j) {
      for (int k = j + 1; k < chs.size(); ++k) {
        ans += cnts[chs[i]] * cnts[chs[j]] * cnts[chs[k]];
      }
    }
  }

  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())

sumans = [0] * 110

i = 1
while i <= k:
  d = int(input())
  j = 0
  aes = list(map(int, input().split()))
  while j < d:
    sumans[aes[j]] = 1
    j += 1
  i += 1

ans = n - sum(sumans)
print(ans)

Measured memory_bytes: 9192
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    T = input()

    ans = 0
    for x, y in zip(S, T):
        if x == y:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


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

using namespace std;
#define ll long long
#define db long double
#define all(a) a.begin(),a.end()
#define f(i,l,u) for(ll i=l;i<u;i++)
#define lb lower_bound
#define ub upper_bound
#define pb push_back

int main() {
ll s=0;
ll n;
cin>>n;
f(i,1,n+1)
{
    ll x;
    cin>>x;
    if(i%2&&x%2)
    s++;
}
cout<<s<<endl;
    
    
    return 0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
const int MOD=1e9+7;
const double eps=1e-8;
typedef long long ll;
//orz yht
using namespace std;
int n,a[105];
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(a[i]%2==0){
			if(a[i]%3==0 || a[i]%5==0)
			continue;
			else{
				cout<<"DENIED";
				return 0;
			}
		}
	}
	cout<<"APPROVED";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <math.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;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
int X;
  int A;
  int B;
  cin >>X>>A>>B;
  if(A>=B) {
cout << "delicious" << endl;
  }
else if (X+A>=B) {
cout << "safe"<< endl;
}
else {
cout << "dangerous" << endl;
}
}
  

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String s = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51";
		String[] as = s.split(", ");
		int k = Integer.parseInt(br.readLine());
		System.out.println(as[k-1]);
	}

}


Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
 
int main() {
  // r g b
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  while (b <= a) {
    b *= 2;
    k--;
  }
  while (c <= b) {
    c *= 2;
    k--;
  }
  cout << (k >= 0 ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n, ma, mb;
  cin >> n >> ma >> mb;
  vl a(n), b(n), c(n);
  rep(i, n) cin >> a[i] >> b[i] >> c[i];
  ll dp[n + 1][401][401] = {};
  rep(i, n + 1) rep(j, 401) rep(k, 401) dp[i][j][k] = 1e18;
  dp[0][0][0] = 0;
  rep(i, n) rep(j, 401) rep(k, 401) {
    if(dp[i][j][k] == 1e18) continue;
    dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k]);
    ll nj = j + a[i];
    ll nk = k + b[i];
    dp[i + 1][nj][nk] = min(dp[i + 1][nj][nk], dp[i][j][k] + c[i]);
  }
  ll ans = 1e18;
  rep2(j, 1, 401) rep2(k, 1, 401) if(mb * j == ma * k) ans =
      min(ans, dp[n][j][k]);
  cout << (ans == 1e18 ? -1 : ans) << endl;
}

Measured memory_bytes: 55104
from copy import deepcopy

n, m = map(int, input().split())
graph = [[] for i in range(n)]
arcs = []
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)
    arcs.append((a, b))
answer = 0
for a, b in arcs:
    graph_ = deepcopy(graph)
    graph_[a].remove(b)
    graph_[b].remove(a)

    initial = 0
    stack = []
    history = set()
    stack.append(initial)
    history.add(initial)

    while stack:
        node = stack.pop()
        for new_node in graph_[node]:
            if new_node not in history:
                stack.append(new_node)
                history.add(new_node)
    
    if len(history) != n:
        answer += 1

print(answer)


Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> d1(n), d2(n);
  for(int i = 0; i < n; i++) {
    cin >> d1.at(i) >> d2.at(i);
  }
  vector<bool> d(n, 0);
  for(int i = 0; i < n; i++) {
    if(d1.at(i) == d2.at(i)) d.at(i) = 1;
  }
  bool x = 0;
  int c = 0;
  for(int i = 0; i < n; i++) {
    if(d.at(i) == 1) {
      c++;
      if(c == 3) {
        x = 1;
        break;
      }
    }
    else c = 0;
  }
  if(x) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

int main()
{
  string N;
  cin >> N;

  int lastChar = (N[N.size() -1]) - '0';
  

  if (lastChar == 2 || lastChar == 4 || lastChar == 5 || lastChar == 7 || lastChar == 9)
  {
    cout << "hon" << endl;
    return 0;
  }
  else if (lastChar == 0 || lastChar == 1 || lastChar == 6 || lastChar == 8)
  {
    cout << "pon" << endl;
    return 0;
  }
  else
  {
    cout << "bon" << endl;
  }
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
const int N=100005,M=1e9+7;
int sum[N],dp[N],nxt[N][3];
char s[N];
int main(){
	scanf("%s",s+1);
	int n=strlen(s+1);
	int flag=0;
	for (int i=1;i<n;i++)
		if (s[i]==s[i+1])flag=1;
	if (!flag){
		puts("1");
		return 0;
	}
	for (int i=1;i<=n;i++)sum[i]=(sum[i-1]+s[i]-'a'+1)%3;
	for (int i=0;i<3;i++)nxt[n+1][i]=n+1;
	for (int i=n;i;i--)
		for (int j=0;j<3;j++)
			if (j==sum[i])nxt[i][j]=i;
			else nxt[i][j]=nxt[i+1][j];
	dp[0]=1;
	for (int i=0;i<=n;i++)
		for (int j=1;j<3;j++)
			(dp[nxt[i+1][(j+sum[i])%3]]+=dp[i])%=M;
	int ans=0;
	for (int i=1;i<=n;i++)
		if (sum[i]==sum[n])(ans+=dp[i])%=M;
	printf("%d\n",ans);
}


Measured memory_bytes: 2304
import os
import numpy as np

class getStdin(object):
    @classmethod
    def get_str(cls):
        return str(input())


if __name__ == '__main__':
    n = getStdin.get_str()
    a = ['', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
    print(a.index(n))

    os.sys.exit(0)

Measured memory_bytes: 21656