akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <cmath>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main() {
  long long H, W;
  cin >> H >> W;

  if (H % 3 == 0 || W % 3 == 0) {
    cout << 0 << endl;
    return 0;
  }

  long long mn = H * W;
  for (int i = 1; i < H; i++) {
    long long S1 = i * W;
    long long S2 = (H - i) * (W / 2);
    long long S3 = (H - i) * ((W + 1) / 2);
    long long Smax = std::max(S1, std::max(S2, S3));
    long long Smin = std::min(S1, std::min(S2, S3));
    if (mn > Smax - Smin) mn = Smax - Smin;

    if (H - i < 2) continue;
  
    S2 = (H - i) / 2 * W;
    S3 = (H - i + 1) / 2 * W;
    Smax = std::max(S1, std::max(S2, S3));
    Smin = std::min(S1, std::min(S2, S3));
    if (mn > Smax - Smin) mn = Smax - Smin;
  }

  for (int i = 1; i < W; i++) {
    long long S1 = i * H;
    long long S2 = (W - i) * (H / 2);
    long long S3 = (W - i) * ((H + 1) / 2);
    long long Smax = std::max(S1, std::max(S2, S3));
    long long Smin = std::min(S1, std::min(S2, S3));
    if (mn > Smax - Smin) mn = Smax - Smin;

    if (W - i < 2) continue;

    S2 = (W - i) / 2 * H;
    S3 = (W - i + 1) / 2 * H;
    Smax = std::max(S1, std::max(S2, S3));
    Smin = std::min(S1, std::min(S2, S3));
    if (mn > Smax - Smin) mn = Smax - Smin;
  }

  cout << mn << endl;

  return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
N, Q = map(int,input().split())
graph = [[] for _ in range(N+1)]
point = [0] * (N+1)
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p] += x

# dfsをします。
def dfs(x, parent):
    point[x] += point[parent]
    for i in range(len(graph[x])):
        if graph[x][i] == parent:
            continue
        dfs(graph[x][i], x)
dfs(1, 0)
point_str = [str(n) for n in point]
ans = ' '.join(point_str[1:])
print(ans)

Measured memory_bytes: 232340
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define IOS cin.tie(0); ios::sync_with_stdio(false)
const int INF = 1e9;
using namespace std;

signed main() {
    int X,Y,Z,K; cin >> X >> Y >> Z >> K;
    int A[X],B[Y],C[Z];
    rep(i,X) cin >> A[i];
    rep(i,Y) cin >> B[i];
    rep(i,Z) cin >> C[i];
    vector<int> AB;
    rep(i,X){
        rep(j,Y){
            AB.push_back(A[i]+B[j]);
        }
    }
    sort(AB.begin(),AB.end(),greater<int>());
    vector<int> SUM;
    rep(i,min(K,X*Y)){
        rep(j,Z){
            SUM.push_back(AB[i]+C[j]);
        }
    }
    sort(SUM.begin(),SUM.end(),greater<int>());
    rep(i,K){
        cout << SUM[i] << endl;
    }
}

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

int n,m,k;
vector<vector<int>> fri(100010);
vector<int> seen;

void dfs(int v, int cur){
  seen[v]=cur;
  for(auto next_v:fri[v]){
    if(seen[next_v]==cur) continue;
    dfs(next_v,cur);
  }
  return;
}

