akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
 
int main(void){
  int rate[200000],n,i,max,min;
  scanf("%d",&n);
 
  for(i=0;i<n;i++) scanf("%d",&rate[i]);
  max=rate[1]-rate[0];
  min=rate[0];
    for(i=1;i<n;i++){
      if(max<rate[i]-min) max=rate[i]-min;
      if(min>rate[i]) min=rate[i];
    }
  printf("%d\n",max);
  return 0;
}

Measured memory_bytes: 1376
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

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

ll factorial(ll n) {
  ll answer = 1;
  while (n > 1) {
    answer *= n;
    answer %= mod;
    n--;
  }
  return answer;
}

ll combination(ll n, ll r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
}

ll permutation(ll n, ll r) { return factorial(n) / factorial(n - r); }

template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}

map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
// for (auto p : prime_factor(n)) {
//	while (p.second--) {
//		cout << p.first << endl;
//	}
//}

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

bool compare_by_b(pair<ll, ll> a, pair<ll, ll> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

bool is_prime[1000000 + 1];
vector<int> P;
void Eratosthenes(const int N, int x) {
  for (int i = 0; i <= N; i++) {
    is_prime[i] = true;  //初期化
  }
  for (int i = 2; i <= N; i++) {
    if (is_prime[i]) {
      for (int j = 2 * i; j <= N; j += i) {
        is_prime[j] = false;
      }
      if (i >= x) {
        cout << i << endl;
        break;
      }
      P.emplace_back(i);
    }
  }
}

int main() {
  int x;
  cin >> x;
  Eratosthenes(1000000, x);
  return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  int a[n];
  rep(i,n){
    cin>>a[i];
    if(a[i]%2==0){
      if(a[i]%3!=0 && a[i]%5!=0){
	cout<<"DENIED"<<endl;
	return 0;
      }
    }
  }
  cout<<"APPROVED"<<endl;
  

  return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 8)

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    X = input()
    pcnt = 0
    ans = []
    for x in X:
        if x == '1': pcnt += 1
    if pcnt == 0:
        for _ in range(N):
            print(1)
            return
    Xinv = X[::-1]
    ex1 = ex2 = 1
    num1 = num2 = 0
    for x in Xinv:
        num1 += (ex1 * int(x)) % (pcnt + 1)
        num1 %= (pcnt + 1)
        if pcnt > 1:
            num2 += (ex2 * int(x)) % (pcnt - 1)
            num2 %= (pcnt - 1)
        ex1 *= 2
        ex1 %= (pcnt + 1)
        ex2 *= 2
        if pcnt > 1: ex2 %= (pcnt - 1)

    def solve(n, p, s):
        if n == 0 and s > 0: return s
        n %= p
        p = bin(n).count('1')
        return solve(n, p, s+1)

    for i in range(N):
        if X[i] == '1':
            p = pcnt - 1
            if p == 0:
                ans.append(0)
                continue
            num = num2 - pow(2, N-i-1, p)
            ans.append(solve(num, p, 0))
        else:
            p = pcnt + 1
            num = num1 + pow(2, N-i-1, p)
            ans.append(solve(num, p, 0))

    for i in range(N):
        print(ans[i])

    return

if __name__ == '__main__':
    main()


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

int main()
{
    int a, b;
    cin >> a >> b;
    if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) cout << "Possible" << endl;
    else cout << "Impossible" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <algorithm>
using namespace std;

int main(){
    int N,K;
    cin >> N >> K;
    if(N % K == 0){
        cout << 0 << endl;
    }else{
        cout << 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
s = input()
inn = []
for i in range(4):
  inn += [ord(s[i])]
  
inn.sort()
flag = 1
if inn[0] != inn[1]:
  flag= 0
if inn[1] == inn[2]:
  flag=0
if inn[2] != inn[3]:
  flag=0
if flag:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
n = int(input())
a = list(map(int, input().split()))
w = 0
l, r = 0, 1
while True:
    while r < n and a[r - 1] >= a[r]:
        r += 1
    w = max(w, r - l)
    if r == n:
        break
    l, r = r, r + 1
w = max(w, r - l)
print(w - 1)


Measured memory_bytes: 63856
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        double[] p = new double[N];
        for (int i=0; i<N; i++) p[i] = stdIn.nextDouble();
        double[][] DP= new double[N+1][N+1];
        for (int i=1; i<N+1; i++) {
            for (int j = 0; j < N + 1; j++)
                DP[i][j] = 0;
        }
        DP[0][0] = 1;
        for (int i=1; i<N+1; i++) {
            for (int j=0; j<i+1; j++) {
                if (j == 0) DP[i][0] = DP[i-1][0] * (1 - p[i-1]);
                else if (i == 1 && j == 1) DP[i][j] = p[0];
                else DP[i][j] = DP[i-1][j] * (1 - p[i-1]) + DP[i-1][j-1] * p[i-1];
            }
        }
        double sum = 0;
        for (int i=N/2+1; i<N+1; i++) sum += DP[N][i];
        System.out.println(sum);
    }
}

Measured memory_bytes: 124560
import java.util.*;

public class Main {

	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int d=sc.nextInt();
		int t=sc.nextInt();
		int s=sc.nextInt();
		double time=(double)d/(double)s;
		if(t>=time) System.out.println("Yes");
		else System.out.println("No");
		
		
		//System.out.println(time);
	}
}


