akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <map>
using namespace std;
struct point
{
    int s;
    int e;
    bool operator<(point const&A)const
    {
        if(s<A.s)
        {
            return true;
        }
        else if(s==A.s&&e<A.e)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
};
int n,m;
int main(void)
{
    point temp;
    point tem;
    map<point,int>M;
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        cin>>temp.s>>temp.e;
        tem.s=temp.e;
        tem.e=temp.s;
        M[temp]=1;
        M[tem]=1;
    }
    point temp1,temp2;
    temp1.s=1;
    temp2.e=n;
    for(int j=1;j<=n;j++)
    {
        temp1.e=j;
        temp2.s=j;
        if(M.count(temp1)==1&&M.count(temp2)==1)
        {
            cout <<"POSSIBLE"<<endl;
            return 0;
        }
    }
    cout <<"IMPOSSIBLE"<<endl;
    return 0;
}


Measured memory_bytes: 25216
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	while(c>0||a>0)
	{
		c=c-b;
		if(c<=0)
		{
			cout<<"Yes"<<endl;
			return 0;
		}
		a=a-d;
		if(a<=0)
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 3592
#include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <map>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <stack>
#include <queue>
#include <cstring>
#include <iterator>

#define FOR(n) for(int cnt=0;cnt<(n);++cnt)
#define FOR_R(it,cont) for(auto it=rbegin(cont);it!=rend(cont);++it)
#define FOR_F(it,cont) for(auto it=begin(cont);it!=end(cont);++it)
#define ALL(cont) begin(cont), end(cont)
#define LB(b,e,v) lower_bound(b,e,v)
#define UB(b,e,v) upper_bound(b,e,v)

using namespace std;
typedef pair<int,int> P;
int N;
int X[100010];
int L;
int Q;
P querys[100010];
int parent[20][100010];

long long powlong(long long x, int i) {
  long long ret = 1;
  long long temp = x;
  while(i!=0) {
    if (i&1) ret *= temp;
    temp *=temp;
    i = i>>1;
  }
  return ret;
}

int bsearch(int a, int b, int k) {
  if (k==-1) {
    return 1;
  }
  if (parent[k][a]==-1 || parent[k][a] >= b) {
    return bsearch(a,b,k-1);
  } else {
    return powlong(2,k) + bsearch(parent[k][a],b,k-1);
  }
}
int main() {
  scanf("%d", &N);
  FOR(N) {
    int x;
    scanf("%d", &x);
    X[cnt]=x;
  }
  scanf("%d%d", &L, &Q);
  FOR(Q) {
    int a,b;
    scanf("%d%d", &a, &b);--a;--b;
    if (a>b) swap(a,b);
    querys[cnt]=P(a,b);
  }
  for(int i=0;i<N;++i) {
    int j=lower_bound(X,X+N,X[i]+L+1)-X-1;
    parent[0][i]=j;
  }
  parent[0][N-1]=-1;
  for(int j=1;j<20;++j) {
    for(int i=0;i<N;++i) {
      if (parent[j-1][i]==-1) {
        parent[j][i]=-1;
      } else {
        parent[j][i] = parent[j - 1][parent[j - 1][i]];
      }
    }
  }
  FOR(Q) {
    P p = querys[cnt];
    printf("%d\n",bsearch(p.first, p.second,19));
  }
  return 0;
}


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

#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

poi=[]
pon=[]
s=input().rstrip("\n")
for i in range(len(s)-1):
    if s[i:i+2] == "RL":
        poi.append(i)
    if s[i:i+2] == "LR":
        pon.append(i)

r=[]
l=[]
k=0
ans=[0]*len(s)
if pon!=[]:
    for i in range(pon[-1]+1):
        if (poi[k]-i)%2==0:#L
            ans[poi[k]]+=1
        else:
            ans[poi[k]+1]+=1
        #print(ans)
        if i==pon[k]:
            k+=1
    for i in range(pon[-1]+1,len(s)):
        if (poi[k]-i) % 2 == 0:  # L
            ans[poi[k]] += 1
        else:
            ans[poi[k]+1] += 1
else:
    for i in range(len(s)):
        if (poi[k]-i) % 2 == 0:  # L
            ans[poi[k]] += 1
        else:
            ans[poi[k]+1] += 1      
print(*ans)


Measured memory_bytes: 10240
#include<iostream>
#include<vector>
using namespace std;
vector<int> w,v;
vector<vector<long long>> t;
long long f(int n,int wc){
  long long r;
  if(t[n][wc]!=-1){
    return t[n][wc];
  }else if(n==0){
    r=0;
  }else{
                   r=f(n-1,wc);
    if(wc-w[n]>=0) r=max(r,f(n-1,wc-w[n])+v[n]);
  }
  return t[n][wc]=r;
}
int main(){
  int n,W; cin>>n>>W;
  w.resize(n+1);
  v.resize(n+1);
  t.resize(n+1,vector<long long>(W+1,-1));
  for(int i=1;i<=n;i++) cin>>w[i]>>v[i];
  cout<<f(n,W)<<endl;
  return 0;
}


Measured memory_bytes: 80256
#include <iostream>
#include <vector>
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;

int N, k, tt=0, starttime[100], stoptime[100], color[100]={0};
vector<int> E[100];

void dfsfunc(int node){
    //cout << node << " OKdfsfunc" << endl;
    tt++;
    starttime[node] = tt;
    color[node] = GRAY;
    for(int i=0;i<E[node].size();i++){
        if(color[E[node][i]]==WHITE){
            dfsfunc(E[node][i]);
        }
    }
    tt++;
    stoptime[node] = tt;
    color[node] = BLACK;
}

void dfs(){
    for(int node=0;node<N;node++){
        if(color[node]==WHITE) dfsfunc(node);
    }
    //cout << "OK" << endl;
}

int main(){
    cin >> N;
    for(int i=0;i<N;i++) {
        cin >> k;
        cin >> k;
        //cout << "OK" << endl;
        for(int j=0;j<k;j++) {
            int node;
            cin >> node;
            node--;
            E[i].push_back(node);
        }
    }
    //cout << "OK" << endl;
    dfs();
    for(int i=0;i<N;i++) cout << i+1 << " " << starttime[i] << " " << stoptime[i] << endl; 
}


Measured memory_bytes: 3152
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <math.h> 
#include <iomanip>
#include <string.h>
#include <vector>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
const int N = 2e5 + 5;

 
int vis[N];


int32_t  main() {

	IOS;

	
	int a;
	double b;

	cin >> a >> b;

	int c = b * 100+0.5;

	int ans = a*c /100; 
	cout << fixed << ans << endl;


}

Measured memory_bytes: 3184
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			String str = sc.nextLine();
			if (str.equals("-"))
				break;
			int m = Integer.parseInt(sc.nextLine());
			int h_sum = 0;
			for (int i = 0; i < m; ++i) {
				h_sum += Integer.parseInt(sc.nextLine());
			}
			h_sum %= str.length();
			for (int i = h_sum; i < str.length(); ++i) {
				System.out.print(str.charAt(i));
			}
			for (int i = 0; i < h_sum; ++i) {
				System.out.print(str.charAt(i));
			}
			System.out.println();
		}
	}
}