int main() {
  cin>>n>>m>>k;
  vector<vector<int>> blo(100010);
  for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    fri.at(a-1).push_back(b-1);
    fri.at(b-1).push_back(a-1);
  }
  for(int i=0;i<k;i++){
    int a,b;
    cin>>a>>b;
    blo.at(a-1).push_back(b-1);
    blo.at(b-1).push_back(a-1);
  }
  seen.assign(n+2,0);
  int cur=1;
  for(int i=0;i<n;i++){
    if(seen[i]==0) dfs(i,cur++);
  }
  int memo[100010]={};
  for(int i=0;i<n;i++){
    memo[seen[i]]++;
  }
  for(int i=0;i<n;i++){
    int ans=memo[seen[i]];
    ans-=1;
    ans-=fri.at(i).size();
    for(int j=0;j<blo.at(i).size();j++){
      if(seen[i]==seen[blo.at(i).at(j)]) ans--;
    }
    cout<<ans;
    if(i!=n-1) cout<<' ';
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 12672
c=input()

import copy
pattern = []

def roop_cal(l,max_l,temp):
    if (l ==0):
        pattern.append(copy.copy(temp))
    else:
        for i in range(2):
            temp[max_l-l] = i
            roop_cal(l-1, max_l, temp)
            
l =len(c)-1
temp = [None for _ in range(l)]
roop_cal(l,l,temp)
sum_equation = 0
for i in range(len(pattern)):
    temp = []
    for j in range(len(c)):
        temp.append(c[j])
        if(j >=len(pattern[i])):
            sum_equation = sum_equation+int(''.join(map(str,temp)))
        else:
            if(pattern[i][j]==1):
                sum_equation = sum_equation+int(''.join(map(str,temp)))
                temp = []
                
print(sum_equation)

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

int main() {
	int x, y;
	cin >> x >> y;
	if (x < y) {
		int t = x;
		x = y;
		y = t;
	}
	while (x % y) {
		x = x % y;
		if (x < y) {
			int t = x;
			x = y;
			y = t;
		}
	}
	cout << y << endl;
	return 0;
}


Measured memory_bytes: 3120
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500 + j*100 + k*50 == x:
                count = count + 1
print(count)

Measured memory_bytes: 3060
#include <stdio.h>

int main(void) {
	
	int h,m,n,o;
	scanf("%d",&h);
	
	
	m=(h/60)/60;
	n=(h/60)%60;
	o=h%60;
	
	
	
	printf("%d:%d:%d\n",m,n,o);
	// your code goes here
	return 0;
}



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

#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int long long 
#define rep(i,n) for(int i=0;i<n;i++)
#define repa(i,arr,n) for(int i=arr;i<=n;i++)
#define repd(i,arr,n) for(int i=arr;i>=n;i--)
#define trav(arr,x) for(auto& arr:x)
#define all(c) c.begin(), c.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(arr) arr.size()
#define pi 3.14159265358979323846
#define MAX (1000*1000*1000+7)
#define vi vector<int>
#define pii pair<int,int>
#define pqueue priority_queue<int>
#define pdqueue priority_queue<int,vi,greater<int> >
 
const int mod=1000000007;
int power(int a,int b)
{
    int ans=1;
    while(b)
    {
        if(b&1)
        {
            ans=(ans*a)%mod;
        }
        a=(a*a);
        a%=mod;
        b>>=1;
    }
    return ans;
}


int32_t main()
{
    fast;
    multiset<int,greater<int> > temp;
    
    int n,m,a,b,ans=0;
    cin>>n>>m;
    std::vector<pii> v;

    rep(i,n)
    {
        cin>>a>>b;
        v.pb({a,b});
    }

    sort(all(v));
    int j=0;
    repa(i,1,m)
    {
        while(j<n)
        {
            //cout<<j<<endl;
            if(v[j].ff>i)
            {
                break;
            }
            temp.insert(v[j].ss);
            j++;
        }
        if(sz(temp)>0)
        {
            ans+=*temp.begin();
            auto it=temp.begin();
            temp.erase(it);
        }
        //cout<<i<<endl;
    }
    cout<<ans<<endl;
    return 0;
}

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

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int h = fs.nextInt(), w = fs.nextInt(), n = fs.nextInt();
		int max = Math.max(h, w);
		int min = Math.min(h, w);
		int ans = (n+(max-1))/max;
		System.out.println(ans);
	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

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

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

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

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

Measured memory_bytes: 21204
#include <cstdio>
#include <random>
#include <cassert>
#include <algorithm>    
#include <iostream>
#include <chrono>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <bitset>
#define pb push_back
#define mk make_pair
#define eb emplace_back
#define eps 1e-8
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
// #define int long long


using namespace std;
typedef long double ld;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef tuple<int, int, int> tiii;
typedef vector<int> vii;
typedef vector<long double> vd;
const int inf = 1e9;
const long long INF = 1e18;
const int M = 1e9 + 7;





signed main()
{
#ifndef ONLINE_JUDGE
	// freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
#endif
	int n;
	ios::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	int tot = 0;
	const int maxn = 50000;
	static int num[maxn];
	static double dp[maxn][400];
	static bool vis[maxn][400];
	int t[202], v[202];
	for(int i = 0; i < n; ++i) {
		cin >> t[i];
		for(int j = tot + 1; j <= tot + 2 * t[i]; ++j) {
			num[j] = i;
		}
		tot += 2 * t[i];
	}
	for(int i = 0; i < n; ++i) {
		cin >> v[i];
		v[i] *= 2;
	}	
	vis[0][0] = 1;
	dp[0][0] = 0;
	for(int i = 0; i < tot; ++i) {
		int k = num[i];
		for(int j = 0; j <= v[k]; ++j) {
			if(vis[i][j]) {
				int tk = num[i + 1];
				if(j + 1 <= v[tk]) {
					dp[i + 1][j + 1] =  max(dp[i + 1][j + 1], dp[i][j] + (j + j + 1) / 2.);
					vis[i + 1][j + 1] = 1;
				}
				if(j <= v[tk]) {
					dp[i + 1][j] = max(dp[i][j] + j, dp[i + 1][j]);
					vis[i + 1][j] = 1;
				}
				if(j > 0 && j <= v[tk]) {
					dp[i + 1][j - 1] = max(dp[i + 1][j - 1], dp[i][j] + (j + j - 1) / 2.);
					vis[i + 1][j - 1] = 1;
				}
			}
		}
	}
	printf("%.5f\n", dp[tot][0] / 4);


    
	return 0;
}

Measured memory_bytes: 143744
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        a: isize,
        b: isize,
        c: isize,
        d: isize,
    };
    use std::cmp::max;
    println!("{}", max(max(a * c, a * d), max(b * c, b * d)));
}