Measured memory_bytes: 35556
import java.util.*;
import static java.lang.System.*;

class Main {
    public static Scanner sc = new Scanner(in);
    public static Random rand=new Random();

    int cardinality(int bits){
	    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
	    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
	    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
	    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
	    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
    }


    public void run() {
        int n=sc.nextInt(),m=sc.nextInt();

        double[][] c=new double[n][3];
        for(int i=0;i<n;i++)for(int j=0;j<3;j++){
        	c[i][j]=sc.nextDouble();
        }

        double max=0;
        for(int s=0;s<(1<<n);s++){
        	if(cardinality(s)==m){
            	double val=0;
            	for(int a=0;a<n;a++){
                	for(int b=a+1;b<n;b++)
                	if(((s>>a) & 1)==1 && ((s>>b) & 1)==1)
                		val+=(c[a][0]-c[b][0])*(c[a][0]-c[b][0])+
                		(c[a][1]-c[b][1])*(c[a][1]-c[b][1])+
                		(c[a][2]-c[b][2])*(c[a][2]-c[b][2]);
                }
            	if(max<val)max=val;
        	}
        }
        ln(max);
    }
    public static void main(String[] args) {
        new Main().run();
    }

    public int[] nextIntArray(int n){
        int[] res=new int[n];
        for(int i=0;i<n;i++){
            res[i]=sc.nextInt();
        }
        return res;
    }
    public static void pr(Object o) {
        out.print(o);
    }
    public static void ln(Object o) {
        out.println(o);
    }
    public static void ln() {
        out.println();
    }
}

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

using namespace std;

int main() {
int n;
while(cin>>n,n){
int cnt=0,v;
bool f = false;
for(int i=0;i<n;++i) {
cin >> v;
if( v >= 2) f = true;
if( v ) ++cnt;
}
if(!f)puts("NA");
else cout << cnt + 1 << endl;
}
return 0;
}

Measured memory_bytes: 3072
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
	int n;
	cin>>n;
	REP(t,n){
		string s;
		cin>>s;
		if(s[0]!='>')goto na;
		if(s[1]=='\''){
			int state=0;
			int cnt1=0;
			int cnt2=0;
			FOR(i,2,s.size()){
				if(s[i]=='='&&state==0){
					cnt1++;
				}else if(s[i]=='#'&&state==0){
					state=1;
				}else if(s[i]=='='&&state==1){
					state=2;
					cnt2++;
				}else if(s[i]=='='&&state==2){
					cnt2++;
				}else if(s[i]=='~'&&state==2){
					state=3;
				}else{
					state=-1;
					break;
				}
			}
			if(state==3&&cnt1==cnt2){
				goto a;
			}else{
				goto na;
			}
		}else if(s[1]=='^'){
			int state=0;
			int flag=0;
			FOR(i,2,s.size()){
				if(s[i]=='Q'&&state==0){
					state=1;
				}else if(s[i]=='='&&state==1){
					state=0;
					flag=1;
				}else if(s[i]=='~'&&state==0){
					state=2;
				}else if(s[i]=='~'&&state==2){
					state=3;
				}else{
					state=-1;
					break;
				}
			}
			if(state==3&&flag){
				goto b;
			}else{
				goto na;
			}
		}else{
			goto na;
		}
a:
		cout<<"A"<<endl;
		continue;
b:
		cout<<"B"<<endl;
		continue;
na:
		cout<<"NA"<<endl;
		continue;
	}

}

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

int main() {
  int n, m = 0;
  scanf("%d", &n);
  std::vector<int> a;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a.push_back(x);
  }
  for (int i = n; i >= 1; i--) {
    int num = 0;
    for (int j = i + i; j <= n; j += i) {
      num ^= a[j - 1];
    }
    a[i - 1] ^= num;
    if (a[i - 1]) { m++; }
  }
  printf("%d\n", m);
  for (int i = 0; i < n; i++) {
  	if (a[i]) {
      printf("%d%c", i + 1, ((m == 1) ? '\n' : ' '));
      m--;
    }
  }
  return 0;
}

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