Measured memory_bytes: 26532
#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t N;cin>>N;
  vector<int64_t>A(N);
  int64_t sum=0;
  for(int i=0;i<N;i++){
    cin>>A.at(i);sum+=A.at(i);
  }int64_t n=(N*(N+1))/2;
  if(sum%n!=0)
    cout<<"NO"<<endl;
  else{
  int64_t a=sum/n;bool x=true;int64_t Sum=0;
    for(int i=0;i<N;i++){
    int64_t b=A.at((i+1)%N)-A.at(i);
      b-=a;
      if(b%N!=0 || 0<b){x=false;break;}
      else{Sum+=(b/N);}
    }
  if(!x)cout<<"NO"<<endl;
    else{
    if(Sum==-a)
      cout<<"YES"<<endl;
      else
        cout<<"NO"<<endl;
     }
   }
  return 0;
}

Measured memory_bytes: 4052
def gets_num
  gets.split("\s").map(&:to_i)
end

n, m = gets_num
h = gets_num
good = h.dup

m.times do
  a, b = gets_num
  good[a-1] = nil if h[a-1] <= h[b-1]
  good[b-1] = nil if h[b-1] <= h[a-1]
end


good.delete(nil)
p good.size

Measured memory_bytes: 24156
MOD = 998244353
N = gets.to_i
robots = Array.new N 
N.times do |i|
  robots[i] = gets.split.map(&:to_i)
end
robots.sort_by!{|x| x[0] }
notouched = Array.new N

class MaxSegmentTree
  def initialize n, init
    @n = n 
    @init = init
    @offset = 2 ** (Math.log2(n).to_i + 1)
    @tree = Array.new(2*@offset, @init )
  end

  def update pos, val
    pos += @offset
    @tree[pos] = val
    while pos > 1
      pos = pos / 2
      @tree[pos] = max(@tree[2*pos], @tree[2*pos+1])
      break if @tree[pos] > val
    end
  end

  def query l,r 
    l += @offset
    r += @offset
    ret = @init
    while l<=r && ret != N
      ret = max(ret, max(@tree[r], @tree[l]))
      r = (r-1) / 2
      l = (l+1) / 2
    end
    return ret
  end
end

def max a, b 
  a > b ? a : b
end

segtree = MaxSegmentTree.new(N, 0)
dp = Array.new(N + 1)
dp[N] = 1
N.times do |i|
  x = N - 1 - i
  d = robots[x][0] + robots[x][1]
  l = x
  r = N
  unless robots[N-1][0] < d
    while l + 1 < r do
      c = ( l + r ) / 2
      if robots[c][0] >= d
        r = c
      else
        l = c
      end
    end
  end
  ro = r
  if ro  != N
    xro = segtree.query(x+1,ro-1)
    ro = xro if xro > ro
    notouched[x] = ro
    dp[x] = ( dp[x+1] + dp[notouched[x]] ) % MOD
  else
    dp[x] = ( dp[x+1] + 1 )
  end
  segtree.update(x, ro)
end

puts dp[0] % MOD

Measured memory_bytes: 25488
N,P=map(int,input().split())
maxfac = int(P**(1/N))
# print(range(1,maxfac+1))
if N==1:
    print(P)
    exit()
elif N > 10**6:
    print(1)
    exit()
for i in range(1,maxfac+2)[::-1]:
    p = i**N
    # print(P%p)
    if P%p == 0:
        print(i)
        break


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

int main() {

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

    if(a+b>=10){
        puts("error");
    }else{
        printf("%d",a+b);
    }


    return 0;

}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> a(N);
	for (int i = 0; i < N; i++) {
		cin >> a.at(i);
	}

	long int min = 4000001;
	for (int i = -100; i < 101; i++) {
		long int sum = 0;
		for (int j = 0; j < N; j++) {
			sum += (i - a.at(j)) * (i - a.at(j));
		}
		if (sum < min) min = sum;
	}

	cout << min << endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int arr[MAXN];
