akhauriyash/Code-Regression huggingface dataset:
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+:---test
4 3
1 2
2 3
2 4
2 10
1 100
3 1
---+/
/+---test
6 2
1 2
1 3
2 4
3 6
2 5
1 10
1 10
---+/

void main(string[] args) {
  long N, Q;
  readf(" %d %d ", &N, &Q);

  long[][] verts;
  verts.length = N;

  foreach (i; 0..N-1) {
    long a, b;
    readf(" %d %d ", &a, &b);
    --a;
    --b;
    verts[a] ~= b;
    verts[b] ~= a;
  }

  auto queries = new long[N];
  foreach (i; 0..Q) {
    long p, x;
    readf(" %d %d ", &p, &x);
    --p;
    queries[p] += x;
  }

  auto dp = new long[N];

  struct Item { long target, parent; }
  DList!Item queue;
  queue.insertBack(Item(0, -1));

  while (!queue.empty) {
    const front = queue.front;
    queue.removeFront();

    dp[front.target] = queries[front.target];
    if (front.parent >= 0) dp[front.target] += dp[front.parent];

    foreach (v; verts[front.target]) {
      if (v != front.parent) queue.insertBack(Item(v, front.target));
    }
  }

  foreach (i, v; dp) {
    if (i != 0) " ".write;
    v.write;
  }
  writeln;
}


