akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
public class Main {
	
	public static class unionfind{
		int[] parent;
		int[] rank;
		int[] size;
		public unionfind(int n){
			this.parent = new int[n+1];
			this.rank = new int[n+1];
			this.size = new int[n+1];
			for(int i = 1; i <= n; i++) set(i);
		}
		public void set(int i) {
			parent[i] = i;
			rank[i] = 0;
			size[i] = 1;
		}
		public int find(int i) {
			if (i == parent[i])
				return parent[i];
			else
				return parent[i] = find(parent[i]);
			
		}
		public boolean same(int x, int y){
			return find(x) == find(y);
		}
		public void unite(int x, int y) {
			int xroot = find(x);
			int yroot = find(y);
			if(xroot == yroot)
				return;
			if(rank[xroot] > rank[yroot]) {
				parent[yroot] = xroot;
				size[xroot] += size[yroot];
			}
			else if(rank[xroot] < rank[yroot]) {
				parent[xroot] = yroot;
				size[yroot] += size[xroot];
			}
			else {
				parent[yroot] = xroot;
				size[xroot] += size[yroot];
				rank[xroot]++;
			}
		}
		public int getsize(int i) {
			return size[find(i)];
		}
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int K = sc.nextInt();
		StringBuilder ans = new StringBuilder();
		int[] edgenum = new int[N+1];
		unionfind u = new unionfind(N);
		for (int i = 1; i <= M; i++) {
			int A = sc.nextInt();
			int B = sc.nextInt();
			u.unite(A, B);
			edgenum[A]++;
			edgenum[B]++;
		}
		int[] x = new int [N+1];
		for(int i = 1; i <= N; i++)
			x[i] = u.getsize(i) - edgenum[i] - 1;
		for (int i = 1; i <= K; i++) {
		        int a = sc.nextInt();
		        int b = sc.nextInt();
		        if(u.same(a, b)) {
		        	x[a]--;
		        	x[b]--;
		        }
		}
		for(int i = 1; i <= N; i++) {
			ans.append(x[i] + " ");
		}
		System.out.println(ans);

	}

}

Measured memory_bytes: 96816
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	int a, b;
	cin >> a >> b;
	if (a >= 1 && a <= 9 && b <= 9) {
		cout << a * b;
	}
	else {
		cout << -1;
	}
	cout << endl;
}

Measured memory_bytes: 888
N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]

OK = [0 for i in range(N)]
for i in range(Q):
    OK[A[i]-1] += 1
for i in range(N):
    if K>Q:
        print('Yes')
    elif K<=Q and OK[i]>Q-K:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 56536
#include<iostream>
#include<bitset>
#define DIM 50005
#define f first
#define s second
using namespace std;
int n, m, i, t, x;
int c[DIM], num[DIM];
bitset<DIM> a[DIM], d, aux;
char sol[2 * DIM];
pair<int, int> v[2 * DIM];
int main(){
    cin>> n >> m >> t;
    for(i = 1; i <= m; i++){
        cin>> v[i].f >> v[i].s;
    }
    if(t == 2){
        if(n == 2){
            cout<< -1;
            return 0;
        }
        for(i = 1; i <= n; i++){
            c[i] = i;
            num[i] = 1;
        }
        for(i = m; i >= 1; i--){
            if(num[ c[ v[i].f ] ] > num[ c[ v[i].s ] ]){
                sol[i] = 'v';
                num[ c[ v[i].f ] ]--;
                num[ c[ v[i].s ] ]++;
                c[ v[i].f ] = c[ v[i].s ];
            }
            else{
                sol[i] = '^';
                num[ c[ v[i].f ] ]++;
                num[ c[ v[i].s ] ]--;
                c[ v[i].s ] = c[ v[i].f ];
            }
        }
    }
    else{
        for(i = 1; i <= n; i++){
            a[i][i] = d[i] = 1;
        }
        for(i = m; i >= 1; i--){
            aux = (a[ v[i].f ] | a[ v[i].s ]);
            a[ v[i].f ] = a[ v[i].s ] = aux;
        }
        for(i = 1; i <= n; i++){
            d &= a[i];
        }
        for(i = 1; i <= n; i++){
            if(d[i] == 1){
                x = i;
                break;
            }
        }
        if(i == n + 1){
            cout<< -1;
            return 0;
        }
        c[x] = 1;
        for(i = m; i >= 1; i--){
            if(c[ v[i].f ] == 1){
                sol[i] = '^';
                c[ v[i].s ] = 1;
            }
            else{
                if(c[ v[i].s ] == 1){
                    sol[i] = 'v';
                    c[ v[i].f ] = 1;
                }
                else{
                    sol[i] = '^';
                }
            }
        }
    }
    cout<< sol + 1;
}


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

