akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
int main(void)
{
  int a,b,c;
  int i,j;
  int f=0;
  int z[100]={0};
  int cnt=0;

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


  /*------------cの約数を求める-------------------*/
  for (i=1; i<=c; i++) {
	if (c%i==0) {
	  z[f]=i;
	  f++;
	}
  }

  /*------ここでfは約数の個数、z[0]--z[f-1]まで約数の格納-----*/
  for (j=a; j<=b; j++) {
	for (i=0; i<f; i++) {
	  if (j==z[i]) {
		cnt++;
	  }
	}
  }

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

  return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int i,j,k,n,m,l,count1=0;
void ABC140(void);
void ABC141(void);
void ABC142(void);
void ABC143(void);
void ABC144(void);
void ABC145(void);
void ABC146(void);
void ABC147(void);
void ABC148(void);
void ABC149(void);

int main(void){
    ABC142();
}

void ABC142(){
    int x;
    cin>>n>>k;
    for(i=0;i<n;i++){
        cin>>x;
        if(x>=k)count1++;
    }
    cout<<count1<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
    int ret=0,f=0;char c=gc();
    while(!isdigit(c)){if(c=='-')f=1;c=gc();}
    while(isdigit(c)){ret=ret*10+c-48;c=gc();}
    if(f)return -ret;return ret;
}
signed main()
{
	int n=read();
	cout<<180*(n-2);
}

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

int main() {
  stack<int> S1; // 逆slash の
  stack<pair<int, int> > S2;
  char ch;
  string s;
  int sum = 0;
  cin >> s;
  int N = s.size();
  for ( int i = 0; i < N; i++ ) {
    if ( s[i] == '\\' ) S1.push(i); // S1 is depth
    else if ( s[i] == '/' && S1.size() > 0 ) {
      int j = S1.top(); S1.pop();
      sum += i - j;
      int a = i - j;
      while ( S2.size() > 0 && S2.top().first > j ) {
        a += S2.top().second; S2.pop();
      }
      S2.push(make_pair(j, a)); // S1.top() and i - j
    }
    // cout << S1.top() << " " << S2.top() << " " << s[i] << " " << endl;
  }

  vector<int> ans;
  while ( S2.size() > 0 ) { ans.push_back(S2.top().second); S2.pop(); }
  reverse(ans.begin(), ans.end());
  cout << sum << endl;
  cout << ans.size();
  for ( int i = 0; i < ans.size(); i++ ) {
    cout << " ";
    cout << ans[i];
  }
  cout << endl;

  return 0;

}



Measured memory_bytes: 3292
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
// #define endl "\n"

void precalculate(vector<vector<ll>>& arr, vector<ll>& cost) {
    ll n = arr.size();
    ll N = 1 << n;
    cost.resize(N);
    fill(cost.begin(), cost.end(), 0);
    for (ll bitmask = 1; bitmask < N; bitmask++) {
        for (ll i = 0; i < n; i++) {
            if (!(bitmask & (1 << i))) {
                continue;
            }
            for (ll j = i+1; j < n; j++) {
                if (bitmask & (1 << j)) {
                    cost[bitmask] += arr[i][j];
                }
            }
        }
    }
}

void build(ll i, ll bitmask, ll submask, vector<vector<ll>>& adj, ll n) {
    if (i == n) {
        if (__builtin_popcount(submask) != 0) {
            adj[bitmask].push_back(submask);
        }
        return;
    }

    build(i+1, bitmask, submask, adj, n);
    build(i+1, bitmask | (1 << i), submask, adj, n);
    build(i+1, bitmask | (1 << i), submask | (1 << i), adj, n);
}

ll recurse(ll bitmask, vector<vector<ll>>& adj, vector<bool>& visited, vector<ll>& cost, vector<ll>& dp) {
    if (bitmask == 0) {
        return 0;
    }
    if (visited[bitmask]) {
        return dp[bitmask];
    }

    visited[bitmask] = true;

    ll best = LLONG_MIN;

    for (auto submask: adj[bitmask]) {
        best = max(best, recurse(bitmask ^ submask, adj, visited, cost, dp) + cost[submask]); // same bitmask never comes, because submask is never 0
    }

    return dp[bitmask] = best;
}

int main(void) {
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.tie(NULL);
    ll n;
    cin >> n;
    vector<vector<ll>> arr(n, vector<ll> (n));
    for (ll i = 0; i < n; i++) {
        for (ll j = 0; j < n; j++) {
            cin >> arr[i][j];
        }
    }

    ll N = 1 << n;

    // precalculate group costs
    vector<ll> cost;
    precalculate(arr, cost);

    // form possible subgroups for each group of left over individuals
    vector<vector<ll>> adj (N);
    build(0, 0, 0, adj, n);
    
    vector<ll> dp (N);
    vector<bool> visited (N, false);

    cout << recurse(N-1, adj, visited, cost, dp) << endl;



    return 0;
}

Measured memory_bytes: 347460
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <numeric>
#include <limits>
#include <cmath>
#include <iomanip>
 
#define ALL(a)  (a).begin(),(a).end()
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

 
int main() {
    ll n, ans = 0;
    

    cin >> n;

    cout << n * n * n << endl;

    
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
	int n, val;
  	cin >> n;
  	unordered_set<int> s;
 	for(int i = 0; i < n; i++) {
      	cin >> val;
    	s.insert(val);
    }
  	if (s.size() == n)
      cout << "YES" << endl;
  	else
      cout << "NO" << endl;
    return 0;
}



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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)


