akhauriyash/Code-Regression huggingface dataset:
n=97
p=print
r=range
def c(i,j,k):p('<',i,j,k)
def a(i,j,k):p('+',i,j,k)
def b(i):a(i,i,i+1)
def d(x,i,j):
	for t in r(30):
		b(j+t-1)
		a(j+t,n,j+t)
		for s in r(j+t,j+29):b(s)
		c(j+29,x,i+t)
		b(j+t-1)
		a(j+t,i+t,j+t)
p(3933)
a(0,1,n)
c(2,n,n)
a(0,n,3)
a(1,n,4)
d(3,5,36)
d(4,36,67)
for t in r(59):
	a(2,2,2)
	for s in r(t+1):
		if t-30<s<30:a(5+t-s,36+s,98);c(n,98,99);a(2,99,2)

Measured memory_bytes: 9116
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0
 
for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        s += i
    else:
        k.append(i)
k.sort()
c = np.array(k)
l = c.sum()
if l%10==0 and len(k) !=0:
    l = l - c[0]
    s = s + l
elif len(k) == 0:
    s = 0
else:
    s = s + l
print(s)

Measured memory_bytes: 21656
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int n,m;
  cin >> n >> m;
  string s[n];
  rep(i,n) R s[i];
  vector<P> v;
  int d[n][m];
  rep(i,n)rep(j,m)d[i][j]=MAX;
  queue<P> que;
  rep(i,n)rep(j,m) {
    if(s[i][j]=='%') {
      d[i][j]=0;
      que.push(P(i,j));
    }
    if(s[i][j]=='@') v.pb(P(i,j));
  }
  rep(i,n)rep(j,m)if(s[i][j]=='$') v.pb(P(i,j));
  while(!que.empty()) {
    P p=que.front();que.pop();
    rep(i,4) {
      int x=p.F+dx[i],y=p.S+dy[i];
      if(!check(n,m,x,y)||d[x][y]<=d[p.F][p.S]+1||s[x][y]=='#') continue;
      d[x][y]=d[p.F][p.S]+1;
      que.push(P(x,y));
    }
  }
  bool f=1;
  REP(i,1,v.size()) {
    if(d[v[0].F][v[0].S]>=d[v[i].F][v[i].S]) f=0;
  }
  if(f) pr("Yes");
  else pr("No");
}

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


Measured memory_bytes: 3752
minutes = [int(input()) for i in range(5)]

if minutes[0] % 10 == 0:
    m0 = minutes[0]
else:
    m0 = minutes[0] + 10 - (minutes[0] % 10)

if minutes[1] % 10 == 0:
    m1 = minutes[1]
else:
    m1 = minutes[1] + 10 - (minutes[1] % 10)

if minutes[2] % 10 == 0:
    m2 = minutes[2]
else:
    m2 = minutes[2] + 10 - (minutes[2] % 10)

if minutes[3] % 10 == 0:
    m3 = minutes[3]
else:
    m3 = minutes[3] + 10 - (minutes[3] % 10)

if minutes[4] % 10 == 0:
    m4 = minutes[4]
else:
    m4 = minutes[4] + 10 - (minutes[4] % 10)

mx = min([(minutes[0] - 1 ) % 10, (minutes[1] - 1 ) % 10, (minutes[2] - 1 ) % 10, (minutes[3] - 1) % 10, (minutes[4] - 1) % 10])

mx = mx + 1

print(m0 + m1 + m2 + m3 + m4 + mx - 10)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
bool ma[60][60],f_ma[60][60];
bool check(int n,int *p,int *q);
int main(void)
{
    int n;
    cin>>n;
    int a[60],b[60];
    memset(ma,0,sizeof(ma));
    memset(f_ma,0,sizeof(ma));
    for(int i = 1; i <= n; i++)
        cin>>a[i];
    for(int i = 1; i <= n; i++)
        cin>>b[i];
    for(int i = 0; i <= 50; i++)
        f_ma[i][i] = true;
    LL sum = 0;
    int cnt = 0;
    for(int i = 50; i >= 1; i--)
    {
        for(int j = 0; j <= 50; j++)
        {
            for(int s = 0; s <= 50; s++)
            {
                ma[j][s] = f_ma[j][s];
            }
        }
        for(int j = 0; j <= 50; j++)
        {
            for(int s = 1; s <= i-1; s++)
            {
                ma[j][j%s] = true;
            }
        }
        if(!check(n,a,b))
        {
            cnt++;
            sum += (1LL)<<i;
            for(int j = 0; j <= 50; j++)
                f_ma[j][j%i] = true;
        }
    }
    if(cnt != 50)
    {
        printf("%lld\n",sum);
    }
    else
    {
        for(int i = 1;i <= n;i++)
        {
            if(!f_ma[a[i]][b[i]])
            {
                printf("-1\n");
                return 0;
            }
        }
        printf("%lld\n",sum);
    }
    return 0;
}
bool check(int n,int *p,int *q)
{
    for(int k = 0; k <= 50; k++)
    {
        for(int i = 0; i <= 50; i++)
        {
            for(int j = 0; j <= 50; j++)
            {
                if(ma[i][k]&&ma[k][j])
                    ma[i][j] = true;
            }
        }
    }
    for(int i = 1; i <= n; i++)
        if(!ma[p[i]][q[i]])
            return false;
    return true;
}


Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
???????????????
??´??° n ?????\???????????±??? n ????????°????????????????????£??????????????????
?????????????????????????????§?¨????????????????????????°????????????????????????????????????