int main(){
    int N, A, T; cin >> N >> T >> A;
    int ans = -1; double cur = 1e8;

    rep(i,N){
        int H; cin >> H;
        double temp = T - H*0.006;
        double dif = abs(A - temp);
        if(cur > dif) {cur = dif; ans = i;}
    }
    cout << ans+1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fr first
#define sc second
#define N 300009
#define inf 2e16
#define pi pair<ll,ll>
#define pb push_back
using namespace std;
typedef long long ll;
void slv()
{
}
vector<int>adj[N];
bool vis[N];
int dis[N];
void vfs(int s)
{
    queue<int>q;
    q.push(s);
    dis[s]=0;
    vis[s]=1;
    while (!q.empty())
    {
        int u=q.front();
        q.pop();
        for(auto v : adj[u])
        {
            if(!vis[v])
            {
                vis[v]=1;
                dis[v]=dis[u]+1;
                q.push(v);
            }
        }
    }
    
}
int main()
{
    int n,m;
    cin>>n>>m;
    while(m--)
    {
        int u,v;
        cin>>u>>v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    vfs(1);
    if(dis[n]==2) puts("POSSIBLE");
    else puts("IMPOSSIBLE");
    return 0;
}


Measured memory_bytes: 18668
#include<stdio.h>
#define abs(a) (a>0) ? (a) : (-(a))

int main()
{
    int n,x,i,sa,karisa,karisamin,city[100010],flag=1;
	scanf("%d %d",&n,&x);
	city[0]=x;
	sa=1000000000;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&(city[i]));
		karisa=abs((city[i]-city[i-1]));
		if(sa>karisa)sa=karisa;
	}
	karisamin=sa;
	while(flag)
	{
		flag=0;
		for(i=1;i<=n;i++)
		{
			karisa=abs(((city[i]%sa)-(city[i-1]%sa)));
			if(karisa!=0)
			{
				flag=1;
				if(karisamin>karisa)karisamin=karisa;
			}
		}
		if(flag==1)sa=karisamin;
		if(sa==1)flag=0;
	}
	
    printf("%d",sa);
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <unordered_set>
#include <unordered_map>

using namespace std;
const int MAXN = 100001;
int dp[MAXN];
vector<int> v[MAXN];

int f(int i)
{
    if(dp[i]!=0) return dp[i];
    int val = -1;
    for(int j : v[i]) val = max(val,f(j));
    return dp[i] = val+1;
}

int main()
{
    int N, M;
    cin >> N >> M;
    for(int i = 0; i < M; i++)
    {
        int x, y;
        cin >> x >> y;
        v[x].push_back(y);
    }
    for(int i = 1; i <= N; i++) dp[i] = 0;
    int best = 0;
    for(int i = 1; i <= N; i++) best = max(best,f(i));
    cout << best;
}

Measured memory_bytes: 8192
# coding: utf-8


def solve(*args: str) -> str:
    n, y = map(int, args[0].split())

    man = 0
    while man <= n:
        gosen = 0
        while gosen <= n-man:
            sen = n-man-gosen
            if y//1000 == (10*man)+(5*gosen)+sen:
                return '{} {} {}'.format(man, gosen, sen)

            gosen += 1
        man += 1

    return '-1 -1 -1'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


Measured memory_bytes: 3060
#include<iostream>

using namespace std;

int main(void){

    int m, f, r, T;

    char G;

    while(true){

        cin >> m >> f >> r;

        T = m + f;

        if(m == -1 && f == -1 && r == -1)break;

        if(m == -1 || f == -1 ) G = 'F';
        else{
             if(T >= 80) G = 'A';
             if(T >= 65 && T < 80) G = 'B';
             if(T >= 50 && T < 65) G = 'C';
             if(T >= 30 && T < 50) {
                   if(r >= 50) G = 'C';
                   else{G = 'D';
                   }
             }    
        }
        if(T < 30) G = 'F';

        cout << G << endl;

    }

return 0;

}

Measured memory_bytes: 1156
m,d = map(int, input().split())
res = 0
for i in range(1,m+1):
  for j in range(1,d+1):
    if j >= 22 and j % 10 >= 2 and int(str(j)[0]) * int(str(j)[1]) == i:
      res += 1
print(res)


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

#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif

struct m32 {
  static unsigned mod, lg;
  static uint64_t r;
  static void set_mod(int _mod = mod) {
    assert(_mod >= 2);
    mod = _mod;
    lg = __lg(mod - 1);
    r = ((__uint128_t(1) << (lg + 64)) + mod - 1) / mod;
  }
  unsigned v;
  m32(int x = 0) : v(x) { assert(0 <= x and x < (int)mod); }
  m32(long long x) : v((x %= mod) < 0 ? x + mod : x) {}
  m32 operator-() const { return m32() -= *this; }
  m32& operator+=(m32 b) {
    if ((int)(v += b.v - mod) < 0) v += mod;
    return *this;
  }
  m32& operator-=(m32 b) {
    if ((int)(v -= b.v) < 0) v += mod;
    return *this;
  }
  m32& operator*=(m32 b) {
    auto a = (uint64_t)v * b.v;
    v = a - (uint64_t)((__uint128_t(a) * r >> lg) >> 64) * mod;
    return *this;
  }
  friend m32 operator+(m32 a, m32 b) { return a += b; }
  friend m32 operator-(m32 a, m32 b) { return a -= b; }
  friend m32 operator*(m32 a, m32 b) { return a *= b; }
  friend bool operator==(m32 a, m32 b) { return a.v == b.v; }
};
unsigned m32::mod, m32::lg;
uint64_t m32::r;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n >> m32::mod;
  m32::set_mod();
  vector dp(n, m32());
  dp[0] = 1;
  for (int i = 1; i < n; ++i) {
    int dy = min(i - 1, n - i);
    for (int s = 0; s + 1 + dy < n; ++s) {
      dp[s + 1 + dy] += dp[s];
    }
  }
  m32 res;
  for (int s = 0; s < n; ++s) {
    res += dp[s] * (n - s);
  }
  cout << res.v << '\n';
}


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