int main(){
    int X,Y,Z;
    cin>>X>>Y>>Z;
    swap(X,Y);
    swap(X,Z);
    cout<<X<<" "<<Y<<" "<<Z;
    return 0;
}

//a=97,z=122

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

#ifdef LOCAL_PC
	#define debug(args...) { cout.flush(); fflush(stdout); fprintf(stderr, args); }
#else
	#define debug(args...) ; /*  */
#endif
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second
using ll = long long;
using pii = pair<int, int>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class Ty> Ty rnd(Ty a, Ty b) { return uniform_int_distribution<Ty>(a, b)(rng); }

template<class num> inline void rd(num &x) {
	char c; while(isspace(c = getchar()));
	bool neg = false;
	if(!isdigit(c)) neg = (c == '-'), x = 0;
	else x = c - '0';
	while(isdigit(c = getchar()))
		x = (x << 3) + (x << 1) + c - '0';
	if (neg) x = -x;
} template <class T, class... Args> inline void rd(T& x, Args&... args) { rd(x); rd(args...); }

const int MAXN = 2e5 + 5, INF = 0x3f3f3f3f;

int main() {
	int n; rd(n);

	map<int, int> mp;
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		int a; rd(a);
		ans += mp[a - i];
		mp[-a - i]++;
	}

	printf("%lld\n", ans);
}

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

int main(){
  	int N;
  	cin >> N;
  	vector<int> p(N);
  	for(int i=0; i<N; i++){
    	cin >> p[i];
    }
  	sort(p.begin(), p.end());
  	int sum = 0;
  	for(int i=0; i<N; i++){
    	if(i == N-1){
        	sum += p[i]/2;
        }else{
        	sum += p[i];
        }
    }
  
  	cout << sum << endl;
  	return 0;
}

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

class Program
{
    static void Solve()
    {
        var items = new int[5];
        var rems = new int[5];

        for (var i = 0; i < 5; i++)
        {
            var item = ReadInt();
            items[i] = item;

            rems[i] = item % 10;
        }

        if (rems.All(_ => _ == 0))
        {
            Console.WriteLine(items.Sum());
        }
        else
        {
            var temp = rems.Where(_ => _ != 0).Select(_ => 10 - _);
            Console.WriteLine(items.Sum() + temp.Sum() - temp.Max());
        }
    }