int main(){
   // freopen("file.in", "r", stdin);
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",arr+i);
	sort(arr+1,arr+n+1);
	double ans=(arr[1]+arr[2])/2.0;
	for(int i=3;i<=n;i++)
		ans=(ans+arr[i])/2.0;
	cout<<setprecision(12)<<ans<<endl;			
	return 0;
}


Measured memory_bytes: 256
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

n = ii()
ed = {(i, j) for i in range(1, n) for j in range(i + 1, n + 1)}
i, j = 1, n - n % 2
while i < j:
    ed.remove((i, j))
    i += 1
    j -= 1
print(len(ed))
print(*('%d %d' % e for e in ed), sep='\n')

Measured memory_bytes: 4120
n = int(input())
s = [[0] * 13 for i in range(4)]
for i in range(n):
	t = input().split()
	if t[0] == "S":
		u = 0
	elif t[0] == "H":
		u = 1
	elif t[0] == "C":
		u = 2
	elif t[0] == "D":
		u = 3
	s[u][int(t[1]) - 1] = 1
for i in range(4):
	for j in range(13):
		if s[i][j] != 1:
			if i == 0:
				st = 'S'
			elif i == 1:
				st = 'H'
			elif i == 2:
				st = 'C'
			elif i == 3:
				st = 'D'
			print(st, end=" ")
			print(j + 1)



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


#define li			long long int
#define rep(i,to)	for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)	for(li i=(li)(start);i<((li)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)		idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)	for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)		idp p2((x).F, (x).S)
#define dump(x,n)	idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)	idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)	idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)	idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)	rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)	rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n;
li a[100100];
PI b[100100];

int main() {
	cin >> n;
	rin{cin >> a[i]; b[i] = {a[i], i};}
	sort(b, b + n);
	li res = 0;
	rin{
		if (i % 2 != b[i].S % 2)res++;
	}
	cout << res / 2 << endl;



	return 0;
}

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

