akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using ll = int64_t;
#define MAX_N 1010
#define MAX_M 100010
const long long mod = pow(10,9)+7;
#define vec vector<int>
#define vecll vector<ll>
#define vecllvec vector<vector<ll>>
#define vecb vector<bool>
#define vecBvec vector<vector<bool>>
#define vecst vector<string>
#define veche vector<char>
#define vecd vector<double>
#define vecvec vector<vector<int>>
#define vecDvec vector<vector<double>>
#define vecHvec vector<vector<char>>
#define all(x) (x).begin(),(x).end()
#define ent cout<<endl
#define printvec(vec) for(int aqw=0;aqw<vec.size();aqw++){cout<<vec[aqw]<<" ";}ent;
#define rep1(n) for(ll i = 0; i < (n); ++i)
#define rep2(i, n) for(ll i = 0; i < (n); ++i)
#define rep3(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep4(i, a, b, c) for(ll i = (a); i < (b); i += (c))
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; }
#define INF 1e+9
#define print(x) cout<<x<<endl;
using P = pair<int, int>;
#define PLL pair<ll, ll>;
#define MAX_V 10010
#define PI 3.141592653589793
#define vecP vector<P>
 //cout << setprecision(15) << std::fixed;

int main() {
    int n,m;
    cin >> n >> m;
    vec A(n,-1);
    for (int i = 0;i < m;i++) {
        int s, c;
        cin >> s >> c;
        s--;
        if (A[s] != -1 && A[s] != c) {
            print("-1");
            exit(0);
        }
        if (n==1 && (s == 0 && c == 0)) {
            A[s] = c;
            continue;
        }
        if ((s == 0 && c == 0)) {
            print("-1");
            exit(0);
        }
        A[s] = c;
    }
    if (A[0] == -1) {
        A[0] = 1;
        if (n == 1) A[0] = 0;
    }
    for (int i = 0;i < n;i++) {
        if (A[i] == -1) A[i] = 0;
    }
    string s="";
    for (int i = 0;i < n;i++) {
        s += to_string(A[i]);
    }
    print(s);
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int n,k;cin>>n>>k;
  int sum = 0;
  for(int i=0;i<n;i++){
    int x;cin>>x;
    if(x<k-x) sum+=x*2;
    else sum+=(k-x)*2;
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF=1e9;
//const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
#define int long long
//template
int MOD;
std::vector<int> edge[100000];
int dp[100000],ans[100000];
void dfs1(int idx,int par){
  for(int to:edge[idx]){
    if(to==par)continue;
    dfs1(to,idx);
    dp[idx]*=dp[to]+1;dp[idx]%=MOD;
  }
}
void dfs2(int idx,int dp_par,int par){
  int U=edge[idx].size();
  std::vector<int> cum1(U+1,1),cum2(U+1,1);
  for(int i=0;i<U;i++){
    if(edge[idx][i]==par)cum1[i+1]=cum1[i]*(dp_par+1)%MOD;
    else cum1[i+1]=cum1[i]*(dp[edge[idx][i]]+1)%MOD;
  }
  for(int i=U-1;i>=0;i--){
    if(edge[idx][i]==par)cum2[i]=cum2[i+1]*(dp_par+1)%MOD;
    else cum2[i]=cum2[i+1]*(dp[edge[idx][i]]+1)%MOD;
  }
  ans[idx]=cum1[U];
  for(int to=0;to<edge[idx].size();to++){
    if(edge[idx][to]==par)continue;
    dfs2(edge[idx][to],cum1[to]*cum2[to+1]%MOD,idx);
  }
}
//main
signed main(){
  for(int i=0;i<100000;i++)dp[i]=ans[i]=1;
  int N;cin>>N>>MOD;
  for(int i=1;i<N;i++){
    int u,v;cin>>u>>v;u--;v--;
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  dfs1(0,-1);
  dfs2(0,-1,-1);
  for(int i=0;i<N;i++)cout<<ans[i]<<endl;
}


Measured memory_bytes: 18816
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

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

        Pattern pattern = Pattern.compile("A.+Z");
        Matcher matcher = pattern.matcher(s);

        int length = 0;

        if (matcher.find()) {
            String split = matcher.group();
            if (split.length() > length) {
                length = split.length();
            }
        }

        System.out.println(String.valueOf(length));


    }
}

Measured memory_bytes: 15068
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  double p[N],answer = 0;
  map<int,double> dp[N+1];
  for (int i = 0; i < N; i++) {
    cin >> p[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= N; i++) {
    dp[i][0] = dp[i-1][0]*(1-p[i-1]);
    for (int j = 1; j <= i; j++) {
      dp[i][j] = dp[i-1][j-1]*p[i-1];
      if (j <= i-1) {
        dp[i][j] += dp[i-1][j]*(1-p[i-1]);
      }
    }
  }
  for (int i = N/2+1; i <= N; i++) {
    answer += dp[N][i];
  }
  cout.precision(10);
  cout << answer;
}

Measured memory_bytes: 285296
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAXN 103
typedef struct element {
  int weight;
  int value;
}element;
int somWeight;
long long int dp[MAXN][100005];
int last;
int W;
element tab[MAXN];
long long int max(long long int a,long long int b){
  return a>b ? a : b ;
}
long long int solve (int n,int w){
  if (tab[n].weight>w) {
    return solve(n+1,w);
  }
  if (n>last||w==0) {
    return 0;
  }
if (dp[n][w]!=-1) {
  return dp[n][w];
}
long long int case1=0;
long long int case2=0;
case1=solve(n+1,w);
case2=tab[n].value+solve(n+1,w-tab[n].weight);
return dp[n][w]=max(case1,case2);
}
int main() {
  for (int i = 0; i < MAXN; i++) {
    for (int j = 0; j < 100005; j++) {
      dp[i][j]=-1;
    }
  }
  scanf("%d",&last);
  scanf("%d",&W);
  for (int i = 0; i < last; i++) {
    scanf("%d",&tab[i].weight);
    scanf("%d",&tab[i].value);
  }
  printf("%lld",solve(0,W));
return 0;
}



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

#define ll long long
#define ull unsigned long long

using namespace std;

int main() {
	ll N, X, Y;
	cin >> N >> X >> Y;
	X--;
	Y--;

	vector <ll> cnt(N, 0);

	for (int ii = 0; ii < N-1; ++ii){
		for (int jj = ii + 1; jj < N; ++jj){
			ll dist1 = jj - ii;
			ll dist2 = abs(X - ii) + 1 + abs(Y - jj);
			ll dist = min(dist1, dist2);

			cnt[dist]++;
		}
	}

	for (int ii = 1; ii < N; ++ii){
		cout << cnt[ii]  << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define MAX_N 200010
long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];

void GetInv(){
    for (int i = 1; i < MAX_N; i++) {
        if (i == 1) inv[i] = 1;
        else {
            inv[i] = (mod - (mod / i) * inv[mod % i]) % mod;
            if (inv[i] < 0) inv[i] += mod;
        }
    }
}
void GetFactorial(){
    factorial[0] = 1; inv_factorial[0] = 1;
    for (int i = 1; i < MAX_N; i++) {
        factorial[i] = factorial[i-1] * i;
        factorial[i] %= mod;
        inv_factorial[i] = inv_factorial[i-1] * inv[i];
        inv_factorial[i] %= mod;
    }
}

long long combination(int n, int r) {
    long long ret = factorial[n] * inv_factorial[r];
    ret %= mod;
    ret *= inv_factorial[n-r];
    return ret % mod;
}

long long modpow(int n, int r) {
    long long ret = 1; long long tmp = (long long) n;
    while (r != 0) {
        if (r % 2) ret *= tmp;
        tmp *= tmp; tmp %= mod; ret %= mod;
        r /= 2;
    }
    return ret;
}

int main(){
    GetInv(); GetFactorial();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, a, b; cin >> n >> a >> b;
    long long c = modpow(2, n);
    auto calc = [&](int n, int r) {
        long long ret = 1;
        for (int i = 0; i < r; i++) {
            ret *= n-i;
            ret %= mod;
            ret *= inv[i+1];
            ret %= mod;
        }
        return ret;
    };
    cout << (c - 1 + mod * 2 - calc(n, a) - calc(n, b)) % mod << "\n";
    return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) std::memset(arg,n,sizeof(arg))
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
const int INF=1e+9;
const ll INFLL=1e+17;
ll N,M;
ll solve(){
  ll res;
  if(M<=2*N){
    res=M/2;
  }
  else{
    res=N;
    res+=(M-2*N)/4;
  }
  return res;
}
int main(){
  cin>>N>>M;
  prin(solve());
  return 0;
}


Measured memory_bytes: 256
#abc172c
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=[0]
y=[0]
for i in range(n):
 x.append(x[i]+a[i])
for i in range(m):
 y.append(y[i]+b[i])
res=0
j=m
for i in range(n+1):
 if x[i]>k:
  break
 while y[j]>k-x[i]:
  j-=1
 res=max(res,i+j)
print(res)


Measured memory_bytes: 47372
//#pragma warning(disable:4996)
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>
//#include <stdio.h>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
typedef long long LL;
typedef long double LD;
//typedef boost::multiprecision::cpp_int bigint;
typedef pair<LL, LL> PLL;
typedef pair<int, int> PI;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef unsigned long long ULL;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int ans = 0;
	string S;
	cin >> S;
	for (int n = 0; n < 4; n++) {
		if (S[n] == '+')ans++;
		else ans--;
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 3164
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;
typedef complex<ld> com;
constexpr int inf = 1000000000;
constexpr ll INF = 1000000000000000000;
constexpr ld EPS = 1e-12;
constexpr ld PI = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


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

	int n, m;
	cin >> n >> m;
	string s;
	cin >> s;
	vector<vector<int>> graph(n, vector<int>());
	vector<int> cnta(n), cntb(n);
	rep(i, m) {
		int u, v;
		cin >> u >> v;
		u--; v--;
		graph[u].pb(v);
		graph[v].pb(u);
		if (s[v] == 'A') cnta[u]++;
		else cntb[u]++;
		if (s[u] == 'A') cnta[v]++;
		else cntb[v]++;
	}
	queue<int> que;
	vector<bool> vis(n);
	int ng = 0;
	rep(i, n){
		if (cnta[i] == 0 || cntb[i] == 0) {
			que.push(i);
			ng++;
			vis[i] = true;
		}
	}
	while (!que.empty()) {
		int v = que.front(); que.pop();
		for (int i : graph[v]) {
			if (vis[i]) continue;
			if (s[v] == 'A') cnta[i]--;
			else cntb[i]--;
			if (cnta[i] == 0 || cntb[i] == 0) {
				que.push(i);
				ng++;
				vis[i] = true;
			}
		}
	}
	cout << (ng == n ? "No" : "Yes") << '\n';
}

Measured memory_bytes: 12240
a = [int(input()) for _ in range(5)]
k = int(input())
ans = True

for i in range(5):
    for j in range(i+1, 5):
        if a[j] - a[i] > k:
            ans = False
            break
    if not ans:
        break

print('Yay!' if ans else ':(')


Measured memory_bytes: 2940
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main()
{
	int n,m,res=0;
	cin>>n>>m;
	cout<<(1900*m+100*(n-m))*pow(2,m)<<endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
//#include <functional> // for less
//using namespace __gnu_pbds;
using namespace std;
typedef long long  L;

#define max_(x, y) (((x) > (y)) ? (x) : (y))
#define min_(x, y) (((x) < (y)) ? (x) : (y))
#define ___ ios_base::sync_with_stdio(false);cin.tie(NULL);
#define Mx 2000001
#define inf 1e17
const L MOD = 1e9+7;
const double pi = 2 * acos (0.0);

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/


//typedef tree<L,null_type,less<L>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

L a,b,a1,a2,a3,b1,b2,b3,c,c1,c2,c3,d,d1,d2,d3,d4,d5,e1,e2,e3,f,h,k,l,n,m,m1,m2,n1,n2,o,p1,p2,p3,p4,
q1,q2,q3,q4,r,s,t,x,y,z,sum,mn,flg,flg1,flg2,id1,id2,id3,lim,cost;
char str[10];
int main()
{
    L ac,tle,wa,re;
    ac=tle=wa=re=0;
    scanf("%lld",&n);
    for(L i=0;i<n;i++){
        scanf("%s",str);
        if(str[0]=='A')ac++;
        else if(str[0]=='W')wa++;
        else if(str[0]=='T')tle++;
        else if(str[0]=='R')re++;
    }

    printf("AC x %lld\n",ac);
    printf("WA x %lld\n",wa);
    printf("TLE x %lld\n",tle);
    printf("RE x %lld\n",re);
    // solve();
    return 0;
}
/// empty() lld I64d push_back() top() pop() insert() upper_bound() lower_bound() memset() max() min() scanf continue


Measured memory_bytes: 3792
import java.math.*;
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

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

    void run() {

        long[] arr = new long[n];
        for (int i=0; i<n; i++) arr[i] = sc.nextLong() * (-1L);
        Arrays.sort(arr);
        for (int i=0; i<n; i++) arr[i] *= (-1);

//        System.out.print(arr[0]);

        long res = 0;
        res += arr[0];
        n -= 1;

        if (n % 2 == 1) {
            int tmp = n / 2;
            for (int i=0; i<tmp; i++) {
                res += arr[i+1] * 2;
            }
            System.out.print(res);
        } else {
            int tmp = n / 2 - 1;
            int j = 1;
            for (int i=0; i<tmp; i++) {
                res += arr[i+1] * 2;
                j++;
            }
            res += arr[j];
            System.out.print(res);
        }
    }


}



Measured memory_bytes: 61312
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] s = S.split("");
        int base = 97;
        boolean[] boo = new boolean[26];
        for(int i=0; i<s.length; i++) {
            char x = S.charAt(i);
            boo[x-base] = true;
        }
        
        for(int i=0; i<26; i++) {
            if(boo[i]) {
                if(i == 25) {
                    System.out.println("None");
                }
                continue;
            }else {
                System.out.println((char)(base+i));
                break;
            }
            
        }
    }
}