    static void Main(string[] args)
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }

    public static string Read() { return Console.ReadLine(); }
    public static int ReadInt() { return int.Parse(Read()); }
    public static long ReadLong() { return long.Parse(Read()); }
    public static double ReadDouble() { return double.Parse(Read()); }

    public static string[] Reads() { return Console.ReadLine().Split(' '); }
    public static int[] ReadInts() { return Reads().Select(_ => int.Parse(_)).ToArray(); }
    public static long[] ReadLongs() { return Reads().Select(_ => long.Parse(_)).ToArray(); }
    public static double[] ReadDoubles() { return Reads().Select(_ => double.Parse(_)).ToArray(); }
}

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0; i<N; i++) cin >> a.at(i);
  int ans=4000001;
  for(int i=-100; i<=100; i++){
    int cnt=0;
    for(int j=0; j<N; j++){
      cnt+=(i-a.at(j))*(i-a.at(j));
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>

typedef int32_t i32;
typedef int64_t i64;

static void print_int(i64 n){if(n<0){putchar('-');n=-n;}if(n==0){putchar('0');return;}int s[20],len=0;while(n>0){s[len++]=n%10+'0';n/=10;}while(len>0){putchar(s[--len]);}}
static i64 read_int(void){int prev='\0';int c=getchar();while(!('0'<=c && c<='9')){prev=c;c=getchar();}i64 res=0;while('0'<=c && c<='9'){res=10*res+c-'0';c=getchar();}return prev=='-'?-res:res;}

typedef struct range {
  i32 l, r;
} range;

typedef range radix_type;
typedef uint32_t u32;

#define RADIX_WIDTH 9
const u32 radix_type_max = 17;
const u32 radix_type_begin = 0;
const u32 radix_width = RADIX_WIDTH;
const u32 radix_mask = (1 << RADIX_WIDTH) - 1;
#undef RADIX_WIDTH

static inline u32 radix_get_bit (radix_type v, u32 shift) {
  return (u32)(v.r - v.l) >> shift & radix_mask;
}

void radix_sort (radix_type *a, u32 n) {
  radix_type * const array = (radix_type *) calloc (4 * n, sizeof (radix_type));
  radix_type **bucket = (radix_type **) calloc (1 << radix_width, sizeof (radix_type *));
  u32 *len = (u32 *) calloc (2 << radix_width, sizeof (u32));
  u32 *max_len = len + (1 << radix_width);
  for (u32 shift = radix_type_begin; shift < radix_type_max; shift += radix_width) {
    radix_type *p = array;
    memset (len, 0, sizeof (u32) << (radix_width + 1));
    for (u32 i = 0; i < n; ++i) {
      u32 bit = radix_get_bit (a[i], shift);
      if (len[bit] == max_len[bit]) {
	for (u32 j = 0; j < len[bit]; ++j) {
	  p[j] = bucket[bit][j];
	}
	max_len[bit] = 2 * max_len[bit] + 1;
	bucket[bit] = p;
	p += max_len[bit];
      }
      bucket[bit][len[bit]++] = a[i];
    }
    for (u32 bit = 0, i = 0; bit < (1 << radix_width); ++bit) {
      for (u32 j = 0; j < len[bit]; ++j, ++i) {
	a[i] = bucket[bit][j];
      }
    }
  }
  for (u32 i = 0; i + 1 < n; ++i) {
    if (a[i].r - a[i].l > a[i + 1].r - a[i + 1].l) {
      exit (1);
    }
  }
  free (array);
  free (bucket);
  free (len);
}

void add (i32 *bit, i32 x, i32 v) {
  i32 n = bit[0];
  for (i32 i = x; i <= n; i += i & -i) {
    bit[i] += v;
  }
}

i32 find (i32 *bit, i32 x) {
  i32 sum = 0;
  for (i32 i = x; i > 0; i -= i & -i) {
    sum += bit[i];
  }
  return sum;
}

void run (void) {
  i32 n = read_int();
  i32 m = read_int();
  range *p = (range *) calloc (n, sizeof (range));
  for (i32 i = 0; i < n; ++i) {
    p[i].l = read_int();
    p[i].r = read_int() + 1;
  }
  radix_sort (p, n);
  i32 *bit = (i32 *) calloc (m + 2, sizeof (i32));
  bit[0] = m + 1;
  for (i32 d = 1, i = 0; d <= m; ++d) {
    for (; i < n && p[i].r - p[i].l < d; ++i) {
      add (bit, p[i].l, 1);
      add (bit, p[i].r, -1);
    }
    i32 ans = n - i;
    for (i32 j = d; j <= m; j += d) {
      ans += find (bit, j);
    }
    print_int (ans);
    putchar ('\n');
  }
}

int main (void) {
  run();
  return 0;
}


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

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
const int INF = 0x3f3f3f3f;
const int maxn = 1100000;
const int mod = 1e9 + 7;
ll a[maxn];
bool cmp(int a, int b)
{
    return abs(a) > abs(b);
}
void run_case()
{
    int n, k;
    cin >> n >> k;
    bool ok = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + n);
    ll ans = 1;
    if (a[n] < 0)
    {
        if (k & 1)
        {
            for (int i = n - k + 1; i <= n; i++)
            {
                ans = (ans * a[i]) % mod;
            }
        }
        else
        {
            for (int i = 1; i <= k; i++)
            {
                ans = (ans * a[i]) % mod;
            }
        }
    }
    else
    {
        int l = 1, r = n;
        if (k & 1)
        {
            ans = ans * a[r] % mod;
            r--;
            k--;
        }
        while (k)
        {
            if (a[l] * a[l + 1] > a[r] * a[r - 1])
            {
                ans = ans * a[l] % mod * a[l + 1] % mod;
                l += 2;
            }
            else
            {
                ans = ans * a[r] % mod * a[r - 1] % mod;
                r -= 2;
            }
            k -= 2;
        }
    }
    cout << (ans + mod) % mod << "\n";
    //ll ans = 1;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    run_case();
    cout.flush();
    return 0;
}

Measured memory_bytes: 5216
S=input()

if (len(S)==4):
    w=[]
    for x in S:
        w.append(x)
    c=dict(zip(w,[0]*len(w)))
    b=[0]*len(c)
    a=dict(zip(w,b))
    if (len(c)==2):
        flag=True
        for t in w:
            c[t]=c[t]+1
        for t in w:
            if c[t]!=2:
                flag=False
        if(flag):
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Measured memory_bytes: 3064
n, y = [int(i) for i in input().split()]
a = b = c = -1

for i in range(n+1):
    for j in range(n+1-i):
        k = n-i-j
        if 10000*i+5000*j+1000*k == y:
            a = i
            b = j
            c = k
            break
    else:
        continue
    break

print('{} {} {}'.format(a, b, c))


Measured memory_bytes: 3060
r, D, x= map(int, input().split())
s=[0]*(11)
s[0]=x
for i in range(10):
    if i ==0:
        s[i+1]=r*x-D
        print(s[i+1])
    else:
        s[i+1]=r*s[i]-D
        print(s[i+1])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}