Measured memory_bytes: 27900
/*input
8
8 2 7 3 4 5 6 1
*/
#include <iostream>
#include <map>
#define rep(i,a) for(int i=0;i<a;i++)
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);	
	cin.tie(0);
	cout.tie(0);
	int n,x;
 	map<int,int> m;
 	cin>>n;
 	rep(i,n){
 		cin>>x;
 		m[x] = i+1;
 	}
 	for(auto i:m)cout<<i.second<<" ";
	return 0;
}


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

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    long long m,n;
    cin >> m >> n;
    unsigned long long x=1;
    while (true){
        if (n == 0) break;
        if (n&1) x*=m;
        x %= 1000000007;
        m *= m ;
        m %= 1000000007;
        n >>= 1;
    }
    cout << x << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  long long sum = 0;
  for (int i = 1; i <= N; i++) {
    if (i % 3 != 0 && i % 5 != 0) {
      sum += i;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int read(void)
{
	int x = 0,f = 1; char ch = getchar();
	while(!isdigit(ch)){f = ch == '-' ? -1 : 1; ch = getchar();}
	while(isdigit(ch)){x = (x << 3) + (x << 1) + ch - '0'; ch = getchar();}
	return x * f;
}
signed main(signed argc, char *argv[])
{
	int ans = 0;
	int N = read(),K = read();
	if (K == 0)
	{
		N *= N;
		cout << N;
		return 0;
	}
	for (int b = K+1; b <= N; b++)
	{
		int xmax = (N)/(b);
		//cout << xmax << " # " << "\n"; 
		ans += xmax * (b-K);
		ans += max(0LL,(N - b * xmax) - K + 1);
		//cout << ans << endl;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;
const int MOD = 1000000007;


typedef long long int ll; 
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

void floatOutPutSetup(){
    cout << fixed;
    cout << setprecision(10);
}

int main(){
    int n,m;
    cin >> n >> m;
    int ans=0;
    ans+=max(n*(n-1),0);
    ans+=max(m*(m-1),0);
    cout<<ans/2;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>



int main() {
  int n, i, j, temp, t;
  scanf("%d", &n);
  int a[n];
  for(i = 0; i < n; i++) scanf("%d", a+i);

  t=0;
  for(i = 0; i < n-1; i ++)
    for(j = n-1; j > i; j--)
      if(a[j] < a[j-1]) {
	temp = a[j];
	a[j] = a[j-1];
	a[j-1] = temp;
	t++;
      }

  for(i = 0; i < n-1; i++) printf("%d ", a[i]);
  printf("%d\n", a[i]);
  printf("%d\n", t);

  return 0;  
}

Measured memory_bytes: 600
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
	int a, b, c;
	cin >> a >> b >> c;
	for(int i = b; i <= c; i++){
		if(i % a == 0){
			puts("OK");
			return 0;
		}
	}
	puts("NG");
    return 0;
}
// Write Here


Measured memory_bytes: 3648
use std::io::*;

fn dfs(i: usize, j: usize, k: usize, n: usize, memo: &mut Vec<Vec<Vec<f64>>>) -> f64 {
    if memo[i][j][k] >= 0.0 {
        memo[i][j][k]
    } else {
        let mut res: f64 = n as f64;
        if i > 0 {
            res += i as f64 * dfs(i - 1, j + 1, k, n, memo);
        }
        if j > 0 {
            res += j as f64 * dfs(i, j - 1, k + 1, n, memo);
        }
        if k > 0 {
            res += k as f64 * dfs(i, j, k - 1, n, memo);
        }
        res /= (i + j + k) as f64;
        memo[i][j][k] = res;
        res
    }
}

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();

    let mut cnt: Vec<usize> = vec![0; 4];
    for i in a {
        cnt[i] += 1;
    }

    let mut memo: Vec<Vec<Vec<f64>>> = vec![vec![vec![-1.0; 303]; 303]; 303];
    memo[0][0][0] = 0.0;
    println!("{:.10}", dfs(cnt[3], cnt[2], cnt[1], n, &mut memo));
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef string st;
typedef double db;
typedef vector<long long> vecll;
typedef vector<char> vechar;
typedef vector<string> vecst;

int main(){
    ll N;
    cin >> N;
    vecll W(N);
    for(auto& i : W) cin >> i;

    ll ans = 10000000000000000;
    for(ll T = 1; T < N; T++){
        ll S1 = 0;
        ll S2 = 0;
        for(ll i = 0; i < N; i++){
            if(i <= T) S1 += W.at(i);
            else S2 += W.at(i);
        }
        if(abs(S1 - S2) < ans) ans = abs(S1 - S2);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
/**************************************************************************
Coded by: Saba Karimi(_VINTAGE)
Institution: AIT PUNE
***************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back 
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define ld long double
#define int long long int 
/**************************************************************************/
int mod = 1e9+7;
int add(int a,int b)
{
    return ((a%mod)+(b%mod))%mod;
}
signed main()
{
    fast;
    string s;
    cin>>s;
    int n = s.size();
    s = "a"+s;
    int dp[n+1][13];
    memset(dp,0,sizeof(dp));
    if(s[1]=='?')
    {
        for(int k=0;k<=9;k++)
            dp[1][k] = 1;
    }
    else dp[1][s[1]-'0'] = 1;
    for(int i=2;i<=n;i++)
    {
        for(int j=0;j<13;j++)
        {
            if(dp[i-1][j]==0) continue;
            if(s[i]=='?')
            {
                for(int k=0;k<=9;k++)
                {
                    dp[i][(j*10+k)%13] = add(dp[i][(j*10+k)%13],dp[i-1][j]);
                }
            }
            else
            {
                int k = s[i]-'0';
                dp[i][(j*10+k)%13] = add(dp[i][(j*10+k)%13],dp[i-1][j]);
            }
        }
    }
    cout<<dp[n][5];
}

Measured memory_bytes: 10604
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <unordered_map>
#include <tuple>
#include <complex>


#define FOR(i, a, b)		for(int i = (int)(a); i < (int)(b); ++i)
#define FORE(i, a, b)		for(int i = (int)(a); i <= (int)(b); ++i)
#define REP(i, n)			FOR(i, 0, n)
#define REPE(i, n)			FORE(i, 0, n)
#define ALL(x)				(x).begin(),(x).end()
#define DEBUG_DC(x)			cout << #x << ": " << x << endl
#define VEC_TYPE			int	
#define INF					1e5+1

using namespace std;
typedef long long ll;
typedef vector<VEC_TYPE> vdef;
typedef vector<vdef> vvdef;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmaxE(T& a, T b) { if (a <= b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool chminE(T& a, T b) { if (a >= b) { a = b; return 1; } return 0; }
template<typename T>inline T mygcd(T a, T b) { return b ? mygcd(b, a%b) : a; }
template<typename T>inline T mylcm(T a, T b) { return a * b / mygcd(a, b); }


int main()
{
	string s;
	cin >> s;
	int ans = 0;
	int zero = 0;
	int one = 0;

	for (int i = 0; i < s.size(); ++i)
	{
		if (i % 2 == 0)
		{
			if (s[i] == '0') ++zero;
			if (s[i] == '1') ++one;
		}
		else
		{
			if (s[i] != '0') ++zero;
			if (s[i] != '1') ++one;
		}
	}

	chmin(zero, one);
	cout << zero << endl;
	return 0;
}

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

#define mod 1000000007

#define rep(i, n) for(int i=0; i<n; ++i)

using namespace std;
typedef long long ll; 
 
int main(void){
	
	int N;
	
	cin >> N;
	
	double v[N];
	
	rep(i, N)
		cin >> v[i];
		
	sort(v, v+N);
	
	double a = v[0];
	for(int i=0; i<N-1; i++){
		a = (a + v[i+1]) / 2.0;
	}
	
	cout << a;
	
	return 0;
}

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

typedef long long ll;

using vi = vector<int>;
using vl = vector<long long int>;
using vii = vector<vector<int>>;
using vll = vector<vector<long long int>>;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
       const int INF=1e9+7;
    int n,k,temp;
    string s,t;
    cin>>s>>t;
    int l1=s.length(),l2=t.length();
    vector<char>ss(l1+1);
    for(int i=1;i<=l1;i++)ss[i]=s[i-1];
        vector<char>tt(l2+1);
    for(int i=1;i<=l2;i++)tt[i]=t[i-1];

vector<char>ans;

vii dp(l1+1,vi(l2+1));

for(int i=1;i<=l1;i++)
{

    for(int j=1;j<=l2;j++)
    {
        temp=0;
        if(ss[i]==tt[j])temp=1+dp[i-1][j-1];
        dp[i][j]=max(dp[i][j-1],max(dp[i-1][j],temp));
        
    }
}

int count=dp[l1][l2];
int right_end=l2;

    for(int i=l1;i>0;i--)
    {
        for(int j=right_end;j>0;j--)
        {
            if(dp[i][j]==count&&ss[i]==tt[j])
            {
                ans.push_back(ss[i]);
                count--;
                right_end=j;
                 break;
            }
        }
           if(!count)break;
    }
 
for(int i=ans.size()-1;i>=0;i--)cout<<ans[i];
    cout<<"\n";

return 0;

}


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

using namespace std;

typedef long long ll;

string s;

int main(){
    cin >> s;
    for(int i=0;i<s.size();i++){
        if(i%2 == 0){
            if(s[i] != 'R' && s[i] != 'U' && s[i] != 'D'){
                cout << "No" << endl;
                return 0;
            }
        }else{
            if(s[i] != 'L' && s[i] != 'U' && s[i] != 'D'){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
using System;

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var _ = Console.ReadLine().Split();
            var l = long.Parse(_[0]);
            var r = long.Parse(_[1]);

            var mod = 2018;
            if(r - l >= 2019 * 2){
                mod = 0;
            }else{
                for(var i = l; i < r; i++){
                    for(var j = i + 1; j <= r; j++){
                        var n = (i * j) % 2019;
                        mod = Math.Min(mod, (int)n);
                    }
                }
            }

            Console.WriteLine(mod);
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<vector>
#include<algorithm>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define pb push_back
using namespace std;
const int INF = 1e9;
typedef long long ll;
using namespace std;

int main(){
  int N;
  cin >> N;
  long long a;
  vector <long long> s;
  REP(i,N){
    cin >> a;
    s.push_back(a);
  }
  ll sum = 0;
  sort(s.begin(),s.end());
  REP(i,N){
    ll m = s[i];
    int j = i;
    while(s[i] == m){
      i++;
    }
    if((i-j)%2 == 1){
      sum++;
    }
    i--;
  }
  cout << sum << endl;

}


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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int f(int n) {
  if(n % 2) return 3 * n + 1;
  else return n / 2;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  vi l(n);
  int su = 0;
  for(int i=0;i<n;++i) {
    cin >> l[i];
    su += l[i];
  }
  bool ok = true;
  for(int i=0;i<n;++i) {
    if(l[i] >= su - l[i]) {
      ok = false;
      break;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;


}


Measured memory_bytes: 256
import sys
import heapq
import bisect

mod = 10**9+7
dd = ((-1,0),(1,0),(0,-1),(0,1))

def I(): return(int(sys.stdin.readline()))
def LI(): return([int(x) for x in sys.stdin.readline().split()])
def S(): return((list(sys.stdin.readline()))[:-1])
def IR(n): return([I() for _ in range(n)])

def GCD(a,b):
    while b!=0:
        a,b = b,a%b
    return a

def LCM(a,b):
    return a * b // GCD(a,b)

def main():
    N,K,Q = LI()
    A = IR(Q)

    point = [K-Q for _ in range(N)]
    for a in A:
        point[a-1] += 1

    for p in point:
        if p>0:
            print("Yes")
        else:
            print("No")
            


if __name__ == "__main__":
    main()


Measured memory_bytes: 50780
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			List<Integer> list = new ArrayList<Integer>();
			String s;

			while ((s = br.readLine()) != null && list.size() <= 200) {

				String[] num = s.split(" ");
				if (0 <= Integer.parseInt(num[0])
						&& Integer.parseInt(num[1]) <= 1000000) {
					int sum = Integer.parseInt(num[0])
							+ Integer.parseInt(num[1]);
					list.add(Integer.toString(sum).length());
				}else {
					break;
				}
			}

			for (int keta : list) {
				System.out.println(keta);
			}

		} finally {
			br.close();
		}

	}
}

Measured memory_bytes: 17068
#include<cstdio>
using namespace std;
int myabs(int f__k) {return f__k<0?-f__k:f__k;}
int main()
{
	int a,b;scanf("%d%d",&a,&b);if(a==b) {printf("0\n");return 0;}
	if(a>0&&b<0||a<0&&b>0) {printf("%d\n",myabs(a+b)+1);return 0;}
	if(a<b) {printf("%d\n",b-a);return 0;}
	if(a>b&&(!a||!b)) {printf("%d\n",a-b+1);return 0;}
	if(a>b) {printf("%d\n",a-b+2);return 0;}
	return 0;
}

Measured memory_bytes: 128
import sys
n = int(input())
s, score= [], 0
for i in range(n):
    s.append(int(input()))
    score += s[i]

if score % 10 != 0:
    print(score)
    sys.exit(0)

s.sort()
for i in s:
    if i % 10 == 0:
        continue
    else:
        print(score-i)
        sys.exit(0)
print(0)
sys.exit(0)


Measured memory_bytes: 3060
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
  int a,b;
  char op;
  cin >> a >> op >> b;
  while(op!='?'){
    int c;
    if(op=='+') c=a+b;
    if(op=='-') c=a-b;
    if(op=='*') c=a*b;
    if(op=='/') c=a/b;
    cout << c << endl;
    cin >> a >> op >> b;
  }
  return 0;
}


Measured memory_bytes: 3084
x=int(input())

a=int(100)
for i in range (3800)  :
    a=int(a*1.01)
    #a=round(a) roundは四捨五入、intは切り捨て
    if a < x:
        continue
    else:
        break

print(i+1)
#range関数によるリストは1番目が0


Measured memory_bytes: 9132
/// Template by Zayed ///

/// #include <bits/stdc++.h>
#include <iostream>
#include <cstdio>

#include <string>
#include <cstring>
#include <sstream>

//#include <tuple>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <map>
//#include<unordered_map>
#include <set>
//#include<unordered_set>

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>

using namespace std;
int caseno = 1;

#define NL '\n'
#define SF scanf
#define PF printf
#define PC() printf("Case %d: ", caseno++)//NOTES:printf
//#define PC cout << "Case "//NOTES:cout
//#define CN cout << caseno++ << ": "//NOTES:cout
#define CLR(ar) memset(ar, 0, sizeof(ar))
#define SET(ar) memset(ar, -1, sizeof(ar))
#define READ() freopen("input.txt", "r", stdin)
#define WRITE() freopen("output.txt", "w", stdout)
#define BOOST std::ios_base::sync_with_stdio(0);

typedef long long LL;//NOTES:"%lld"
typedef unsigned long long ULL;//NOTES:"%llu"

#define INF (1 << 31) - 1
#define MOD 1000000007
#define PRIME 999998727899999 			// (largest prime below 10^16)
#define PB push_back
#define pii pair<int, int>
#define pic pair<int, char>
#define pci pair<char, int>
#define pLL pair<LL, LL>
#define pis pair<int, string>
#define psi pair<string, int>
#define pss pair<string, string>
//#define tiii tuple<int, int, int>
#define PI 2 * acos(0.0)
#define EPS 1e-11


// Numeric Functions
template < class T > inline void SWAP(T &a, T &b) { T t = a; a = b; b = t; }
inline LL POW(LL base, LL power){
	LL res = base; if (power == 0) return 1;
	for (int I = 0; I < power - 1; I++) res *= base; return res;
}


// Translator Functions
int ToInt(string s) { int r = 0; istringstream sin(s); sin >> r; return r; }//NOTES:ToInt(
double ToDouble(string s) { double r = 0; istringstream sin(s); sin >> r; return r; }//NOTES:ToDouble(
string ToString(int n) { string s; stringstream convert; convert << n; s = convert.str(); return s; }//NOTES:ToString(


/*
*******4 Direction Array*******
int dx[] = {0, 0, - 1, 1}, dy[] = {-1, 1, 0, 0};
*******8 Direction Array*******
int dx[] = {0, 0, -1, +1, -1, -1, +1, +1}, dy[] = {-1, +1, 0, 0, -1, +1, -1, +1};
********Knight Moves********
int dx[] = {-2, -2, -1, -1, +1, +1, +2, +2}, dy[] = {-1, +1, -2, +2, -2, +2, -1, +1};
*/


const int SIZE = 1e6;
string S;



int main()
{
	BOOST
	///READ();
	///WRITE();
	int T, I, J, K, N, n, m, k, cnt = 0, len;

	cin >> S;
	len = S.length();

	cout << "2018";
	for(I = 4; I < len; I++)
		cout << S[I];

	cout << NL;


	return 0;
}






Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int a, b, c, e, f, g, i, k, max;
    scanf("%d%d%d%d", &a, &b, &c, &k);
    if ( a > b ) {
        e = a;
        max = 0;
    } else {
        e = b;
        max = 1;
    }
    if ( e > c ) {
        g = e;
    } else {
        g = c;
        max = 2;
    }
    for ( i = 0; i < k; i++)
        g *= 2;
    switch(max){
        case 0:
            printf("%d\n", g + b+ c);
            break;
        case 1:
            printf("%d\n", a + g+ c);
            break;
        case 2:
            printf("%d\n", a + b+ g);
            break;
            
    }
    return 0;
}


Measured memory_bytes: 128
import java.util.*;
//import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		String ans;
		int a = s.indexOf(s.charAt(0), 1);
		int b = -1;
		if(a < 0) {
			ans = "No";
		} else {
			if(a == 1) {
				if(s.charAt(0) == s.charAt(2)) {
					ans = "No";
				} else {
					b = s.indexOf(s.charAt(2), 3);
				}
			} else {
				b = s.indexOf(s.charAt(1), 2);
			}
			if(b < 0) {
				ans = "No";
			} else {
				ans = "Yes";
			}
		}
		System.out.println(ans);
	}
}


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

int main() {
  string S;
  cin >> S;
  int a = 0, b = 0, c = 0;
  for (unsigned i = 0; i < S.size(); ++i)
    if (S[i] == 'a')
      ++a;
    else if (S[i] == 'b')
      ++b;
    else
      ++c;
  if (max(max(a, b), c) - min(min(a, b), c) <= 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

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

using namespace std;

int main(){
	char map[50][50];
	char ans[50][50];
	int h,w;
	cin>>h>>w;
	for(int i = 0;i < h;i++){
		for(int j = 0;j < w;j++){
			cin >> map[j][i];
			if(map[j][i] == '#')ans[j][i] = '#';
		}
	}
	int DIRX[8] = {-1,0,1,-1,1,-1,0,1};
	int DIRY[8] = {-1,-1,-1,0,0,1,1,1};
	for(int i = 0;i < h;i++){
		for(int j = 0;j < w;j++){
			if(map[j][i] == '#')continue;
			int count = 0;
			for(int k = 0;k < 8;k++){
				int nx = j+DIRX[k];
				int ny = i+DIRY[k];
				if(nx<0||ny<0||nx>=w||ny>=h)continue;
				count+=(map[nx][ny]=='#')?1:0;
			}
			ans[j][i] = '0'+count;
		}
	}
	for(int i = 0;i < h;i++){
		for(int j = 0;j < w;j++){
			cout << ans[j][i];
		}
		cout<<endl;
	}
}

Measured memory_bytes: 256
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

N = int(input())
A = [int(i) for i in input().split()]

result = 0
for ai in A:
    result = gcd(result, ai)

print(result)

Measured memory_bytes: 14224
n, a, b = map(int, input().split())
s = input()

ans = ["No"] * n
success = 0
foreigner = 0

for i in range(n):
    if s[i] == "a":
        ans[i] = "Yes"
        success += 1
    elif s[i] == "b" and foreigner < b:
        ans[i] = "Yes"
        success += 1
        foreigner += 1
    if success == a + b:
        break

print("\n".join(ans))

Measured memory_bytes: 5108
n = int(input())
s = input()
numlst = []
ans = 0

for i in range(1000):
  if i//10 == 0:
    numlst.append("00"+str(i))
  elif i//100 == 0:
    numlst.append("0"+str(i))
  else:
    numlst.append(str(i))

for i in range(1000):
  judge = False
  a, b, c = numlst[i][0], numlst[i][1], numlst[i][2]
  
  for j in range(n-2):
    if s[j] == a:
      for k in range(j+1, n-1):
        if s[k] == b:
          for l in range(k+1, n):
            if s[l] == c:
              judge = True
          break
      break
      
  if judge:
    ans += 1
     
print(ans)
   
    

Measured memory_bytes: 74016
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█
 
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long lo;
typedef pair< lo,lo > PII;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)
 
const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;
 
int n,m,b[li],a[li],k,flag,t;
int cev;
string s;
vector<int> v;
 
int main(void){
	scanf("%d",&n);
	FOR{
		scanf("%d",&a[i]);
	}
	int mx=0;
	FOR{
		if(a[i]<=a[i-1])cev++;
		else cev=0;
		mx=max(mx,cev);
	}
	printf("%d\n",mx);
	return 0;
}


Measured memory_bytes: 640
#include<iostream>

using namespace std;

int main(){
 int s,x,y;
 cin >> s;
 x = s/100;
 y = s%100;
 if(x > 12 || x == 0){
  if(y > 12 || y == 0){
   cout << "NA" << endl;
  }else{
    cout << "YYMM" << endl;
  } 
 }else{
  if( y > 12 || y == 0){
   cout << "MMYY" << endl;
  }else{
   cout << "AMBIGUOUS" << endl;
  }
 }
 return 0;
}
  
   

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner sc = new Scanner(System.in);
        int val = sc.nextInt();
        long hh = Math.round(val%(60*60*60)/(60*60));
        long mm = Math.round(val%(60*60)/60);
        System.out.println(hh+":"+mm+":"+val%60);
    }
}

Measured memory_bytes: 26208
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; 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 SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

int main(){
    ll n;
    cin >> n;
    ll rec = 1, cnt = 0;
    while(1){
        cnt++;
        rec *= 3;
        if(n <= rec){
            cout << cnt << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 3096
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include<stack>
using namespace std;
typedef long long ll;
#define MAX 200


int main(){
  char b,ans;
  cin>>b;
  if(b=='A') ans='T';
  else if(b=='T') ans='A';
  else if(b=='G') ans='C';
  else ans='G';
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int a,b;

	scanf("%d%d", &a, &b);

	if (a < b) {
		printf("a < b\n");
	}
	if (a > b) {
		printf("a > b\n");
	}
	if (a == b) {
		printf("a == b\n");
	}

	return 0;
}


Measured memory_bytes: 2044
#include <bits/stdc++.h>
#define rep(begin, end) for (i=begin;i<end;i++)
#define init(arr, val) for (i=0;i<end;i++) arr[i] = val;
#define printint(i0, i1) printf("%d %d\n", i0, i1)

using namespace std;
const int inf = pow(10,9);
const int nil = -1;
const float pi = 3.141592653589;
int a[1000];
float n;

int main() {
    scanf(" %f", &n);

    printf("%f\n", 2 * n * pi);
}

Measured memory_bytes: 3836
#include <cstdio>
#include <iostream>

using namespace std;
static long long int MUL_LIMIT = 1000000000000000000;

int main() {
	int N;
	cin >> N;
	long long int A[N];
	bool zero = false;

	for(int i=0; i<N; i++) {
		cin >> A[i];
		if(A[i] == 0) {
			zero = true;
		}
	}

	long long int ml = 1;
	if(zero) {
		ml = 0;
	} else {
		for(int i=0; i<N; i++) {
			if(ml > (MUL_LIMIT / A[i])) {
				ml = -1;
				break;
			} else {
				ml *= A[i];
			}
		}
	}

	cout << ml << endl;
	return 0;
}

Measured memory_bytes: 4404
// RAM RAM

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define mp make_pair
#define arrayin(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define N 55
const int MOD=1000000007;
using namespace std;
unordered_map<int,bool> done;

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


    int sx,sy,tx,ty;cin>>sx>>sy>>tx>>ty;
    string res="";
    int cur_x=sx;
    int cur_y=sy;
    while(cur_y!=ty){
    		if(cur_y<ty){
    			cur_y++;
    			res.pb('U');
    		}else{
    			cur_y--;
    			res.pb('D');
    		}
    }

    while(cur_x!=tx){
    		if(cur_x<tx){
    			cur_x++;
    			res.pb('R');
    		}else{
    			cur_x--;
    			res.pb('L');
    		}
    }

    cur_x=tx;
    cur_y=ty;

    while(cur_y!=sy){
    		if(cur_y<sy){
    			cur_y++;
    			res.pb('U');
    		}else{
    			cur_y--;
    			res.pb('D');
    		}
    }

    while(cur_x!=sx){
    		if(cur_x<sx){
    			cur_x++;
    			res.pb('R');
    		}else{
    			cur_x--;
    			res.pb('L');
    		}
    }
    string res1=res;
    //cout<<res<<endl;
    string res2="";
    int sav_tx=tx;
    int sav_ty=ty;
    int sav_sx=sx;
    int sav_sy=sy;
    string adder="";
    if(sx<tx){
    	sx--;
    	res2.pb('L');
    }else{
    	sx++;
    	res2.pb('R');
    }

    if(ty<sy){
    	ty--;
    	adder.pb('U');
    }else{
    	ty++;
    	adder.pb('D');
    }

    
    cur_x=sx;
    cur_y=sy;
    //cout<<cur_x<<" "<<cur_y<<endl;
    while(cur_y!=ty){
    		if(cur_y<ty){
    			cur_y++;
    			res2.pb('U');
    		}else{
    			cur_y--;
    			res2.pb('D');
    		}
    }

    while(cur_x!=tx){
    		if(cur_x<tx){
    			cur_x++;
    			res2.pb('R');
    		}else{
    			cur_x--;
    			res2.pb('L');
    		}
    }
    res2=res2+adder;
    res=res+res2;

    //cout<<res2<<endl;
	
	string res3="";
	string adder2="";
    if(sav_tx<sav_sx){
    	sx=sav_tx-1;
    	res3.pb('L');
    }else{
    	sx=sav_tx+1;
    	res3.pb('R');
    }
    sy=sav_ty;
    if(sav_ty>sav_sy){
    	ty=sav_sy-1;
    	adder2.pb('U');
    }else{
    	ty=sav_sy+1;
    	adder2.pb('D');
    }
    tx=sav_sx;

   //cout<<sx<<" "<<sy<<" "<<tx<<" "<<ty<<endl;

    cur_x=sx;
    cur_y=sy;
    while(cur_y!=ty){
    		if(cur_y<ty){
    			cur_y++;
    			res3.pb('U');
    		}else{
    			cur_y--;
    			res3.pb('D');
    		}
    }

    while(cur_x!=tx){
    		if(cur_x<tx){
    			cur_x++;
    			res3.pb('R');
    		}else{
    			cur_x--;
    			res3.pb('L');
    		}
    }
    res3=res3+adder2;
    res=res+res3;
    string temp="UURRURRDDDLLDLLULUUURRURRDDDLLDL";
    cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;
class Main{


	static final int MOD = 1000000007;


	static int ans = 0;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		//方針
		//数字とindexをpairとかで持っておき、数字ソート
		//loop
		//大きい順に、自分より大きい数字を一つ含む時の左と右の候補を計算
		//Treesetに自分のindexを入れる
		//loop
		String S = sc.next();
		if(S.equals("SUN")){
			System.out.println(7);
		}else if(S.equals("MON")){
			System.out.println(6);

		}else if(S.equals("TUE")){
			System.out.println(5);

		}else if(S.equals("WED")){
			System.out.println(4);

		}else if(S.equals("THU")){
			System.out.println(3);

		}else if(S.equals("FRI")){
			System.out.println(2);

		}else if(S.equals("SAT")){
			System.out.println(1);

		}
		
		




	}

	static boolean ok(ArrayList<ArrayList<Integer>> queues){
		for(int i = 0;i < queues.size();i++){
			if(queues.get(i).size() != 0){
				return false;
			}
		}
		return true;

	}


	static void sieve(ArrayList<Long> list){
		int n = 50000000;
		boolean[] is_prime = new boolean[n+1];
		int[] prime = new int[n];
		for(int i= 0;i <=n;i++){
			is_prime[i] = true;
		}
		list.add((long) 1);
		for(int i = 2;i <= n;i++){
			if(is_prime[i]){
				list.add((long)i);
				for(int j = 2*i;j <= n;j+=i){
					is_prime[j] = false;
				}
			}
		}



	}




	static int upperbond(int k,int min,int[] data){		//kより小さい最大の値をdataの中から探し、返す二分探索
		int max = data.length;
		//		if(min == data.length-1){
		//			if(data[min] > k){
		//				return min;
		//			}
		//		}

		while(max-min > 1){
			int mid = (max+min)/2;
			if(data[mid] >= k){
				max = mid;
			}else{
				min = mid;
			}
		}

		return max;
	}

	static int lowerbond(int k,int min,int[] data){		//kより大きい最小の値をdataの中から探し、返す二分探索
		int max = data.length;

		while(max-min > 1){
			int mid = (max+min)/2;
			if(data[mid] >= k){
				max = mid;
			}else{
				min = mid;
			}
		}
		return min;
	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



	static long lcm (long a, long b) {
		long g = gcd(a,b);
		return a/g*b;
	}




}

class Town{
	int index;
	int x ;
	int y;
	public Town(int index,int x,int y) {
		this.index = index;
		this.x = x;
		this.y = y;
		// TODO 自動生成されたコンストラクター・スタブ
	}


}


class Edge extends ArrayList<P>{

}

class P{
	int to;
	long cost;
	P(int to,long cost){
		this.to = to;
		this.cost = cost;
	}
}

class Pair implements Comparable{
	int from;
	int end;
	public Pair(int from,int end) {
		this.from = from;
		this.end = end;
		// TODO 自動生成されたコンストラクター・スタブ
	}

	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   otherpair.from - from;
	}








}






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

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

using ll = long long;
using P = pair<int , int>;
  
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n; cin >> n;
  rep(i, 3) {
    if(n%10 == 7) {
      cout << "Yes"; return 0;
    }
    n /= 10;
  }
  cout << "No";
}


Measured memory_bytes: 3640
import java.util.*;

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

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int a[] = new int[N];
		int b[] = new int[N];
		int c[] = new int[N];
		for(int n=0;n<N;n++){
			a[n] = sc.nextInt();
			b[n] = sc.nextInt();
			c[n] = sc.nextInt();
		}
		int dp[][] = new int[N][3];
		dp[0][0] = a[0];
		dp[0][1] = b[0];
		dp[0][2] = c[0];
		for(int n=1;n<N;n++){
			dp[n][0] = Math.max(dp[n-1][1],dp[n-1][2])+a[n];
			dp[n][1] = Math.max(dp[n-1][0],dp[n-1][2])+b[n];
			dp[n][2] = Math.max(dp[n-1][1],dp[n-1][0])+c[n];
		}
		System.out.println(max(dp[N-1]));
	}
	
	private static int max(int ar[]){
		int tmp=ar[0];
		for(int n=1;n<ar.length;n++){
			if(tmp<ar[n]) tmp = ar[n];
		}
		return tmp;
	}
}

Measured memory_bytes: 94064
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();

    int max = Math.max(c, Math.max(a, b));
   
      	System.out.print(a+b+c-max);
    }
}


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

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

  int n = S.size();
  char tmp = S[0];
  int cnt = 0;
  rep(i, n) {
    if (tmp != S[i]) {
      cnt++;
      tmp = S[i];
    }
  }
  cout << cnt << endl;
}


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



int main()
{
    string str;
    cin>>str;
    int n=str.size();

    if(str[0]==str[n-1])
    {
        if(n%2==0)
        {
            cout<<"First";
            return 0;
        }
        cout<<"Second";
            return 0;
    }

    if(n%2==1)
        {
            cout<<"First";
            return 0;
        }
        cout<<"Second";
            return 0;
}


Measured memory_bytes: 512
import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main {

	int INF = 1 << 28;
	//long INF = 1L << 62;
	double EPS = 1e-10;

	void run() {
		Scanner sc = new Scanner(System.in);
		for(;sc.hasNext();) {
			String str = sc.next();
			int joi = 0, ioi = 0;
			for(int i=2;i<str.length();i++) {
				if(str.charAt(i-2) == 'J' && str.charAt(i-1) == 'O' && str.charAt(i) == 'I')
					joi++;
				if(str.charAt(i-2) == 'I' && str.charAt(i-1) == 'O' && str.charAt(i) == 'I')
					ioi++;
			}
			System.out.println(joi); System.out.println(ioi);
		}
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 19668
#include <stdio.h>
using namespace std;

int main(){
  int i0,i1,i2,i3,i4,i5;

  scanf("%d%d%d%d",&i0,&i1,&i2,&i3);  
  i4 = i0 + i1 + i2 + i3;

  scanf("%d%d%d%d",&i0,&i1,&i2,&i3);
  i5 = i0 + i1 + i2 + i3;

  if(i4 == i5) printf("%d\n",i4);
  else{  
    if(i4 < i5) printf("%d\n",i5);
    else printf("%d\n",i4);
  } 
}

Measured memory_bytes: 2688
import java.util.*;

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

		int N = sc.nextInt();
		long[] A = new long[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
		}
		
		long goal = 0;
		for(int i=2; i<N; i++)
			goal ^= A[i];
		
		System.out.println(solve(A[0], A[1], goal));
		sc.close();
	}
	
	static long solve(long a0, long a1, long goal) {
		if((a0^a1)==goal)
			return 0;
		
		long sum = a0+a1;
		
		int[] bits = new int[LEN];
		boolean carry = false;

		for(int i=LEN-1; i>=0; i--) {
			if(carry) {
				if(bit(sum, i)==0) {
					if(bit(goal, i)==0) {
						bits[i] = 2;
						carry = false;
					} else {
						bits[i] = 1;
					}
				} else {
					if(bit(goal, i)==0) {
						bits[i] = 2;
					} else {
						return -1;
					}
				}
			} else {
				if(bit(sum, i)==0) {
					if(bit(goal, i)==0) {
						bits[i] = 0;
					} else {
						return -1;
					}
				} else {
					if(bit(goal, i)==0) {
						bits[i] = 0;
						carry = true;
					} else {
						bits[i] = 1;
					}
				}
			}
		}
		if(carry)
			return -1;

		long ans = Long.MAX_VALUE;
		for(int i=LEN-1; i>=0; i--) {
			if(bit(a0, i)==1) {
				boolean ok = true;
				long after = 0;
				for(int j=LEN-1; j>=0; j--) {
					if(j>i) {
						if((bit(a0, j)==0 && bits[j]==2)||(bit(a0, j)==1 && bits[j]==0)) {
							ok = false;
							break;
						}
						after |= ((long)(bit(a0, j)))<<j;
					} else if(j==i) {
						if(bits[j]==2) {
							ok = false;
							break;
						}
					} else {
						if(bits[j]>0) {
							after |= 1l<<j;
						}
					}
				}
				if(ok) {
					ans = Math.min(ans, a0-after);
				}
			}
		}
		
		return ans < Long.MAX_VALUE ? (ans==a0 ? -1 : ans) : -1;
	}
	
	static int bit(long a, int b) {
		return (int)((a>>b)&1);
	}
}


Measured memory_bytes: 27624
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
print(S.replace("2017", "2018"))


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


//TEMPLATE
#define pb                push_back
#define mp                make_pair
#define ll                long long
#define ld                long double
#define pii               pair <ll, ll>
#define piii              pair <ll, pii>
#define F                 first
#define S                 second

#define newline           printf("\n")
#define minusone          printf("-1\n")
#define zeroo             printf("0\n")
#define scl1(a)           scanf("%lld", &a)
#define scl2(a, b)        scanf("%lld %lld", &a, &b)
#define scl3(a, b, c)     scanf("%lld %lld %lld", &a, &b, &c)
#define prl1(a)           printf("%lld\n", a)
#define prl2(a, b)        printf("%lld %lld\n", a, b)
#define ssl1(s)           scanf(" %[^\n]", s)
#define scd1(a)           scanf("%lf", &a)
#define scd2(a, b)        scanf("%lf %lf", &a, &b)
#define prd(a)            printf("%lf\n", a)
#define prld(a)           printf("%Lf\n", a)
#define prcase(cs)        printf("Case %lld: ", cs)
#define cin1(a)           cin >> a
#define cin2(a, b)        cin >> a >> b
#define cin3(a, b, c)     cin >> a >> b >> c
#define cin4(a, b, c, d)  cin >> a >> b >> c >> d
#define cot1(a)           cout << a << "\n"
#define cot2(a, b)        cout << a << " " << b << "\n"
#define cot3(a, b, c)     cout << a << " " << b << " " << c << "\n"
#define cot4(a, b, c, d)  cout << a << " " << b << " " << c << " " << d << "\n"
#define cotline           cout << "\n"
#define cotminus          cout << "-1\n"
#define cot0              cout << "0\n"
#define cotyes            cout << "YES\n"
#define cotno             cout << "NO\n"
#define cotcase(cs)       cout << "Case " << cs << ": "

#define reversed(s)       reverse(s.begin(), s.end())
#define asort(s)          sort(s.begin(), s.end())
#define dsort(s)          sort(s.rbegin(), s.rend())
#define all(s)            s.begin(), s.end()
#define uniq(s)           s.resize(distance(s.begin(),unique(s.begin(), s.end())))
#define found(s, x)       (s.find(x) != s.end())

#define for0(i, n)        for (i = 0; i < n; i++)
#define for1(i, n)        for (i = 1; i <= n; i++)
#define fora(i, a, b)     for (i = a; i <= b; i++)
#define forb(i, b, a)     for (i = b; i >= a; i--)
#define fori(it, s)       for(auto it = s.begin(); it != s.end(); it++)

#define FR                ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ms(a, x)          memset(a, x, sizeof a)
#define bitcount(n)       __builtin_popcountll(n)

//#define pi              3.1415926536
#define pi                acos(-1)

const ll INF = LLONG_MAX;
const ll SZ = 4e5+5;
const ll mod = 1e9+7;


string s, s1, s2;
ll n, k, ans = 0;
ll a[SZ];
//ll b[SZ];



int main() {
    FR;
    ll cs = 0, tc = 1, x, y, z, i, j, g, p, q, sum = 0, c = 0, t = 0;
//    ll a, b, d;
//    string s, s1, s2;

    cin1(n);
    (n == 1) ? cot1(0) : cot1(1);

    return 0;
}



Measured memory_bytes: 3644
#!/usr/bin/env python3
# from typing import *
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def solve(A, B):
    print(A*B)
    




def main():
    A, B = map(int, input().split())
    solve(A, B)

if __name__ == '__main__':
    main()


'''
cd ~/Desktop/Programming/AtCoder/contest/abc169/abc169_a && sh shellscripts/test_py.sh
cd ~/Desktop/Programming/AtCoder/contest/abc169/abc169_a && sh shellscripts/etest_py.sh
cd ~/Desktop/Programming/AtCoder/contest/abc169/abc169_a && sh shellscripts/submit_py.sh
'''


Measured memory_bytes: 9044
#include <iostream>
#include <string>
#include <math.h>

using namespace std;
int main()
{
    int N,x,count=0;
    cin>>N;  
    for ( int i = 1; i <= N; i++)
    {
        x=log10(i);
        
        if ((x%2)==0){
            count++;
        }

    }
    
    cout<<count;
    return 0;
}



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

int main(){
  int n,k,ans=0;
  cin >> n >>k;
  vector<int> h(n);
  for (int i = 0; i < n; i++) {
    cin >> h.at(i);
    if(h.at(i) >= k){
      ++ans;
    }
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intA = scan.nextInt();
		int intB = scan.nextInt();
		int intC = scan.nextInt();
		if(intB < intA){
			int intTemp = intA;
			intA = intB;
			intB = intTemp;
		}
		int intCount = 0;
		for(int i = 0; i <= intB - intA; i++){
			if(intC % (intA + i) ==0){
				intCount++;
			}
		}
		System.out.println(intCount);
	}
}

Measured memory_bytes: 17328
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll, ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define pdd pair<double, double>
#define f first
#define s second
#define MOD 1000000007
#define mkp make_pair
#define M_PI 3.14159265358979323846
#define FOR(i,l,r) for (int i=l;i<=r;i++)
#define LOR(i,l,r) for (ll i=l;i<=r;i++)
#define FORD(i,r,l) for (int i=r;i>=l;i--)
#define LORD(i,r,l) for (ll i=r;i>=l;i--)
#define INF 1000000000
#define CL(x) memset(x,0,sizeof(x))
#define DEB(x) cout << #x << " : " << x << '\n'
#define ALL(x) x.begin(), x.end()
#define SZ(x) x.size()
#define UI(x) (int)(x-'A')
#define LI(x) (int)(x-'a')
typedef long long ll;

int N;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
  
	cin>>N;
  cout<<(N-2)*180<<'\n';

    return 0;
}

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

