akhauriyash/Code-Regression huggingface dataset:
program main
  implicit none
  integer :: N
  integer,allocatable  :: divisor(:)
  integer :: out
  integer :: i,j 
  read (*,*) N
  allocate(divisor(N))
  divisor = 0
  do i = 1, N
     do j = 1, i
        if (mod(i,j) ==0 ) then
           divisor(i) = divisor(i)+1
        end if
     end do
  end do
  out = 0
  do i = 1, N
     if ( mod(i,2) /= 0 .and. divisor(i) == 8 ) then
        out = out + 1
     end if
  end do
  write(*,'(i0)') out 
  stop
end program main


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define inf1 1e18+1
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(a>b)swap(a,b);if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	s[k-1]=s[k-1]+32;
	cout<<s;
}
int main()
{
	waste;
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 256
import std.stdio;
import std.ascii;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;

void main()
{
    auto input = readln.chomp.split().map!(to!long);
    long n = input[0];
    long k = input[1];
    if (n % k == 0)
    {
        writeln("0");
    }
    else
    {
        writeln("1");
    }
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

    private static final String LINE_SEPARATOR = System.getProperty("line.separator");

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();
        for (String s : lines) {

            final int[] intArray = split(s);
            int x = intArray[0];
            int y = intArray[1];

            if (x == 0 && y == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append(LINE_SEPARATOR);
            }

            Arrays.sort(intArray);

            sb.append(intArray[0]).append(' ').append(intArray[1]);
        }

        return sb.toString();
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

}

Measured memory_bytes: 25292
N, M = map(int, input().split())
graph = [[False for i in range(N)] for j in range(N)]
visit = [False for i in range(N)]
for i in range(M):
  a, b = map(lambda x: int(x) - 1, input().split())
  graph[a][b] = graph[b][a] = True
visit[0] = True

def dfs(c, n, vis):
  for i in range(n):
    if not vis[i]:
      break
  else:
    return 1
  ret = 0
  for i in range(n):
    if not graph[c][i]:
      continue
    if vis[i]:
      continue
    vis[i] = True
    ret += dfs(i, n, vis)
    vis[i] = False
  return ret

print(dfs(0, N, visit))

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

const int MAX_N = int(1e3) + 10;

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

int n, m;
int dis[MAX_N][MAX_N];
bool vis[MAX_N][MAX_N];
char s[MAX_N];
std::vector<std::pair<int, int> > que;

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; ++i) {
		scanf("%s", s + 1);
		for (int j = 1; j <= m; ++j) {
			if (s[j] == '#') {
				que.emplace_back(i, j);
				vis[i][j] = 1;
				dis[i][j] = 0;
			}
		}
	}

	int ans = 0;
	for (int i = 0; i < que.size(); ++i) {
		int x = que[i].first, y = que[i].second;
		for (int k = 0; k < 4; ++k) {
			int _x = x + dx[k], _y = y + dy[k];
			if (_x >= 1 && _x <= n && _y >= 1 && _y <= m && !vis[_x][_y]) {
				vis[_x][_y] = 1;
				dis[_x][_y] = dis[x][y] + 1;
				que.emplace_back(_x, _y);
				if (dis[_x][_y] > ans) ans = dis[_x][_y];
			}
		}
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 16488
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

typedef struct node{
  double x;
  double y;
}POINT;

void shori(int,POINT,POINT);

int main(){
  POINT a,b;
  int n;
  scanf("%d",&n);
  if(n>6||n<0) exit(2);
  a.x=0;
  a.y=0;
  b.x=100;
  b.y=0;
  printf("%.8f %.8f\n",a.x,a.y);
  shori(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);
  
  return 0;
}

void shori(int n,POINT a,POINT b){
  POINT m,k,l;
  double t=M_PI*60/180;
  if(n==0)return ;
  m.x=(2*a.x+1*b.x)/3;
  m.y=(2*a.y+1*b.y)/3;
  k.x=(1*a.x+2*b.x)/3;
  k.y=(1*a.y+2*b.y)/3;
  l.x=(k.x-m.x)* cos(t) - (k.y-m.y)* sin(t) + m.x;
  l.y=(k.x-m.x)* sin(t) + (k.y-m.y)* cos(t) + m.y;

  shori(n-1,a,m);
  printf("%.8f %.8f\n",m.x,m.y);
  shori(n-1,m,l);
  printf("%.8f %.8f\n",l.x,l.y);
  shori(n-1,l,k);
  printf("%.8f %.8f\n",k.x,k.y);
  shori(n-1,k,b);
}



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

int main(){
    vector<int> ns;
    int temp, max_n = 0;
    while(cin >> temp){
        ns.push_back(temp);
        max_n = max(temp, max_n);
    }
    max_n++;

    vector<bool> is_prime(max_n, true);
    vector<int> primes;
    for(ll i=2;i<max_n;i++){
        if(is_prime[i]){
            primes.push_back(i);
            for(ll j=i*i;j<max_n;j+=i){
                is_prime[j] = false;
            }
        }
    }

    for(int n: ns){
        int ans = upper_bound(primes.begin(), primes.end(), n) - primes.begin();
        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 3428
#include <bits/stdc++.h>
        using namespace std;
        #define int long long
const int MAX = 510000;
const int MOD = 1000000007;

     signed main(){
          string n;
          cin>>n;
          for(int i=0;i<n.size();i++){
                  if(n[i]=='9'){
                          cout<<"Yes";
                          return 0;
                  }
          }
          cout<<"No";
        
}

        


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    long t =1000000007;
    int N =sc.nextInt();
    long A[] =new long[N];
    long a=0;
    long b=0;
    long c =0;
    for(int i=0;i<N;i++){
      A[i] =sc.nextLong();
      A[i] =A[i]%t;
      a =a+A[i];
      a=a%t;
      b = A[i]*A[i];
      b =b%t;
      c =c+b;
      c =c%t;}
    long d =(a*a)%t;
    long e =d-c;
    e =e%t;
    if(e<0){e =e+t;}
    if(e%2==1){e =e+t;}
    e =e/2;
    System.out.println(e);
  }
}    


Measured memory_bytes: 63176
#include <queue>
#include <vector>
#include <iostream>
using namespace std;

// ------ Class ------ //
class Graph1 {
public:
	// ------ Variables ------ //
	static const int INF = 1000000000;
	int V, E; vector<vector<int> > G;

	// ------ Constructors ------ //
	Graph1() : V(0), E(0), G(vector<vector<int> >()) {}
	Graph1(int v) : V(v), E(0), G(vector<vector<int> >(v)) {}
	Graph1(vector<vector<int> > g) : V(g.size()), G(g) { for (int i = 0; i < g.size(); i++) E += g[i].size(); }

	// ------ Basic Functions ------ //
	int size() { return V; }
	void add1(int v1, int v2) { G[v1].push_back(v2); E++; }
	void add2(int v1, int v2) { add1(v1, v2); add1(v2, v1); }

	// ------ Operators ------ //
	friend bool operator==(const Graph1& g1, const Graph1& g2) { return g1.G == g2.G; }
	friend bool operator!=(const Graph1& g1, const Graph1& g2) { return g1.G != g2.G; }
	vector<int> operator[](int x) { return G[x]; }

	// ------ Algorithms ------ //
	vector<int> dist(int s) {
		queue<int> que; que.push(s);
		vector<int> d(V, INF); d[s] = 0;
		while (!que.empty()) {
			int u = que.front(); que.pop();
			for (int i = 0; i < G[u].size(); i++) {
				if (d[G[u][i]] == INF) {
					d[G[u][i]] = d[u] + 1;
					que.push(G[u][i]);
				}
			}
		}
		return d;
	}
};

// ------ Main ------ //
int n, u, k, v;
int main() {
	cin >> n; Graph1 g(n);
	for(int i = 0; i < n; i++) {
		cin >> u >> k;
		for(int j = 0; j < k; j++) cin >> v, g.add1(u - 1, v - 1);
	}
	vector<int> d = g.dist(0);
	for(int i = 0; i < n; i++) cout << i + 1 << ' ' << (d[i] != Graph1::INF ? d[i] : -1) << endl;
}

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

using namespace std;

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

	int N;
	cin >> N;
	vector<double> heads(N + 1);
	for(int i = 1; i <= N; ++i)
	{
		cin >> heads[i];
	}

	vector<double> dp(N + 1, 0);
	dp[0] = 1;

	for(int i = 1; i <= N; ++i)
	{
		for(int j = i; j >= 0; --j)
		{
			if(j == 0)
			{
				dp[j] *= 1 - heads[i];
			}
			else
			{
				dp[j] = dp[j - 1] * heads[i] + dp[j] * (1 - heads[i]);
			}
		}
	}

	double res = 0;
	for(int i = (N + 1) >> 1; i <= N; ++i)
	{
		res += dp[i];
	}

	cout << fixed << setprecision(10) << res << "\n";

	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <bitset>
#include <functional>
#include <random>
#define REP(_i,_a,_n) for(int _i=_a;_i<=_n;++_i)
#define PER(_i,_a,_n) for(int _i=_n;_i>=_a;--_i)
#define hr putchar(10)
#define pb push_back
#define lc (o<<1)
#define rc (lc|1)
#define mid ((l+r)>>1)
#define ls lc,l,mid
#define rs rc,mid+1,r
#define x first
#define y second
#define io std::ios::sync_with_stdio(false)
#define endl '\n'
#define DB(_a) ({REP(_i,1,n) cout<<_a[_i]<<',';hr;})
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int P = 1e9+7, INF = 0x3f3f3f3f;
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll qpow(ll a,ll n) {ll r=1%P;for (a%=P;n;a=a*a%P,n>>=1)if(n&1)r=r*a%P;return r;}
ll inv(ll x){return x<=1?1:inv(P%x)*(P-P/x)%P;}
inline int rd() {int x=0;char p=getchar();while(p<'0'||p>'9')p=getchar();while(p>='0'&&p<='9')x=x*10+p-'0',p=getchar();return x;}
//head



#ifdef __APPLE__
const int N = 1e2+50;
#else
const int N = 1e6+50;
#endif


int n,cnt,cnt2;
ll a[N],b[N],c[N];
char s[N];

void work() {
	scanf("%d", &n);
	REP(i,1,n) scanf("%lld",a+i);
	scanf("%s",s+1);
	cnt = 0;
	int p=n;
	while (p) {
		ll x=a[p];
		REP(j,1,cnt) x=min(x,x^b[j]);
		if (s[p]=='0') {
			if (x) b[++cnt]=x;
		}
		else {
			if (x) return puts("1"),void();
		}
		--p;
	}
	puts("0");
}

int main() {
	int t;
	scanf("%d", &t);
	while (t--) work();
}










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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define mp(a,b) make_pair((a),(b))
#define debug(x) #x << "=" << (x)
 
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int INF=1<<30;
const long long int LLNF_=1LL<<58;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
	os << "[";
	for (const auto &v : vec) {
		os << v << ",";
	}
	os << "]";
	return os;
}