using namespace std;

// 多次元 mul_array<int, 1, 2, 3> a
//template <typename T, std::size_t... Ns>
//struct index_reverse_for_array;
//template <typename T, std::size_t N, std::size_t... Ns>
//struct index_reverse_for_array<T, N, Ns...> { using type = std::array< typename index_reverse_for_array<T, Ns...>::type, N>; };
//template <typename T, std::size_t N>
//struct index_reverse_for_array<T, N> { using type = std::array<T, N>; };
//template <class T, std::size_t... Ns> using mul_array = typename index_reverse_for_array<T, Ns...>::type;
//
//using u32 = uint32_t;
//using s32 = uint32_t;
//using u64 = uint64_t;
//using s64 = uint64_t;

int main() {
    //cout << fixed << setprecision(10);

    while (true) {
        int w, h;
        cin >> h >> w;
        if (w == 0 && h == 0) break;

        bool f = true;
        int www, hhh;
        for (int s = w * w + h * h; f; s++) {
            int i;
            if (s == w * w + h * h) i = h + 1;
            else i = 1;

            for (; i <= s && f; i++) {
                if (i <= 150 && f) {
                    hhh = i;
                    if (s - (i * i) <= 0)
                        break;
                    double ww = sqrt(s - (i * i));
                    www = sqrt(s - (i * i));
                    if (ww == www && hhh < www)
                        f = false;
                }
            }
        }

        cout << hhh << " " << www << endl;

    }

    return 0;
}






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

#define M 16777216
#define FOUND 1
char H[M];

int getChar( char ch )
{
	if( ch == 'A') {
		return 1;
	} else if( ch == 'C') {
		return 2;
	} else if( ch == 'G') {
		return 3;
	} else if( ch == 'T') {
		return 4;
	}
	return 0;
}

int getKey( char str[] )
{
	int i;
	int key = 0, base = 1;
	for ( i=0; '\0'!=str[i]; i++ ) {
		key += base*( getChar( str[i] ) );
		base = base + (base << 2);
	}
	return key;
}

int find( char str[] )
{
	if( FOUND == H[ getKey( str ) ] ) {
		return FOUND;
	} else {
		return 0;
	}
}

void insert( char str[] )
{
	H[ getKey( str ) ] = FOUND;
	return;
}

int main() 
{
	int i, n;
	char str[14], com[9];
	
	for ( i=0; i<M; i++ ) {	H[i] = '\0'; }
	
	scanf( "%d", &n );
	int j;
	for ( j=0; j<n; j++ ) {
		scanf( "%s %s", com, str );
		if ( com[0] == 'i' ){
			insert( str );
		} else {
			if( find( str ) ){
				printf("yes\n");
			} else {
				printf("no\n");
			}
		}
	}

    return 0;
}

Measured memory_bytes: 16968
#include <bits/stdc++.h>
#define REP(i,n)   for(int i=0;i<(n);++i)
#define ALL(v)     (v).begin(),(v).end()
#define debug(x)   cerr<<#x<<": "<<(x)<<endl
using namespace std;
using llong = long long;
using vi    = vector<int>;
using vvi   = vector<vi >;
using vvvi  = vector<vvi >;
using pii   = pair<int,int>;
constexpr int    INF=1e9;
constexpr double EPS=1e-9;
constexpr int    MOD=1e9+7;
template<class Type>
void line(const Type &a){int cnt=0;for(const auto &elem:a){cerr<<(cnt++?' ':'>');cerr<<elem;}cerr<<endl;}

struct UnionFind{
	vi par;		//par[i]:=(0以上の場合iの親, 0未満の場合はiを含むグループのサイズ).
	int num;	//num:=(グループの数).
	
	UnionFind(int n):par(n,-1),num(n){}//constructor.
	
	void init(){fill(ALL(par),-1), num=par.size();}
	int root(int x){return (par[x]<0)?x:par[x]=root(par[x]);}//recrusion.
	int size(int x){return -par[root(x)];}
	bool same(int x,int y){return root(x)==root(y);}
	bool unite(int x,int y){
		x=root(x), y=root(y);
		if(x==y) return false;//Do nothing.
		if(size(x)<size(y)) swap(x,y);//merge technique(y to x).
		par[x]+=par[y];
		par[y]=x;
		num--;
		return true;
	}
};