using namespace std;

int a[100010];

int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  int k = -1;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] + a[i + 1] >= m) {
      k = i;
    }
  }
  if (k == -1) {
    puts("Impossible");
  } else {
    puts("Possible");
    for (int i = 0; i < k; ++i) {
      printf("%d\n", i + 1);
    }
    for (int i = n - 2; i > k; --i) {
      printf("%d\n", i + 1);
    }
    printf("%d\n", k + 1);
  }
  return 0;
}

Measured memory_bytes: 1152
import java.util.*;
public class Main {
  public static void main(String[] args){
    int a,b;
    Scanner sc = new Scanner(System.in);
    a=sc.nextInt();
    b=sc.nextInt();
    if((a*b)%2==0) System.out.println("Even");
    else System.out.println("Odd");
  }
}

Measured memory_bytes: 21844
import sys
from io import StringIO
import unittest


def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    stock = 0
    money = 1000

    for i in range(1, len(a)):
        add_stock = 0
        # print(money, stock)
        if a[i - 1] < a[i]:
            add_stock = money // a[i - 1]
            money -= add_stock * a[i - 1]
            stock += add_stock
        elif a[i - 1] > a[i]:
            money += a[i - 1] * stock
            stock = 0

    print(money + stock * a[-1])


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """7
100 130 130 130 115 115 150"""
        output = """1685"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """6
200 180 160 140 120 100"""
        output = """1000"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """2
157 193"""
        output = """1216"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Measured memory_bytes: 16336
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
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++)
#define all(v) v.begin(), v.end()
#define chmin(x, y) x = min(x, y)

int main(){
  string s;
  cin >> s;
  string t = s.at(0) + to_string(s.size()-2) + s.at(s.size()-1);
  cout << t << endl;
}

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

int main() {
  // ここにプログラムを追記
  int a, x, y, z;
  cin >> a;
  x = a / 100;
  y = ( a / 10 ) % 10;
  z = a % 10;
  
  cout << x + y + z << endl;
}

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

using namespace std;

string S;
int w;

int main() {
    cin >> S;
    cin >> w;
    for (int i = 0; i < S.length(); i++) {
        if (i % w == 0) {
            cout << S[i];
        }
    }
    cout << endl;
}

Measured memory_bytes: 888