struct Service{
	ll w;
	int t,x;
	bool operator<(const Service &s)const{
		return true;
	}
};

void Solve(){
	int n,q;
	cin >> n >> q;

	queue<Service> qs;
	vector<int> anss;
	rep(i,0,n){
		ll w;
		int t,x;
		cin >> w >> t >> x;
		qs.push(Service{w,t,x});
	}
	
	queue<int> qy;
	vector<ll> ansy;
	rep(i,0,q){
		int y;
		cin >> y;
		qy.push(y);
	}
	
	const int limit=3652425;
	int num[3]={},days=0;
	ll restore=0,accel[3]={};
	priority_queue<pair<int,Service>,vector<pair<int,Service>>,greater<pair<int,Service>>> expire;
	rep(i,0,limit+1){
		if(qy.size()&&i==qy.front()){
			ansy.push_back(restore);
			qy.pop();
		}
		
		while(qs.size()&&restore>=qs.front().w){
			anss.push_back(i);
			Service service=qs.front();
			qs.pop();
			++num[service.t];
			if(service.t==0) ++accel[service.t];
			expire.push(mp(i+service.x,service));
		}

		while(expire.size()&&expire.top().first==i){
			Service service=expire.top().second;
			expire.pop();
			--num[service.t];
			if(service.t==0) --accel[service.t];
			else if(service.t==1) accel[service.t]-=service.x;
			else if(service.t==2){
				accel[service.t]-=(ll)service.x*service.x;
				days-=service.x;
			}
		}
		
		accel[1]+=num[1];
		accel[2]+=2*days+num[2];
		days+=num[2];
		rep(j,0,3) restore+=accel[j];
		++restore;
	}
	
	rep(i,0,n){
		if(anss.size()>i) cout << anss[i] << endl;
		else cout << "Many years later" << endl;
	}
	rep(i,0,q) cout << ansy[i] << endl;
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	Solve();
	return 0;
}