????????????????????????????????????????¨???¨????????\?????????????????????
?????????????????¨????????°???????§??????????????????¢????????¨??§???
??\????????????????????°????????¢??°????????????????????¨???????????????????????¨?????§????????????

????????????????????? (p1,p2) ??? 3 ???????????????
????????? 3???????????? 2 ??? s,ts,t ???????????¨????????£????§???¢ (s,u,t) ??????????????????
?????? (p1,s)????????? (s,u)????????? (u,t)????????? (t,p2)?????????????????°???????????????????????°????????????

"""
import math

X = 0
Y = 1
sin60 = math.sin(math.radians(60))
cos60 = math.cos(math.radians(60))

def fn(P1, P2, n, l):
    l += 1
    if l > n:
        return [P1,P2]
    
    x3 = (P2[X] -P1[X]) / 3
    y3 = (P2[Y] -P1[Y]) / 3
    xa = x3 + P1[X]
    ya = y3 + P1[Y]
    xc = P2[X] - x3
    yc = P2[Y] - y3
    xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa
    yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya
    Pa = [xa,ya]
    Pb = [xb,yb]
    Pc = [xc,yc]
    Ps = [P1]
    f1 = fn(P1,Pa,n,l)
    f2 = fn(Pa,Pb,n,l)
    f3 = fn(Pb,Pc,n,l)
    f4 = fn(Pc,P2,n,l)
    Ps.extend(f1[1:])
    Ps.extend(f2[1:])
    Ps.extend(f3[1:])
    Ps.extend(f4[1:])
    return Ps

def main():
    """ ????????? """
    num = int(input().strip())
    p1 = [0,0]
    p2 = [100,0]
    k = fn(p1,p2,num,0)
    for i in k:
        print("{} {}".format(i[0],i[1]))

if __name__ == '__main__':
    main()

Measured memory_bytes: 8460
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)






vector<vector<ll>> g;

ll dfs(ll now, ll par){
    vector<ll> depth;
    for(auto &child : g[now]){
        if(child == par) continue;
        depth.push_back(dfs(child, now));
    }
    sort(depth.begin(), depth.end());
    ll mx = 0;
    REP(i, depth.size()){
        mx = max(mx, depth[i] + ((ll)depth.size() - i));
    }
    return mx;
}

int main() {
    ll n;
    cin >> n;
    g.resize(n);
    for(ll i = 1; i < n; i++){
        ll a;
        cin >> a;
        a--;
        g[i].push_back(a);
        g[a].push_back(i);
    }
    cout << dfs(0, -1) << endl;;
}


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

using namespace std;

#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define PB push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second

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

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

	int n; cin >> n;
	vi v(n); 
	ll x = 0;
	FOR(i, n){
		cin >> v[i];
		x ^= v[i];
	}

	FOR(i, n){
		cout << (x^v[i]) << " \n"[i==n-1];
	}


	return 0;
}


Measured memory_bytes: 3892
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, T = il()
    print(B*(T//A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 10092
import java.io.*;
import java.util.*;
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] h = new int[n];
        for(int i = 0; i<n; i++){
        h[i] = scan.nextInt();
        }
        int solve = dp(n, h);
    System.out.println(solve);
    }
    public static int dp(int n, int[] h){
    int[] arr = new int[n];
    arr[1] = Math.abs(h[0] - h[1]);
    for(int i = 2; i<arr.length; i++){
    arr[i] = Math.min(Math.abs(h[i-1]-h[i])+arr[i-1], Math.abs(h[i-2]-h[i])+arr[i-2]);
    }
    return arr[n-1];
    }
    
}

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

long long n;

int main(void){
    string name = "";
    cin >> n;
    while(n > 0){
        n--;
        name+=char('a'+n%26);
        n/=26;
    }
    reverse(name.begin(), name.end());
    cout << name << endl;
    return 0;
}


Measured memory_bytes: 3632
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    int N = sc.nextInt();
    Interval[] li = new Interval[N];
    for (int i = 0; i < N; i++) {
      int l = Integer.parseInt(sc.next());
      int r = Integer.parseInt(sc.next());
      li[i] = new Interval(l, r);
    }
    Interval[] ri = li.clone();
    Arrays.sort(li, (i1, i2) -> Integer.compare(i2.l, i1.l));
    Arrays.sort(ri, (i1, i2) -> Integer.compare(i1.r, i2.r));
    long ans = solve(li, ri);
    for (int i = 0; i < N; i++) {
      ri[i].used = false;
    }
    ans = Math.max(ans, solve(ri, li));
    System.out.println(ans);
  }

  static long solve(Interval[] f, Interval[] s) {
    int fi = 0;
    int si = 0;
    int t = 0;
    int p = 0;
    long sum = 0;
    while (true) {
      while (f[fi].used) {
        ++fi;
      }
      f[fi].used = true;
      if (p < f[fi].l) {
        sum += f[fi].l - p;
        p = f[fi].l;
      } else if (f[fi].r < p) {
        sum += p - f[fi].r;
        p = f[fi].r;
      }
      ++t;
      if (t == f.length) break;

      while (s[si].used) {
        ++si;
      }
      s[si].used = true;
      if (p < s[si].l) {
        sum += s[si].l - p;
        p = s[si].l;
      } else if (s[si].r < p) {
        sum += p - s[si].r;
        p = s[si].r;
      }
      ++t;
      if (t == s.length) break;
    }
    sum += Math.abs(p);
    return sum;
  }


  static class Interval {
    int l, r;
    boolean used;

    Interval(int l, int r) {
      this.l = l;
      this.r = r;
    }
  }
}

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

#define endl '\n'

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long x, quo_1, rem, quo_2;
    cin >> x;
    quo_1 = x / 500;
    rem = x % 500;
    quo_2 = rem / 5;
    cout << (quo_1 * 1000 + quo_2 * 5) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.function.BiConsumer;

public class Main {

    private static int max = 0;

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt( sc.nextLine() );
        String[] ss = new String[n];
        Map<String,Integer> map = new HashMap<>();
        max = 0;
        for( int i = 0 ; i < n ; i++ ){
            String str = sc.nextLine();
            Integer count = map.get( str );
            if( count == null ){
                count = 0;
            }
            max = Math.max( max , count + 1 );
            map.put( str , count + 1 );
        }

        List<String> outputs = new ArrayList<>();
        map.forEach((str, count) -> {
            if(count == max ){
                outputs.add( str );
            }
        });

        outputs.sort(String::compareTo);

        for (String output : outputs) {
            System.out.println(output);
        }

    }

}


Measured memory_bytes: 178840
import java.util.Scanner;

public class Main {

  static int bubbleSort(int[] a, int n) {
    int sw = 0;
    boolean flag = true;
    for (int i = 0; flag; i ++) {
      flag = false;
      for (int j = n - 1; j >= i + 1; j--) {
        if (a[j] < a[j-1]) {
          int t = a[j];
          a[j] = a[j-1];
          a[j-1] = t;
          flag = true;
          sw++;
        }
      }
    }
    return sw;
  }

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = stdIn.nextInt();
    int sw = bubbleSort(a, n);
    for (int i = 0; i < n; i++) {
      System.out.print(a[i]);
      if (i != n - 1) System.out.print(' ');
      else System.out.println();
    }
    System.out.println(sw);
  }
}

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

int a[55];

int main() {
	int n,k,ans=0;
	scanf("%d%d",&n,&k);
	for (register int i=1;i<=n;++i) {
		scanf("%d",a+i);
	}
	sort(a+1,a+n+1);
	for (register int i=n-k+1;i<=n;++i) {
		ans+=a[i];
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var v, A, B, C int
	fmt.Scan(&A, &B, &C)
	if A&1 == 1 || B&1 == 1 || C&1 == 1 {
		fmt.Println(0)
		return
	}
	if A == B && B == C {
		fmt.Println(-1)
		return
	}
	for A&1 == 0 && B&1 == 0 && C&1 == 0 {
		v++
		A, B, C = (B+C)/2, (A+C)/2, (A+B)/2
	}
	fmt.Println(v)
}


Measured memory_bytes: 1768
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,ans=0;
    cin>>n;
    if(n%2==0){
        n/=2;
        while(n){
          n/=5;
          ans+=n; 
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

#define f(i,a,b) for( ll i = a; i < b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x);1
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair	
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

using namespace std;
typedef long long ll;
typedef long double ld;	
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
	 
const ll MAX = 10000000;
const ll inf = 5e18-1;
	
ll flor(double m){
	return (ll) m;
}

int main() {
	fastio;
	string s;
	cin>>s;
	if(s=="ABC") cout<<"ARC";
	else cout<<"ABC";
	return 0;
	}

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



Measured memory_bytes: 3076
function Main(input) {
    var result;
    const A = parseInt(input[0])
    const P = parseInt(input[1])
    console.log(Math.floor((A*3+P) / 2));
}

// 1行入力の場合
// Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

// 改行で分割
// Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n/));

// 改行・空白で分割
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

Measured memory_bytes: 21064
#include <stdio.h>

int main(void) {
	int h,r;
	scanf("%d%d",&h,&r);
	if(h < -1*r)
	{
		printf("-1\n");
	}
	else if(h == -1*r)
	{
		printf("0\n");
	}
	else
	{
		printf("1\n");
	}
	return 0;
}

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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    vll a(3),count(3,0);
    rep(i,3)cin >> a[i];
    rep(i,3){
        rep(j,3){
            if(a[i] == a[j])count[i]++;
        }
        if(count[i] == 1){
            cout << a[i] << endl;
            return 0;
        }
    }

    return 0;
}

Measured memory_bytes: 256
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define test ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*
int inv[1000001]={0};int invf[1000001]={0};
void findinverse(){
	inv[0]=1;
	inv[1] = 1;
	for(int i = 2; i <=1e6 ; ++i)
		inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;
	invf[0]=1;invf[1]=1;
	for(int i=2;i<=1e6;i++){
		invf[i]=invf[i-1]*inv[i]%mod;
	}
}*/
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> orderedSet;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> orderedMultiset;
int solve()
{
	int a;
	double b;
	cin>>a>>b;
	int x=b*100+0.5;
	cout<<(x*a)/100<<endl;
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}



Measured memory_bytes: 3684
from math import gcd
def main():
    n=int(input())
    A=list(map(int,input().split()))
    m=max(A)
    l=[0 for _ in range(m)]
    fp=True
    for a in A:
        l[a-1]+=1
    for i in range(2,m):
        cnt=0
        for j in range(i-1,m,i):
            cnt+=l[j]
            if cnt>1:
                fp=False
                break
    g=0
    fs=False
    for a in A:
        g=gcd(g,a)
    if g==1:
        fs=True

    if fp:
        print("pairwise coprime")
    elif fs:
        print("setwise coprime")
    else:
        print("not coprime")
if __name__=="__main__":
    main()

Measured memory_bytes: 126884
#include <iostream>

using namespace std;

int ans;
char s[5], t[5];
int main()
{
    cin >> s >> t;
    for (int i = 0; i < 3; i ++){
        if (s[i] == t[i]) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
N, A, B, C = map(int, input().split())
S = [list(input()) for i in range(N)]

v = [A, B, C]
id_d = {'A':0, 'B':1, 'C':2}
ans = [0] * N
for i, s in enumerate(S):
  s1, s2 = s
  id1, id2 = id_d[s1], id_d[s2]
  v1, v2 = v[id1], v[id2]
  if v1 == v2 == 0:
    if i == 0:
      print('No')
      quit()
    else:
      pre_s1, pre_s2 = S[i-1]
      pre_id1, pre_id2 = id_d[pre_s1], id_d[pre_s2]
      if pre_s1 in [s1, s2]:
        v[pre_id1] += 2
        v[pre_id2] -= 2
        ans[i-1] = pre_s1
        if v[pre_id2] < 0:
          print('No')
          quit()
      else: # pre_s2 in [s1, s2]
        v[pre_id2] += 2
        v[pre_id1] -= 2
        ans[i-1] = pre_s2
        if v[pre_id1] < 0:
          print('No')
          quit()
  v1, v2 = v[id1], v[id2]
  if v1 >= v2:
    ans[i] = s2
    v[id1] -= 1
    v[id2] += 1
  else:
    ans[i] = s1
    v[id1] += 1
    v[id2] -= 1

print('Yes')
print(*ans, sep='\n')

Measured memory_bytes: 20200
#include "bits/stdc++.h"
using namespace std;

// #define int long long

signed main(void) {
  int num; // num
  num = 0; // count, result
  // num = numeric_limits<int>::min(); // max
  // num = numeric_limits<int>::max(); // min
  int N;
  // int M;
  // array<int, 10000> A;
  string yes = "Yes";
  string no = "No";
  // string S;
  // string T;

  // cin >> N;

  int A, B;
  cin >> A;
  cin >> B;

  cout << (A - 1) * (B - 1) << endl;

  // for (auto it = A.begin(); it < A.begin() + N; ++it)
  //   cin >> *it;

  // for (auto it = A.begin(); it < A.begin() + N; ++it)
  //   if (*it % 2 == 0) ++num;

  // cout << num << end;
  
  return 0;
}


Measured memory_bytes: 764
#include<stdio.h>
int main()
{
    int i=1,x;
   while(scanf("%d",&x)!=EOF)
        //for(i=1;i;i++)

{


    if(x==0)
    {
        break;
    }
     printf("Case %d: %d\n",i,x);
    i++;

}

    return 0;
}



Measured memory_bytes: 2044
import java.io.*;
import java.util.*;

class Main {
	
	public static void main(String[] args) throws IOException {

		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));
		
		int cnt = 0;
		
		while (true) {
			
			String s = br.readLine();
			if (s == null) break;
			if (s.equals(new StringBuffer(s).reverse().toString()))
				cnt++;
			
		}
		
		System.out.println(cnt);

	}

}

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

int main() {
    int n;
    cin >> n;
    int res = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a, a--;
        res += a;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define lb lower_bound
#define ub upper_bound
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

ll dp[1<<17]={};
ll cost[1<<17]={};

signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  int n;cin>>n;
  VV<ll> v(n,V<ll>(n));
  rep(i,0,n)rep(j,0,n)cin>>v[i][j];

  rep(i,0,1<<n){
    rep(j,0,n){
      rep(k,j+1,n){
        if((i&(1<<j)) && (i&(1<<k))){
          cost[i]+=v[j][k];
        }
      }
    }
    dp[i]=cost[i];
  }

  rep(i,0,1<<n){
    for(int j=i;j>0;--j,j&=i){
      chmax(dp[i],dp[j]+dp[i^j]);
    }   
  }

  cout<<dp[(1<<n)-1]<<ENDL;


}
//( ・ __ ・ ) KEEP BEING ORGANIZED
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 1280
s = input()
d = {'a': 0, 'b': 0, 'c': 0}

for si in s:
    d[si] += 1
d = dict(sorted(d.items(), key=lambda x:x[1], reverse=True))

value = list(d.values())
if value[0]-value[-1] > 1:
    print('NO')
else:
    print('YES')


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

int pop();
void push();

int top,S[1000];



void push(int x){
  S[++top]=x;
}

int pop(){
  top--;
  return S[top+1];
}



int main(){
  int a,b;
  top=0;
  char s[100];

  while(scanf("%s",s) != EOF){
    if(s[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
     
      }
    else if ( s[0] == '-' ){
      b=pop();
      a=pop();
      push(a-b);
    }
    else if ( s[0] == '*' ){
      a=pop();
      b=pop();
      push(a*b);
    }
    else {
      push(atoi(s));

    }
  }

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

  return 0;
}




Measured memory_bytes: 2036
#include <iostream>
#include <string.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[22][1<<21];
int a[21][21];
int N;
long long calc(int i, int s) {
	if (~dp[i][s]) return dp[i][s];
	if (i == N) return dp[i][s] = 1;
	dp[i][s] = 0;
	for (int j = 0; j < N; j++) {
		if (a[i][j]) {
			if (s >> j & 1) {
				dp[i][s] = (dp[i][s] + calc(i + 1, s ^ (1 << j))) % mod;
			}
		}
	}
	return dp[i][s];
}
int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			cin >> a[i][j];
		}
	}
	memset(dp, 0xff, sizeof(dp));
	cout << calc(0, (1 << N) - 1) << endl;
}


Measured memory_bytes: 360704
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int n,temp;cin>>n;
  	map<int,int> d;
  	for(int i=0;i<n;i++){
      	cin>>temp;
    	d[temp]++;
    }
  	
  	int m;cin>>m;
  	for(int i=0;i<m;i++){
      	cin>>temp;
    	d[temp]--;
      	if(d[temp]<0){
        	cout<<"NO"<<endl;
          	return 0;
        }
    }
  cout<<"YES"<<endl;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
int main()
{
    string s;
    cin >> s;

    int N = s.size();
    long long sum = 0;

    REP(bit, (1<<N-1)){
        long long v = s[0] - '0' ;
        REP(i, N-1){
            if (bit & 1<<i){
                sum += v;
                v = s[i+1] - '0';
            }
            else v = v*10 + (s[i+1] - '0');
        }
        sum += v;
    }
    
    cout << sum <<endl;
   return 0;
}

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

int main() {
    int N, K;
    cin >> N >> K;
    int ans = 0;
    int tmp;
    rep(i, N) {
        cin >> tmp;
        if (tmp >= K) {
            ans += 1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
typedef long long ll;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=LLONG_MAX;
const int inf=INT_MAX;
const int nmax=1e5+5;
const int mod=1e9+7;
using namespace std;
int n,s,x;
int main()
{
    //freopen("sol.in","r",stdin);
	//freopen("sol.out","w",stdout);
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	cin>>n;
	x=n;
	while(x)s+=x%10,x/=10;
	if(n%s==0)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
gets
s=gets.chomp
cnt=0
ml=0
s.chars do |c|
  if c=="("
    cnt-=1
  else
    cnt+=1
    ml=cnt if cnt>ml
  end
end
cnt=0
mr=0
s.reverse.chars do |c|
  if c==")"
    cnt-=1
  else
    cnt+=1
    mr=cnt if cnt>mr
  end
end
puts "("*ml + s + ")"*mr


Measured memory_bytes: 1788
#include<bits/stdc++.h>
int a[105],n,i,x;
int main(){
	scanf("%d%d",&n,&x);
	for(i=1;i<=n;++i)scanf("%d",a+i);
	std::sort(a+1,a+n+1);
	for(i=1;i<=n && x>=a[i];x-=a[i++]);
	if(i>n && x)i=n;
	printf("%d\n",i-1);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main(){
    int n; cin >> n;
    int four = 0;
    int two = 0;
    REP(i,n){
        int a; cin >> a;
        if(a%4==0){
            four++;
        }else if(a%2==0){
            two++;
        }
    }
    bool ans ;
    if(2*four+1>=n){
        ans = true;
    }else if(2*four+two >= n){
        ans = true;
    }else{
        ans = false;
    }
    if(ans){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

}

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

int main(){
  int N;
  cin >> N;
  vector<double> x(N);
  vector<string> u(N);
  double sum = 0;
  for(int i = 0; i < N; i++){
    cin >> x[i] >> u[i];
    if(u[i] == "JPY"){ sum += x[i]; }
    else{ sum += x[i] * 380000.0; }
  }

  cout << sum << endl;


  return 0;
}

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

int main()
{
	string S,T;
	bool ans=true;
	int Sal[26],Tal[26];
	for(int i=0;i<26;i++){
		Sal[i]=0;
		Tal[i]=0;
	}
	
	cin >> S >> T;
	for(int i=0;i<S.size();i++){
		Sal[S[i]-'a']++;
	}
	for(int i=0;i<T.size();i++){
		Tal[T[i]-'a']++;
	}
	sort(Sal,Sal+26);
	sort(Tal,Tal+26);
	for(int i=0;i<26;i++){
		if(Sal[i]!=Tal[i]){
			ans=false;
			break;
		}
	}
	if(ans==true)cout << "Yes";
	else cout << "No";
	cout << endl;
	return 0;
}

Measured memory_bytes: 776
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

const int INF = 1 << 25;

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

int main() {
#ifdef DEBUG
  ifstream ifs("in.txt");
  cin.rdbuf(ifs.rdbuf());
#endif
  int H, W;
  while (cin >> H >> W) {
    vector<string> grid(H);
    for (auto& x : grid) cin >> x;
    int N = H * W;
    vec<int, 2> G = make_v(N, N, INF);
    for (int i = 0; i < N; i++) G[i][i] = 0;
    for (int y = 0; y < H; y++) {
      for (int x = 0; x < W; x++) {
        for (int k = 0; k < 4; k++) {
          int ny = y + dy[k], nx = x + dx[k];
          if (ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
          if (grid[y][x] == '.' && grid[ny][nx] == '.') {
            int a = y * W + x, b = ny * W + nx;
            G[a][b] = G[b][a] = 1;
          }
        }
      }
    }
    for (int k = 0; k < N; k++)
      for (int i = 0; i < N; i++)
        for (int j = 0; j < N; j++)
          chmin(G[i][j], G[i][k] + G[k][j]);
    int res = 0;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if (G[i][j] != INF) chmax(res, G[i][j]);
      }
    }
    cout << res << endl;
  }
  return 0;
}


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

int main() {
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  int a_amari=a%10;
  int b_amari=b%10;
  int c_amari=c%10;
  int d_amari=d%10;
  int e_amari=e%10;
  int sa_a=10-a_amari;
  if(sa_a==10)sa_a=0;
  
  int sa_b=10-b_amari;
  if(sa_b==10)sa_b=0;
  
  int sa_c=10-c_amari;
  if(sa_c==10)sa_c=0;
  
  int sa_d=10-d_amari;
  if(sa_d==10)sa_d=0;
  
  int sa_e=10-e_amari;
  if(sa_e==10)sa_e=0;
  
  int kotae=a/10*10+b/10*10+c/10*10+d/10*10+e/10*10;
  int tasu=0;
  if(a_amari!=0)tasu++;
  if(b_amari!=0)tasu++;
  if(c_amari!=0)tasu++;
  if(d_amari!=0)tasu++;
  if(e_amari!=0)tasu++;
  int saishou=INT_MAX;
  if(a_amari!=0)saishou=min(saishou,a_amari);
  if(b_amari!=0)saishou=min(saishou,b_amari);
  if(c_amari!=0)saishou=min(saishou,c_amari);
  if(d_amari!=0)saishou=min(saishou,d_amari);
  if(e_amari!=0)saishou=min(saishou,e_amari);
  if(tasu>1)kotae+=10*(tasu-1)+saishou;
  else if(tasu==1)kotae+=max({sa_a,sa_b,sa_c,sa_d,sa_e});
  cout<<kotae<<endl;
  return 0;
}

Measured memory_bytes: 3640
using System;

namespace ABC062_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var aaa = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var H = aaa[0];
            var W = aaa[1];
            var str = new char[H, W];
            for (var i = 0; i < H; i++)
            {
                var s = Console.ReadLine();
                for (var j = 0; j < W; j++)
                {
                    str[i, j] = s[j];
                }
            }
            for (var i = 0; i < H + 2; i++)
            {
                for (var j = 0; j < W + 2; j++)
                {
                    if (i == 0 || j == 0 || i == H + 1 || j == W + 1)
                        Console.Write('#');
                    else
                        Console.Write(str[i-1, j-1]);
                }
                Console.WriteLine();
            }
        }
    }
}


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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

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

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn binary_search<T: Ord, F>(v: &[T], f: F) -> usize
where
    F: Fn(&T) -> bool,
{
    let mut ok = v.len() as i64;
    let mut ng = -1;
    while (ok - ng).abs() > 1 {
        let mid = (ok + ng) / 2;
        if f(&v[mid as usize]) {
            ok = mid;
        } else {
            ng = mid;
        }
    }
    ok as usize
}

fn main() {
    input! {
        n: usize,
        a: [usize; n],
        b: [usize; n],
    }

    let mut ans = 0;

    for i in 0..30 {
        let mut am = vec![];
        let mut bm = vec![];
        for j in 0..n {
            am.push(a[j] % (1 << (i + 1)));
            bm.push(b[j] % (1 << (i + 1)));
        }
        bm.sort();
        let mut ones = 0;
        for j in 0..n {
            let u = (1 << i) + (1 << (i + 1)) - am[j];
            let r1 = if (1 << i) >= am[j] {
                binary_search(&bm, |&x| x >= (1 << i) - am[j])
            } else {
                0
            };
            let r2 = binary_search(&bm, |&x| x >= (1 << (i + 1)) - am[j]);
            let r3 = binary_search(&bm, |&x| x >= u);
            // println!("{}, {}, {}, {}", j, r1, r2, r3);
            ones += n - r3 + r2 - r1;
        }
        if ones & 1 > 0 {
            ans += 1 << i;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 14588
#include <iostream>

using namespace std;

int main()
{
    int n;
    long int min, max, acc = 0;
    cin  >> n;
    
    int a[n], s;
    cin  >> s;
    
    min = s;
    max = s;
    acc = s;
    
    for(int i = 0; i < n - 1; i++)
    {
        cin  >> a[i];
        
        if(min > a[i])
            min = a[i];
        
        if(max < a[i])
            max = a[i];
            
        acc += a[i];
    }
    
    cout << min << ' ' << max << ' ' << acc << endl;
    
    return 0;
}

Measured memory_bytes: 3140
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  set<char> c = {'A','C','T','G'};
  string s;
  cin >> s;
  int ans = 0,cnt = 0;
  rep(i,s.size()){
    if(c.count(s[i])>0){
      ++cnt;
      ans = max(ans,cnt);
    }else{
      cnt = 0;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 384
package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	const maxWord = (1 << 30)
	buf := []byte{}
	sc.Buffer(buf, maxWord)
	sc.Split(bufio.ScanWords)
}

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

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func main() {
	n, _ := strconv.Atoi(input())
	h := make([]int, n+1)
	for i := 1; i <= n; i++ {
		h[i], _ = strconv.Atoi(input())
	}

	dp := make([]int, n+1)
	dp[1] = 0
	dp[2] = abs(h[2] - h[1])
	for i := 3; i <= n; i++ {
		dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
	}
	fmt.Println(dp[n])
}


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

using namespace std;

using ll = long long;

vector<int> parse(int n, string& s) {
    char c = s[0];
    int tmp = 1;
    vector<int> res;
    for (int i = 1; i < n; i++) {
        if (s[i] != c) {
            c = s[i];
            res.push_back(tmp);
            tmp = 1;
        } else {
            tmp++;
        }
    }
    res.push_back(tmp);
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, K;
    cin >> n >> K;
    string s;
    cin >> s;

    vector<int> v = parse(n, s);
    int ans = 0;
    for (int x : v) {
        ans += x - 1;
    }

    int sz = v.size();
    int cnt2 = (sz - 1) / 2;
    int cnt1 = (sz - 1) % 2;
    cnt2 = min(cnt2, K);
    K -= cnt2;
    ans += 2 * cnt2;
    if (K) ans += cnt1;
    cout << ans << endl;
    return 0;
}

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

using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)

int main() {
	int H, W; cin >> H >> W;
	char S[102][102];
	rep(i, 0, H) {
		cin >> S[i];
	}

	rep(j, 0, W + 2) {
		cout << "#";
	}
	cout << endl;
	rep(i, 0, H) {
		cout << "#";
		rep(j, 0, W) {
			cout << S[i][j];
		}

		cout << "#" << endl;
	}
	rep(j, 0, W + 2) {
		cout << "#";
	}
	cout << endl;
}

Measured memory_bytes: 256
import scala.io.StdIn
import scala.collection.mutable._

object Main extends App {

  val Array(n, m) = StdIn.readLine.split(" ").map(_.toInt)
  val graph = Array.fill(n+1)(ListBuffer.empty[Int])
  Iterator.continually(StdIn.readLine)
    .take(m)
    .map(_.split(" ").map(_.toInt))
    .foreach(e => graph(e(0)) += e(1))

  val isPossible = {
    var visited = false
    def dfs(pos:Int, cnt:Int):Unit = {
      if(cnt < 0) return
      if(pos == n) visited = true
      if(!visited) {
        for(i <- graph(pos)) {
          dfs(i, cnt-1)
        }
      }
    }
    dfs(1,2)
    visited
  }
  val ans = if(isPossible) "POSSIBLE" else "IMPOSSIBLE"
  println(ans)
}

Measured memory_bytes: 81672
import java.util.*;

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

        String[] strArray = str.split("");
        String[] akibaArray = { "A", "K", "I", "H", "A", "B", "A", "R", "A" };
        boolean flag = true;
        int count = 0;
        int i = 0;

        for (; i < akibaArray.length; i++) {
            if (count >= strArray.length) {
                break;
            }
            if (strArray[count].equals(akibaArray[i])) {
                count++;
            } else if (!akibaArray[i].equals("A")) {
                flag = false;
                break;
            }

        }

        if (i <= akibaArray.length - 2 || count < strArray.length) {
            flag = false;
        }

        System.out.println(flag ? "YES" : "NO");
    }
}

Measured memory_bytes: 22612
# coding: utf-8
 
uSec = 1
uMinute = 60 * uSec
uHour = 60 * uMinute
 
input_secs = int(raw_input().rstrip())
 
h = input_secs / uHour
m = (input_secs - h * uHour) / uMinute
s = (input_secs - h * uHour - m * uMinute) / uSec
 
print ':'.join([str(x) for x in [h, m, s]])

Measured memory_bytes: 4204
#include <bits/stdc++.h>
//登録しよう！→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define gre greater //sortを降順にする
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::vector<long long> H){
  bool ans = true;
  ll x = 0;
  for (int i = 0; i < N; i++) {
    if(H[i] < x)ans = false;
    x = max(x,H[i]-1);
  }
  cout << (ans ? YES:NO) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> H(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    solve(N, std::move(H));
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using lint=long long;
using real=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n;std::cin>>n;
    n/=5;
    std::cout<<n*5+n/100*500<<'\n';
}


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

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

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

long long X,Y,ans=0;

int main(){
    cin>>X>>Y;
    while(Y>=X){
        ans++;
        X*=2;
    }
    out(ans);
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <vector>
#include <list>
 
using namespace std;
typedef long long ll;
 
#define mod 1000000007
#define INF 1000000000
#define SIZE 1000
int n,c[SIZE],w[SIZE];
bool memo[SIZE][SIZE];

void dfs(int l,int r,int now,int weight){
  if(l < 0 || n <= r) return;
  if(memo[l][r]) return;
  
  if(c[now] < weight) return;

  memo[l][r] = true;

  //cerr << "(" << l << "," << r << ")" << endl;
  
  weight += w[now];
  
  dfs(l,r+1,r+1,weight);
  dfs(l-1,r,l-1,weight);

}
  

int main(){
  int l[SIZE],r[SIZE];
  int dp[SIZE+10];
  
  scanf("%d",&n);

  for(int i=0;i<n;i++){
    scanf("%d%d",&c[i],&w[i]);
  }

  for(int i=0;i<n;i++){
    dfs(i,i,i,0);
  }
  
  for(int i=0;i<=n;i++){
    dp[i] = INF;
  }

  dp[0] = 0;

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

    for(int j=i;j<n;j++){
      if(memo[i][j]) dp[j+1] = min(dp[j+1],dp[i]+1);
    }

  }

  cout << dp[n] << endl;
  
  return 0;
}

Measured memory_bytes: 2200