using namespace std;

#define inf 1<<30
#define llong long long
#define usd unsigned
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef struct data{
	int now;
	int cost;
}data;
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};

int main(){
	string ans = "Yes";
	int n, m;
	vector<P> dis[100001];
	cin >> n >> m;
	int l, r, d;
	for(int i = 0; i < m; i++){
		cin >> l >> r >> d;
		// dis[l<r?l:r].pb(P(l<r?r:l, l<r?d:-d));
		dis[l].pb(P(r, d));
		dis[r].pb(P(l, -d));
	}

	int pos[100001];
	bool check[100001];
	fn(pos, 100001, inf);
	queue<int> next;
	for(int i = 1; i <= n && ans != "No"; i++){
		if(check[i]) continue;
		check[i]++;
		if(pos[i] == inf) pos[i] = 0;
		for(int j = 0; j < dis[i].size(); j++){
			P in = dis[i][j];
			if(pos[in.first] != inf){
				if(pos[in.first] - pos[i] != in.second){
					ans = "No";
					break;
				}
			}else{
				pos[in.first] = pos[i] + in.second;
			}
			next.push(in.first);
		}
		while(next.size() && ans != "No"){
			int left = next.front(); next.pop();
			if(check[left]) continue;
			check[left]++;
			for(int j = 0; j < dis[left].size(); j++){
				P in = dis[left][j];
				if(pos[in.first] != inf){
					if(pos[in.first] - pos[left] != in.second){
						ans = "No";
						break;
					}
				}else{
					pos[in.first] = pos[left] + in.second;
				}
				next.push(in.first);
			}
		}
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 10368
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>

using namespace std;

int main()
{
    int A,B,a,b,c,d,cnt = 0;

    scanf("%d%d%d%d",&a,&b,&c,&d);
    A = a + b + c + d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    B = a + b + c + d;
    if(A<B){
        printf("%d\n",B);
    }
    else printf("%d\n",A);

    return 0;
}

Measured memory_bytes: 1188
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string str = Console.ReadLine();
		long N = long.Parse(str);
		long a = 1;
		long b = 1;
		string ans = "";
		while(true){
			if(N == 0){
				break;
			}
			if((Math.Abs(N) / Math.Abs(b)) % 2 == 1){
				ans = "1" + ans; 
				N -= b;
			} else {
				ans = "0" + ans;
			}
			b *= -2;
		}
		if(ans == ""){
			ans = "0";
		}
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 13140
from itertools import permutations
n = int(input())
div = 1
s = 0
for i in range(1, n + 1):
	div *= i
L = [list(map(int, input().split())) for _ in range(n)]
for x in permutations(range(n), n):
	s += sum(((L[i][0] - L[j][0]) ** 2 + (L[i][1] - L[j][1]) ** 2) ** .5 for i, j in zip(x, x[1:]))
print(s / div)

Measured memory_bytes: 3188
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define prints(x, y) cout<<(x)<<" "<<(y)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long int
#define pb push_back

int main() {
  int a, b, k;
  cin >> a >> b >> k;

  if(b-a+1 > k*2) {
    for(int i = a; i < a + k ; i++){
    print(i);
    }
    for(int i = b-k+1; i <= b; i++){
      print(i);
    }
  } else {
    for(int i = a; i <= b; i++){
      print(i);
    }
  }

}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  string s;
  cin >> s;
  if (s[s.size() - 1] == 's') {
    s = s + "es";
  } else {
    s = s + "s";
  }
  cout << s << endl;
}


Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  IOS;
  string s; cin >> s;
  int ans = 0;
  REP(i,s.size()) { if (s[i] == '1') ans++; }
  COUT(ans);

  return 0;
}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;