Measured memory_bytes: 6888
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
int main(){
    int N;
    cin >> N;
    vector<int> vec(N);
    REP(i,N){
        cin >> vec.at(i);
    }
    vector<int> a(100);
    REP(j,100){
        int value = 0;
        REP(i,N){
            value += (j-vec.at(i))*(j-vec.at(i));
        }
        a.at(j) = value;
    }
    sort(ALL(a));
    cout << a[0] << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
using namespace std;
typedef long long lint;
#define cout cerr
#define ni (next_num<int>())
template<class T>inline T next_num(){
	T i=0;char c;
	while(!isdigit(c=getchar())&&c!='-');
	bool flag=c=='-';
	flag?c=getchar():0;
	while(i=i*10-'0'+c,isdigit(c=getchar()));
	return flag?-i:i;
}
template<class T1,class T2>inline void apmax(T1 &a,const T2 &b){if(a<b)a=b;}
template<class T1,class T2>inline void apmin(T1 &a,const T2 &b){if(b<a)a=b;}
const int N=100010,INF=0x7f7f7f7f;
int pval[N];
namespace T{
	const int E=N<<1;
	int to[E],bro[E],head[N],e=0;
	int liml[N],limr[N];
	inline void init(){
		memset(head,-1,sizeof(head));
		memset(liml,128,sizeof(liml));
		memset(limr,127,sizeof(limr));
	}
	inline void ae(int u,int v){
		to[e]=v,bro[e]=head[u],head[u]=e++;
	}
	inline void add(int u,int v){
		ae(u,v),ae(v,u);
	}
	bool dfs1(int x,int fa){
		for(int i=head[x],v;~i;i=bro[i]){
			if((v=to[i])!=fa){
				if(!dfs1(v,x))return false;
				if(limr[v]<INF){
					if(limr[x]==INF){
						liml[x]=liml[v]-1,limr[x]=limr[v]+1;
					}else if((limr[x]&1)!=(limr[v]&1)){
						apmax(liml[x],liml[v]-1);
						apmin(limr[x],limr[v]+1);
						if(liml[x]>limr[x])return false;
					}else return false;
				}
			}
		}
		return true;
	}
	void dfs2(int x,int fa){
		if(fa==0){
			pval[x]=limr[x];
		}else{
			pval[x]=min(limr[x],pval[fa]+1);
			assert(pval[x]>=liml[x]);
		}
		for(int i=head[x],v;~i;i=bro[i]){
			if((v=to[i])!=fa){
				dfs2(v,x);
			}
		}
	}
}
int main(){
	int n=ni;
	T::init();
	for(int i=1;i<n;T::add(ni,ni),i++);
	for(int tot=ni;tot--;){
		int x=ni;
		T::liml[x]=T::limr[x]=ni;
	}
	if(!T::dfs1(1,0)){
		puts("No");
		return 0;
	}
	puts("Yes");
	T::dfs2(1,0);
	for(int i=1;i<=n;i++){
		printf("%d\n",pval[i]);
	}
	putchar('\n');
	return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
    string s;
    cin >>s;
    int n = s.size();
    
    
    int ans = 753;
    for(int i = 0; i < n-2; i++) {
        string temp = "";
        temp += s[i];
        temp += s[i+1];
        temp += s[i+2];
        int num = stoi(temp);
        ans = min(ans, abs(753-num));
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3588
//                             In The Name Of Allah
#include <bits/stdc++.h>
#define ss second
#define ff first
#define use_fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ret(n) return cout << n, 0
#define se(n) cout << setprecision(n) << fixed
#define pb push_back
#define int long long
#define ld long double
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std; 
 
const int N = 1e6 + 100, OO = 1e9 + 7, M = 1e9 + 7, P = 769, sq = 360, lg = 26;
typedef pair <int, int> pii;
int a[N];

int32_t main() {	
	int a, b, c;
	cin >> a >> b >> c;
	set <int> s;
	s.insert(a);
	s.insert(b);
	s.insert(c);
	if(s.size() == 2)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;	
} 
/*
be carefull :
1- if not solve after 20 min, read again twice
2- after submit read the code again
3- fun with contest
4- ... 
*/	

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(i=0;i<(n);i++)
using namespace std;
using ll=long long;
using P=pair<int,int>;
int main(){
  ll a,b,c,d;
  cin >> a >> b >> c >> d;
  long long ans;
  ans = max(max(a*c,a*d),max(b*c,b*d));
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3488
#include<algorithm>
#include<iomanip>
#include<iostream>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<vector>
#include<bitset>
#include<cmath>
#define FOR(i,a,b) for(int i=(a); i<int(b); ++i)
#define RFOR(i,a,b) for(int i=(b)-1; i>=int(a); --i)
#define rep(i,n) FOR(i,0,n)
#define rep1(i,n) FOR(i,1,int(n)+1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
#define al(d) d.begin(),d.end()
#define fill(n) std::setfill('0')<<std::right<<std::setw(n)
template <typename T>
using vec = std::vector<T>;
using vi = vec<int>;
using vvi = vec<vi>;
using pii = std::pair<int, int>;
using ll = long long;
using ld = long double;
using namespace std;
const int MOD = 1000000007;

template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
template <class T>
vector<T> getv(int n){
	vector<T> vec;
	rep(i,n){
		T input;
		cin >> input;
		vec.emplace_back(input);
	}
	return vec;
}

using AdjList = vector<vector<int>>;
using Weight = int;
using Flow = int;
struct Edge {
	int src, dst;
	Weight weight;
	Flow cap;
	Edge() : src(0), dst(0), weight(0) {}
	Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;
using Array = std::vector<Weight>;
using Matrix = std::vector<Array>;
void add_edge(Graph &g, int a, int b, Weight w = 1) {
	g[a].emplace_back(a, b, w);
	g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int a, int b, Weight w = 1) { g[a].emplace_back(a, b, w); }
// Recieve edge(=(int,int)) as an adj list.
AdjList getadj(int N, int M){
	// Initialize all lists of the graph as a empty vector.
	vector<int> init;
	vector<vector<int>> graph(N,init);
	rep(i,M){
		int a, b;
		cin >> a >> b;
		graph[a-1].emplace_back(b-1);
		graph[b-1].emplace_back(a-1);
	}
rep(i,N){
	cout << i<< ": ";
	putv(graph[i]);
}
 
	return graph;
}
void out(bool ans){
	if(ans == true) cout << "yes" << endl;
	else cout << "no" << endl;
}
void Out(bool ans){
	if(ans == true) cout << "Yes" << endl;
	else cout << "No" << endl;
}
void OUT(bool ans){
	if(ans == true) cout << "YES" << endl;
	else cout << "NO" << endl;
}
ll gcd(const ll a, const ll b){
	return (b==0) ? a : gcd(b,a%b);
}
ll lcm(const ll a, const ll b){
	return a*(b/gcd(a,b));
}
ll Manhattan_dist(ll x1, ll y1, ll x2, ll y2){
	return abs(x1-x2) + abs(y1-y2);
}
// nをpで何回割れるか
ll hmt_p_divide_n(ll p, ll n){
	ll s = 0;
	while(n%p == 0){
		n /= p;
		s++;
	}
	return s;
}
int digit(ll n){
	int cntr = 0;
	while(n>0){
		n/=10;
		cntr++;
	}
	return cntr;
}


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

	// ACTG文字列
	int max_len = 0;
	int cntr = 0; //ACTGが何文字連続しているか
	rep(i,s.length()){
		char c = s[i];
		if(c=='A'||c=='C'||c=='T'||c=='G')
			cntr++;
		else{
			max_len = max(max_len,cntr);
			cntr = 0;
		}
	}
	max_len = max(max_len,cntr);
	cout << max_len <<endl;
}



Measured memory_bytes: 256
k = int(input())

def fun(k):
    lun_luns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    index = 0
    while True:
        if len(lun_luns) >= k:
            break
        num = lun_luns[index]
        mod = num%10
        n = num*10
        if mod == 9:
            lun_luns.extend([n+mod-1, n+mod])
        elif mod == 0:
            lun_luns.extend([n, n+1])
        else:
            lun_luns.extend([n+mod-1, n+mod, n+mod+1])
        index += 1
    
    return lun_luns[k-1]

print(fun(k))

Measured memory_bytes: 45040
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include<math.h>
#include<bitset>
#include<iomanip>
#include<queue>
using namespace std;


int main() {
	long long A, B; cin >> A>> B;
	long long x = A / 2 % 2;
	long long y = (B+1) / 2 % 2;
	if (A % 2 == 1)x ^= A-1;
	if ((B+1) % 2 == 1)y ^= B;
	cout << (x^y) << endl;
}




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

int dev2(int kk){
  int m=0;
  int k=kk;
  while(k%2 == 0){
    k = k/2;
    m++;
  }

  // cout << kk << " " << m << endl;                                                                              

  return m;
}

int main(){
  int n;
  cin >> n;
  int a[n];
  int b[3] = {0, 0, 0};
  for(int j=0;j<n;j++){
    cin >> a[j];
    int l = dev2(a[j]);
    if(l==0){
      b[0]++;
    }
    else if(l==1){
      b[1]++;
    }
    else{
      b[2]++;
    }
  }

  // cout << b[0] << " " << b[1] << " " << b[2] << endl;                                                          

  if((b[0] <= b[2]) || ((b[0] == (b[2] + 1)) && (b[1] == 0))){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

  return 0;
}



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

#define cn count
#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define len length
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i < (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

int main(){
	IO;
	ll a,sum=0;
	forn(i,3){cin>>a; sum+=a;}
	(sum>=22)?cout<<"bust\n":cout<<"win\n";
	return 0;
}


// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""



Measured memory_bytes: 3620
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

const int MAX = 1000010;

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

	int N, M;
	string S;

	vector<int> ans;

	cin >> N >> M >> S;

	int p = SZ(S) - 1;
	int c = 1;
	int tc = -1;
	while (p != 0)
	{
		tc = -1;
		while (c <= M && p - c != -1)
		{
			if (S[p - c] == '0')
			{
				tc = c;
			}
			c++;
		}
		if (tc == -1)
		{
			cout << -1 << endl;
			return 0;
		}
		ans.push_back(tc);
		p -= tc;
		c = 1;
	}

	reverse(all(ans));

	for (auto v : ans)
	{
		cout << v << " ";
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1480
#include <bits/stdc++.h>
// #include <atcoder/all> // NOTE: AtCoderライブラリ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
// using namespace atcoder; // NOTE: AtCoderライブラリ
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef pair<int, int> pii;
// #define INF __INT32_MAX__
#define INF 1e9
#define LINF __LONG_LONG_MAX__

int main() {
    int N; cin >> N;
    vi A(N); rep(i, N) cin >> A[i];
    
    sort(A.begin(), A.end());

    const int AMAX = 1e6;
    vector<bool> dp(AMAX + 1, false);
    vector<bool> used(AMAX + 1, false);
    
    rep(i, N) {
        int a = A[i];
        if (used[a]) {
            dp[a] = true;
            continue;
        }
        used[a] = true;

        for (int j = 2 * a; j <= AMAX; j += a) {
            dp[j] = true;
        }
    }

    int cnt = 0;
    rep(i, N) {
        if (!dp[A[i]]) cnt++;
    }

    cout << cnt << endl;
}


Measured memory_bytes: 4256
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[allow(dead_code)]
fn pow_mod(base: i64, power: i64, modulo: i64) -> i64 {
    let mut base = base;
    let mut power = power;
    let mut ans = 1;
    while power > 0 {
        if power & 1 == 1 {
            ans = ans * base % modulo;
        }
        power >>= 1;
        base = base * base % modulo;
    }
    ans
}

#[allow(dead_code)]
fn inv_mod(a: i64, modulo: i64) -> i64 {
    pow_mod(a, modulo - 2, modulo)
}

const MOD: i64 = 998244353;
const FACT_MAX: usize = 100000;
static mut FACTORIAL: [i64; FACT_MAX + 1] = [0; FACT_MAX + 1];
static mut RFACTORIAL: [i64; FACT_MAX + 1] = [0; FACT_MAX + 1];
fn init_fact() {
    unsafe {
        if FACTORIAL[0] == 0 {
            FACTORIAL[0] = 1;
            for i in 1..FACT_MAX + 1 {
                FACTORIAL[i] = (FACTORIAL[i - 1] * i as i64) % MOD;
            }
            RFACTORIAL[FACT_MAX] = inv_mod(FACTORIAL[FACT_MAX], MOD);
            for i in (0..FACT_MAX).rev() {
                RFACTORIAL[i] = RFACTORIAL[i + 1] * (i as i64 + 1) % MOD;
            }
        }
    }
}
#[allow(dead_code)]
fn fact(n: usize) -> i64 {
    init_fact();
    unsafe { FACTORIAL[n] }
}
#[allow(dead_code, unused_comparisons)]
fn combi(n: i64, m: i64) -> i64 {
    if n < m || m < 0 {
        return 0;
    }
    init_fact();
    unsafe {
        FACTORIAL[n as usize] * RFACTORIAL[m as usize] % MOD * RFACTORIAL[(n - m) as usize] % MOD
    }
}

fn h(n: i64, k: i64) -> i64 {
    return combi(n + k - 1, n);
}

fn calc(n: i64, k: i64, ban: i64) -> i64 {
    let mut ans = 0;
    let mut cnt = ban / 2;
    if ban > k + 1 {
        cnt -= ban - (k + 1);
    }
    for i in 0..(cnt + 1) {
        let sign = if i % 2 == 0 { 1 } else { MOD - 1 };
        let rest = n - i * 2;
        ans = (ans + sign * combi(cnt, i) % MOD * h(rest, k) % MOD) % MOD;
        // println!("{} {} {}", ans, rest, h(rest, k));
    }
    return ans;
}

fn main() {
    let k = read::<i64>();
    let n = read::<i64>();
    for i in 2..(2 * k + 1) {
        let ans = calc(n, k, i);
        println!("{}", ans);
    }
}


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

const int MAXN=1e5+10;

int dp[MAXN][3];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,a,b,c;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a>>b>>c;
        dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a;
        dp[i][1]=max(dp[i-1][0],dp[i-1][2])+b;
        dp[i][2]=max(dp[i-1][0],dp[i-1][1])+c;
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
}


Measured memory_bytes: 1408
/*
  ∧,,∧
( 'ω' )つ ＜WA,またお前か！！　
（m9 ＼ 　　
　 ＼　 ＼
　 　 ) ) ＼
　 ／／ ＼ ＼
　 (＿） 　 (＿)
*/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rep(x, y) for (int x = 0; x < y; x++)
#define MOD 1000000007

typedef long long LL;
typedef long double LD;

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

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    int N;
    cin >> N;
    vector<pair<int, int>> attendance(N, {0, 0});
    for (int i = 0; i < N; i++) {
        attendance[i].first = i+1;
        cin >> attendance[i].second;
    }

    sort(all(attendance), compare_by_b);

    for (int i = 0; i < N; i++)
        cout << attendance[i].first << " ";
    cout << endl;

    return 0;
}


Measured memory_bytes: 1664
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
    a = [int(i) for i in ipt().split()]
    a.sort(reverse=True)
    ans = a[0]
    cou = n-2
    for i in a[1::]:
        if cou == 0:
            break
        elif cou == 1:
            ans += i
            break
        else:
            ans += 2*i
            cou -= 2
    print(ans)

    return None

if __name__ == '__main__':
    main()


Measured memory_bytes: 95260
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include<chrono>
using namespace std;
using namespace std::chrono;      
using namespace __gnu_pbds; 
#define fastio     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define fi         first
#define se         second
#define int         long long 
#define pb         push_back
#define emp        emplace_back
#define vv(x)      vector<x>
#define mp(x,y)    map<x,y>
#define dq(x)      deque<x>
#define pql(x)     priority_queue<x>
#define pqs(x)     priority_queue<x,vv(x),greater<x> >
#define M          1000000007
#define forf(i,a,b) for(int i=a;i<b;i++)
#define it(x)      x::iterator
#define ll         long long 
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d)  for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
#define vii        vector<int>
#define big        1e9
#define sm         -2e9
#define mkr        make_pair
#define vpi        vector<pair<int,int> >
#define pii        pair<int,int>
#define rng        500005
#define sz(x)      (int)x.size()
#define rv(x)      reverse(x.begin(),x.end())
#define out(x)     cout<<x.fi<<" "<<x.se<<endl;

//#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update> 

void pr_init()
{

#ifndef ONLINE_JUDGE
freopen("gin.txt", "r", stdin);
freopen("gout.txt", "w", stdout);

#endif
}


int h,w,ch;
char mat[11][1001];
vector<vpi> segs;

void recur(int i,int n,vpi cur)
{
if(i>n)
{
   segs.pb(cur);
   return ;
}

for(int j=i;j<=n;j++)
{
    cur.pb({i,j});
    recur(j+1,n,cur);
    cur.pop_back();
}

}
void solve()
{

cin >> h >> w >> ch;

for(int i=1;i<=h;i++)
{
for(int j=1;j<=w;j++) cin >> mat[i][j];
}
vpi cur;
recur(1,h,cur);
int an = big;
for(auto x:segs)
{
int cur = sz(x)-1;
vii vls(sz(x),0);

for(int j=1;j<=w;j++)
{
    for(int k=0;k<sz(x);k++)
    {
      for(int l = x[k].fi ; l<=x[k].se ; l++)
      {
        if(mat[l][j] == '1') vls[k]++;
      }
    }
    

    for(int k=0;k<sz(x);k++) 
    if(vls[k]>ch)
    {
      cur ++ ;
      for(int k=0;k<sz(x);k++) 
        {
             vls[k]=0;
             for(int l = x[k].fi ; l<=x[k].se ; l++)
              {
                 if(mat[l][j] == '1') vls[k]++;
              }
              if(vls[k]>ch) cur += big;
            
        }
        break;
    }

}
an = min(an,cur);
}
if(an>=big) an = -1;

cout<<an<<"\n";

}


int32_t main()
{
pr_init();
fastio;

auto start = high_resolution_clock::now(); 

solve();
auto stop = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop - start); 
// cout << "Time taken by function: "
//       << duration.count() << " microseconds" << endl; 

}
  
  

Measured memory_bytes: 3708
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=45,inf=0x3f3f3f3f;
int read(){
	int f=1,g=0;
	char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-1;
	for (;isdigit(ch);ch=getchar()) g=g*10+ch-'0';
	return f*g;
}
int n,h[N][N];
ll ans,f[N][N][N];
char ch[N];
int main(){
//	freopen("a.in","r",stdin);
//	freopen("a.out","w",stdout);
	n=read()*2;
	for (int i=1;i<=n;i++){
		scanf(" %s",ch+1);
		for (int j=1;j<=n;j++) h[i][j]=ch[j]-'0';
	}
	for (int i=1;i<=n;i++) f[i][i][i]=1;
	for (int l=n-2;l;l--)
	for (int r=l+2;r<=n;r++)
	if (((l^r)&1)==0) for (int i=l+1;i<r;i++)
	for (int j=l;j<i;j++)
	for (int k=i+1;k<=r;k++)
	if (h[j][k]) for (int p=j;p<i;p++)
	for (int q=i+1;q<=k;q++)
	f[l][r][i]+=f[l][p][j]*f[p+1][q-1][i]*f[q][r][k];
	
	ans=0;
	for (int i=2;i<=n;i++)
	if (h[1][i]) ans+=f[2][n][i];
	printf("%lld\n",ans);
	return 0;
}

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

bool is_ans(int a, int b, int c) {
  int mxx = max(max(a, b), c);
  int mnn = min(min(a, b), c);
  return b != mxx && b != mnn;
}

int main() {
  int N;
  cin >> N;
  vector<int> ps(N);
  for(int i = 0; i < N; ++i) {
    cin >> ps[i];
  }
  int ans = 0;
  for(int i = 0; i < N - 2; ++i) {
    if(is_ans(ps[i], ps[i + 1], ps[i + 2])) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(list(map(int, input().split())) for _ in range(2))
ans = 0
for i in range(N):
    now = 0
    now += sum(A[0][0: i + 1])
    now += sum(A[1][i: N])
    if ans < now:
        ans = now
print(ans)

Measured memory_bytes: 3064
from math import gcd

n,m = map(int,input().split())
s = input()
t = input()

l = n * m // gcd(n,m)

cnt = (l // m) * (l // n)
a = [i * l // m for i in range(l // cnt)]
b = [i * l // n for i in range(l // cnt)]

for i in range(l // cnt):
    a1 = a[i]
    b1 = b[i]
    if s[a1] == t[b1]:
        pass
    else:
        print(-1)
        exit()

print(l)


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

int main(){
	int k,n;
	cin >> k >> n;
	vector<int> a(n);
	rep(i,n){
		cin >> a[i];
	}
	vector<int> ans(n);
	for(int i=1;i<n;i++){
		ans[i] = a[i] - a[i-1];
	}
	ans[0] = k-a[n-1]+a[0];
	int maxim = 0;
	rep(i,n){
		if(maxim < ans[i]) maxim = ans[i];
	}
  //cout << a[n-1] << endl;
	cout << k-maxim << endl;
}

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

using namespace std;

typedef long long int ll;
typedef long double ld;

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    int n, d;
    int arr[30][30];
    
    cin >> n >> d;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < d; j++){
			cin >> arr[i][j];
		}
	}
	
	int cnt = 0;
	for(int i = 0; i < n; i++){
		for(int j = i + 1; j < n; j++){
			ll a = 0;
			for(int k = 0; k < d; k++){
				a += (arr[i][k] - arr[j][k]) * (arr[i][k] - arr[j][k]);
			}
			
			ll b = sqrt(a);
			double d = sqrt(a);
			
			if(b == d) cnt++;
		}
	}
	
	cout << cnt << endl;
	
	return 0;
}




Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,m;
char r[600][600],b[600][600],a[600][600];
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i+=2)
        for(int j=1;j<=m;j++)
            r[i][j]='#';
    for(int i=2;i<=n;i+=2)
        for(int j=1;j<=m;j++)
        {
            r[i][j]='.';
        }
    for(int i=2;i<=n;i+=2)
        for(int j=1;j<=m;j++)
            b[i][j]='#';
    for(int i=1;i<=n;i+=2)
        for(int j=1;j<=m;j++)
        {
            b[i][j]='.';
        }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            char cur;
            cin>>cur;
            if(cur=='#')
            {
                r[i][j]='#';
                b[i][j]='#';
            }
        }
    }
    for(int i=1;i<=n;i++)
        r[i][1]='#',b[i][1]='.';
    for(int i=1;i<=n;i++)
        r[i][m]='.',b[i][m]='#';
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
          cout<<r[i][j];
        cout<<endl;
    }
    cout<<endl;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
          cout<<b[i][j];
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 1280
'use strict';
(function(stdin) {
  //declare function
  var f = function(a, b, c) {
    return a < b ? (b < c ? 'Yes' : 'No') : 'No';
  };
  //declare variable
  var inputs = stdin.toString().trim().split('\n');
  var cols = inputs[0].split(' ').map(Number);
  var a = cols[0];
  var b = cols[1];
  var c = cols[2];
  //main

  //display
  console.log(f(a, b, c));
})(require('fs').readFileSync('/dev/stdin', 'utf8'))

Measured memory_bytes: 15452
#include <iostream>
#include <utility>
#include <vector>
#include <queue>
#include <stack>
#include <array>
#include <algorithm>
#include <numeric>
#include <limits>
#include <string>
#include <regex>
#include <cstdio>
#include <cstring>
#include <cmath>
#define INF 2000000000
#define REP(i,b,n) for(int i = (b); i < n; i++)
#define rREP(i,b,n) for(int i = n; i >= b; i--)
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const string lowercase = "abcdefghijklmnopqrstuvwxyz";
const string uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int gcd(int a, int b){return b ? gcd(b, a % b): a;}

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    cout << a * b / 2.0 << endl;
    return 0;
}

Measured memory_bytes: 764
import math
N=int(input())
A=list(map(int, input().split()))
A=sorted(A)




MAX=max(A)
nums=[0]*(MAX)

ans=0

for i in range(N):
    a=A[i]
    kousin=True
    if i!=0:
        if A[i-1]==a:
            kousin=False
    if i!=N-1:
        if a==A[i+1]:
            kousin=False

    if nums[a-1]==0 and kousin:
        ans+=1
        
                
        if a>MAX//2:
            continue
            

    count=1
    num=a
    while num<=MAX:
        nums[num-1]+=1
        count+=1
        num=a*count
    
#print(nums)
print(ans)

    


Measured memory_bytes: 114052
#include <iostream>
 
int main() {
  int W, H, x, y, r;
  std::cin >> W >> H >> x >> y >> r;
  if (r <= x && x <= (W - r) && r <= y && y <= (H - r)) std::cout << "Yes" << std::endl;
  else std::cout << "No" << std::endl;
  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<(n);++i)
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
 
int main() {
    string s,t;

    cin>>s>>t;

    rep(i,s.size())
    t.push_back(s[i]);
    
    cout<<t<<endl;

 return 0;
}

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

int func(int n);
bool check(int a);

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

  vector<int> a(1);//要素a
  a.at(0) = s;//aに初項を代入
  int i=0;
  //cout << "a" << i << " = " << a.back() << endl;

  while(check(a.at(i))){
    //4 -> 2 -> 1 -> 4 -> 2 -> 1 -> 4 のループに入る
    i++;
    int t = func(a.at(i - 1));//t:a(i)=f(a(i-1))
    a.push_back(t);
    //cout << "a" << i << " = " << a.back() << endl;
  }
  cout << i + 4 << endl;
}