int main(){
	int n,q;
	cin>>n>>q;
	
	UnionFind ob(n);
	REP(i,q){
		int t,u,v;
		cin>>t>>u>>v;
		
		if(t==0) ob.unite(u,v);
		else cout<<(ob.same(u,v)?1:0)<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 4052
//BISMILLAH
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ve vector<int>
#define FOR(n)          for(int i=0; i<(int)(n); ++i)


int main()
{
    string s,t;
    cin>>s>>t;
    int ssize=s.size(),tsize=t.size();

    int ans=INT_MAX;

    for(int i=0;i<ssize-tsize+1;i++)
    {
        int temp=0;

        for(int j=0;j<tsize;j++) //brute force
        {
            if(s[i+j]!=t[j]) temp++;
        }
        ans=min(ans,temp);
    }

    cout<<ans<<endl;
}


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

int main() {
  int N,count=2;
  cin>>N;
  vector<char> S(N);
  rep(i,N) cin>>S.at(i);
  sort(S.begin(),S.end());
  vector<int> num;
  if(N==1) cout<<1;
  else{
    S.push_back(10);
    for(int i=1;i<N+1;i++){
      if(S.at(i)==S.at(i-1)) count++;
      else{
        num.push_back(count);
        count=2;
      }
    }
    int64_t ans=1;
    rep(i,num.size()){
      ans*=num.at(i);
      ans%=MOD;
    }
    cout<<ans-1;
  }
}



Measured memory_bytes: 3724
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int n,k; cin >> n >> k;
    int ans = 0;
    while (n > 0) {
        n /= k;
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import math
a,b,c=map(float,input().split())
C=math.radians(c)
D=math.sin(C)*a*b
S=D/2
E=a**2+b**2-2*a*b*math.cos(C)
F=math.sqrt(E)
L=a+b+F
if C<90:
    h=b*math.sin(C)
elif C==90:
    h=b
else:
    h=b*math.sin(180-C)
print(S,L,h)


Measured memory_bytes: 5692
x, n = map(int, input().split())
p = list(map(int, input().split()))

li = []


for i in range(-101, 201):
    if not i in p:
        li.append(i)

zzz = float('inf')

for i in li:
    if zzz > abs(x - i):
        zzz = abs(x - i)
        ans = i


print(ans)


Measured memory_bytes: 61768
using System;
using System.Linq;
using System.Collections.Generic;

namespace ABC
{
    class ProgramB
    {
        static void Main(string[] args)
        {
            var x = long.Parse(Console.ReadLine());
            var result = 0L;
            var a = 100L;
            while (a < x)
            {
                a = a + (a / 100L);
                result++;
            }

            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 27456
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<stdlib.h>
#include<set>
#include<climits>
#include<cmath>  
#include<memory.h> 
#include<sstream>
#include<time.h>
#include<iomanip>
using namespace std;
const unsigned long long BIGEST=1000000000000000000+1000000000000000000;
const long long BIGER=1000000000000000000;
const int BIG=1000000000;
const int MOD=1000000007;
const long long LMOD=998244353;
//const long long LMOD=1000000007;
#define Fi first
#define Se second
#define P2 pair
#define Pii pair<int,int>
#define Cb make_pair
#define Ll long long
#define Ull unsigned long long
#define Snf scanf
#define Prf printf
#define Pb push_back
#define Stc stack
#define Vct vector
#define Ret return
#define Sz size
#define Ins insert
int l[2005][2005];
int r[2005][2005];
int u[2005][2005];
int d[2005][2005];
int n,m;
char mp[2005][2005];
int main()
{
	Snf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
	{
		Snf("\n");
		for(int j=1;j<=m;j++)
		{
			Snf("%c",&mp[i][j]);
		}
	}
	for(int i=1;i<=n;i++)
	{
		mp[i][0]='#';
		mp[i][m+1]='#';
	}
	for(int i=1;i<=m;i++)
	{
		mp[0][i]='#';
		mp[n+1][i]='#';
	}
	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=m;j++)
		{
			if(mp[i][j]=='#')
			{
				l[i][j]=j;
				u[i][j]=i;
			}
			else
			{
				l[i][j]=l[i][j-1];
				u[i][j]=u[i-1][j];
			}
		}
	}
	for(int i=n+1;i>=1;i--)
	{
		for(int j=m+1;j>=1;j--)
		{
			if(mp[i][j]=='#')
			{
				r[i][j]=j;
				d[i][j]=i;
			}
			else
			{
				r[i][j]=r[i][j+1];
				d[i][j]=d[i+1][j];
			}
		}
	}
	int s=0;
	
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			if(mp[i][j]=='#')
			{
				//cout<<"* ";
			}
			else
			{
				s=max(s,r[i][j]-l[i][j]+d[i][j]-u[i][j]-1-2);
				//cout<<r[i][j]-l[i][j]+d[i][j]-u[i][j]-1-2<<" ";
			}
		}
		//cout<<endl;
	}
	Prf("%d",s);
	return 0;
}

Measured memory_bytes: 66944
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<set>
using namespace std;
int gcd(int a, int b) {
	int c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}
	return b;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};
int main() {
	int i, p, ns[33], nt[33];
	char s[222222], t[222222];
	cin >> s >> t;
	for (i = 0; i < 26; i++) {
		ns[i] = -1;
		nt[i] = -1;
	}
	p = 1;
	for (i = 0; s[i] != '\0'; i++) {
		if (ns[s[i]-'a'] == -1) {
			ns[s[i]-'a'] = p;
			p++;
		}
	}
	p = 1;
	for (i = 0; t[i] != '\0'; i++) {
		if (nt[t[i]-'a'] == -1) {
			nt[t[i]-'a'] = p;
			p++;
		}
	}
	for (i = 0; s[i] != '\0'; i++) {
		if (ns[s[i]-'a'] != nt[t[i]-'a']) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template<typename T> using v2 = vector<vector<T>>;
template<typename T> inline v2<T> fill(int r, int c, T t){return v2<T>(r, vector<T>(c, t));}

int n;
int sz = 55556;
vector<bool> prime;
void seive(){
    prime = vector<bool>(sz, true);
    int s = sqrt(sz);
    for(int i = 2; i <= s; i++){
        if(!prime[i]) continue;
        for(int j = i*i; j < sz; j+=i){
            prime[j] = false;
        }
    }
}

void solve(){
    cin >> n;
    seive();
    int cnt = 0;
    for(int i = 2; i < sz; i++){
        if(prime[i] && i%5==1){
            cout << i << " ";
            cnt++;
            if(cnt == n){
                cout << '\n';
                return;
            }
        }
    }
    assert(false);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}


Measured memory_bytes: 3708
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

void SieveOfEratosthenes(vector<int>& v, int n){
    vector<bool> t(n+1, true);
    for (int i = 2; i <= n; i++){
		if (!t[i]) { continue; }

		v.push_back(i);
		for (int j = 2; i*j <= n; j++){
	    	t[i*j] = false;
		}
    }
}

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

	vector<int> v;
	SieveOfEratosthenes(v, 1000000);
	int ans = *lower_bound(v.begin(), v.end(), x);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1020
class Range
  def binary_search
    ng = first
    ok = last

    while (ok - ng).abs > 1
      mid = (ok + ng) / 2

      if yield(mid)
        ok = mid
      else
        ng = mid
      end
    end

    ok
  end
end

N = gets.to_i

n = (0..(10 ** 8)).binary_search { |n| (n * (1 + n)) / 2 >= N }
v = (n * (1 + n)) / 2
e = v - N

(1..n).each do |i|
  next if i == e

  puts i
end



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

using namespace std;
int main(int argc, char *argv[]) {
	int n, m;
	cin >> n >> m;
	int l[m];
	int r[m];
	for (int i = 0; i < m; i++) {
		cin >> l[i] >> r[i];
	}
	
	int l_max = INT_MIN;
	int r_min = INT_MAX;
	for (int i = 0; i < m; i++) {
		l_max = max(l[i], l_max);
		r_min = min(r[i], r_min);
	}
	
	cout << max(r_min - l_max + 1, 0) << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
long long lW[300002],lE[300002],rW[300002],rE[300002];
int main(){
    long long n;
    string s;
    cin>>n;
    cin>>s;
    
    for(int i=0;i<s.size();i++){
        if(s[i]=='W'){
            lW[i]=lW[i-1]+1;
            lE[i]=lE[i-1];
        }
        else{
            lE[i]=lE[i-1]+1;
            lW[i]=lW[i-1];
        }
    }
    for(int i=s.size()-1;i>=0;i--){
        if(s[i]=='W'){
            rW[i]=rW[i+1]+1;
            rE[i]=rE[i+1];
        }
        else{
            rE[i]=rE[i+1]+1;
            rW[i]=rW[i+1];
        }
    }
    long long target=1000000;
    for(int i=0;i<s.size();i++){
        target=min(target,lW[i-1]+rE[i+1]);

    }
    cout<<target;
}

Measured memory_bytes: 9988
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
using namespace std;
typedef long long ll;

int main(){
int n;cin>>n;
vector<int> a(n),b(n);
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i<n;i++)cin>>b[i];
reverse(b.begin(),b.end());
vector<int> aa(n),bb(n);
aa[0]=a[0];bb[0]=b[0];
for(int i=1;i<n;i++){
    aa[i]=aa[i-1]+a[i];
    bb[i]=bb[i-1]+b[i];
}
reverse(bb.begin(),bb.end());
int ans=0;
for(int i=0;i<n;i++){
    ans=max(aa[i]+bb[i],ans);
}
cout<<ans;


}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> l_l;
typedef pair<int,int> i_i;
const ll mod=1e9+7;
const int inf=1<<30;

vector<vector<int> > to;
int color[100010];
bool isbi=true;
void dfs(int v,int c=0){
  color[v]=c;
  rep(i,to[v].size()){
    int nv=to[v][i];
    if(color[nv]==-1) dfs(nv,1-c);
    else if(color[nv]==1-c) continue;
    else isbi=false;
  }
}

int main(){
  ll N,M;
  cin >> N >> M;
  to.resize(N);
  rep(i,N) color[i]=-1;
  rep(i,M){
    int a,b;
    cin >> a >> b;
    a--; b--;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  dfs(0);
  ll ans;
  if(isbi){
    ll b=0,w=0;
    rep(i,N){
      if(color[i]==0) b++;
      else w++;
    }
    ans=b*w-M;
  }
  else{
    ans=N*(N-1)/2-M;
  }
  cout << ans << endl;
}

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

using ll = long long;

const int mod = 998244353;

struct mint {
    ll x;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const {return mint(-x);}
    mint& operator+=(const mint a) {
        if((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {(x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const {return mint(*this) += a;}
    mint operator-(const mint a) const {return mint(*this) -= a;}
    mint operator*(const mint a) const {return mint(*this) *= a;}
    mint pow(ll t) const {
        if(!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if(t & 1) a *= *this;
        return a;
    }

    mint inv() const {return pow(mod - 2);}
    mint& operator/=(const mint a) {return *this *= a.inv();}
    mint operator/(const mint a) const {return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) {return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) {return os << a.x;}

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> l(k), r(k);
    for(int i = 0; i < k; i++) cin >> l[i] >> r[i];
    vector<mint> dp(n + 1);
    dp[1] = 1;
    dp[2] = -1;
    for(int i = 1; i <= n; i++) {
        dp[i] += dp[i - 1];
        for(int j = 0; j < k; j++) {
            if(i + l[j] <= n) dp[i + l[j]] += dp[i];
            if(i + r[j] <= n) dp[i + r[j] + 1] -= dp[i];
        }
    }
    cout << dp[n].x << endl;
    return 0;
}


Measured memory_bytes: 4812
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int[] left = new int[n + 1];
        for (int i = 0; i < a.length; i++) {
            left[i + 1] = gcd(left[i], a[i]);
        }

        int[] right = new int[n + 1];
        for (int i = n - 1; i >= 0; i--) {
            right[i] = gcd(right[i + 1], a[i]);
        }

        int gcd = 0;
        for (int i = 0; i < n; i++) {
            gcd = Math.max(gcd(left[i], right[i + 1]), gcd);
        }
        System.out.println(gcd);

    }

    public static int gcd(int x, int y) {
        if (y == 0)
            return x;
        return gcd(y, x % y);
    }
}


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

class Main {

    public static void main(String[] args) {

	final Scanner stdin = new Scanner(System.in);

	while ( stdin.hasNextLine() ) {
	    String[] input = stdin.nextLine().split( " " );

	    final double xA = Double.parseDouble( input[0] );
	    final double yA = Double.parseDouble( input[1] );
	    final double xB = Double.parseDouble( input[2] );
	    final double yB = Double.parseDouble( input[3] );
	    final double xC = Double.parseDouble( input[4] );
	    final double yC = Double.parseDouble( input[5] );
	    final double xD = Double.parseDouble( input[6] );
	    final double yD = Double.parseDouble( input[7] );

	    final double v1x = xA - xB;
	    final double v1y = yA - yB;
	    final double v2x = xC - xD;
	    final double v2y = yC - yD;

	    if ( v1x * v2x + v1y * v2y == 0.0 ) {
		System.out.println( "YES" );
	    } else {
		System.out.println( "NO" );
	    }	    
	}	
    }    
}

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

int main(){
    int n, i=1, x;
    cin >> n;
    do{
        x = i;
        if (x%3 == 0) cout << " " << i;
        else{
            do{
                if (x%10 == 3){
                    cout << " " << i;
                    break;
                }
                else x /= 10;
            }while(x);
        }
    }while(++i<=n);
    cout << endl;
}


Measured memory_bytes: 3112
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.NoSuchElementException;

import javax.swing.plaf.synth.SynthSpinnerUI;

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

	public void run() {
		Scanner sc = new Scanner();
		int N = sc.nextInt();
		int M = sc.nextInt();
		String str = sc.next();
		int[] col = new int[N];
		for (int i = 0; i < N; ++i) {
			col[i] = str.charAt(i) - 'A';
		}
		ArrayList<Integer>[] g = new ArrayList[N];
		for (int i = 0; i < N; ++i) {
			g[i] = new ArrayList<>();
		}
		int[][] deg = new int[N][2];
		for (int i = 0; i < M; ++i) {
			int a = sc.nextInt() - 1;
			int b = sc.nextInt() - 1;
			g[a].add(b);
			g[b].add(a);
			++deg[a][col[b]];
			++deg[b][col[a]];
		}
		ArrayDeque<Integer> dq = new ArrayDeque<>();
		for (int i = 0; i < N; ++i) {
			if (deg[i][0] == 0 || deg[i][1] == 0) {
				dq.add(i);
			}
		}
		boolean[] delete = new boolean[N];
		Arrays.fill(delete, false);
		while (!dq.isEmpty()) {
			int cur = dq.pollFirst();
			if (delete[cur])
				continue;
			delete[cur] = true;
			--N;
			for (int dst : g[cur]) {
				--deg[dst][col[cur]];
				if (deg[dst][1] == 0 || deg[dst][0] == 0) {
					dq.addLast(dst);
				}
			}
		}
		System.out.println(N > 0 ? "Yes" : "No");
	}

	class Scanner {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[ptr++];
			else
				return -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr]))
				ptr++;
		}

		public boolean hasNext() {
			skipUnprintable();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}

		int nextInt() {
			return (int) nextLong();
		}
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

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

typedef long long ll;
ll h, w, n, m, ans, sz, M = 1e9 + 7, d[1005][1005];
ll fa[200005], iv[200005];
ll pow(ll p, ll q) {
	ll ret = 1;
	for (; q; q >>= 1, p = p * p % M) if (q & 1) ret = (ret * p) % M;
	return ret;
}
int main()
{
	ll i, j, t1, t2;
	cin >> h >> w >> n >> m;
	d[1][0] = d[1][1] = 1;
	d[0][0] = d[0][1] = 1;
//	sz = max(h, w) *2 + 5;
//	for (i = 2; i <= sz; i++) {
//		d[i][0] = 1;
//		for (j = 1; j <= i; j++) {
//			d[i][j] = (d[i - 1][j] + d[i - 1][j - 1]) % M;
//		}
//	}
	fa[0] = 1;
	for (i = 1; i <= h + w; i++) fa[i] = (fa[i - 1] * i) % M;
	iv[h + w] = pow(fa[h + w], M - 2);
	for (i = h + w - 1; i >= 0; i--) {
		iv[i] = iv[i + 1] * (i + 1) % M;
	}
	for (i = 1; i <= h - n; i++) {
		t1 = ((fa[i + m - 2] * iv[m - 1]) % M * iv[i - 1]) % M;
		t2 = (fa[h - i + w - m - 1] * iv[w - m - 1] % M * iv[h - i]) % M;
		ans = (ans + t1 * t2) % M;
//		ans = (ans + d[i + m - 2][i - 1] * d[h - i + w - m - 1][h - i]) % M;
	}
	cout << ans;
    return 0;
}


Measured memory_bytes: 4352
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N,M = map(int, lines.pop(0).split(' '))
    min_n = 0
    max_n = N
    for i in range(M):
        a,b = map(int, lines.pop(0).split(' '))
        min_n = max(a, min_n)
        max_n = min(b, max_n)
    print( max(0, max_n - min_n + 1 ) )

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Measured memory_bytes: 17428
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    int n; cin >> n;
    string in; cin >> in;
    vi a(n); rep(i, n) a[i] = (in[i] == 'o' ? 0:1);

    rep(k, 4){
        vi ass(n, -1);
        ass[0] = (k & 1) ? 1:0;
        ass[n - 1] = ((k >> 1) & 1) ? 1:0;

        bool ok = true;
        rep(_, 2 * n){
            int i  = _ % n;
            int  cur = ass[i]; assert(cur != -1);
            int  pre = ass[(i - 1 + n) % n]; assert(pre != -1);
            int& nxt = ass[(i + 1) % n];

            int val = cur ^ a[i] ^ pre;
            if(nxt != -1 and val != nxt){
                ok = false;
                break;
            }
            nxt = val;
        }
        if(ok){
            rep(i, n){
                cout << (ass[i] ? 'W':'S');
            }
            cout << endl;
            return 0;
        }
    }
    cout << -1 << endl;

    return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = n - 1; i >= 0; i--)

#define ALL(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define y0 y3487465
#define y1 y8687969

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

int N;
const int MAX_N = 100;
int L[MAX_N * 2];

int main(){
  cin >> N;
  REP(i, 2 * N) cin >> L[i];
  sort(L, L + 2 * N);
  ll ans = 0;
  REP(i, N) {
    ans += L[2 * i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    double n,sa,max=0,small=1000000;
    while(cin>>n){
        if(max<n)max=n;
        else if(small>n)small=n;
    }
    sa=max-small;
    cout<<sa<<endl;
    return 0;
}

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

int main(){
    int N,K; cin>>N>>K;
    vector<long> tree(N);
    for(int i=0;i<N;i++)cin>>tree.at(i);
    sort(tree.begin(),tree.end());
    long ans = 10000000000;
    for(int i=0;i+K-1<N;i++){
        ans = min(ans,tree.at(i+K-1)-tree.at(i));
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    map<int, int> m;
    for(int i=0; i<N; ++i){
        int tmp;
        cin >> tmp;
        m[tmp]++; 
    }
    int res = 0;
    for(auto itr = m.begin(); itr!=m.end(); itr++){
        int key = itr->first;
        int value = itr->second;
        if(key<value){
            res += value - key;
        }
        else if(key>value){
            res += value;
        }
        else continue;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 5120
n, m = map(int, input().split())
h = list(map(int, input().split()))
michi = [[] for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    michi[a-1].append(b-1)
    michi[b-1].append(a-1)
ans = 0
for i in range(n):
    t = michi[i]
    flag = True
    if len(t) != 0:
        for j in t:
            if h[i] <= h[j]:
                flag = False
    if flag:
        ans += 1
print(ans)

Measured memory_bytes: 29384
// 基本テンプレート
 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int A, B;
int D[15][15], C[110][110];
const int N = 100;
const int V = (N+1)*2;
const int E = (N+1)*(N+1) + 2*N;
const int S = V-1, T = V;
 
signed main() {
    cin >> A >> B;
    repq(i,1,A) repq(j,1,B) cin >> D[i][j];

    repq(a,0,N) repq(b,0,N) {
        repq(x,1,A) repq(y,1,B) chmax(C[a][b], D[x][y] - a*x - b*y);
    }

    repq(x,1,A) repq(y,1,B) {
        int cost = INF;
        repq(a,0,N) repq(b,0,N) chmin(cost, a*x + b*y + C[a][b]);
        if(cost != D[x][y]) {
            cout << "Impossible" << endl;
            return 0;
        }
    }

    cout << "Possible" << endl;
    printf("%lld %lld\n", V, E);
    printf("%lld %lld X\n", S, 1LL);
    printf("%lld %lld Y\n", S-1, T);
    rep(i,1,N) printf("%lld %lld X\n", i, i+1);
    rep(i,1,N) printf("%lld %lld Y\n", N+i, N+i+1);

    repq(a,0,N) repq(b,0,N) {
        int u = (a ? a   : S);
        int v = (b ? S-b : T);
        printf("%lld %lld %lld\n", u, v, C[a][b]);
    }
    printf("%lld %lld\n", S, T);
    return 0;
}

Measured memory_bytes: 384
while True:
    a,op,b=input().split()
    a,b=int(a),int(b)
    if op=='+':
        print(a+b)
    elif op=='-':
        print(a-b)
    elif op=='*':
        print(a*b)
    elif op=='/':
        print(a//b)
    else:
        break


Measured memory_bytes: 5600
import sys
n,y=map(int,input().split())

if y >10000*n:
  print("-1 -1 -1")
  sys.exit()
for i in reversed(range(y//10000+1)):
  for j in reversed(range((y-i*10000)//5000+1)):
    d=10000*i+5000*j+1000*(n-i-j)
    if y==d:
      print(i,j,n-i-j)
      sys.exit()
else:
  print("-1 -1 -1")
      
    
  
  


Measured memory_bytes: 73564
#include"bits/stdc++.h"
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	int a, b, c, d;
  	cin >> a >> b >> c >> d;
 	if(abs(a-c)<=d) cout << "Yes" << endl;
	else if(abs(a-b)<=d && abs(b-c)<=d) cout << "Yes" << endl;
	else  cout << "No" << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define IOS std::cin.tie(0),std::ios::sync_with_stdio(false)

namespace idaten {

	using namespace std;
	using ll = int_fast64_t;
	using ull = uint_fast64_t;
	using P = std::pair<int64_t, int64_t>;
	template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
	template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
	template<class Type>struct is_vector : std::false_type {};
	template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
	template <typename T> inline std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
		if (v.empty())return out;
		constexpr bool is_vector_v = is_vector<T>::value;
		if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
		else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
		return out;
	}
	inline void put() {}
	template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
	template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
	inline void putn() {}
	template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

	void solve() {
		IOS;
		int n = 8, k;
		cin >> k;
		vector<P> p(k);
		vector<vector<int>> b(n, vector<int>(n, 0));
		vector<int> s(n,-1), t(n);
		REP(i, k) {
			cin >> p[i].first >> p[i].second;
			//p[i].first--;
			//p[i].second--;
			b[p[i].first][p[i].second];
			s[p[i].first] = p[i].second;
		}
		REP(i, n) {
			t[i] = i;
		}
		vector<string> res(n);
		int dy[] = { 0,1,1,1,0,-1,-1,-1 };
		int dx[] = { 1,1,0,-1,-1,-1,0,1 };
		do {
			bool flag = true;
			REP(i, n) {
				if (s[i] >= 0 && s[i] != t[i]) {
					flag = false;
					break;
				}
			}
			if (!flag) {
				continue;
			}
			REP(i, n) {
				REP(j, n) {
					if (t[i] == j) {
						b[i][j] = 1;
					} else {
						b[i][j] = 0;
					}
				}
			}
			REP(i, n) {
				int y = i;
				int x = t[i];
				REP(j, 8) {
					FOR(k, 1, n) {
						int ny = y + dy[j] * k;
						int nx = x + dx[j] * k;
						if (0 <= ny && ny < n && 0 <= nx && nx < n) {
							if (b[ny][nx] == 1) {
								flag = false;
								break;
							}
						}
					}
				}
			}
			if (!flag) {
				continue;
			}
			string tmp;
			REP(i, n) {
				tmp = "";
				REP(j, n) {
					if (t[i] == j) {
						tmp += 'Q';
					} else {
						tmp += '.';
					}
				}
				res[i] = tmp;
			}
			break;
		} while (next_permutation(all(t)));
		REP(i, n) {
			put(res[i]);
		}
	}
} // namespace idaten

int main() {
	idaten::solve();
	return 0;
}



Measured memory_bytes: 3224
/** 
If comrades that you trust gather around you, hope can take physical form and become visible. That’s what I believe.
*/
#include <bits/stdc++.h>
using namespace std;
/**
(▀̿Ĺ̯▀̿ ̿) (ง ͠° ͟ل͜ ͡°)ง
*/
int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
    int tt = clock();
    int r; cin >> r;
    cout << 2 * r * 3.14159 << '\n';



    cerr << "TIME = " << (double) 1.0 * (clock() - tt) / CLOCKS_PER_SEC << " seconds" << endl;
	return 0;
}


Measured memory_bytes: 3800