int main() {
    int n;
    cin >> n;
    double a;
    double t = 0;
    REP(i, n) {
        cin >> a;
        t += 1 / a;
    }
    cout << fixed << setprecision(10) << 1 / t << endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
A = [int(a) for a in input().split()]
P = 10**9+7
a = 0
b = 0
for i in range(N):
    for j in range(i):
        if A[i] < A[j]:
            a += 1
for i in range(N):
    for j in range(N):
        if A[i] < A[j]:
            b += 1

print((a*K+b*K*(K-1)//2)%P)


Measured memory_bytes: 41308
#include <bits/stdc++.h>
#define PREP(i, s, x) for(ll i = (s); i < (x); i++)
#define MREP(i, s, x) for(ll i = (s); i >= (x); i--)
#define REP(i, x) PREP(i, 0, x)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }

// variable -------------------------------------------

constexpr ll INF = (1ll << 60);
constexpr ll MOD = 1000000007ll;

// structure ------------------------------------------

// function -------------------------------------------

ll llabs(ll &a) { return (a < 0) ? (-a) : (a); }

// main -----------------------------------------------

int main() {
    ll n;
    cin >> n;
    vector<ll> h(n);
    REP(i, n) { cin >> h[i]; }

    vector<ll> dp(n, INF);
    dp[0] = 0;
    dp[1] = llabs(h[1] - h[0]);
    REP(i, n) {
        if(i <= 1) continue;
        chmin(dp[i], dp[i - 2] + llabs(h[i - 2] - h[i]));
        chmin(dp[i], dp[i - 1] + llabs(h[i - 1] - h[i]));
    }
    cout << dp[n-1] << endl;
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << '\n'; exit(0);}

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

  ll ans = 0;
  for (ll i = 1; i <= N; i++)
  {
    if (N - i > i)
      ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
def main():
    N = int(input())
    A = [int(x) for x in input().split(" ")]
    cash = 1000
    stock = 0
    for i in range(N-1):
        if A[i] < A[i+1]:
            stock += cash // A[i]
            cash = cash % A[i]
        elif stock != 0 and A[i] > A[i+1]:
            cash = cash + A[i]*stock
            stock = 0
    print(cash + A[-1]*stock)


if __name__ == '__main__':
    main()


Measured memory_bytes: 61856
#include<bits/stdc++.h>
using namespace std ;
int main () {
  char a[220] , b[110] , c[110] ;
  cin >> a >> b ;
  strcpy(c,a) ;
  strcat(a,c) ;
  
  if(strstr(a,b)) cout <<"Yes" << endl; 
  else cout << "No" << endl ;
}


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

int main() {
  string c;
  bool ans = false;
  vector<string> vect = {"a","i","u","e","o"};
  cin >> c;

  for (int i = 0; i<5; i++){
    if (vect.at(i) == c){
      ans = true;
    }
  }

  if (ans){
    cout << "vowel" << endl;
  }
  else
  {
    cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int a, b , c;
  cin >> a >> b >> c;
  bool e = false;
  for(int i = 10000000;i > 0;i--) {
    if(i % a == 0 && i % b == c){
      e = true;
      break;
    }
  }
  cout << ((e)? "YES":"NO") << endl;
}

Measured memory_bytes: 256
import java.util.*;
    
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int H = sc.nextInt();
    int W = sc.nextInt();
    String a;
    for(int i = 0; i < H; i++){
      a = sc.next();
      for(int j = 0; j < 2; j++){
        System.out.println(a);
      }
    }
  }
}


Measured memory_bytes: 23252
def calc(s, i):
    global n
    global anslst
    global nlst
    if i == n:
        anslst[s] = 'yes'
        return

    calc(s, i+1)
    calc(s + nlst[i], i+1)


anslst = ['no']*2001
n = int(input())
nlst = list(map(int, input().split()))
q = int(input())
qlst = list(map(int, input().split()))

calc(0, 0)

for i in qlst:
    print(anslst[i])


Measured memory_bytes: 5632
import collections
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(n):
  if i%2==0:
    a.append(v[i])
  else:
    b.append(v[i])

a_c=collections.Counter(a)
b_c=collections.Counter(b)
    
a1=a_c.most_common()[0][0]
b1=b_c.most_common()[0][0]

x1=a_c[a1]
y1=b_c[b1]

if a1!=b1:
  print(n-x1-y1)
else:
  if len(a_c)==1:
    x2=0
  else:
    a2=a_c.most_common()[1][0]
    x2=a_c[a2]
  if len(b_c)==1:
    y2=0
  else:
    b2=b_c.most_common()[1][0]
    y2=b_c[b2]
  print(n-max(x1+y2,y1+x2))

Measured memory_bytes: 20568
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
  	int dp[];
  	Main(int n){
      dp = new int[n];
    }
	public static void main (String[] args) throws java.lang.Exception
	{
      	FastReader s = new FastReader();
		int  n = s.nextInt();
      	int k = s.nextInt();
		int arr[] = new int[n];
		for(int i=0;i<n;i++)
		arr[i]= s.nextInt();
		Main ob = new Main(n);
		//k = Math.min(k,n-1);
		int ans = ob.getCost(n,arr,k);
		System.out.println(ans);
	}
  int getCost(int n,int arr[], int k){
   dp[0]=0;
   dp[1]=Math.abs(arr[1]-arr[0]);
   for(int i=2; i<n;i++){
     int min = Integer.MAX_VALUE;
   for(int j = Math.max(0,i-k); j<i;j++)
     min = Math.min(Math.abs(arr[i]-arr[j])+dp[j],min);
     dp[i]=min;
   }
    return dp[n-1];
  }


  static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
}


Measured memory_bytes: 34048
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.io.InputStream;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
 
    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int H = in.nextInt();
            int N = in.nextInt();
            A = new int[N];
            B = new int[N];
            _get = new int[H+1];
            for (int i = 0; i <= H; i++) {
              _get[i]=-1;
            }
            for (int i = 0; i < N; i++) {
                A[i] = in.nextInt();
                B[i] = in.nextInt();
            }
            out.println(get(H));
        }
      int[] A,B,_get;
      int get(int heal){
        if(heal<=0)return 0;
        if(_get[heal]!=-1)return _get[heal];
        int res=Integer.MAX_VALUE;
        for(int i=0;i<A.length;i++){
          res=Math.min(res,get(heal-A[i])+B[i]);
        }
        _get[heal]=res;
        return res;
      }
 
    }
 
    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;
 
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }
 
        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }
 
        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }
 
        public int nextInt() {
            return Integer.parseInt(next());
        }
 
    }
 
    static class state implements Comparable<state> {
        int dmg;
        int cost;
 
        public int compareTo(state o) {
            if (dmg != o.dmg) {
                return dmg - o.dmg;
            }
            if (cost != o.cost) {
                return cost - o.cost;
            }
            return 0;
        }
 
    }
}