Measured memory_bytes: 2148
import javax.print.DocFlavor;
import java.awt.*;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.List;

public class Main {

    static String br = System.getProperty("line.separator");
    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String S = next();
        String T = next();

        println(T + S);
    }

    static long a(long n){
        return n < 2L ? 1L : n*a(n-2);
    }

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

    static Long nextLong() {
        return Long.parseLong(next());
    }

    static String next() {
        return sc.next();
    }

    static String nextLine(){
        return sc.nextLine();
    }

    static void println(Object o) {
        out.println(o);
        out.flush();
    }

    static void print(Object o) {
        PrintWriter out = new PrintWriter(System.out);
        out.print(o);
        out.flush();
    }
}


Measured memory_bytes: 22996
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        char[][] map = new char[h+2][w+2];
        for(int i = 0; i < h+2; i++) {
            for(int j = 0; j < w+2; j++) {
                map[i][j] = '.';
            }
        }
        for(int i = 1; i <= h; i++) {
            String s = sc.next();
            for(int j = 0; j < w; j++) {
                map[i][j+1] = s.charAt(j);
            }
        }
        int[] y = {0, 1, 0, -1};
        int[] x = {1, 0, -1, 0};
        boolean flag = true;
        for(int i = 1; i < h+1; i++) {
            for(int j = 1; j < w+1; j++) {
                if(map[i][j]=='#') {
                    boolean isOK = false;
                    for (int k = 0; k < 4; k++) {
                        if (map[i + x[k]][j+y[k]]=='#') {
                            isOK = true;
                        }
                    }
                    if(!isOK) {
                        flag = false;
                    }
                }
            }
        }
        System.out.println(flag ? "Yes" : "No");
    }
}

Measured memory_bytes: 21972
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <string>
#include <queue>
#include <numeric>
#include <ctype.h>
#include <limits>
#include <iomanip>

#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

typedef long long ll;
#define mod  998244353;

ll pow_mod(ll X, ll Y)
{
	ll y = Y;
	ll ret = 1;

	while (y > 0) {
		ret *= X;
		ret %= mod;
		y--;
	}

	return ret;
}

int main()
{
	/*int n;
	cin >> n;
	int ans = (n % 2 == 0 ? n / 2 - 1 : n / 2);
	cout << ans;*/


	int n;
	cin >> n;
	vector<ll>d(100002);
	bool ok = true;

	int a;
	rep(i, n) {
		cin >> a;
		d[a]++;
		if (i == 0 && a != 0) {
			ok = false;
		}
		if (i > 0 && a == 0)ok = false;
	}

	if (!ok) {
		cout << 0;
		return 0;
	}

	ll ans = 1;
	ll judge = d[1] + d[0];
	for (int i = 2; i <= 100000; i++) {
		if (d[i] == 0)break;
		judge += d[i];
		ans *= pow_mod(d[i - 1], d[i]);
		ans %= mod;
	}
	if (judge != n) {
		cout << 0;
		return 0;
	}
	cout << ans;

	return 0;
}

Measured memory_bytes: 1024
using System;
class Program {
    static void Main(string[] args){
        string input1 = Console.ReadLine();
        int n = int.Parse(input1);
        string[] vStr = Console.ReadLine().Split(' ');
        string[] cStr = Console.ReadLine().Split(' ');
        int res = 0;
        for(int i = 0; i < n; i++){
            int v = int.Parse(vStr[i]);
            int c = int.Parse(cStr[i]);
            if(v > c) res += v - c;
        }
        Console.WriteLine(res);
    }
}

Measured memory_bytes: 11092
def main():
    global results, S
    S = int(input())
    S_str = str(S)
    results = []
    for i in range(3, len(S_str) + 1):
        bfs(i, '')
    print(len(results))


def bfs(i, s):
    global results, S
    if i == 0:
        if int(s) <= S and len(set(s)) == 3:
            results.append(s)
        return
    i -= 1
    bfs(i, s + '3')
    bfs(i, s + '5')
    bfs(i, s + '7')


if __name__ == '__main__':
    main()


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

signed main(){
  string s;
  cin>>s;
  int N=s.size();
  int a,b,c;
  a=b=c=0;
  for(int i=0;i<N;i++){
    if(s[i]=='a')a++;
    if(s[i]=='b')b++;
    if(s[i]=='c')c++;
  }
  int out=0;
  if(a>((N-1)/3)+1)out++;
  if(b>((N-1)/3)+1)out++;
  if(c>((N-1)/3)+1)out++;
  if(out)cout<<"NO"<<endl;
  else cout<<"YES"<<endl;
}