int main() {
  int w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;
  if (x - r < 0 || y - r < 0 ||
      x + r > w || y + r > h) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
const int N = 1e5 + 54;
int n, m;
namespace Tree {
	struct node { int u, v; } edge[N << 1];
	int head[N], v[N], col[N], cnt;
	long long sum, ans;
	inline void add(int x, int y) { edge[cnt].u = head[x], edge[cnt].v = y, head[x] = cnt++; }
	void dfs(int x, int fa) {
		int i;
		for (i = head[x]; ~i; i = edge[i].u) {
			int y = edge[i].v;
			if (y == fa) continue;
			col[y] = 1 - col[x], dfs(y, x);
		}
	}
	void solve(int x, int fa) {
		int i;
		for (i = head[x]; ~i; i = edge[i].u) {
			int y = edge[i].v;
			if (y == fa) continue;
			solve(y, x);
			v[x] += v[y];
		}
	}
	void SOLVE() {
		int x, y, i;
		memset(head, -1, sizeof head);
		for (i = 1; i <= m; ++i) scanf("%d%d", &x, &y), add(x, y), add(y, x);
		col[1] = 1, dfs(1, 0);
		for (i = 1; i <= n; ++i) {
			if (col[i]) v[i] = 1;
			else v[i] = -1;
			sum += v[i];
		}
		if (sum) {
			puts("-1");
			return;
		}
		solve(1, 0);
		for (i = 1; i <= n; ++i) ans += abs(v[i]);
		printf("%lld\n", ans);
	}
}

namespace BRT {
	struct Edge { int id, x, y; } E;
	struct node { int u, v; } edge[N << 1];
	int head[N], v[N], col[N], cnt, tot, p[N], vis[N], f[N];
	long long sum, ans;
	inline void add(int x, int y) { edge[cnt].u = head[x], edge[cnt].v = y, head[x] = cnt++; }
	void dfs(int x, int fa) {
		int i;
		vis[x] = 1;
		for (i = head[x]; ~i; i = edge[i].u) {
			int y = edge[i].v;
			if (y == fa) continue;
			if (vis[y]) E.id = i, E.x = x, E.y = y;
			else col[y] = 1 - col[x], dfs(y, x);
		}
	}
	void solve(int x, int fa) {
		int i;
		for (i = head[x]; ~i; i = edge[i].u) {
			int y = edge[i].v;
			if (y == fa || i == E.id || (i ^ 1) == E.id) continue;
			solve(y, x), v[x] += v[y], f[x] += f[y];
		}
	}
	void SOLVE() {
		memset(head, -1, sizeof head);
		int x, y, i;
		for (i = 1; i <= m; ++i) scanf("%d%d", &x, &y), add(x, y), add(y, x);
		col[1] = 1, dfs(1, 0);
		for (i = 1; i <= n; ++i) {
			if (col[i]) v[i] = 1;
			else v[i] = -1;
			sum += v[i];
		}
		if (col[E.x] == col[E.y]) {
			if (abs(sum) & 1) {
				puts("-1");
				return;
			}
			v[E.x] -= sum / 2, v[E.y] -= sum / 2, ans += abs(sum / 2);
		} else {
			if (sum) {
				puts("-1");
				return;
			}
			f[E.x] = 1, f[E.y] = -1;
		}
		solve(1, 0);
		if (col[E.x] == col[E.y]) {
			for (i = 1; i <= n; ++i) ans += abs(v[i]);
			printf("%lld\n", ans);
			return;
		}
		for (i = 1; i <= n; ++i)
			if (f[i] == 0) ans += abs(v[i]);
			else p[++tot] = f[i] * v[i];
		p[++tot] = 0;
		std::sort(p + 1, p + tot + 1);
		int mid = p[(tot + 1) >> 1];
		for (i = 1; i <= tot; ++i) ans += abs(p[i] - mid);
		printf("%lld\n", ans);
	}
}
int main() {
	scanf("%d%d", &n, &m);
	if (m == n - 1) Tree::SOLVE();
	else BRT::SOLVE();
}

Measured memory_bytes: 9344
main = getLine >>= print.f.map read.words
f [n,x] = g sz pt x where
  sz = iterate ((+3).(*2)) 1 !! n
  pt = iterate ((+1).(*2)) 1 !! n
g _ _ 0 = 0
g 1 _ _ = 1
g sz pt k
  | k <= psz+1 = g psz ppt (k-1)
  | k <= sz-2  = ppt + 1 + g psz ppt (k-psz-2)
  | otherwise  = pt
  where
    psz = div (sz-3) 2
    ppt = div (pt-1) 2 

Measured memory_bytes: 508
#include <bits/stdc++.h>
#define MAX 100005
#define MOD 1e9
#define pb push_back
#define pairs pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<pairs>
#define lb lower_bound
#define ub upper_bound
#define ll long long
#define endl '\n'
using namespace std;
/* ----------------------------------------------------------------------------------- */

#define fastInput ios_base::sync_with_stdio(false), cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define scan(a) scanf("%d", &a)
#define scanll(a) scanf("%lld", &a)
#define scanD(a) scanf("%lf", &a)
#define print(a) printf("%d\n", a)
#define printll(a) printf("%lld\n", a)
#define printD(a) printf("%lf\n", a)
#define printTwo(a) printf("%.2lf\n", a);
#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
#define rep(i, a, n) for (int i = a; i < n; i++)
#define REP(i, a, n) for (int i = a; i <= n; i++)
#define inputArray(a,n) rep(i, 0, n) cin >> a[i];
#define copyArray(a,temp,n) rep(i, 0, n) temp[i]=a[i];
#define printArray(a,n) rep(i, 0, n) cout << a[i] << " "; cout << endl;

/* ----------------------------------------------------------------------------------- */

#define Cases  cout << "Case " << ++Case << ": ";
#define __test int tt; int Case=0; cin >> tt; while(tt--)
#define showTime cerr << "time = " << (clock() / CLOCKS_PER_SEC) << " sec" << '\n';

#define dbgA2(A, n, m) {cout<<"--> "<<#A<<" = \n";rep(i, 0, n){rep(j, 0, n){cout<<A[i][j]<<" ";}cout<<"\n";}cout<<"\n";}
#define dbgA(A, n) {cout<<" --> "<<#A<<" = (";rep(i, 0, n)cout<<A[i]<<" ";cout<<")\n";}
#define dbg(args...) {string sss(#args);sss+=',';cout<<" --> ";debugger::call(all(sss), args);cout<<"\n";}

/* ----------------------------------------------------------------------------------- */

ll gcd(ll n, ll m) { return m ? gcd(m, n % m) : n; }
ll lcm(ll n, ll m) { return n / gcd(n, m) * m; }

struct debugger {
	typedef string::iterator si;
	static void call(si it, si ed) {}
	template<typename T, typename ... aT>
	static void call(si it, si ed, T a, aT... rest) {
		string b;
		for(; *it!=','; ++it)
			if(*it!=' ')
				b+=*it;
		cout << b << "=" << a << " ";
		call(++it, ed, rest...);
	}
};

/* ----------------------------------------------------------------------------------- */


void solve() {
	int l, sum = 0;
	scan(l);
	double vol = (l * l * l) / 27.0;
	printf("%.10lf\n", vol);
}

int main() {
#ifdef Niloy
	read("input.txt");
	write("output.txt");
#endif

	solve();

	// __test {
	// 	solve();
	// }

	showTime;
	return 0;
}




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

public class Main {

    public static void main(String[] args) throws Exception {
        String line = Io.read();

        int[] ab = parse(line);

        if (can_get(ab[0], ab[1])) {
            Io.write("Yay!");
        } else {
            Io.write(":(");
        }
    }

    private static int[] parse(String line) {
        String[] strs = line.split(" ");

        int[] parsed = new int[strs.length];
        for (int i = 0; i < strs.length; i++) {
            parsed[i] = Integer.parseInt((strs[i]));
        }

        return parsed;
    }

    private static boolean can_get(int a, int b) {
        if (a <= 8 && b <= 8) return true;

        return false;
    }
}

class Io {

    /**
     * 標準入力から1行ずつ受け取る
     * @return
     * @throws IOException
     */
    public static String read() throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        br.close();
        return line;
    }

    /**
     * 標準出力
     * @param answer
     */
    public static void write(String answer)
    {
        System.out.println(answer);
    }
}

Measured memory_bytes: 22612
#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,m,s;
    cin>>s;
    h=s/3600;
    s%=3600;
    m=s/60;
    s%=60;
    string ans=to_string(h)+':'+to_string(m)+':'+to_string(s);
    cout<<ans<<endl;
}


Measured memory_bytes: 3232
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(),m=scan.nextInt(),a,b,t[]=new int[50],i;
		for(i=0;i<m;i++) {
			a=scan.nextInt();
			b=scan.nextInt();
			t[a-1]++;
			t[b-1]++;
		}
		scan.close();
		for(i=0;i<n;i++) System.out.println(t[i]);
	}
}

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


#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}