Measured memory_bytes: 23764
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

//26^13 > LINFなので12乗まで見ればよい

int main(){
    ll n; cin >> n;
    vector<char> alp{'-'};
    for(char c='a'; c<='z'; c++) alp.push_back(c);
    
    vector<char> res(20);

    int index = 12;
    for(ll i = 0; i <= 12; i++){
        ll tmp = pow(26, i);
        if(n - tmp >= 0){
            res[index] = 'a';
            n -= tmp;
        }
        index--;
    }
    index = 0;
    for(ll i = 12; i >= 0; i--){
        ll tmp = pow(26, i);
        int cnt = 0;
        while(cnt <= 26){
            if(n - tmp < 0)break;
            n -= tmp;
            cnt++;
        }
        res[index] += cnt;
        index++;
    }
    rep(i, 20){
        if(res[i] >= 'a' && res[i] <= 'z')
        cout << res[i];
    }
    cout << ln;
    
}


Measured memory_bytes: 4068
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <tuple>
#include <math.h>
#include <set>
#include <map>
using namespace std ;
using ll = long long ;
using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
using vc = vector<char> ;
using vvc = vector<vc> ;
using vb = vector<bool> ;
using vvb = vector<vb> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end() 
const ll INF = 1e18 ;
const ll mod = 1e9+7 ;
const double pie = acos(-1); 
vll dx4 = {-1,0,1,0} ;
vll dy4 = {0,-1,0,1} ;
vll dx8 = {-1,0,1,1,1,0,-1,-1} ;
vll dy8 = {-1,-1,-1,0,1,1,1,0} ; 

void fix_cout(){cout << fixed << setprecision(20) ; }
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 ; }
void chmax(ll &a,ll b){if(a<b) a = b ; }
void chmin(ll &a,ll b){if(a>b) a = b ; }

int main(){
	ll x,y ;
	cin >> x >> y ;
	ll a,b ;
	a = 4*x-y ;
	b = y-2*x ;
	if(a>=0&&a%2==0&&b>=0&&b%2==0){
		cout << "Yes\n" ;
	}else{
		cout << "No\n" ;
	}
}

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

const ll INF = 1LL << 60;


int main() {
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    long long K;
    scanf("%lld",&K);

    ll ans = 0;
    ll total = 0;

    // 1 をとる
    ll cnt = min(A, K); 
    total += cnt;
    ans += cnt;

    if (total == K) {
        cout << ans << endl;
        return 0;
    }

    ll cnt_0 = min(B, K - A);
    total += cnt_0;
    if (total == K) {
        cout << ans << endl;
        return 0;
    }

    ll cnt_1 = min(C, K - A - B);
    ans -= cnt_1;
    cout << ans << endl;
}


Measured memory_bytes: 3688
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0027&lang=jp

#include<iostream>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;
template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

int main() {
	int year = 2004;
	int month,day;
	string week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
	
	while(true) {
		cin >> month >> day;
		if (month == 0 && day == 0) { break; }
		int month_ = month;
		if(month < 3){ year--; month_+=12; }
		if(month_ == 14){ day += 1; }
		int w = ((year + (year/4) - (year/100) + (year/400) + (((13 * month_) + 8)/5) + day) % 7);
		cout << week[w] << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
int main(){
    int x, y, z; cin >> x >> y >> z;
    swap(x, y); swap(x, z);
    cout << x << endl;
    cout << y << endl;
    cout << z << endl;
    return 0;
}

Measured memory_bytes: 3636
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))