int main(){
  ll N;
  cin >> N;
  vector<ll> a(N);
  for(auto &&x:a)cin>>x;

  map<ll,ll> ma;
  for(auto x:a){
    ma[x]++;
  }

  if(ma[0] == N){
    cout << "Yes" << endl;
  }else if(N%3!=0){
    cout << "No" << endl;
  }else if(ma.size()==2 && ma[0]*3 == N){
    cout << "Yes" << endl;
  }else{
    bool ok = true;
    for(auto x:ma){
      if(x.first==0 && x.second==0)continue;
      //cout << x.first << " " << x.second << endl;
      if( x.second*3 != N)ok=false;
    }
    ll k = 0;
    for(auto x:a)k ^= x;
    if(k!=0) ok = false;
    cout << ( ok ? "Yes" : "No" ) << endl;
  }



}


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

int pre[50];
int in[50];
int ans[50];
int N;
int cur = 0;
int ansIndex = 0;

void solve( int l, int r ){
  if( r - l > 0 ){
    int root = pre[cur++];
    int d;
    for( int i = 0; i < N; i++ ){
      if( in[i] == root ){
	d = i;
	break;
      }
    }

    solve( l, d );
    solve( d + 1, r );
    ans[ansIndex++] = root;
  }
}

int main(){
  cin >> N;
  for( int i = 0; i < N; i++ ) cin >> pre[i];
  for( int i = 0; i < N; i++ ) cin >> in[i];

  solve( 0, N );

  for( int i = 0; i < N; i++ ){
    cout << ans[i];
    if( i == N - 1 ) cout << endl;
    else cout << " ";
  }

}



Measured memory_bytes: 3116
x=list(map(int,input().split()))
if x[1]<x[3]:
    x=x
elif x[1]>x[3]:
    x=[x[2],x[3],x[0],x[1]]
else:
    x=[min(x[0],x[2]),x[1],max(x[0],x[2]),x[3]]
a,b,c,d=x

print(max(0,b-c) if a<c else b-a)

Measured memory_bytes: 3064
//	Author : amnptl 
//	   Godbless
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define NeedForSpeed() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MOD (1000000007); // 1e9+7
int main()
{
	NeedForSpeed();
	ll x; cin>>x; ll ans = 0; ll cur = 100;
	while(cur < x)
	{
		cur += cur/100;
		ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3576
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

void dfs(int v, int p, vector<int> &dp, const vector<vector<int>> &G,
         const vector<int> &A, vector<int> &res) {

    auto it = lower_bound(All(dp), A[v]);
    int save = *it;
    int idx = it - dp.begin();
    *it = A[v];
    res[v] = lower_bound(All(dp), INF) - dp.begin();
    for(auto nv : G[v]) {
        if(nv == p)
            continue;
        dfs(nv, v, dp, G, A, res);
    }
    dp[idx] = save;
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    vector<vector<int>> G(N, vector<int>());
    rep(i, N - 1) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        G[u].pb(v);
        G[v].pb(u);
    }
    vector<int> dp(N, INF);
    vector<int> res(N);
    dfs(0, -1, dp, G, A, res);
    FOR(i, 0, N) { cout << res[i] << endl; }
    return 0;
}

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

struct guide {
    int id;
    string name;
    int point;
};

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

    int N;
    cin >> N;

    int W[N];
    int acc_W[N];
    for (int i = 0; i < N; ++i) {
        cin >> W[i];
        if (i == 0) {
            acc_W[i] = W[i];
        } else {
            acc_W[i] = acc_W[i - 1] + W[i];
        }
    }

    int min_val = acc_W[N - 1];

    for (auto w: acc_W) {
        min_val = min(min_val, abs(acc_W[N - 1] - w - w));
    }

    cout << min_val  << '\n';

    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
 
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	//*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	int M = 0;
	int ans = 0;

	public void input() throws IOException {
		//*
		M = Integer.parseInt(br.readLine());
		/*/
		X = in.nextInt();
		Y = in.nextInt(new int[N]);
		//*/
	}
	
	public void solve() throws IOException {
		ans = 48 - M;
	}
	
	
	public void output() {
		out.println(ans);
		out.flush();
	}
}

//*
class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 100000;
	
	//Fields
	protected InputStream in;
	private byte[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private DataInputStream dis = null;
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);}
	protected void initBuf(int bufsiz) {buf = new byte[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	}
	
	//Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(byte b) {return b=='-'; }
 
	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}
 
	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}
}
//*/

Measured memory_bytes: 23248
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
const ll BIG=1e15;