void solve(){


}
int a[509][509];
ll s1[509][509],s2[509][509];
ll tot1[509][509],tot2[509][509];
ll b[509][509];
int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();
	int n;cin>>n;
	rep(i,n){
		rep(j,i) cin>>a[i][j],s2[i][j]=a[i][j];
		repA(j,i+1,n-1) cin>>a[i][j],s1[j][i]=a[i][j];
	}
	rep(i,n) repD(j,i-1,0) s1[i][j]+=s1[i][j+1],s2[i][j]+=s2[i][j+1];
	rep(i,n) repD(j,i-1,0){
		tot1[i][j]=s1[i][j]+tot1[i-1][j];
		tot2[i][j]=s2[i][j];
	}
	repD(i,n-2,0) repD(j,i-1,0) tot2[i][j]+=tot2[i+1][j];
	ll ans = 1e18;
	rep(i,n-1){
		ans=min(ans,tot1[i][0]+tot1[n-1][i+1]);
		b[0][i+1]=tot1[i][0];
	}
	trace(ans);
	repA(i,1,n-2){
		repA(j,0,i-1){
			b[j+1][i+1]=1e18;
			repA(k,-1,j-1){
				ll cur=b[k+1][j+1]+tot1[i][j+1];
				cur+=tot2[i+1][k+1]-tot2[i+1][j+1];
				b[j+1][i+1]=min(b[j+1][i+1],cur);
				ans=min(ans,cur+tot1[n-1][i+1]);
			}
		}
	}
	cout<<ans;
	return 0;
}



Measured memory_bytes: 11392
#include<bits/stdc++.h>
using namespace std; 
#define mod 1000000007
#define N 100005
#define int long long
#define ull unsigned long long
#define loop1(i, j, k, step) for (int i=j; i<k; i+=step)
#define loop(i, j, k) for (int i=j; i<k; i++) 
#define rloop1(i, j, k, step) for (int i=j; i>=k; i-=step)
#define rloop(i, j, k) for(int i=j; i>=k; i--)
#define rep(i, k) for(int i = (0); i < (k); i++ )
#define rrep(i, k) for(int i = k-1; i >= 0; i-- )

#define forall(it, l) for(auto it=l.begin(); it != l.end(); it++)
#define mp make_pair
#define pb push_back
#define pop pop_back
#define F first
#define S second
#define sz(x) (int)(x).size()
#define endl "\n"
#define Max (int)INT_MAX
#define Min (int)INT_MIN
#define MEM(a, b) memset(a, (b), sizeof(a))
#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL)
typedef vector<int> vi;
typedef pair<int,int> pi;


void solve()
{
	int n,i,j,k=0,l,a,b,w,d;
	cin>>n>>w;
	vi val(n),wt(n);
	rep(i,n){
		cin>>a>>b;
		val[i]=b;
		wt[i]=a;
	}
	vector<vector<int>> dp(n+1,vector<int>(w+1,0));
	rep(i,n+1){
		rep(j,w+1){
			if(i==0 || j==0)
				dp[i][j]=0;
			else if(wt[i-1]<=j)
				dp[i][j]=max(val[i-1]+dp[i-1][j-wt[i-1]],dp[i-1][j]);
			else
				dp[i][j]=dp[i-1][j];
		}
	}
	cout<<dp[n][w]<<endl;
}
signed main() 
{
	fast_io;
    int t=1;
    //cin>>t;
    while(t--)
    	solve();
	return 0; 
}

Measured memory_bytes: 83108
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

using i64 = int64_t;

const int INF = 1LL << 29;

struct edge {
    int to, cap, rev;
    edge(int a, int b, int c): to(a), cap(b), rev(c) {}
};

int V, E;
vector< vector<edge> > graph;
vector<char> visited;

int dfs(int u, int v, int f = INF) {
    if (u == v) return f;
    visited[u] = true;
    for (edge& e : graph[u]) {
        if (!visited[e.to] && e.cap > 0) {
            int ff = dfs(e.to, v, min(f, e.cap));
            if (ff > 0) {
                e.cap -= ff;
                graph[e.to][e.rev].cap += ff;
                return ff;
            }
        }
    }
    return 0;
}

int ford_fulkerson(int u, int v) {
    int ans = 0;
    for (;;) {
        fill(begin(visited), end(visited), 0);
        int f = dfs(u, v);
        if (f == 0) return ans;
        ans += f;
    }
    return -1;
}

int main() {
    cin >> V >> E;
    graph.resize(V);
    visited.resize(V);
    for (int j = 0; j < E; ++j) {
        int u, v, c;
        cin >> u >> v >> c;

        graph[u].emplace_back(v, c, graph[v].size());
        graph[v].emplace_back(u, 0, graph[u].size()-1);
    }

    cout << ford_fulkerson(0, V-1) << endl;

    return 0;
}

Measured memory_bytes: 3144
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void){
    int n, m, X, Y;
    int x[100], y[100];
    
    cin >> n >> m >> X >> Y;

    for(int i = 0; i < n; i++){
        cin >> x[i];
    }

    for(int i = 0; i < m; i++){
        cin >> y[i];
    }

    for(int z = X + 1; z <= Y; z++){
        int xflag = 1;
        int yflag = 1;
    
        for(int i = 0; i < n; i++){
            if(x[i] >= z){
                xflag = 0;
            }            
        }

        for(int j = 0; j < m; j++){
            if(y[j] < z){
                yflag = 0;
            }
        }

        if(xflag && yflag){
            cout << "No War" << endl;
            return 0;
        }
    }

    cout << "War" << endl;
    
    return 0;
}