def main():
    # print(A)
    partition(A, 1, len(A) - 1)


def partition(A, p, r):
    last = A[r]
    i = p - 1
    # print("last:{}".format(last))
    # print("i:{}".format(i))
    for j in range(i, r, 1):
        # print("A[j]:{}".format(A[j]))
        if A[j] <= last:
            # print("change")
            tmp = A[i]
            A[i] = A[j]
            A[j] = tmp
            i += 1

        # print(A)
    tmp = A[i]
    A[i] = A[r]
    A[r] = tmp

    for k in range(len(A)):
        if k > 0:
            print(' ', end="")
        if k == i:
            strNum = "[" + str(A[k]) + "]"
        else:
            strNum = str(A[k])
        print(strNum, end="")
    print()
    # print(A)


if __name__ == '__main__':
    main()



Measured memory_bytes: 15608
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <unordered_map>
#include <queue>

int main()
{
    typedef std::pair<long long, int> P;

    int N, K;
    std::cin >> N >> K;
    std::vector<P> sushi(N); // (d[i], t[i])
    for(int i=0; i<N; i++) scanf(" %d %lld", &(sushi[i].second), &(sushi[i].first));

    std::sort(sushi.begin(), sushi.end(), std::greater<P>());

    long long sum = 0;
    std::priority_queue<long long,
        std::vector<long long>,
        std::greater<long long> > q; // 種類がかぶった寿司を入れる
    std::unordered_map<int, int> exist; 
    for(int i=0; i<K; i++){
        sum += sushi[i].first;
        if(exist.find(sushi[i].second) == exist.end()) exist[sushi[i].second];
        else q.push(sushi[i].first);
    }
    sum += exist.size() * exist.size();

    std::vector<long long> sum_list;
    sum_list.push_back(sum);
    for(int i=K; i<N; i++){
        if(q.empty()) break;
        if(exist.find(sushi[i].second) == exist.end()){
            exist[sushi[i].second];
            long long sub = q.top(); q.pop();
            sum_list.push_back(sum_list.back() - sub + sushi[i].first + 2*exist.size()-1);
        }
    }

    std::cout << *std::max_element(sum_list.begin(), sum_list.end()) << std::endl;
}

Measured memory_bytes: 5516
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;


int main(){
	int N;
	cin >> N;
	vector<string> s(N);
	int i;
	for (i = 0;i < N;i++) cin >> s[i];
	int M;
	cin >> M;
	vector<string> t(M);
	for (i = 0;i < M;i++) cin >> t[i];
	int res = 0;
	int j;
	for (i = 0;i < N;i++) {
		int yen = 0;
		for (j = 0;j < N;j++) {
			if (s[j] == s[i]) yen++;
		}
		for (j = 0;j < M;j++) {
			if (t[j] == s[i]) yen--;
		}
		if (res < yen) res = yen;
	}
	cout << res << endl;
	return 0;
}


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

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)

using namespace std;
using ll = long long;