int main(){
    int A,B;cin>>A>>B;
    int ans=0;
    for(int i=A; i<=B; i++){
        string S=to_string(i);
        if(S.at(0)==S.at(4) && S.at(1)==S.at(3)) ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
 
int main(){
    int a, b;
    char buf[16];
 
    while(scanf("%d %d", &a, &b) != EOF) {
        sprintf(buf, "%d", a+b);
        printf("%d\n", strlen(buf));
    }
    return 0;
}

Measured memory_bytes: 1728
#include <stdio.h>
int main() {
	int i,sum=0;
	char S[100000],start;
	int n = 0;
	gets(S);
	start = S[0];

	for(i = 0; ;i++){
		if (S[i] == '\0') {
			n = i;
			break;
		}
	}
	for(i = 0; i < n;i++){
		if(S[i+1] == start) {
			sum ++;
		}
		if (start == '1') {
			start = '0';
		}else {
			start = '1';
		}
	}
	printf("%d",sum);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>
#include<iostream>
#include<cmath>


int main() {
	int r; std::cin >> r;
	std::cout << r * r << '\n';
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
 
using namespace std;
 
#define ll long long 
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353
#define inf 1e18
 
ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}
 
class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};
 
const ll N=10000005;
 
ll dp[N]={0};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);    
 
    ll test=1;
    // cin>>test;
    while(test--)
    {
        for(ll i=1;i<N;i++)
        {
            for(ll j=i;j<N;j+=i)
            dp[j]++;
        }

        ll ans=0;

        ll n;
        cin>>n;

        for(ll i=1;i<=n;i++)
        ans+=(i*dp[i]);

        cout<<ans;
    }
}

Measured memory_bytes: 81724
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int n;
    string s;
    cin >> n >> s;

    vector<int> east(n), west(n);
    for(int i = 0; i < n-1; i++){
        east[i+1] = east[i];
        if(s[i] == 'W'){
            east[i+1]++;
        }
    }
    for(int i = n-1; i >= 1; i--){
        west[i-1] = west[i];
        if(s[i] == 'E'){
            west[i-1]++;
        }
    }

    int ans = INF;
    rep(i, n){
        int tmp = east[i] + west[i];
        if(tmp < ans){
            ans = tmp;
        }
    }
    cout << ans << endl;
    return 0;
}


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

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 rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
using Graph = vector<vector<int>>;

int main(){
    int a,b,c; cin>>a>>b>>c;
    int x; cin>>x;
    int res = 0;
    rep(i,a+1){
        rep(j,b+1){
            rep(k,c+1){
                if(500*i+100*j+50*k==x)res++;
            }
        }
    }
    cout<<res<<endl;
}


Measured memory_bytes: 3556
N, M = map(int,input().split())
M = [0 for k in range(M)]

for k in range(N):
    L = list(map(int,input().split()))
    for e in range(L[0]):
        M[L[1+e]-1] += 1
ans = 0
for e in M:
    if e == N:
        ans += 1
print(ans)


Measured memory_bytes: 3060
#! /usr/bin/python
# -*- coding:utf-8 -*-

N = int(raw_input())
s = raw_input()

res = -1
maru = 0
batsu = 0

for i in range(N):
    if s[i] == 'o':
        maru += 1
    else:
        batsu += 1
#print maru, batsu

revers = {'S':'W', 'W':'S'}
res = ''
patterns = ['SS', 'SW', 'WS', 'WW']

for pattern in patterns:
    res = ''
    flg = 0
    flg2 = 0
    res += pattern
    for i in range(2, N,1):
        if res[i-1] == 'S':
            if s[i-1] == 'o':
                res += res[i-2]
            else:
                res += revers[res[i-2]]
        else:
            if s[i-1] == 'o':
                res += revers[res[i-2]]
            else:
                res += res[i-2]
    if res[0] == 'S':
        if s[0] == 'o':
            if res[-1] == res[1]:
                flg = 1
        else:
            if res[-1] != res[1]:
                flg = 1
    else:
        if s[0] == 'o':
            if res[-1] != res[1]:
                flg = 1
        else:
            if res[-1] == res[1]:
                flg = 1

    if res[-1] == 'S':
        if s[-1] == 'o':
            if res[-2] == res[0]:
                flg2 = 1
        else:
            if res[-2] != res[0]:
                flg2 = 1
    else:
        if s[-1] == 'o':
            if res[-2] != res[0]:
                flg2 = 1
        else:
            if res[-2] == res[0]:
                flg2 = 1

    if flg == 1 and flg2 == 1:
        break

if flg == 0 or flg2 ==0:
    print -1
else:
    print res