Measured memory_bytes: 256
/*
 * atcoder/abc161/a.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>

using namespace std;

#define ll long long

#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

ll A, B, C;

void input() {
  cin >> A >> B >> C;
}

void solve() {
  swap(A, B);
  swap(A, C);
  cout << A << " " << B << " " << C << endl;
}

int main() {
  // cout.precision(15);
  input();
  solve();
  return 0;
}


Measured memory_bytes: 256
N = int(input())
S = input()
res = [0] + [0] * len(S)

for i,s in enumerate(S, 1):
    if s == "I":
        res[i] = res[i-1] + 1
    else:
        res[i] = res[i-1] - 1

print(max(res) if max(res) > 0 else 0)

Measured memory_bytes: 3060
from math import factorial as f
from functools import reduce
def C(n,k):
    a,b=sorted((k,n-k))
    return reduce(int.__mul__, range(b+1,n+1),1) // f(a)

def almost_everywhere_zero(v, k):
    if not v or not k: return 0
    s = str(v)
    n,d = len(s), int(s[0])
    
    if k>n: return 0
    
    below = 9**k * C(n-1,k) if n>k else 0
    return below + ( d if k==1 else (d-1) * 9**(k-1) * C(n-1,k-1) + almost_everywhere_zero(int(s[1:]), k-1) )
N = input()
K = int(input())
print(almost_everywhere_zero(N,K))

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

int main(){
    int N, D;
    cin >> N >> D;

    vector<vector<int>> dis(N, vector<int>(D));
    for(int i = 0; i < N; i++){
        for(int j = 0; j < D; j++){
            cin >> dis[i][j];
        }
    }

    int ans = 0;
    for(int i = 0; i < N; i++){
        for(int j = i+1; j < N; j++){
            int sum = 0;
            for(int k = 0; k < D; k++){
                sum += pow(abs(dis[i][k] - dis[j][k]),2.0);
            }
            double hey = sqrt(sum);
            if(ceil(hey) == floor(hey)) ans++;
        }
    }
    cout << ans << endl;

   
}

Measured memory_bytes: 256
import java.util.*;

/*
問題文
N+M個のボールがあります。各ボールには整数が 
1つ書かれています。
これらのボールに書かれている数について、
N個のボールに書かれている数は偶数
M個のボールに書かれている数は奇数
であることがわかっています。

これらの N+M個のボールの中から 2つ選んで、書かれた数の和が偶数になる方法の数を求めてください。選ぶ順序は考慮しません。

なお、この方法の数はボールに書かれている整数の実際の値によらないことが示せます。

制約
0≤N,M≤100
2≤N+M
入力はすべて整数である。
*/



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

        //スキャン
        Scanner s = new Scanner(System.in);
        int n =  s.nextInt();
        int m = s.nextInt();

        int hoge = (n * (n-1) + m * (m-1))/2;
        
        System.out.println(hoge);
    }

    
}


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

const int N = 200005, inf = 0x3f3f3f3f;

int n, s, t, head[N], cur[N], tot = 1, f[N];
struct edge { int to, nxt, rem; } e[N << 2];
int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); }

void link(int x, int y) {
	e[++tot] = (edge) { y, head[x], 1 }, head[x] = tot;
	e[++tot] = (edge) { x, head[y], 0 }, head[y] = tot;
	if (x != s && y != t) f[find(x)] = find(y);
}

int dis[N];
bool bfs() {
	std::memset(dis, 0, sizeof dis), dis[s] = 1;
	std::queue<int> q; q.push(s);
	while (q.size()) {
		int tmp = q.front(); q.pop();
		for (int i = head[tmp]; i; i = e[i].nxt)
			if (e[i].rem && !dis[e[i].to])
				dis[e[i].to] = dis[tmp] + 1, q.push(e[i].to);
	}
	return dis[t] > 0;
}
int dinic(int x, int low) {
	if (x == t || !low) return low;
	int ans = 0, t;
	for (int &i = cur[x]; i; i = e[i].nxt)
		if (e[i].rem && dis[e[i].to] > dis[x] && (t = dinic(e[i].to, std::min(low, e[i].rem)))) {
			e[i].rem -= t, e[i ^ 1].rem += t, low -= t, ans += t;
			if (!low) break;
		}
	return ans;
}

std::pair<int, int> ans[N];
int E[N];

int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n, s = 0, t = 2 * n;
	for (int i = 1; i < 2 * n; ++i) f[i] = i;
	for (int i = 1, c, x; i < n; ++i) {
		std::cin >> c, link(s, i + n);
		while (c--) std::cin >> x, link(i + n, x);
	}
	for (int i = 2; i <= n; ++i) link(i, t);
	for (int i = 1; i < 2 * n; ++i) if (find(i) != find(1))
		return std::cout << "-1\n", 0;
	int sum = 0;
	while (bfs()) std::memcpy(cur, head, sizeof head), sum += dinic(s, inf);
	if (sum < n - 1) return std::cout << "-1\n", 0;
	for (int i = 1; i < n; ++i)
		for (int j = head[i + n]; j; j = e[j].nxt)
			if (e[j].to != s && !e[j].rem) E[i] = e[j].to;
	static bool vis[N];
	std::queue<int> q; q.push(1), vis[1] = 1;
	while (q.size()) {
		int tmp = q.front(); q.pop();
		for (int i = head[tmp]; i; i = e[i].nxt)
			if (e[i].to != t && !vis[E[e[i].to - n]]) {
				vis[E[e[i].to - n]] = 1, q.push(E[e[i].to - n]);
				ans[e[i].to - n] = std::make_pair(tmp, E[e[i].to - n]);
			}
	}
	for (int i = 1; i < n; ++i)
		std::cout << ans[i].first << ' ' << ans[i].second << '\n';
	return 0;
}