int func(int n){
  /*
  f(n)について，
  nが偶数のとき，f(n)=n/2
  nが奇数のとき，f(n)=3n+1
  */
  int a;
  if(n % 2 == 0)
    a = n / 2;
  else
    a = 3 * n + 1;
  
  return a;
}

bool check(int a){
  if (a == 4) return false;
  else if (a == 2)  return false;
  else if (a == 1)  return false;
  else return true;;
}

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

using namespace std;

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

    vector<vector<long long>> nck(n + 1, vector<long long>(n + 1, 0));
    nck[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        nck[i][0] = nck[i][i] = 1;
        for (int j = 1; j < i; j++) {
            nck[i][j] = (nck[i - 1][j - 1] + nck[i - 1][j]) % 1000000007;
        }
    }

    for (int i = 1; i <= k; i++) {
        cout << (nck[n - k + 1][i] % 1000000007) * (nck[k - 1][i - 1] % 1000000007)  % 1000000007 << endl;
    }
}


Measured memory_bytes: 31616
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	maxwh = 2000
)

/*
 * すみません、自作ではありません。本人には謝りました。
 */

func main() {
	// 入力
	r := bufio.NewReader(os.Stdin)
	var h, w int
	fmt.Fscan(r, &h, &w)
	r.ReadString('\n')
	var s [maxwh + 2][maxwh + 2]bool
	for y := 1; y <= h; y++ {
		line, _ := r.ReadString('\n')
		for x := 1; x <= w; x++ {
			s[x][y] = line[x-1] == '.'
		}
	}

	// 上下左右の計算
	var jo, ge, sa, yu [maxwh + 2][maxwh + 2]int
	for y := 1; y <= h; y++ {
		for x := 1; x <= w; x++ {
			if s[x][y] {
				jo[x][y] = jo[x][y-1] + 1
				sa[x][y] = sa[x-1][y] + 1
			}
		}
	}
	for y := h; y >= 1; y-- {
		for x := w; x >= 1; x-- {
			if s[x][y] {
				ge[x][y] = ge[x][y+1] + 1
				yu[x][y] = yu[x+1][y] + 1
			}
		}
	}

	// 最大値の計算
	res := 0
	for y := 1; y <= h; y++ {
		for x := 1; x <= w; x++ {
			v := jo[x][y] + ge[x][y] + sa[x][y] + yu[x][y] - 3
			if v > res {
				res = v
			}
		}
	}

	// 出力
	fmt.Println(res)
}