Measured memory_bytes: 6132
import java.util.Scanner;


	public class Main {
		
		

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int h = sc.nextInt();
			int w = sc.nextInt();
			
			
			char[][] ac = new char[h][w];
			String S;
			
			for(int i=0;i<h;i++) {
				S = sc.next();
				for(int j=0;j<w;j++) {
					ac[i][j] = S.charAt(j);
				}
			}
			
			int num = 0;
			
			for(int i=0;i<h;i++) {
				for(int j=0;j<w;j++) {
					if(ac[i][j]=='#') {
						num++;
					}
				}
			}
				
			
			if(num != h+w-1) {
				System.out.println("Impossible");
				return;
			}
			
			int x = 0;
			int y = 0;
			
			for(int j=1;j<num;j++) {
				
				boolean flg = false;
				
				if(y<w-1) {
					if((ac[x][y+1]=='#')) {
						y++;
						continue;
					}
				}
				
				
				if(x<h-1) {
					if((ac[x+1][y]=='#')) {
						x++;
						continue;
					}
				}
				
				System.out.println("Impossible");
				return;
				
			}
			
			System.out.println("Possible");
			
		}
		
	}
	


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

int main(){
  int A, B;
  cin >> A >> B;
  int ans = -1;
  if(1 <= A && A <= 9 )
    if(1 <= B && B <= 9 )
      ans = A*B;
  cout << ans;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#include<random>
#pragma warning(disable:4996)
using namespace std;
using ld= long double;

int main()
{
	int N;
	ld W;
	cin>>N>>W;
	vector<pair<ld,ld>>pluss;
	ld ans=0;
	for (int i = 0; i < N; ++i) {
		ld w,v;cin>>w>>v;
		if (w > 0) {
			if (v > 0) {
				pluss.emplace_back(w, v);
			}
			else if (v <= 0) {

			}
		}
		else {
			if (v >= 0) {
				ans += v;
				W -= w;
			}
			else {
				if (w < 0) {
					ans+=v;
					W-=w;
					pluss.emplace_back(-w,-v);
				}
			}
		}
	}
	sort(pluss.begin(), pluss.end(), [](const pair<ld, ld>&l, const pair<ld, ld>&r) {
		return l.second/l.first>r.second/r.first;
	});

	ld rest(W);
	int now(0);
	while (rest > 0&&now!=pluss.size()) {
		ld use=min(pluss[now].first,rest);
		ans+=use/pluss[now].first*pluss[now].second;
		rest-=use;
		now++;
	}
	cout<<setprecision(10)<<fixed<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3404
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

vector<int> ls;

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

    ls.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> ls[i];
    }
    // sort(ls.begin(), ls.end());

    int ans = 0;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            for (int k = j + 1; k < N; k++) {
                int a = ls[i];
                int b = ls[j];
                int c = ls[k];
                // if (a + b > c) {
                //     ans++;
                // }
                if (a + b > c && a + c > b && b + c > a) {
                    if (a != b && b != c && c != a) {
                        ans++;
                    }
                }
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3592
#include <iostream>
using std::cout;
using std::endl;
using std::cin;

int main()
{
    int a, b;
    
    while (cin >> a >> b) {
        if (a == 0 && b == 0) {
            break;
        }
        if (a > b) {
            int temp = a;
            a = b;
            b = temp;
        }
        cout << a << " " << b << endl;
    }
    return 0;
}



Measured memory_bytes: 3068
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

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);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }

    static class Task {
        char[][] campus;
        void solve(InputReader in, PrintWriter out) {
            // write your code here
            int H = in.nextInt(), W = in.nextInt();
            campus = new char[H + 2][W + 2];
            for (int i = 0; i < H; i++) {
                if (i == 0 || i == H + 1) {
                    Arrays.fill(campus[i], '.');
                } else {
                    campus[i] = ("." + in.next() + ".").toCharArray();
                }
            }

            boolean possible = true;
            for (int i = 1; i <= H; i++) {
                for (int j = 1; j <= W; j++) {
                    if (campus[i][j] == '#') {
                        possible &= !isolated(i, j);
                    }
                }
            }

            out.println(possible ? "Yes" : "No");
        }

        boolean isolated(int i, int j) {
            return campus[i - 1][j] == '.' &&
                    campus[i][j - 1] == '.' &&
                    campus[i + 1][j] == '.' &&
                    campus[i][j + 1] == '.';
        }
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

Measured memory_bytes: 23508
n = int(input())
prog = list(map(int, input().split()))
prog.sort()
prog_dict = {}
ans = 0

for i in range(n):
    if prog[i] not in prog_dict:
        prog_dict[prog[i]] = 1
    else:
        prog_dict[prog[i]] += 1

keys = list(prog_dict.keys())
for i in range(len(prog_dict)):
    if keys[i] > prog_dict[keys[i]]:
        ans += prog_dict[keys[i]]
    else:
        ans += prog_dict[keys[i]] - keys[i]

print(ans)


Measured memory_bytes: 18160
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n; cin>>n;
    string s1,s2; cin>>s1>>s2;
    int i=1;
    long sum=3;
    if(s1[0]!=s2[0]){
        sum*=2;
        i++;
    }
    while(i<n){
        bool jud=(s1[i-1]==s2[i-1]);
        if(s1[i]!=s2[i]){
            sum*=2;
            if(!jud){
                sum*=3;
                sum/=2;
            }
            i+=2;
        }
        else{
            if(jud)
                sum*=2;
            i++;
        }
        sum%=(int)(1e9+7);
    }
    cout<<sum;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printv(x) for(int i = 0; i < x.size(); i++){ cout << (x[i]) << " "; } cout << endl; 
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printaa(x) for(int i = 0; i < (sizeof(x)/sizeof(x[0])); i++){ for(int j = 0; j < (sizeof(x[0])/sizeof(x[0][0])); j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    double n,m,d;
    cin >> n >> m >> d;
    double ans;
    if(d == 0){
        ans = (m - 1);
        ans /= n;
    }else{
        ans = 2 * (n - d) * (m - 1);
        ans /= (n*n);
    }
     cout << setprecision(10) << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); 
    long long a,b;
    cin>>a>>b;
    if(a>b)
     cout<<a-b;
    else 
     cout<<"0";
    return 0;
}

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

using namespace std;

int main()
{
  int H, W;
  char board[128][128];
  int dp[128][128];
  
  scanf("%d %d", &H, &W);
  
  for (int i = 0; i < H; i++) {
    scanf("%s", board[i]);
    for (int j = 0; j < W; j++) {
      dp[i][j] = 100000;
    }
  }
  
  dp[0][0] = (board[0][0] == '#');
  
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (i) dp[i][j] = min(dp[i][j], dp[i - 1][j] + (board[i][j] != board[i - 1][j] && board[i][j] == '#'));
      if (j) dp[i][j] = min(dp[i][j], dp[i][j - 1] + (board[i][j] != board[i][j - 1] && board[i][j] == '#'));
    }
  }
  
  printf("%d\n", dp[H - 1][W - 1]);
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int a, b, k, dev;
  cin >> a >> b >> k;
  int count = 0;
  
  if (a > b){
    dev = b;
  } else {
    dev = a;
  }
  
  while (count < k){
    if (a % dev == 0 && b % dev == 0){
      count++;
    }
    dev--;
  }
  
  cout << dev + 1 << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  int flag,i,j,size,n,tmp,c=0,k;
  int minj;
  int *A;
  scanf("%d",&size);
  A = (int *)malloc(size * sizeof(int));

  for(i=0;i<=size-1;i++){
    scanf("%d",&A[i]);
  }
  
  for(i=0;i<=size-1;i++){
   flag = 0;
    minj = i;
    for(j=i; j<=size-1; j++){
       
      if(A[j] < A[minj]){
	minj = j;
	if(flag == 0){
	  c++;
	  flag = 1;
	}
      }
    }
    if(flag = 1){
      tmp = A[i];
      A[i] = A[minj];
      A[minj] = tmp;
    }
      /*  
    for(k=0;k<size-1;k++){
    printf("%d ",A[k]);
    }
    printf("%d\n",A[k]);
      */
  }

  for(i=0;i<size-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d\n",A[i]);
  printf("%d\n",c);
  return 0;
}