Measured memory_bytes: 16396
// Created by Nandu Vinodan
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define pi pair<int, int>
#define INF INT_MAX
#define _INF INT_MIN
#define TC 0

using namespace std;
using ll = long long;

void testcase() {
    int n, k;
    cin >> n >> k;

    int ans = 0;
    while (n > 0) {
    	n -= k;
    	ans++;
    	if (n==0) break;
    	n++;
    }

    cout << ans;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    if (TC)
        cin>>t;
    while(t--) {
        testcase();
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,l; 
        
        n = scan.nextInt(); m=scan.nextInt(); l = scan.nextInt();
        
        long [][] mtxA = new long[n][m]; 
        long [][] mtxB = new long[m][l];
        long [][] mtxC = new long[n][l];
        
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                mtxA[i][j] = scan.nextLong();
            }
        }
        
        for(int i = 0; i < m; i++){
            for(int j = 0; j < l; j++){
                mtxB[i][j] = scan.nextLong();
            }
        }
      
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < l; j++) {
                long sum = 0;
                for (int k = 0; k < m; k++) {
                    sum +=  mtxA[i][k] * mtxB[k][j];
                }
                 mtxC[i][j] =sum; 
            }
            
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < l; j++) {
                System.out.print(mtxC[i][j]);
                if (j<l-1) {
                    System.out.print(" ");
                }
            }
              System.out.println();
        }
        
    }
}


Measured memory_bytes: 52712
#include<stdio.h>
#include <stdlib.h>

int main(void){
	int N,M,K;
	long int *A,*B;
	int i,j,sum=0,max=0,start;
	scanf("%d %d %d",&N,&M,&K);
	N++;	//ここで先に多めにとってるよ
	M++;	//ここで先に多めにとってるよ
	A = malloc((N) * sizeof(long int));
	B = malloc((M) * sizeof(long int));
	A[0] = 0;
	B[0] = 0;
	for(i=1;i<N;i++) scanf("%ld",&(A[i]));
	for(i=1;i<M;i++) scanf("%ld",&(B[i]));
	for(i=1;i<N;i++) A[i] += A[i-1];
//	for(i=0;i<N;i++) printf("A[%d] = %ld\n",i,A[i]);//
	for(i=1;i<M;i++) B[i] += B[i-1];
//	for(i=0;i<M;i++) printf("B[%d] = %ld\n",i,B[i]);//
	for(i=0;i<N;i++){
		if(max<i){
			start = 0;
		}else{
			start = max-i;
		}
		for(j=start;j<M;j++){
			if(A[i]+B[j] <= K){
				if((i+j) > max) max = i+j;
			}else{
				break;
			}

		}
	}
	printf("%d\n",max);

	free(A);
	free(B);
	return 0;
}

Measured memory_bytes: 4620
#include <iostream>
using namespace std;
int main(void){
  string s;
  cin >> s;
  for(int i = 0; i < s.length(); i++){
    for(int j = i + 1; j < s.length(); j++){
      if(s[i] == s[j]){
        cout << "no" << endl;
        return 0;
      }
    }
  }
  cout << "yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;

// ===============================================================

ll gcd(ll a, ll b) //最大公約数
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}

ll lcm(ll a, ll b) //最小公倍数
{
	return a * b / gcd(a, b);
}

ll box(double a) //doubleの切り捨て
{
	ll b = a;
	return b;
}

ll fff(double a) //doubleの四捨五入
{
	ll b = a + 0.5;
	return b;
}

ll sum(ll n) { //整数sまでの合計
	if (n == 0) {
		return 0;
	}

	int s = sum(n - 1);
	return s + n;
}

bool prime(ll num)//素数判定、primeならtrue,違うならfalse
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}

// ===============================================================

int main() {
	ll a, b, c;
	cin >> a >> b >> c;
	if (a == b && a != c) {
		cout << "Yes" << endl;
	}
	else {
		if (a == c && a != b) {
			cout << "Yes" << endl;
		}
		else {
			if (b == c && a != b) {
				cout << "Yes" << endl;
			}
			else {
				cout << "No" << endl;
			}
		}
	}
}

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

using namespace std;

int main(){

	ios_base::sync_with_stdio(false);
	cin.tie(0);

    string s;
    cin >> s;
    int sol = 1e9;
    for(int i = 0; i <= s.size() - 3; i++){
    	string x = s.substr(i, 3);
    	//cout << x << endl;
    	int num = stoi(x);
    	sol = min(abs(num - 753), sol);
    }
    cout << sol;
}

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 = sc.nextInt();
		int k = sc.nextInt();

		int[] count = new int[n];
		for(int i = 0;i < n;i++) {
			count[i] = 0;
		}

		for(int j = 0;j < k;j++) {
			int[] d = new int[k];
			d[j] = sc.nextInt();
			int[] a = new int[d[j]];
			for(int i = 0;i < d[j];i++) {
				a[i] = sc.nextInt();
				for(int q = 0;q < n;q++) {
					if(a[i] == q+1) {
						count[q] = 1;
					}
				}
			}

		}


		int totalcount = 0;
		for(int i = 0;i < n;i++) {
			if(count[i] == 0) {
				totalcount++;
			}
		}

		System.out.println(totalcount);

	}
}