Measured memory_bytes: 512
while True:
    x,y,s = map(int,input().strip().split(" "))
    if [x,y,s] == [0,0,0]:   #ｘは変更前税率、ｙは変更後税率、ｓは変更前税込み合計
        break
    S = []
    M = 0
    for i in range(1,s//2+1):
        for j in range(1,s-i+1):
            if  (i*(100+x)//100) + (j*(100+x)//100) == s:
                t = (i*(100+y)//100) + (j*(100+y)//100)
                if t > M:
                    M = t
    print(M)


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


int main() {
	int n,m,ans;
	cin>>n>>m;
	ans=(n-1)*(m-1);
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  string s;
  cin >> n >> s;

  map<char, int> mp;
  rep(i, 0, s.size()) mp[s[i]]++;

  ll r = mp['R'], g = mp['G'], b = mp['B'];
  ll ans = r * g * b;
  rep(i, 0, n) {
    rep(j, 0, n) {
      if (i - j < 0 || i + j >= n)
        break;
      if (s[i] != s[i - j] && s[i - j] != s[i + j] && s[i] != s[i + j])
        ans--;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// typedef pair<ll,ll> Pair;
// ll mod=1000000007;
int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll t,c,i,j,k,temp,temp2,n,m,sum=0;
    string a;
    cin >> a;
    a[2]==a[3]&&a[4]==a[5] ? cout << "Yes" : cout <<"No";

}


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

using namespace std;
const int MAXN=100005;

int n,ans=0,a[MAXN];

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i){
		int x; scanf("%d",&x);
		++a[x];
	}
	for(int i=1;i<=100001;++i) ans=max(ans,a[i-1]+a[i]+a[i+1]);
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 512
import sys
n,k=map(int,input().split())
number=[[int(i) for i in l.split()] for l in sys.stdin]
stack=[0]*(10**5+1)
for i in number:
  stack[i[0]]+=i[1]
acsum=[]
acSum=0
for i in stack:
  acSum+=i
  acsum.append(acSum)
def binary_search():
  ng=-1
  ok=10**5+1
  while abs(ng-ok)>1:
    mid=(ng+ok)//2
    if acsum[mid]>=k:
      ok=mid
    else:
      ng=mid
  return ok
print(binary_search())

Measured memory_bytes: 28848
#include <iostream>
#include<cstdio>
#include<stdio.h>
using namespace std;

int main() {
	int a, b;
	int d, r;
	double f;
	cin >> a;
	cin >> b;
	r = a % b;
	d = a / b;
	f = double(a) / double(b);

	printf("%d %d %.5f", d, r, f);
	return 0;
}

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  long long r;
  scanf("%lld", &r);

  put(r * r);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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;
}

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 999999999;
//最小公約数
int gcd(int a, int b) {
 return b != 0 ? gcd(b, a % b) : a;
}
void solve() {
	int N, X; cin >> N >> X;
	vector<int> x(N);
	for (int i = 0; i < N; ++i) {
		cin >> x[i];
		//現在位置との距離(絶対値)を格納した配列を作る
		x[i] = abs(X - x[i]);
	}
	int ans = x[0];
	//全ての距離を割り切れる中で最大の数(最大公約数)をユークリッド互除法で求める
	for (int i = 1; i < x.size(); ++i) {
		ans = gcd(ans, x[i]);
	}
	cout << ans << endl;
	return;
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 3696
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N,M;
  cin>>N>>M;
  vector<vector<int>> A(M+1);
  for(int i=0;i<N;i++){
    int a,b;
    cin>>a>>b;
    if(a<=M)
      A[a].push_back(b);
  }
  priority_queue<int> B;
  int k=0;
  for(int i=1;i<=M;i++){
    for(int j:A[i])
      B.push(j);
    if(!B.empty()){
      k+=B.top();
      B.pop();
    }
  }
  cout<<k<<endl;
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

const ll mod=1e9+7;

const int N=300;
// i日目,訪れた頂点数j,町1と強連結成分をなす町の個数k
ll dp[N+1][N+1][N+1]={0};

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

    dp[0][1][1]=1;
    rep(i,m)for(int j=1; j<=N; ++j)for(int k=1; k<=j; ++k)
    {
        // 町1との強連結成分内の町に行く
        (dp[i+1][j][j]+=dp[i][j][k]*k)%=mod;
        // 町1との強連結成分外の訪問済みの町に行く
        (dp[i+1][j][k]+=dp[i][j][k]*(j-k))%=mod;
        // 未訪問の町に行く
        if(j<N) (dp[i+1][j+1][k]+=dp[i][j][k]*(n-j))%=mod;
    }

    cout << dp[m][n][n] << endl;
    return 0;
}


Measured memory_bytes: 212608
#include <bits/stdc++.h>
using namespace std;
int n, cnt, a[101];
int main()
{
    cin>>n;
    for (int i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    for (int i=1; i<=n; i++)
    {
        for (int j=i+1; j<=n; j++)
        {
            for (int k=j+1; k<=n; k++)
            {
                if (a[i]+a[j]>a[k] && a[i]+a[k]>a[j] && a[k]+a[j]>a[i])
                {
                    if (a[i]!=a[j] && a[i]!=a[k] && a[k]!=a[j])
                    {
                       // cout<<i<<" "<<j<<" "<<k<<endl;
                        cnt++;
                    }
                }
            }
        }
    }
    cout<<cnt;
}


Measured memory_bytes: 3644
import java.util.Scanner;
import java.util.Stack;

class Main {
    private static void solve() {
        final Scanner scanner = new Scanner(System.in).useDelimiter("\n");

        while (scanner.hasNext()) {
            String[] input = scanner.next().split("\\s+");
            Stack<Double> stack = new Stack<Double>();
            for (String string: input) {
                final char c = string.charAt(0);
                if (!Character.isDigit(c) && string.length() == 1) {
                    double op2 = stack.pop();
                    double op1 = stack.pop();
                    if (c == '+') {
                        stack.push(op1 + op2);
                    } else if (c == '-') {
                        stack.push(op1 - op2);
                    } else if (c == '*') {
                        stack.push(op1 * op2);
                    } else if (c == '/') {
                        stack.push(op1 / op2);
                    }
                } else {
                    stack.push(Double.valueOf(string));
                }
            }
            System.out.println(String.format("%.6f", stack.pop()));
        }
    }

    public static void main(String... args) {
        solve();
    }
}

Measured memory_bytes: 12000
//	Sha3ban_El-Bay
#include<bits/stdc++.h>
using namespace std ;
//======================================================
#define El_Bay ios_base::sync_with_stdio(false);cin.tie(NULL);
#define forn(i,n)  for (int i = 0; i < (int)(n); ++i)
#define for1(i,n)  for (int i = 1; i <=(int)(n); ++i)
#define all(v)     (v).begin(),(v).end()
#define ull        unsigned long long
#define PI         3.14159265359
#define ll         long long
#define sz(v)	   v.size()
#define pb         push_back
#define pp         pop_back
#define S          second
#define bgn        begin
#define F          first
#define N	100000+5
#define MOD	1e9+7
#define inf 1e18
//======================================================
int dx[] = { 0,  0, 1, -1 ,  1,  -1,  1,  -1 };
int dy[] = { 1, -1, 0,  0 , -1,   1,  1,  -1 };
//======================================================
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
ll power(ull a, ull b, ull ret = 1LL) {
	while (b--) ret = (ret * a);
	return ret;}
//======================================================
ll n;
ll a[N];
ll dp[N];
ll Frog(int i)
{
	if(i>=n) return 0;
	if(dp[i]!=-1) return dp[i];
	ll c1=inf,c2=inf;
	if(i+1<=n)c1=Frog(i+1)+abs(a[i]-a[i+1]);
	if(i+2<=n)c2=Frog(i+2)+abs(a[i]-a[i+2]);
	return dp[i]=min(c1,c2);
}

int main()
{
	El_Bay
	cin >> n;
	memset(dp,-1,sizeof dp);
	for(int i=1 ; i<=n ; i++)
		cin >> a[i];
	ll ans=Frog(1);
	cout << ans;
	return 0;
}


Measured memory_bytes: 9884
#pragma region template
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9 + 7, MAX = LLONG_MAX, larg = 1e5, INF = -1e9;
long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W;
typedef long long ll;
typedef pair<ll, ll> Pa;

vector<int> arr[100001];
Pa info[100001];

string int_tostring(int i){
    string in = to_string(i);
    string s = "000000";
    rep(j, in.size()){
        s[6-in.size()+j] = in[j];
    }
    return s;
}

int main() {
	cin >> N >> M;
	rep(i, M) {
		cin >> A >> B;
		info[i] = Pa(A, B);
		arr[A].push_back(B);
	}

	rep(i, N+1) {
		sort(arr[i].begin(), arr[i].end());
	}

	rep(i, M) {
		cout << int_tostring(info[i].first);
        cout << int_tostring(lower_bound(arr[info[i].first].begin(), arr[info[i].first].end(), info[i].second) - arr[info[i].first].begin() + 1) << endl;
	}
}


Measured memory_bytes: 8576
#include <iostream>
#include <cmath>

bool isPrime(int p)
{
  if( p == 2 ){ return true; }
  if( p < 2 || p % 2 == 0 ){ return false; }

  int i = 3;
  while( i <= std::sqrt(p) ){
    if( p % i == 0 ){ return false; }
    i = i + 2;
  }
  return true;
}


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

  int p;
  int count = 0;
  for(int i=0; i<n; ++i){
    std::cin >> p;
    if( isPrime(p) ) count ++;
  }
  std::cout << count << std::endl;
  return 0;
}


Measured memory_bytes: 3084
#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    string s;
    int k;
    cin>>s>>k;
    char c='1';
    for(int i=0;i<s.size();i++)
    {
        if(k==i) break;
        if(s[i]!=c)
        {
            c=s[i];
            break;
        }
    }
    cout<<c<<endl;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
    int n,dis; cin>>n;
    vector<int> me(n+1,-1);
    int ad;
    rep(i,n+1){
        scanf("%d",&ad);
        if(me[ad]>=0){
            dis=i-me[ad]+1; break;
        }
        else{
            me[ad]=i;
        }
    }
    vector<ll> v(n+2,0); v[1]=1;
    for(int i=2;i<=n+1;i++){
        v[i]=(-v[MOD%i]*(MOD/i))%MOD;
    }
    ll c=1,d=1;
    rep(i,n+1){
        c=((c*(n+1-i))%MOD)*v[i+1]%MOD;
        c=(c+MOD)%MOD;
        printf("%lld\n",(c-d+MOD)%MOD);
        d=((d*(n+1-dis-i))%MOD)*v[i+1]%MOD;
        d=(d+MOD)%MOD;
    }
}

Measured memory_bytes: 2432
n = int(input())
ts = 0
hs = 0
for i in range(n):
 taro, hanako = input().split()
 if taro > hanako:
  ts += 3
 elif taro < hanako:
  hs += 3
 else:
  ts += 1
  hs += 1
print(str(ts) + " " + str(hs))

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

int main() {
  int a, b;
  cin >> a >> b;
  
  if ((a * b ) % 2 == 0) {
    cout << "Even" << endl;
  }
  
  else {
    cout << "Odd" << endl;
  }
  
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
using ll = long long;

const long double PI = acos(-1.0);
const int MOD = 1e9 + 7;

int main() {
    double d, t, s;
    cin >> d >> t >> s;

    if(d <= t * s) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3716
#include<stdio.h>

int main(){
  int N;
  int A[100];
  int i;
  double sum;

  scanf("%d",&N);
  for(i=0;i<=N-1;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<=N-1;i++){
    sum+=1.0/A[i];
  }
  printf("%lf",1.0/sum);
  return 0;
}


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

using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)

int main() {
  int N;
  cin >> N;
  
  vector<int> bottuns(N);
  rep(i, N){
    cin >> bottuns.at(i);
  }
  
  int now = 1;
  int counter = 0;
  while(bottuns.at(now - 1)){
    if(bottuns.at(now - 1) == 2){
      counter++;
      cout << counter << endl;
      break;
    }
    int next = bottuns.at(now - 1);
    bottuns.at(now - 1) = 0;
    now = next;
    counter++;
  }
  if(bottuns.at(now - 1) == 0)
    cout << -1 << endl;
}
    
    
  

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();

            out.println((a + b) % 24);
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 21460
//(・ω・)
#include <stdio.h>
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, atoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip> //setprecision
#include <limits>
#include <sstream> //istringstream
#include <stdlib.h>
#include <list>
#include <iterator>//std::advance()
using namespace std;

int main(){
    int n;
    long long ans=0;
    cin >> n;
    vector<long long> a(n+1);
    vector<long long> b(n);
    for(int i=0; i<n+1; i++) cin >> a[i];
    for(int i=0; i<n; i++) cin >> b[i];
    for(int i=n-1; i>=0; i--){
        if(b[i]<=a[i+1]) ans+=b[i];
        else{
            ans+=a[i+1];
            b[i]-=a[i+1];
            ans+=min(a[i],b[i]);
            a[i]-=min(a[i],b[i]);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

struct unionfind {
    vector<int> d;
    unionfind(int n=0) : d(n,-1) {}
    int find(int x) {
        if (d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x, int y) {
        x = find(x); y = find(y);
        if (x == y) return false;
        if (d[x] > d[y]) swap(x, y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x, int y) { return find(x) == find(y);}
    int size(int x) { return -d[find(x)];}
};

struct edge{ int u, v, weight;};
bool comp(const edge &e1, const edge &e2) { return e1.weight < e2.weight;}
vector<edge> es;

int kruskal(int n) {
    sort(es.begin(), es.end(), comp);
    unionfind uf(n);
    int res = 0;
    for (size_t i = 0; i < es.size(); ++i) {
        edge e = es[i];
        if (!uf.same(e.u, e.v)) {
            uf.unite(e.u, e.v);
            res += e.weight;
        }
    }
    return res;
}

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

    int v, e;
    cin >> v >> e;
    es.resize(e);
    rep(i, e) {
        int s, t, d;
        cin >> s >> t >> d;
        es[i] = edge{s, t, d};
    }
    cout << kruskal(v) << endl;
}



Measured memory_bytes: 4188
import copy

N, M = map(int, input().split())
N += 1
A = [[int(i) for i in input().split()] for i in range(M)]
    
def dfs(x):
    if vis[x]:
        return
    vis[x] = True
    for  i in range(N):
        if G[x][i]:
            dfs(i)
            
cnt = 0
for i in range(M):
    vis = [False] * N
    A2 = copy.deepcopy(A)
    del A2[i]
    G = [[0] * N for i in range(N)]
    for i, j in A2:
        G[i][j] = 1
        G[j][i] = 1
        
    dfs(1)
    if any(vis[i] == False for i in range(1, N)):
        cnt += 1
        
print(cnt)

Measured memory_bytes: 3572
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793

int main(){
   int n;
   cin >> n;
   vector<ll> a(n);
   vector<ll> b(n);
   vector<pair<ll,ll>>  mp(n);
   rep(i,n){
      cin >> a.at(i) >> b.at(i);
      mp.at(i)=make_pair(b.at(i),a.at(i));
   }
   sort(mp.begin(),mp.end());
   ll sum=0;
   bool c=true;
   rep(i,n){
      ll bb,aa;
      tie(bb,aa)=mp.at(i);
      sum+=aa;
      if(sum>bb){
         c=false;
         break;
      }
   }
   if(c)cout << "Yes" << endl;
   else cout << "No"  << endl;
}


Measured memory_bytes: 6528
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    h0,w0h1,w1 = map(int, input().split())
    aa=[list(map(int, input().split())) for _ in range(h0)]
    bb=[list(map(int, input().split())) for _ in range(w0h1)]
    for ar in aa:
        print(*[sum(a*b for a,b in zip(ar,bc)) for bc in zip(*bb)])

main()



Measured memory_bytes: 6596
#include<iostream>
#include<vector>
#include<cmath>
#include<iomanip>
using namespace std;
struct Point { long double px, py; };
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double area(vector<Point> v) {
	long double ret = 0.0L;
	for (int i = 0; i < v.size(); i++) ret += crs(v[i], v[(i + 1) % v.size()]);
	return ret / 2;
}
int main() {
	vector<Point>P; Point W;
	int cnt = 0;
	while (true) {
		P.clear(); int n; cnt++;
		cin >> n; if (n == 0) { break; }
		for (int i = 0; i < n; i++) {
			cin >> W.px >> W.py;
			P.push_back(W);
		}
		cout << cnt << ' ' << fixed << setprecision(1) << fabs(area(P)) << endl;
	}
	return 0;
}

Measured memory_bytes: 1324
#include <cstdlib>
#include <iostream>

int main() {
  int x;
  int a;
  int b;

  std::cin >> x >> a >> b;

  if (std::abs(x - a) > std::abs(x - b)) {
    std::cout << "B" << std::endl;
  } else {
    std::cout << "A" << std::endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>

using namespace std;

int main()
{
	for(int m;scanf("%d",&m),m;){
		int cnt[1001];
		for(int i=0;i<=1000;i++)	cnt[i]=(i==0);

		for(int i=0;i<m;i++){
			int a,b;	scanf("%d%d",&a,&b);
			for(int j=1000;j>=0;j--){
				if(cnt[j]==0)	continue;
				for(int k=1;k<=b;k++){
					if(j+a*k>1000)	break;
					cnt[j+a*k]+=cnt[j];
				}
			}
		}

		int g;	scanf("%d",&g);
		for(int i=0;i<g;i++){
			int n;	scanf("%d",&n);
			printf("%d\n",cnt[n]);
		}
	}

	return 0;
}

Measured memory_bytes: 0
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
void PlacingMarbles() {
	string s;
	cin >> s;
	int c = 0;
	for (size_t i = 0; i < 3; i++)
	{
		c += s[i] == '1';
	}
	cout << c << endl;
}
int main() {

	PlacingMarbles();
	return 0;
}


Measured memory_bytes: 256
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	K, X := sc.nextInt(), sc.nextInt()

	if X <= 500*K {
		fmt.Fprintln(wtr, "Yes")
	} else {
		fmt.Fprintln(wtr, "No")
	}
	wtr.Flush()
}


Measured memory_bytes: 640
def p_d():
    x, y = map(int, input().split())
    if y > x:
        x, y = y, x
    if (x + y) % 3 != 0:
        print(0)
        exit()
    if x - y > (x + y) // 3:
        print(0)
        exit()
    x, y = x - (x + y) // 3, y - (x + y) // 3

    def c_mod(n, r, mod=10 ** 9 + 7):
        n1, r = n + 1, min(r, n - r)
        numer = denom = 1
        for i in range(1, r + 1):
            numer = numer * (n1 - i) % mod
            denom = denom * i % mod
        return numer * pow(denom, mod - 2, mod) % mod

    print(c_mod(x + y, y))
    
p_d()

Measured memory_bytes: 38512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll tmp1,tmp2,tmp3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}
int main() {
  ll k,x;
  cin >> k >> x;
  if(k * 500 >= x){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 764
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
minans = inf ;ans = 0 ;count = 0 ;pro = 1

n=int(input())
print(int(n**.5)**2)

Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define All(V) v.begin(), v.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9+7, INF = 1e9;

int main() 
{
  int x, y; cin >> x >> y;
  int a[] = {1,3,5,7,8,10,12};
  int b[] = {4,6,9,11};
  int c = 2;
  bool f = false, t = false, h = false;;
  for(int i = 0 ; i < 7; i++){
    if(a[i] == x)f = true;
    if(a[i] == y)t = true;
  }
  if(f && t)h = true;
  f = false, t = false;
  for(int i = 0; i < 4; i++){
    if(b[i] == x) f = true;
    if(b[i] == y) t = true;
  }
  if(f && t) h = true;
  if(x == c && y == c)h = true;
  if(h) cout << "Yes" << endl;
  else cout << "No" << endl;
  system("pause");
}

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

int main(){
  int H,W;
  cin >> H >> W;
  vector<vector <char> > masu(H,vector <char>(W));
  int h=0,i,j;
  vector<char> w(W);
  bool check;
  for(i=0;i<H;i++){
    check=false;
    for(j=0;j<W;j++){
      cin >> w.at(j);
      if(w.at(j)=='#'){
        check=true;
      }
    }
    if(check){
      masu.at(h)=w;
      h++;
    }
  }
  /*
  for(i=0;i<h;i++){
    for(j=0;j<W;j++){
      cout << masu.at(i).at(j);
    }
    cout << endl;
  }
  */
  
  vector<int> check_retu;
  for(i=0;i<W;i++){
    check=false;
    for(j=0;j<h;j++){
      //cout << masu.at(j).at(i);//
      if(masu.at(j).at(i)=='#'){
        check=true;
      }
    }
    if(check){
      //cout << "check_retu_push" << i << endl;//
      check_retu.push_back(i);
    }
  }
  for(i=0;i<h;i++){
    for(j:check_retu){
      cout << masu.at(i).at(j);
    }
    cout << endl;
  }
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
use std::num::*;

fn main() {
    let mut b: String = read();
    let mut ans: String = "".to_string();
    if b == "A" {
        ans = "T".to_string();
    }else if b == "T" {
        ans = "A".to_string();
    }else if b == "C" {
        ans = "G".to_string();
    }else{
        ans = "C".to_string();
    }
    println!("{}", ans);
}
fn read<T: FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn read_vec2<T: FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

Measured memory_bytes: 4352
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    A = kwargs["A"]
    res = 1

    for i in range(n):
        res *= A[i]

        if res > 10 ** 18:
            res = -1

            if min(A) == 0:
                res = 0

            break

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cin = input().split()
    kwargs["A"] = [int(i) for i in cin]

    cout = main(kwargs)
    print(cout)

Measured memory_bytes: 44232
#include <bits/stdc++.h>
 
#define int long long 
#define MOD 1000000007
 
using namespace std;
 
signed main(){
 

    int n,m;

    cin >>n>>m;

    map<int,int> ans;

    int k[n];
    int a;

    for(int i=0;i<n;i++){
        cin >> k[i];
        for(int j=0;j<k[i];j++){
            cin>>a;  
            ans[a]++;
        }
    }

    int c=0;

    for(auto b:ans){
        if(b.second==n){
            c++;
        }
    }

    cout<<c<<endl;

 	return 0;
 
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
string s;
ll nr[2051],aux[2051],ans;
void f()
{
    memset(aux,0,sizeof(aux));
        for(int j=0;j<2019;j++)
        {
            aux[(j*10)%2019]+=nr[j];
        }
        for(int j=0;j<2019;j++)
            nr[j]=aux[j];
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>s;
    ll num=0;
    nr[0]=1;
    for(int i=0;i<s.size();i++)
    {
        num=(num*10+(s[i]-'0'))%2019;
        ans+=nr[num];
        nr[num]++;
        f();
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3816
N = int(input())
c_str = input()

r_num = c_str.count('R')
w_num = c_str.count('W')

true_list = 'R' * r_num + 'W' * w_num

if c_str == 'R' * N:
    print(0)
else:
    dif = 0
    for i in range(N):
        if c_str[i] != true_list[i]:
            dif += 1

    print(dif // 2)


Measured memory_bytes: 9576