Measured memory_bytes: 2124
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll n,k,x,y;

int main(){
  ll ans=0;
  cin >> k >> n;
  vi a(n);
  REP(i,n){
    cin>>a[i];
    ans+=a[i];
  }
  if (k<=ans){
    cout<<"Yes"<<endl;
    return 0;
  }else{
    cout<<"No"<<endl;
    return 0;
  }

  return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(){
  int n,m,a,b,i;
  scanf("%d %d",&m,&n);
  for(i=0;i<n;i++){
    scanf("%d %d",&a,&b);
    if(a>m/2){
    	a=m-a+1;
    }
    if(b>m/2){
    	b=m-b+1;
    }
    if(a>b){
    	a=b;
    }
    a%=3;
    if(a%3==0){
    	a=3;
    }
    printf("%d\n",a);
  }
  return 0;
}

Measured memory_bytes: 2688
#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define br break
#define rt return 0
#define fr first
#define sec second
using namespace std;
int main(){
//ll tc; cin>>tc; while(tc--){
ll n,m,mn=INT_MAX,l,r,i,x,j,a,t,k,b=-1,mx=-1,cnt=0,c=0; 
 st s,str; char strn;
//cin>>n; a=n; n-=1; 
//ll ara[n+1],bra[n+1],taj[n+1];

//for(i=1;i<=n;i++) cin>>ara[i]; 
  for(i=1;i<=5;i++)
   {
     cin>>x;
    if(x==0)a=i;
   }      
              

        
     cout<<a<<endl;
    
 
    rt;
}

Measured memory_bytes: 3592
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    if(a == 1){
      a=14;
    }
    if(b == 1){
      b=14;
    }
    if(a>b){
      System.out.println("Alice");
    }else if(a == b){
      System.out.println("Draw");
    }else{
      System.out.println("Bob");
    }
  }
}