Measured memory_bytes: 32300
#include <cstdio>
#include <algorithm>
#include <vector>

typedef long long LL;
const int MN = 105;

int N, eu[MN], ev[MN];
std::vector<int> G[MN];
std::pair<int, LL> Ans;

int dep[MN], deg[MN], xdep;
void DFS(int u, int fz) {
	xdep = std::max(xdep, dep[u]);
	deg[dep[u]] = std::max(deg[dep[u]], (int)G[u].size() - (fz ? 1 : 0));
	for (auto v : G[u])
		if (v != fz)
			dep[v] = dep[u] + 1,
			DFS(v, u);
}

int main() {
	scanf("%d", &N), Ans.first = N + 1;
	for (int i = 1; i < N; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		G[x].push_back(y);
		G[y].push_back(x);
		eu[i] = x, ev[i] = y;
	}
	for (int i = 1; i <= N; ++i) {
		xdep = dep[i] = 1, DFS(i, 0);
		LL Sum = 1;
		for (int j = 1; j < xdep; ++j) Sum *= deg[j], deg[j] = 0;
		Ans = std::min(Ans, {xdep, Sum});
	}
	for (int i = 1; i < N; ++i) {
		int u = eu[i], v = ev[i];
		xdep = dep[u] = dep[v] = 1;
		DFS(u, v), DFS(v, u);
		LL Sum = 2;
		for (int j = 1; j < xdep; ++j) Sum *= deg[j], deg[j] = 0;
		Ans = std::min(Ans, {xdep, Sum});
	}
	printf("%d %lld\n", Ans.first, Ans.second);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool etmin(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//https://www.creativ.xyz/dump-cpp-652/
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
 
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

#ifdef DEBUG_
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif

signed main(void) { cin.tie(0); ios::sync_with_stdio(false);
    int k,x; cin>>k>>x;
    if(k*500 >= x) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

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

public class Hello{
    public static void Main(){
        // Your code here!
      
        int[] t = new int[100010];
        int[] x = new int[100010];
        int[] y = new int[100010];
        t[0] = 0;
        x[0] = 0;
        y[0] = 0;
        int N = int.Parse(Console.ReadLine());
        for(int i = 0; i < N; i++)
        {
            int[] s = Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
            t[i + 1] = s[0];
            x[i + 1] = s[1];
            y[i + 1] = s[2];
        }
        
        bool can = true;
        for(int i = 0; i < N; i++)
        {
            int dt = t[i + 1] - t[i];
            int dist = Math.Abs(x[i + 1] - x[i]) + Math.Abs(y[i + 1] - y[i]);
            if(dt < dist)
            {
                can = false;
                //Console.WriteLine("i = " + i);
                //Console.WriteLine("hoge");
            }
            else
            {
                if(dt % 2 != dist % 2)
                {
                    
                    can = false;
                    //Console.WriteLine("huga");
                } 
            }
        }
        
        if(can == true) Console.WriteLine("Yes");
        else Console.WriteLine("No");
    }
}

Measured memory_bytes: 18400
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back

char to_i(char& c){return int(c - '0');}
i64 dp[10001000][2];

int main(){
    string N;
    cin >> N;
    reverse(all(N));
    
    for(int i = 0; i < 10001000; i++){
        dp[i][0] = 1e18;
        dp[i][1] = 1e18;
    }

    dp[0][0] = 0;

    int len = N.size();
    for(int i = 1; i <= len; i++){
        dp[i][0] = min(dp[i-1][0] + to_i(N[i-1]), dp[i-1][1] + to_i(N[i-1]));
        dp[i][1] = min(dp[i-1][0] + (10 - to_i(N[i-1])) + 1, dp[i-1][1] + (10 - to_i(N[i-1]) - 1));
    }
    //cout << dp[1][0] << " " << dp[1][1] << endl;
    cout << min(dp[len][0], dp[len][1]) << endl;
}

Measured memory_bytes: 157572
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<queue>
#include<map>
#include<math.h>
#include<string>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1ll<<60;

using namespace std;
typedef pair<int, int> P;

int main(){
    float a, b, c, d;
    cin >> a >> b >> c >> d;
    int t_s = ceil(a/d);
    int a_s = ceil(c/b);
    if(t_s>=a_s) out("Yes");
    else out("No");
}

Measured memory_bytes: 3700
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int kMax = 1000 + 10;

char a_str[kMax], b_str[kMax];
int dp[kMax][kMax];

int main() {
    int q;
    scanf("%d", &q);
    while(q --) {
        scanf("%s%s", a_str, b_str);
        int n = strlen(a_str), m = strlen(b_str);
        for(int i = 0;i < n;++ i) {
            for(int j = 0;j < m;++ j) {
                if(a_str[i] == b_str[j]) dp[i][j] = (i && j ? (dp[i-1][j-1] + 1) : 1);
                else dp[i][j] = max(i ? dp[i-1][j] : 0, j ? dp[i][j-1] : 0);
            }
        }
        printf("%d\n", dp[n-1][m-1]);
    }
    return 0;
}

Measured memory_bytes: 6564
#include<iostream>
#include<algorithm>
#include<map>
#include<cstdio>
#define ll long long
#define lson (rt<< 1)
#define rson (rt<< 1 | 1)
#define gmid ((l+r)>> 1 )
using namespace std;

const int maxn=200050;

ll n,k,l,r;
int a[maxn];

bool check(ll x)
{
	int s=0;
	for(int i=1;i<=n;++i)
	  {
	  	  if(a[i]%x>0) s++;
	  	  s+=a[i]/x-1;
	  	  if(s>k) return false;
	  }
	return true;  
}

int main()
{
	scanf("%lld %lld",&n,&k);
	for(int i=1;i<=n;++i)
	  {
	  	  scanf("%d",&a[i]);
	  	  if(a[i]>=r) r=a[i];
	  }
	l=1;
	while(r-l>1)
	  {
	  	  int mid=(l+r)/2;
	  	  if(check(mid)==false) l=mid;
	  	    else r=mid;
	  }  
	if(check(l)==true) printf("%lld\n",l);
	  else printf("%lld\n",r); 
}


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

#define maxn 10007
const int INF=0x3f3f3f3f;


vector <int> v;
int a[107][107];
int main()
{
    int h,w,n,i,j,k,x,y;
    scanf("%d%d%d",&h,&w,&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&x);
        for(j=1;j<=x;j++)
        {
            v.push_back(i);
        }
    }
    int cnt=0;
    for(i=1;i<=h;i++)
    {
        if(i%2==1)
        {
            for(j=1;j<=w;j++)
                a[i][j]=v[cnt++];
        }
        else
        {
            for(j=w;j>=1;j--)
                a[i][j]=v[cnt++];
        }
        printf("%d",a[i][1]);
        for(j=2;j<=w;j++)
        {
            printf(" %d",a[i][j]);
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
using namespace std;
typedef long long int ll;
static const int MAX_N = 100;
static const ll INF = LLONG_MAX;
 
struct edge{int to; ll cap; int rev;};
 
vector<edge> G[MAX_N + 2];
 
int N;
ll A[MAX_N + 1];
bool used[MAX_N + 2];
 
void add_edge(int from, int to, ll cap){
  G[from].push_back((edge){to, cap, G[to].size()});
  G[to].push_back((edge){from, 0, G[from].size() - 1});
}
 
ll dfs(int v, int t, ll f){
  if(v == t) return f;
  used[v] = true;
  for(int i = 0; i < G[v].size(); i++){
    edge &e = G[v][i];
    if(!used[e.to] && e.cap > 0){
      ll d = dfs(e.to, t, min(f, e.cap));
      if(d > 0){
    e.cap -= d;
    G[e.to][e.rev].cap += d;
    return d;
      }
    }
  }
  return 0;
}
 
ll max_flow(int s, int t){
  ll flow = 0;
  for(;;){
    fill(used, used + N + 2, false);
    ll f = dfs(s, t, INF);
    if(f == 0) return flow;
    flow += f;
  }
}

int main(){
	cin >> N;
	for(int i = 1; i <= N; i++) cin >> A[i];
	ll sum = 0LL;
	for(int i = 1; i <= N; i++){
		if(A[i] < 0){
			add_edge(0, i, -A[i]);
		}else{
			add_edge(i, N + 1, A[i]);
			sum += A[i];
		}
		for(int j = 2; j * i <= N; j++){
			add_edge(i, j * i, INF);
		}
	}
	cout << sum - max_flow(0, N + 1) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <deque>
#include <queue>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for(int i = 0; i < n; i++) cin >> v[i];
    int r = min(n, k);
    int ans = 0;
    for(int left = 0; left <= r; left++)
    {
        for(int right = 0; left + right <= r; right++)
        {
            vector<int> J;
            for(int i = 0; i < left; i++) J.push_back(v[i]);
            for(int i = 0; i < right; i++) J.push_back(v[n - 1 - i]);
            sort(J.begin(), J.end());
            int c = k - left - right;
            if(c > 0) for(int i = 0; i < min(c, (int)J.size()); i++) J[i] = max(J[i], 0);
            int sum = 0;
            for(int i = 0; i < J.size(); i++) sum += J[i];
            ans = max(ans, sum);
        }
    }
    cout << ans << endl;
    return 0;
}



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

using namespace std;

const int mod = 1e9 + 7;
int n,k;
int v[100010];
long long f[100010];

int main() {

    f[0] = 1;

    for (int i = 1; i < 100010; ++i)
        f[i] = (i * f[i - 1]) % mod;

    auto modpow = [] (long long a, long long b) {
        long long x=1, y=a; 
        while (b > 0) {
            if (b & 1) 
                x = (x*y) % mod; 
            y = (y*y) % mod; 
            b /= 2;
        }
        return x % mod;
    };


    auto C = [modpow] (long long n, long long k) {
        if(k > n) return 0LL;
        return (f[n] * modpow( (f[k] * f[n - k]) % mod, mod - 2)) % mod;
    };


    cin >> n >> k;

    for (int i = 0; i < n; ++i)
        cin >> v[i];

    sort(v, v + n);

    long long mn = 0, mx = 0;
    for (int i = 0; i < n; ++i) {
        mn += (v[i] * C(n - i - 1, k - 1)) % mod;
        mx += (v[i] * C(i, k - 1)) % mod;
        mn %= mod;
        mx %= mod;
    }

    cout << (mx - mn + mod) % mod << "\n";
    return 0;
}


Measured memory_bytes: 1408
N = int(input())
A = [ int(i) for i in input().split() ]

i = 0; count = 0
while True:
        
    if A[i] % 2 > 0:
        break

    elif i < (N-1):
        A[i] = int(A[i] / 2)
        i+=1    
    else:
        A[i] = int(A[i] / 2)
        i=0
        count+=1
        
print(count)

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

public class Main {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	void solve() throws IOException {
		int[] a = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = nextInt();
		}
		Arrays.sort(a);
		
		if (a[0] % 2 == 0 || a[1] % 2 == 0 || a[2] % 2 == 0) {
			out.println(0);
		} else {
			out.println((long)a[0] * a[1]);
		}
	}

	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 8020
#include <bits/stdc++.h>
using namespace std;
typedef pair<long long, bool> P;  //また使える時true

int main(void) {
  long long N, H;
  cin >> N >> H;
  priority_queue<P> pq;
  for (int i = 0; i < N; i++) {
    long long a, b;
    cin >> a >> b;
    pq.push(P(a, true));
    pq.push(P(b, false));
  }
  long long current = 0, ans = 0;
  while (current < H) {
    P top = pq.top();
    pq.pop();
    current += top.first;
    ans++;
    if (top.second) {
      ans += (H - current + top.first - 1) / top.first;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6512
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pii pair<int , int>
#define pll pair<long long int,long long int>
#define mod 1000000007
#define inf 1e18+7
#define eps 0.00001
#define endl '\n'
int main()
{
    fastio;
 
    ll n;
    cin>>n;
    vector<pll > v;
    for(ll i=0;i<n;i++)
    {
        ll x;
        cin>>x;
        v.pb(mp(x,i));
    }
    sort(v.begin(),v.end());
    ll ans[n+1]={0};
    for(ll i=0;i<n/2;i++)
    {
        ans[v[i].ss]=v[n/2].ff;
    }
    for(ll i=n/2;i<n;i++)
        ans[v[i].ss]=v[n/2-1].ff;
    for(ll i=0;i<n;i++)
        cout<<ans[i]<<endl;

}

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

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

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main()
{
  string S;
  cin >> S;
  bool a = false, b = false, c = false;
  rep(i,0,3){
    if (S[i] == 'a')
    {
      a = true;
    }
    if (S[i] == 'b')
    {
      b = true;
    }
    if (S[i] == 'c')
    {
      c = true;
    }
  }
  if (a && b && c)
  {
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

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

int main() {

	int n; cin >> n;
	int cnt4 = 0;
	int cnt2 = 0;
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		if (a % 4 == 0) cnt4++;
		else if (a % 2 == 0) cnt2++;
		else cnt++;
	}
	string ans = "No";
	if (n % 2 != 0) {
		int tmp = 0;
		if (cnt2 % 2 != 0) {
			tmp = cnt2 - 1;
		}
		else {
			tmp = cnt2;
		}
		n -= tmp;
		if (n / 2 <= cnt4 + 1) {
			ans = "Yes";
		}
	}
	else { // n % 2 == 0
		int tmp = 0;
		if (cnt2 % 2 != 0) {
			tmp = cnt2 - 1;
		}
		else {
			tmp = cnt2;
		}
		n -= tmp;
		if (n / 2 <= cnt4) {
			ans = "Yes";
		}
	}
	cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,r,i;
    cin>>n>>r;
    if(n>=10)
    {
        cout<<r<<endl;
    }
    else
    {
        i=(100*(10-n))+r;
        cout<<i<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;
ll N,W,w[100010],v[100010],dp[110][100010] = {};

int main(){
	cin >> N >> W;
	for(int i=1;i<=N;i++){
		cin >> w[i] >> v[i];
	}
	for(int i=0;i<=N;i++){
		for(int j=0;j<=100000;j++){
			dp[i][j] = 1e18;
		}
	}
	dp[0][0] = 0;
	ll ans = 0;
	for(int i=1;i<=N;i++){
		for(int j=0;j<=100000;j++){
			if(j-v[i]>=0) dp[i][j] = min(dp[i-1][j],dp[i-1][j-v[i]]+w[i]);
			else dp[i][j] = dp[i-1][j];
		}
	}
	for(int i=0;i<=100000;i++){
		if(dp[N][i]<=W) ans = max(ans,(ll) i);
	}
	cout << ans << endl;
}

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

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

using namespace std;

struct Data { 
  int x,y; 
  bool operator < ( const Data &data ) const {
    return ( x == data.x ) ? y < data.y : x < data.x;
  }
  bool operator == ( const Data &data ) const {
    return x == data.x && y == data.y;
  }
};
int h,w;
char c[1010][1010];

inline bool isValid(int nx,int ny) { return 0 <= nx && nx < w && 0 <= ny && ny < h; }

int main(){
  cin >> h >> w;
  rep(i,h) {
    string s;
    cin >> s;
    rep(j,w) c[i][j] = s[j];
  }
  int phase = 0;
  deque<Data> deq;
  rep(i,h) rep(j,w) if( c[i][j] != '.' ) {
    int cnt = 0;
    REP(dy,-1,2) REP(dx,-1,2) {
      int nx = j + dx, ny = i + dy;
      if( !isValid(nx,ny) ) continue;
      if( c[ny][nx] == '.' ) ++cnt;
    }
    if( cnt >= ( c[i][j] - '0' ) ) deq.push_back((Data){j,i});
  }

  while( !deq.empty() ) {
    ++phase;
    deque<Data> next_deq;
    rep(i,deq.size()) c[deq[i].y][deq[i].x] = '.';
    rep(i,deq.size()) {
      REP(dy,-1,2) REP(dx,-1,2){
	int nx = deq[i].x + dx, ny = deq[i].y + dy;
	if( !isValid(nx,ny) ) continue;
	if( c[ny][nx] == '.' ) continue;
	int cnt = 0;
	REP(dy2,-1,2) REP(dx2,-1,2) {
	  int nx2 = nx + dx2, ny2 = ny + dy2;
	  if( !isValid(nx2,ny2) ) continue;
	  if( c[ny2][nx2] == '.' ) ++cnt;
	}
       if( cnt >= ( c[ny][nx] - '0' ) ) next_deq.push_back((Data){nx,ny});
      }
    }
    deq = next_deq;
    sort(deq.begin(),deq.end());
    deq.erase(unique(deq.begin(),deq.end()),deq.end());
  }
  
  cout << phase << endl;
  return 0;
}

Measured memory_bytes: 2248
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;

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

    Int a, b; cin >> a >> b;
    Int eastH = 0;
    rep(i, 0, b-a) eastH += (i+1);

    cout << eastH-b << endl;
}


Measured memory_bytes: 256
/**
* Think twice, code once.
* 1.integer overflow(maybe even long long overflow : (a+b >= c) -> (a >= c-b)
* 2.runtime error
* 3.boundary condition
* ---------------------------------------------------------------------------------------
* Author : zzy
* Date : 2020-03-22-20.12.42 Sunday
*/
#include <bits/stdc++.h>

#define eb emplace_back
#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, 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, l, r) for (int i = (l); i <= (r); i++)
#define per(i, r, l) for (int i = (r); i >= (l); i--)
#define ms(x, y) memset(x, y, sizeof(x))
#define SZ(x) ((int)(x).size())

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

i64 n;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "r", stdin);
#endif

    cin >> n;
    vi64 a(n);
    map<i64, i64> cnt;
    forn(i, n) {
        cin >> a[i];
        ++cnt[a[i]];
    }
    i64 ans = 0;
    for (auto it : cnt) ans += (it.se-1)*it.se/2;
    forn(i, n) {
        i64 temp = cnt[a[i]];
        ans -= temp*(temp-1)/2;
        --temp;
        if (temp > 0) ans += temp*(temp-1)/2;
        cout << ans << '\n';
        ans -= temp*(temp-1)/2;
        ++temp;
        ans += temp*(temp-1)/2;
    }


#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


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

#define NEXT(i) (i+1)%len
int len;

int main(){
    bool ok = false;
    string s, t;
    cin >> s;
    cin >> t;
    len = s.length();

    for(int i = 0; i < len; i++){
        if(s[i] == t[0]){
            string tmp = "";
            int j = 0, k = i, cnt=0;
            while(cnt < len && s[k] == t[j]){
                tmp += t[j];
                j = NEXT(j);
                k = NEXT(k);
                cnt++;
            }
            if(tmp == t){
                ok = true;
                break;
            }
        }
    }

    puts(ok?"Yes":"No");

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text;

namespace AtTest._400Problems_remain_
{
    class CF2016A_C
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            string s = Read();
            char[] chars = s.ToCharArray();
            int k = ReadInt();
            for (int i = 0; i < s.Length - 1; i++)
            {
                if (chars[i] == 'a') continue;

                int delta = 'a' + 26 - chars[i];
                if (delta <= k)
                {
                    chars[i] = 'a';
                    k -= delta;
                }
            }
            //Console.WriteLine(k);
            k %= 26;
            chars[s.Length - 1] 
                = (char)('a'+(chars[s.Length - 1] + k-'a') % 26);
            Console.WriteLine(chars);
        }

        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 13536
#include<stdio.h>
int main(void){
  long long int n,a,b,rem,ans;
  scanf("%lld%lld%lld",&n,&a,&b);
  ans=n/(a+b)*a;
  rem=n%(a+b);
  ans+=a>rem?rem:a;
  printf("%lld",ans);
  return 0;
}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		String str = input.readLine();
		int n = Integer.parseInt(str);
		str = input.readLine( );
		String[] strlist = str.split(" ");
		int[] list = new int[n];
		int count32 = 0;
		boolean[] check = new boolean[8];
		for(int i=0; i<n; i++){
			list[i] = Integer.parseInt(strlist[i]);
			if(list[i] < 3200){
				check[list[i]/400] = true;
			}else{
				count32++;
			}
		}
		int count = 0;
		for (boolean bl: check) {
			  if (bl) count++;
		}
		if(count == 0){
			count = 1;
			count32 = count32-1;
		}

		System.out.print(count+" ");
		System.out.println(count + count32);

	}
}


Measured memory_bytes: 21460
#include<stdio.h>

char ope(int a){
  if(a==0)
    return '+';
  if(a==1)
    return '-';
  return '*';
}

int ope_calc(int x,int o,int y){
  if(o==0)
    return x+y;
  else if(o==1)
    return x-y;
  else if(o==2)
    return x*y;
}

int operate(int a,int b,int c,int d){
  int i,j,k;
  int e,f,g;

  for(i=0;i<3;i++)
    for(j=0;j<3;j++){
      for(k=0;k<3;k++){
        /*1*/
        e=ope_calc(a,i,b);
        f=ope_calc(e,j,c);
        g=ope_calc(f,k,d);
        if(g==10){
          printf("(((%d %c %d) %c %d) %c %d)",a,ope(i),b,ope(j),c,ope(k),d);
          printf("\n");
          return 0;
        }
        /*2*/
        e=ope_calc(b,j,c);
        f=ope_calc(a,i,e);
        g=ope_calc(f,k,d);
        if(g==10){
          printf("((%d %c (%d %c %d)) %c %d)",a,ope(i),b,ope(j),c,ope(k),d);
          printf("\n");
          return 0;
        }
        /*3*/
        e=ope_calc(a,i,b);
        f=ope_calc(c,k,d);
        g=ope_calc(e,j,f);
        if(g==10){
          printf("((%d %c %d) %c (%d %c %d))",a,ope(i),b,ope(j),c,ope(k),d);
          printf("\n");
          return 0;
        }
        /*4*/
        e=ope_calc(b,j,c);
        f=ope_calc(e,k,d);
        g=ope_calc(a,i,f);
        if(g==10){
          printf("(%d %c ((%d %c %d) %c %d))",a,ope(i),b,ope(j),c,ope(k),d);
          printf("\n");
          return 0;
        }
        /*5*/
        e=ope_calc(c,k,d);
        f=ope_calc(b,j,e);
        g=ope_calc(a,i,f);
        if(g==10){
          printf("(%d %c (%d %c (%d %c %d)))",a,ope(i),b,ope(j),c,ope(k),d);
          printf("\n");
          return 0;
        }
      }
    }
  return 1;
}

void combination(int a,int b,int c,int d){
  int i,j,k,l;
  int n[4];

  n[0]=a;
  n[1]=b;
  n[2]=c;
  n[3]=d;

  for(i=0;i<4;i++)
    for(j=0;j<4;j++)
      if(j!=i)
        for(k=0;k<4;k++)
          if(k!=j && k!=i)
            for(l=0;l<4;l++)
              if(l!=k && l!=j && l!=i)
                if(operate(n[i],n[j],n[k],n[l])==0)
                  return;
  
  printf("0\n");
}

int main(void){
  int n[4];

  for(;;){
    scanf("%d%d%d%d",&n[0],&n[1],&n[2],&n[3]);
    if(n[0]==0 && n[1]==0 && n[2]==0 && n[3]==0)
      break;
    combination(n[0],n[1],n[2],n[3]);
  }
  return 0;
}

Measured memory_bytes: 0
import java.util.*;

class Main
{
  public static void main(String [] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    
    int arr[ ] = new int[N];
    for(int i=0;i<N;i++)
    {
      arr[i]=sc.nextInt();
    }
    
    int [ ] c =new int[N];
    for(int i=0;i<c.length-1;i++)
    {
      if(arr[i+1]<=arr[i])
        c[i]=1;
      else c[i]=0;
    }
    int sum=0;
 	int max =Integer.MIN_VALUE;
    for(int i=0;i<c.length;i++)
    {
     	if(c[i]==0 || i == c.length-1)
        {
          if(sum>max) { max=sum; } 
          sum=0;
        }
      else
      {
        sum++;
      }
    }
    
    System.out.println(max);
  }
  
}

Measured memory_bytes: 52152
import math
n=int(input())
A=[]
sum=0
for i in range(n):
  a,s=(int(x) for x in input().split()) 
  A.append((a,s))
for i in A:
  for i2 in A:
    sum+=math.sqrt((i[0]-i2[0])**2+(i[1]-i2[1])**2)
print(sum/n)




Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
const int N=500*500+5;
int a[N];
struct Node{
	int val,id;
}p[505];
bool cmp(Node a,Node b){
	return a.val<b.val;
}
int main (){
	int n;scanf ("%d",&n);
	for (int i=1;i<=n;i++) {
		scanf ("%d",&p[i].val);
		if (a[p[i].val]) {puts("No");return 0;}
		p[i].id=i,a[p[i].val]=p[i].id;
	}
	sort(p+1,p+n+1,cmp);
	int tot=1;bool flag=true;
	for (int i=1;i<=n;i++)
		for (int j=1;j<p[i].id;j++){
			while (a[tot]) {
				if (a[tot]==p[i].id) flag=false;
				tot++;
			}
			a[tot++]=p[i].id;
		}
	if (!flag) {
		puts("No");
		return 0;
	}
	tot=n*n;
	for (int i=n;i>=1;i--)
		for (int j=1;j<=n-p[i].id;j++){
			while (a[tot]) {
				if (a[tot]==p[i].id) flag=false;
				tot--;
			}
			a[tot--]=p[i].id;
		}
	if (!flag) {
		puts("No");
		return 0;
	}
	puts("Yes");
	for (int i=1;i<=n*n;i++) printf ("%d ",a[i]);
	return 0;
}


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

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

int main(int argc, char const *argv[])
{
	int h,w;
	cin>>h>>w;
	char s[h][w];
	for (int i = 0; i < h; ++i)
	{
		for (int j = 0; j < w; ++j)
		{
			cin>>s[i][j];
		}
	}
	long long ans=0LL;
	int memo[h][w]={},a,b;
	for (int i = 0; i < h; ++i)
	{
		for (int j = 0; j < w; ++j)
		{
			if (memo[i][j]==0)
			{
				memo[i][j]=1;
				a=0;b=0;
				if (s[i][j]=='.')
				{
					++a;
				}
				else
				{
					++b;
				}
				queue<pair<int,int>> que;
				que.push(make_pair(i,j));
				while (que.size()>0)
				{
					auto p=que.front();que.pop();
					for (int k = 0; k < 4; ++k)
					{
						int nx=p.first+dx[k],ny=p.second+dy[k];
						if (0<=nx&&nx<h&&0<=ny&&ny<w&&memo[nx][ny]==0&&s[nx][ny]!=s[p.first][p.second])
						{
							memo[nx][ny]=1;
							if (s[nx][ny]=='.')
							{
								++a;
							}
							else
							{
								++b;
							}
							que.push(make_pair(nx,ny));
						}
					}
				}
				ans+=(long long)a*b;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1024
package main

import "fmt"

func main() {

	var a int
	fmt.Scan(&a)

	list := make([]int, a)
	for i := 0; i < a; i++ {
		fmt.Scan(&list[i])
	}

	var list_count []int
	list_count = make([]int, 101)
	for i := 0; i < a; i++ {
		if list[i] > 0 {
			list_count[list[i]]++
		}
	}

	result := 0
	for i := 0; i <= 100; i++ {
		if list_count[i] > 0 {
			result++
		}
	}
	fmt.Println(result)
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=1000000007;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };


int main() {
	string s,x="";
	cin>>s;
	for(int i=0;i<s.size()-1;i++){
		x=x+s[i]+s[i+1];
		if(x=="AC"){
			cout<<"Yes"<<endl;
			return 0;
		}
		x="";	
	}
	cout<<"No"<<endl;
}


Measured memory_bytes: 256
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());
        String s = sc.next();

        String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String result = "";
        for (String c : s.split("")) {
            int index = alphabet.indexOf(c) + n;
            result += alphabet.charAt(index);
        }
        
        System.out.println(result);
        sc.close();
    }
}


Measured memory_bytes: 148808