Measured memory_bytes: 139592
#include<stdio.h>
 
int main(){
    int a,b,c,x,y;
    while(scanf("%d %d",&a,&b)!=EOF){
        x=a;
        y=b;
        if(a<b){
            c=a;
            a=b;
            b=c;
        }
        while(b!=0){
            c=a%b;
            a=b;
            b=c;
        }
        printf("%d %d\n",a,(x/a)*y);
    }
    return 0;
}

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

int main(){
  int n, t;
  cin >> n >> t;
  set<int> s;
  rep(i,n) {
    int a;
    cin >> a;
    s.insert(a+t);
  }
  int ans = 0;
  int p = 0;
  for(auto k : s) {
    ans += min(t,k-p);
    p = k;
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
	int a, b, c;
	cin>>a>>b>>c;
    a=a + b + c;  
    b=a-(b+c); 
    c=a-(b+c);   
    a=a-(b+c);   
    cout<<a<<" "<<b<<" " <<c<<endl; 
  
    return 0; 
} 

Measured memory_bytes: 3556
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
void init()
{
    int n=0,sum=0;
    for(int i=1; i<=100; i++)
    {
        printf("%d %d\n",n,sum);
        n^=i;
        sum^=n;
    }
}
long long xo(long long x)///A0xorA1...xorAx
{
    long long n=0,sum=0;
    if(x<=7)
        for(long long i=1; i<=x; i++)
            {
                n^=i;
                //sum^=n;
            }
    else
    {
        long long m=x;
        m-=7;
        long long pos=m%8;
        for(long long i=x-pos+1; i<=x; i++)
            {
                n^=i;
                //sum^=n;
            }
    }
    return n;
}
int main()
{
    long long T,l,r;
    //init();
   scanf("%lld%lld",&l,&r);
        //cout << xo(r) << " " << xo(l-1) << endl;
        printf("%lld\n",xo(r)^xo(l-1));

    return 0;
}


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

	int main(){
      int W,H,N;
      cin >> W >> H >> N;
      int x,y,a;
      int l=0,r=W,d=0,u=H;
      for (int i;i<N;i++){
        cin >> x >> y >> a;
        if (a==1){
          l=max(x,l);
        }
        if (a==2){
          r=min(x,r);
        }
        if (a==3){
          d=max(y,d);
        }
        if (a==4){
          u=min(y,u);
        }
      }
      if (r>l and u>d){
        cout << (r-l)*(u-d);
      }
      else{
        cout << 0;
      }
    }


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    ll A, B, C;
    cin >> A >> B >> C;

    cout << min(B / A, C) << endl;

    return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int n;
  while (cin >> n, n) {
    int cnt[10] = {};
    for (int i = 0; i < n; i++) {
      int c;
      cin >> c;
      cnt[c]++;
    }
    for (int i = 0; i < 10; i++) {
      if (cnt[i] == 0) cout << "-" << endl;
      else {
        for (int j = 0; j < cnt[i]; j++) {
          cout << "*";
        }
        cout << endl;
      }
    }
  }

  return 0;
}


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

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

    for (int i = 0; i < s.length(); i++)
    {
        if (i % 2 == 0)
        {
            cout << s[i];
        }
    }
    cout << endl;

}

Measured memory_bytes: 512
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int N;
    cin >> N;
    int d[N], sum = 0;
    for (int i = 0; i < N; i++)
        cin >> d[i];

    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            sum += d[i] * d[j];
        }
    }
    cout << sum << endl;
    return 0;
}

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

using namespace std;

int main(){
  int n;
  vector<int> Stop, Free;

  while(cin >> n){
    if(n == 0){
      n = Stop[Stop.size()-1];
      Stop.pop_back();
      Free.push_back(n);
    }else{
      Stop.push_back(n);
    }
  }

  for(vector<int>::size_type i=0; i != Free.size(); ++i){
    cout << Free[i] << endl;
  }

  return 0;
}

Measured memory_bytes: 0