Measured memory_bytes: 21844
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<iomanip>
#include <math.h>
using namespace std;
int main(){
    long long int d,t,s;
    cin>>d>>t>>s;
    if(d/s<t||((d/s==t)&&(d%s==0))){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3612
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 0x6fffffff
#define INFL 0x6fffffffffffffffLL

int main() {
	ll		a,b,c,i,j,k,n,m,x,y,ans = 0;
	string	s;

	cin >> n;
	unordered_map<string, int> ss;
	for(i=0;i<n;i++) {
		cin >> s;
		sort(s.begin(),s.end());
		ss[s]++;
	}

	for(auto p : ss) {
		ll cnt = p.second;
		ans += cnt*(cnt-1)/2;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 10660
n = int(input())
a = list(map(int, input().split()))

cnt = [0] * ((10 ** 6) + 1)

for elem in a:
    cnt[elem] += 1

unique = []

for i in range((10 ** 6) + 1):
    if cnt[i] == 1:
        unique.append(i)

cnt = [0] * ((10 ** 6) + 1)

a = list(set(a))

for elem in a:
    for m in range(elem * 2, (10 ** 6) + 1, elem):
        cnt[m] = 1

ans = 0
        
for elem in unique:
    if cnt[elem] == 0:
        ans += 1

print(ans)

Measured memory_bytes: 48160
#include<stdio.h>

int main(void){
	int i,j,exc;
	int Yama[10];

	for(i=0;i<=9;i++){
		scanf("%d",&Yama[i]);
	}

	for(i=0;i<=8;i++){
		for(j=i+1;j<=9;j++){
			if(Yama[i]<Yama[j]){
				exc=Yama[i];
				Yama[i]=Yama[j];
				Yama[j]=exc;
			}
		}
	}
	for(i=0;i<=2;i++){
		printf("%d\n",Yama[i]);
	}
	return 0;	
}

Measured memory_bytes: 600
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;

struct node{
    int index;
    int time;
    int cost;
};

struct CustomCompare{
    bool operator()(const node& l, const node& r){
        if(l.cost == r.cost){
            return l.time < r.time;
        } else {
            return l.cost < r.cost;
        }
    }
};

bool contains(vector<int> v, int target){
    return std::find(v.begin(), v.end(), target) != v.end();
}

int main(){
    int n, m;
    cin >> n >> m;
    int a, b;
    priority_queue<node, vector<node>, CustomCompare> queue[m+1];
    for(int i = 1; i <= n; i++){
        cin >> a >> b;
        node g = {i, a, b};
        if(a <= m){
            queue[a].push(g);
        }
    }
    long long ans = 0;
    priority_queue<node, vector<node>, CustomCompare> worklist;
    for(int i = 1; i <= m; i++){
        while(!queue[i].empty()){
            worklist.push(queue[i].top());
            queue[i].pop();
        }
        if(!worklist.empty()){
            node work = worklist.top();
            ans += work.cost;
            worklist.pop();
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6972
#include<stdio.h>
 int main(void) {
	int N, M, X, Y, x[100], y[100];
	int xMax = -100, yMin = 100, i;
	scanf("%d %d %d %d", &N, &M, &X, &Y);
	
	for(i = 0; i < N; i++) {
		scanf("%d", &x[i]);
		if(x[i] > xMax) xMax = x[i];
	}
	
	for(i = 0; i < M; i++) {
		scanf("%d", &y[i]);
		if(y[i] < yMin) yMin = y[i];
	}
	
	if(xMax+1 > X) {
		if(yMin <= Y) {
			if(xMax < yMin) {
				printf("No War");
			}
			else printf("War");
		}
		else printf("War");
	}
	else printf("War");
	
	return 0;
}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(" ");
        var A = int.Parse(input[0]);
        var B = int.Parse(input[1]);
        var C = int.Parse(input[2]);
        var K = int.Parse(input[3]);

        var sum = 0;
        var remCards = K - A;
        if(remCards <= 0)
        {
            sum += 1 * K;
        }
        else
        {
            sum += 1 * A;
            remCards -= B;

            if (remCards > 0)
            {
                sum += -1 * remCards;
            }
        }

        Console.WriteLine(sum);
    }
}


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

using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

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

void Main(){
    int a,b;
    cin >> a >> b;
    if((a+b) % 2 != 0) cout << "IMPOSSIBLE";
    else cout << (a + b) / 2;
}
signed main() {
    std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll>pairs;
int main() {
	// your code goes here
	std::ios::sync_with_stdio(false);
	ll t,n,i,j,k,l,c;
	cin>>i>>j;
	cout<<(i*j);
	return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

int main()
{
	int H, A;
	cin >> H >> A;

	if (H % A == 0) {
		cout << H / A << endl;
	}
	else {
		cout << H / A + 1 << endl;
	}

}






Measured memory_bytes: 3640