Measured memory_bytes: 47312
//code by lynmisakura.wish to be accepted!
/****************************/
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<bitset>
#include <climits>
#include<set>
#include<bitset>
using namespace std;
/***************************/
typedef long long ll;
typedef vector<ll> vi;
typedef vector<long long> vl;
typedef pair<ll, ll> pi;
typedef vector<pair<ll, ll>> vpi;
 
//const long long INF = 1LL << 55;
 
#define itn ll
#define endl '\n'
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ss second
#define ff first
#define dup(x,y) ((x) + (y) - 1)/(y)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(ll i = 0;i < n;i++)
#define rep(i,n) for(ll i = 0;i < n;i++)
#define rrep(i,n) for(ll i = n - 1;i >= 0;i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define ioboost cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20)
 
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, ll mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
 
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

int main(void){
   ioboost;
   
   ll n;cin >> n;
   vl b;
   ll acc = 0;
   rep(i,n){
      ll x;cin >> x;
      if(x)acc += x;
      else{
         b.pb(acc);
         acc = 0;
      }
   }
   b.pb(acc);
   ll ans = 0;
   for(auto i : b)ans += i / 2;
   cout << ans << endl;
}

Measured memory_bytes: 1400
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.text.DecimalFormat;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line = br.readLine();

        while(line != null){
        double[] a = new double[6];
        int startIndex = 0;
        int endIndex = line.indexOf(" ");

        for(int i=0; i<6; i++){
        	a[i] = readNum(line, startIndex, endIndex);

        	startIndex = endIndex+1;
        	endIndex = line.indexOf(" ", startIndex);
        	if(endIndex==-1){endIndex=line.length();}
        }

        double x = (a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3]);
        double y = (a[0]*a[5]-a[2]*a[3])/(a[0]*a[4]-a[1]*a[3]);

        x = Math.round(x*1000)/1000.0;
        y = Math.round(y*1000)/1000.0;

        DecimalFormat df = new DecimalFormat("0.000");

        System.out.println(df.format(x)+" "+df.format(y));

        line = br.readLine();
        }
        br.close();
    }

    static double readNum(String line, int startIndex, int endIndex){
		return Double.parseDouble(line.substring(startIndex, endIndex));
    }
}

Measured memory_bytes: 25864
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_D&lang=jp

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    S = int(input())
    h = S // 3600
    m = (S % 3600) // 60
    s = S % 60

    print('{}:{}:{}'.format(h, m, s))


if __name__ == '__main__':
    main(sys.argv[1:])
    

Measured memory_bytes: 7768
#include <stdio.h>
#include <string.h>

int main(void)
{
	char str[1024][64];
	int i, j;
	int ls;
	int lsl;
	int sl;
	int mus;
	int stri[1024];
	
	for (i = 0; i < 1024; i++){
		stri[i] = 0;
	}
	i = 0;
	ls = 0;
	lsl = 0;
	while (scanf("%s", str[i]) != EOF){
		sl = strlen(str[i]);
		if (sl > lsl){
			ls = i;
			lsl = sl;
		}
		for (j = 0; j <= i; j++){
			if (strcmp(str[j], str[i]) == 0){
				stri[j]++;
				break;
			}
		}
		i++;
	}
	mus = 0;
	for (j = 1; j < i; j++){
		if (stri[j] > stri[mus]){
			mus = j;
		}
	}
	
	printf("%s %s\n", str[mus], str[ls]);
	
	return (0);
}

Measured memory_bytes: 568
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	}
}

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

#define MOD (1000 * 1000 * 1000 + 7)
#define INF (1LL << 60)
#define pb push_back
#define po pop_back
#define fi first
#define se second

typedef long long ll;
typedef long double ld;

int main() {
    int n;
    cin >> n;

    map<int, int> niz;
    int t;
    for (int i = 0; i < n; ++i) {
        cin >> t;
        ++niz[t];
    }

    bool good = false;
    for (auto &i : niz) {
        if(n % 2 == 1 && i.se == 1) {
            good = true;
        }
        if (i.se > 2) {
            cout << '0' << endl;
            return 0;
        } else if (i.fi == 0 && i.se > 1) {
            cout << '0' << endl;
            return 0;
        }
    }

    if(n % 2 == 1 && !good) {
        cout << '0' << endl;
        return 0;
    }

    

    ll cnt = 1;
    for(auto &i : niz) {
        cnt *= i.se;
        cnt = cnt % MOD;
    }

    cout << cnt << endl;



    return 0;
}

Measured memory_bytes: 3200
#![allow(clippy::needless_range_loop)]
#![allow(unused_macros)]
#![allow(dead_code)]

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        #[allow(unused_mut)]
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

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

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

    let mut b = 100000;
    let mut s = 0;
    let mut ans = 1000;
    for x in a.iter().copied().chain(std::iter::once(0)) {
        if s == 0 && b >= x {
            b = x;
        } else if s <= x {
            s = x;
        } else {
            ans = (ans / b) * s + (ans % b);
            b = x;
            s = 0;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2176
N ,M = map(int,input().split())
maxx = max(N,M)
minn = min(N,M)
if (maxx-minn)>1:
    print(0)
else:
    import math
    if maxx-minn == 1:
        n = 1
    else:
        n = 2
    print(n*math.factorial(N)*math.factorial(M)%(10**9+7))

Measured memory_bytes: 5100
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<limits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

inline ll tri(int x){ return x * x * x; }

int main(){
  while(int z = getInt()){
    ll zz = tri(z);
    ll ans = numeric_limits<ll>::max();
    for(int x = 1; x < z; x++){
      for(int y = x; y < z; y++){
        ll xy = tri(x) + tri(y);
        if(zz < xy) break;
        ans = min(ans, zz - xy);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 844