int main()
{

	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    vector<int> dp(3,0);
    vector<int> day(3,0);

    rep(i,n){
    	rep(j,3) cin>>day[j];
    	
    	if(i == 0) {
    		rep(j,3) dp[j] = day[j];
    	}
    	else{
    		vector<int> temp(3,0);
    		rep(j,3){
    			rep(k,3){
    				if(j==k) continue;
    				else{
    					temp[k] = max(temp[k], dp[j] + day[k]);
    				}
    			}
    		}
    		dp = temp;
    	}

     }
     cout<<max({dp[0],dp[1],dp[2]});   



	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    int N;cin >> N;
    vector<LL> A(N+1);
    rep(i,N+1)cin >> A[i];
    vector<LL> B(N);
    rep(i,N)cin >> B[i];

    LL ans = 0;
    rep(i,N){
        LL tmp = B[i];
        if(A[i] > B[i]){
            ans += B[i];
            continue;
        }
        else{
            ans += A[i];
            if(A[i] < 0)A[i] = 0;
            tmp -= A[i];
            ans += min(A[i+1],tmp);
            A[i+1] -= tmp;
            A[i+1] = max(A[i+1],0LL);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define SORT(c) sort((c).begin(),(c).end())
#define dbug(x) cout<<#x<<"="<<x<<endl
#define m0(x) memset(x,0,sizeof(x))
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define reps(i, m, n) for(ll i = m; i < n; i++)
#define reprs(i, m, n) for(ll i = n; i >= m; i--)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pl;
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  return is;
}

int MOD=2019;

int main(){

  ll L,R;
  cin >> L>>R;

  if(R-L>2019) {
    std::cout << 0 << '\n';
    return 0;
  }

  ll ans=2019;

  reps(i,L,R){
    reps(j,i+1,R+1){
      ans=min(ans,(i*j)%2019);
    }
  }




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


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

#include <iostream>
using namespace std;
int main() {
  uint64_t n, k;
  cin >> n >> k;
  uint64_t i = 0;
  while (int(n / pow(k, i)) != 0) {
    i++;
  }
  cout << i << endl;
  return 0;
}


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

int main() {
  int K,S;
  cin >> K >> S;

  int ans=0;

  for(int i=0;i<=K;i++) {
    for(int l=0;l<=K;l++) {
        if(S-l-i>=0 && S-l-i<=K) ans++;
    }
  }
  cout << ans << endl;
}


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

int main(){
    int a, b, c;
    cin >> a >> b >> c;

    int n = 100;
    int color[n];
    memset(color, 0, n*sizeof(int));

    color[--a]++;
    color[--b]++;
    color[--c]++;

    int ans = 0;
    for(int i = 0; i < n; i++){
        if(color[i] > 0) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#import pysnooper
#import numpy
#import os,re,sys,operator
from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate#,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys

setrecursionlimit(10**6)
input=stdin.readline

n,t=map(int,input().split())
ac=[0]*(t+1)
for _ in range(n):
    l,r=map(int,input().split())
    ac[l]+=1
    ac[r]-=1
for i in range(1,t+1):
    ac[i]+=ac[i-1]
print(max(ac))


Measured memory_bytes: 9840
import sys
text = sys.stdin.read()
text=text.lower()
alf = list('abcdefghijklmnopqrstuvwxyz')
cnt=[0]*26
for i in text:
    c=0
    for j in alf:
        if i == j:
            cnt[c]+=1
        c+=1
for i in range(26):
    print(alf[i]+' : '+str(cnt[i]))
   
            
    


Measured memory_bytes: 5560
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
        int[] num = inta();
        WriteLine(num[0] * num[1] /2);
    
    
    
    }
    //各種読取
    static string rstr(){
        return ReadLine();
    }
    static int rint(){
        return int.Parse(ReadLine());
    }
    static long rlong(){
        return long.Parse(ReadLine());
    }
    static string[] stra(){
        return ReadLine().Split(' ');
    }
    static int[] inta(){
        string[] read_str_array = ReadLine().Split(' ');
        int[] return_int_array = new int[read_str_array.Length];
        for(int countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_int_array[countup_i] = int.Parse(read_str_array[countup_i]);
        }
        return return_int_array;
    }
    static int[,] inta2(int num_array,int in_array){
        int[,] int_array2 = new int[num_array,in_array];
        for(int i=0;i<num_array;i++){
            int[] temp_array = inta();
            for(int j=0;j<in_array;j++){
                int_array2[i,j] = temp_array[j];
            }
        }
        return int_array2;
    }
    static long[] longa(){
        string[] read_str_array = ReadLine().Split(' ');
        long[] return_long_array = new long[read_str_array.Length];
        for(long countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_long_array[countup_i] = long.Parse(read_str_array[countup_i]);
        }
        return return_long_array;
    }
    static double[] doublea(){
        string[] read_str_array = ReadLine().Split(' ');
        double[] return_double_array = new double[read_str_array.Length];
        for(long countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_double_array[countup_i] = long.Parse(read_str_array[countup_i]);
        }
        return return_double_array;
    }
    // A/B小数点以下切上
    static long divideup(long divided,long divid){
        long temp_divide = divided/divid;
        if(divided % divid > 0){
            temp_divide++;
        }
        return temp_divide;
    }
    static long GCD(long a,long b){
        if(a < b){
            long temp = a;
            a = b;
            b = temp;
        }
        if(a % b == 0){ return b; }
        else{
            long temp = b;
            b = a%b;
            a = temp;
            return GCD(a,b);
        }
    }
    static long LCM(long a,long b){
        return a * b / GCD(a,b);
    }
}
//知見
// (string) hogestr -> (char[]) hoge
    // char hoge = hogestr.ToCharArray();
// (char[]) hoge -> (string) hogestr
    // string hoge = new string(hoge);
// Hashtable ×  Dictionary ○
// Dictionary hoge<string,int>
    // hoge.ContainsKey(string) -> return boolean
    // hoge[string] -> return int
    // hoge[int] -> CE
// Dictionary hoge<int1,int2>
    // hoge<int1,int2>: hoge[int1] -> return int2
    // KeyValuePair<int,int> k <-> k.Key == int1 / k.Value == int2
// SortedDictionary() > SortedList() ???
// キュー　-> 幅優先 ???
// スタック -> 深さ優先 ???

Measured memory_bytes: 13140
#include <ios>
#include <iomanip>
#include <iostream>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
 
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e9)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;

int main()
{
    ll N, K;
    cin >> N >> K;
    vector<ll> x(N);
    rep(i, N) cin >> x[i];
    ll mi = 1e18;
    rep(i, N-(K-1)) {
        if (x[i] <= 0 && x[i+K-1] <= 0) {
            mi = min(mi, abs(x[i]));
        } else if (x[i] >= 0 && x[i+K-1] >= 0) {
            mi = min(mi, abs(x[i+K-1]));
        } else {
            mi = min(mi, min(abs(x[i]), abs(x[i+K-1])) + abs(x[i] - x[i+K-1]));
        }
    }
    print(mi);
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	}
}


Measured memory_bytes: 21844
N = int(input())
L=[[int(j) for j in input().split()] for i in range(N)]
from math import factorial, sqrt
S = 0

def solve(L, r):
    global S
    if len(L) == 0:
        for i in range(N-1):
            x, y = r[i]
            x2, y2 = r[i+1]
            S += sqrt((x - x2)**2 + (y - y2)**2)
    for i, v in enumerate(L):
        if len(L) == N:
            solve(L[:i] + L[i+1:], [v])
        else:
            solve(L[:i] + L[i+1:], r + [v])

solve(L, [])
print(S/factorial(N))

Measured memory_bytes: 3064
N = int(input())
A = list(map(int,input().split()))
B = [[i+1,A[i]] for i in range(N)]
B = sorted(B,key=lambda x: x[1])
ans = ""
ans += str(B[0][0])
for j in range(1,N):
    ans += " "+str(B[j][0])
print(ans)

Measured memory_bytes: 22756
N = int(input())
a = map(int, input().split())
sorted_a = sorted(list(a), reverse=True)
Alice = 0
Bob = 0
for i in range(N):
    if i % 2 == 0:
        Alice += sorted_a[i]
    else:
        Bob += sorted_a[i]
result = Alice - Bob
print(result)

Measured memory_bytes: 9104
#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<vector<double>>> ev;
double check(int n1,int n2,int n3){
  if(n1 < 0 or n2 < 0 or n3 < 0) return 0;
  if(n1 == 0 and n2 == 0 and n3 == 0) return 0;
  if(ev[n1][n2][n3] == 0){
    int tot = n1+n2+n3;
    ev[n1][n2][n3] = 1.0*n/tot;
    ev[n1][n2][n3] += 1.0*n3/tot * check(n1,n2+1,n3-1);
    ev[n1][n2][n3] += 1.0*n2/tot * check(n1+1,n2-1,n3);
    ev[n1][n2][n3] += 1.0*n1/tot * check(n1-1,n2,n3);
  }
  return ev[n1][n2][n3];
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed;
  cout.precision(20);
  cin >> n;
  ev.assign(n+1,vector<vector<double>>(n+1,vector<double>(n+1)));
  int a,n1 = 0,n2 = 0,n3 = 0;
  for(int i = 0; i < n; ++i){
    cin >> a;
    if(a == 1) ++n1;
    else if(a == 2) ++n2;
    else if(a == 3) ++n3;
  }
  cout << check(n1,n2,n3);
  return 0;
}

Measured memory_bytes: 219936
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    a,b=map(int,input().split())
    if(a+b==15):
        print('+')
    elif(a*b==15):
        print('*')
    else:
        print('x')
resolve()

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

typedef long long ll;
typedef pair<ll, ll> p;


int main(){

  int n, k, q;
  cin >> n >> k >> q;
  vector<int> v(q);
  rep(i, q) {
    cin >> v[i];
    v[i]--;
  }
  map<int, int> count;
  rep(i, q){
    count[v[i]]++;
  }
  for (int i = 0; i < n; i++) {
    if(k - (q - count[i]) > 0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 5760
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    }
}

Measured memory_bytes: 48472
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAXN 3005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,m;
char s[MAXN+1],t[MAXN+1];
int dp[MAXN][MAXN],op[MAXN][MAXN];
int main()
{
    scanf("%s",s+1);scanf("%s",t+1);
    n=strlen(s+1);m=strlen(t+1);
    memset(dp,0,sizeof(dp));
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            if(s[i]==t[j]) dp[i][j]=dp[i-1][j-1]+1;
            else dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    int x=n,y=m;
    deque<char> ans;
    while(x>=1&&y>=1)
    {
        if(s[x]==t[y]) {ans.push_front(s[x]); x--; y--;}
        else if(dp[x-1][y]>dp[x][y-1]) x--;
        else y--;
    }
    for(auto ch:ans) printf("%c",ch);
    return 0;
}



Measured memory_bytes: 35968