akhauriyash/Code-Regression huggingface dataset:
N,M = map(int,input().split())
C = [-1] * (N + 1)
for i in range(M):
    s,c = map(int,input().split())
    if C[s] != -1 and C[s] != c:
        print(-1)
        exit(0)
    C[s] = c 
ans = ''
if N == 1:
    if C[1] == 0 or C[1] == -1:
        print(0)
    else:
        print(C[1])
    exit(0)
    
if C[1] == 0:
    print(-1)
    exit(0)
elif C[1] == -1:
    ans += '1'
else:
    ans += str(C[1])
    
for i in range(2,N+1):
    if C[i] == -1:
        ans += '0'
    else:
        ans += str(C[i])
print(ans)

Measured memory_bytes: 9172
// 及时当勉励，岁月不待人！
//当前状态 : attempted
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<cmath>
#include<string>
#include<iomanip>
using namespace std;
typedef long long ll;

int inf=1e9;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
inline int read(){int ret = 0, sgn = 1;char ch = getchar();while(ch < '0' || ch > '9'){if(ch == '-')sgn = -1;ch = getchar();} while (ch >= '0' && ch <= '9'){ret = ret*10 + ch - '0';ch = getchar();}return ret*sgn;}


//结构体
//全局变量
const int maxn=1005;
//函数
int main()
{
    std::ios::sync_with_stdio(false);
    int n,m,sum;
    cin>>n>>m>>sum;
    if(inf==sum)inf--;
    if(n==m){
        for(int i=1;i<=n;++i){
            cout<<sum<<' ';
        }
        cout<<endl;
    }else{
        int tmp=n-m;
        for(int i=1;i<=tmp;++i){
            cout<<inf<<' ';
        }
        for(int i=1;i<=m;++i){
            cout<<sum<<' ';
        }
        cout<<endl;
    }
    return 0;

}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, _VA_ARGS__)
#else
    #define eprintf(...) 42
#endif // LOCAL
int n, m, k;
char s[500][500];
int b[500][500];

int main(){
    scanf("%d %d %d", &n, &m, &k);
    for(int i = 1 ;i <= n ;i ++){
        scanf("%s", s[i] + 1);
    }
    int pt = 0;
    queue<pair<int ,int >> q;
    for(int i = 1 ;i <= n; i++){
        for(int j = 1 ;j <= m; j++){
            if(s[i][j] == '#'){
                b[i][j] = ++pt;
                //assert(pt <= k);
                q.push({i, j});
            }
        }
    }
    while(!q.empty()){
        auto t = q.front();
        q.pop();
        int x = t.first, y = t.second;
        if(x > 1){
            if(b[x - 1][y] == 0){
                b[x - 1][y] = b[x][y];
                q.push({x - 1 , y});
            }
        }
        if(x < n){
            if(b[x + 1][y] == 0){
                b[x + 1][y] = b[x][y];
                q.push({x + 1 , y});
            }
        }
    }
    for(int i = 1 ;i <= n; i ++){
        for(int j = 1 ;j<= m ;j ++){
            if(b[i][j] > 0 ){
                q.push({i, j});
            }
        }
    }
    while(!q.empty()){
        auto t = q.front();
        q.pop();
        int x = t.first, y = t.second;
        if(y > 1){
            if(b[x][y - 1] == 0){
                b[x][y - 1] = b[x][y];
                q.push({x , y - 1});
            }
        }
        if(y < m){
            if(b[x][y + 1] == 0){
                b[x][y + 1] = b[x][y];
                q.push({x , y + 1});
            }
        }
    }
    for(int i = 1 ;i <= n; i++){
        for(int j = 1 ;j <= m; j++){
            printf("%d%c", b[i][j], j == m? '\n' : ' ');
        }
    }
}

/*
    Long time no see!
    Atcoder...
*/


Measured memory_bytes: 2292
// Author -> Preeyadarshee Dev
//
// train hard win easy :D
// nik is love
// nik is motivation
//
// do modulo operations very carefully
// try to avoid binary search, use linear search preferrably to make calculations easier
// always make your custom binary search and watch out for overflows
// read the problems carefully
// never rely on floating point calculation
#include<bits/stdc++.h>
#define mp                    make_pair
#define pb                    push_back
#define ll                    long long
#define ss                       second
#define ff                        first
#define fr(i,a,b)   for(ll i=a;i<b;i++)
#define f(i,n)                fr(i,0,n)
#define rf(i,b,a) for(ll i=b-1;i>=a;i--)
#define r(i,n)                rf(i,n,0)
#define inf                   1000000007
#define eps                   0.000000000000001
#define sz(a)                int((a).size())
#define all(c)               (c).begin(),(c).end()
#define tr(c,i)              for(typeof(c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x)         ((c).find(x) != (c).end())
#define cpresent(c,x)        (find(all(c),x) != (c).end())
#define pi                   pair<int,int>
#define pll                  pair < ll , ll >
#define endl                 '\n'
#define PI                   3.141592653589793238462643383279502884197169399375105820974944592307816406286
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef vector< int > vi;
typedef vector< vi > vvi;
int dx[8]={1,-1,0,0,-1,-1,1,1};
int dy[8]={0,0,-1,1,-1,1,-1,1};
vector<int> adj[200010],vis(200010,0),dis(200010,inf),fin(200010,0),col(200010,0),par(200010,0);
int myrandom (int i) { return std::rand()%i;}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //ifstream fin;
    //ofstream fout;
    //fin.open("input.txt");
    //fout.open("output.txt");
    ll n;
    cin>>n;
    ll num=(n*(n-1))/2;
    cout<<num<<endl;
}


Measured memory_bytes: 8832
//ALDS_ALDS1_4_B_BinarySearch.cpp

#include<bits/stdc++.h>
using namespace std;
const int INF=2E9;
typedef pair<int,int> Pair;
typedef long long LL;
#define M 1046527
//#define M 9973
#define L 14

class Dictionary{
    private:
    char H[M][L];
    public:
    Dictionary();
    int _getChar(char c);
    LL _getKey(char str[]);
    int _h1(LL key);
    int _h2(LL key);
    int _insert(char str[]);
    int _find(char str[]);
};

Dictionary::Dictionary(){
    for(int i=0;i<M;i++) H[i][0]='\0';
}

int Dictionary::_getChar(char c){
    switch(c){
        case 'A':
            return 1;
            break;
        case 'C':
            return 2;
            break;
        case 'G':
            return 3;
            break;
        case 'T':
            return 4;
            break;
        default :
            return 0;
    }
}

LL Dictionary::_getKey(char str[]){
    LL sum=0,p=1,i;
    for(int i=0;i<strlen(str);i++){
        sum+=p*(_getChar(str[i]));
        p*=5;
    }
    return sum;
}

int Dictionary::_h1(LL key){
    return key%M;
}
int Dictionary::_h2(LL key){
    return 1+(key % (M-1));
}

int Dictionary::_insert(char str[]){
    LL key,i,h;
    key = _getKey(str);
    for(i=0;;i++){
        h=(_h1(key)+i*_h2(key))%M;
        if(strcmp(H[h],str)==0) return 1;
        else if(strlen(H[h])==0) {
            strcpy(H[h],str);
            return 0;
        }
    }
    return 0;
}
int Dictionary::_find(char str[]){
    LL key,i,h;
    key = _getKey(str);
    for(i=0;;i++){
        h=(_h1(key)+i*_h2(key))%M;
        if(strcmp(H[h],str)==0) return 1;
        else if(strlen(H[h])==0) return 0;
    }
    return 0;
}
int main(){
    Dictionary dic=Dictionary();
    char str[L],com[9];
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        scanf("%s %s",com,str);
        if(com[0]=='i'){
            dic._insert(str);
        }else{
            if(dic._find(str)){
                printf("yes\n");
            }else{
                printf("no\n");
            }
        }
    }
    return 0;
}



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

using namespace std;

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

	int g = X;
	int min_m = 10000;
	for (int i = 0; i < N; i++)
	{
		int m;
		cin >> m;

		if (min_m > m)
		{
			min_m = m;
		}

		g -= m;
	}

	cout << N + (g / min_m) << endl;

	return 0;
}


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

void Solve()
{
    long long a, b, c, k;
    cin >> a >> b >> c >> k;
    if(k <= a)
    {
        cout << k << endl;
        return;
    }
    if(k > a && k <= (a+b))
    {
        cout << a << endl;
        return;
    }
    long long sum = a;
    k -= (a+b);
    sum -= k;
    cout << sum << endl;
}

int main()
{
    Solve();
    return 0;
}


Measured memory_bytes: 3636
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    char[] c = s.toCharArray();
    
    int count = 1;
    
    for(int i=0; i<n-1; i++){
      if(!(c[i] == c[i+1])){
        count++;
      }
    }
    
    System.out.println(count);
  }
}


Measured memory_bytes: 26620
function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let N = parseInt(input[0][0], 10);
    let X = parseInt(input[0][1], 10);
    let T = parseInt(input[0][2], 10);
    if (N % X === 0) console.log(T * N / X );
    else console.log(Math.ceil(N / X) * T);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29708
import sys
a=[0]*26
s=input()
for i in range(len(s)):
    a[ord(s[i])-97]=1
    #print(a)
    if 0 not in a:
        print('None')
        sys.exit(0)
for i in range(26):
    #print(i)
    if a[i]==0:
        print(chr(i+97))
        break

Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    map<int, int> pos;
    for (int i = 0; i < n; ++i)
        pos[a[i]] = i;
    sort(a.begin(), a.end());
    int odp = 0;
    for (int i = 0; i < n; ++i)
        if (abs(i - pos[a[i]]) % 2 == 1)
            ++odp;
    if (odp % 2 == 1)
        odp = odp / 2 + 1;
    else
        odp /= 2;
    cout << odp;
    return 0;
}


Measured memory_bytes: 5376
A_B=[list(map(int,input().split())) for _ in range(int(input()))]
ans=[A_B[0][0],A_B[0][1]]
for a_b in A_B:
    if ans[0]<a_b[0]:
        ans[0]=a_b[0]
    if ans[1]>a_b[1]:
        ans[1]=a_b[1]
print(sum(ans))

Measured memory_bytes: 27380
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A
{
    class Program
    {
        public static void Main(string[] args)
        {
            var n = ReadLineIntSpilit();
            
            Console.WriteLine((n[0] == n[1]) ? "Yes" : "No");
            ReadLine();
        }

        /// <summary>
        /// コンビネーション
        /// </summary>
        /// <param name="n"></param>
        /// <param name="m"></param>
        /// <returns></returns>
        static int nCm(int n, int m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * nCm(n - 1, m - 1) / m;
        }

        /// <summary>
        /// stringを一文字ずつintにキャストして配列に変換します。
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int[] StringCharArrayIntArray(string str)
        {
            List<int> b = new List<int>();
            for (int i = 0; i < str.Length; i++) {
                b.Add( int.Parse(str[i].ToString()));
            }
            return b.ToArray();
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }

        public static int ReadLineInt()
        {
            return int.Parse(Console.ReadLine());
        }

        public static string[] ReadLineStringSplit(char a = ' ')
        {
            return ReadLine().Split(a).ToArray();
        }

        public static int[] ReadLineIntSpilit(char a = ' ')
        {
            return ReadLine().Split(a).Select(x => int.Parse(x)).ToArray();
        }
    }
}

Measured memory_bytes: 13396
#include <iostream>

using namespace std;

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

    int price;

    cin >> price;
    if (price % 1000)
	cout << 1000 - price % 1000 << "\n";
    else
	cout << "0\n";

    return 0;
}

Measured memory_bytes: 3652
H,W = map(int,input().split())
li = []

for h in range(H):
  li.append(list(input()))

dxy = [(0, -1), (1, 0), (0, 1), (-1, 0)]
ans = 'Yes'

for y in range(H):
  for x in range(W):
    if li[y][x] == '.':
      continue

    a = 0
    for dx, dy in dxy:
      if x+dx < 0 or x+dx > W-1 or y+dy < 0 or y+dy > H-1:
        continue
      if li[y+dy][x+dx] == '#':
        a = 1
    
    if a == 0:
      ans = 'No'

print(ans)

Measured memory_bytes: 3064
#include <stdio.h>
#include<math.h>
int N,X[105],Y[105],i;
double D;
 
double d(int p)
{
    int i;
    for(D=0.0,i=0;i<N;i++)
    {
        if(p==4)D=D>abs(X[i]-Y[i])?D:abs(X[i]-Y[i]);
        else D+=pow(1.0*abs(X[i]-Y[i]),p);
    }
    return p==4?D:pow(D,1.0/p);
}
 
int main()
{
    scanf("%d",&N);
    for(i=0;i<N;i++)scanf("%d",X+i);
    for(i=0;i<N;i++)scanf("%d",Y+i);
    for(i=1;i<5;i++)printf("%lf\n",d(i));
    return 0;
}




Measured memory_bytes: 2088
#include<iostream>
using  namespace std;
int gcd(int a,int b){
    if(a%b==0)return b;
    return gcd(b,a%b); 
}
int main(){
    int w,h,c;cin>>w>>h>>c;
    cout <<(w/gcd(w,h)) *(h/gcd(w,h))*c<<endl;
}


Measured memory_bytes: 3124
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

const int maxN = 1e6 + 5;
char c[maxN];

int main() {
	scanf("%s", c + 1);
	int N = strlen(c + 1);
	int ans = N;
	for(int i = 2; i <= N; ++i) {
		if(c[i] != c[i - 1]) ans = min(ans, max(i - 1, N - i + 1));
	}
	cout << ans << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
long long h,w,k;
long long s[15],sum[1010][15],aans=9999999999;
char a[1010][15];
int main()
{
	cin>>h>>w>>k;
	for(int o=1;o<=h;o++)
		for(int i=1;i<=w;i++)
			cin>>a[i][o];
	for(int o=1;o<=h;o++)
	{
		for(int i=1;i<=w;i++)
		{
			sum[i][o]=sum[i-1][o]+sum[i][o-1]-sum[i-1][o-1];		
			if(a[i][o]=='1')
				sum[i][o]++;
		//	cout<<sum[i][o]<<" ";	
		}
	//	cout<<endl;
	}
	for(int i=0;i<=pow(2,h-1)-1;i++)
	{
		long long ans=0;
		for(int o=1;o<h;o++)
			if(s[o]==2)
			{
				s[o]=0;
				s[o+1]++;
			}
		vector<long long> v;
		v.push_back(0);
		for(int o=1;o<=h;o++)
			if(s[o]==1)
			{
				v.push_back(o);	
				ans++;
			}
		v.push_back(h);	
		//cout<<i<<" "<<ans<<endl;	
		long long tmp=0;		
		bool no=false;
		for(int o=1;o<=w;o++)
		{
			for(int j=1;j<v.size();j++)
			{
			//	cout<<o<<" "<<v[j]<<" "<<tmp<<"!!!"<<sum[o][v[j]]-sum[o][v[j-1]]-sum[tmp][v[j]]+sum[tmp][v[j-1]]<<endl;
				if(sum[o][v[j]]-sum[o][v[j-1]]-sum[tmp][v[j]]+sum[tmp][v[j-1]]>k)
				{
					if(tmp==o-1)
					{
						no=true;
						break;
					}
					tmp=o-1;
					ans++;
					break;
				}
			}
			if(no==true)
			{
				ans=9999999999;
				break;
			}
		}	
		//cout<<ans<<endl;
		aans=min(aans,ans);
		s[1]++;
	}	
	cout<<aans<<endl;		
}

Measured memory_bytes: 384
//chiragjn
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define gibe_de_fast_io_b0ss ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const ll mod = 1e9 + 7;
const ll INF = 0x7FFFFFFFFFFFFFFF/2;
int main(){
    gibe_de_fast_io_b0ss;
    ll ans = 0;
    ll n, a, b;
    cin>>n>>a>>b;
    if(n == 1 &&  a == b) cout<<"1\n";
    else if(a > b || n == 1) cout<<"0\n";
    else{
    	ans = 1LL + (n - 2) * (b - a);
    	cout<<ans;	
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <time.h>
#include <stdio.h>
#include <vector>
#define int long long
using namespace std;
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int mypow(int x, int y) {
	if (y == 0)return 1;
	if (y % 2)return mypow(x, y - 1)*x;
	else return mypow(x, y / 2)*mypow(x, y / 2);
}
int Max(int x, int y) {
	if (x > y)return x;
	else return y;
}
int Min(int x, int y) {
	if (x < y)return x;
	else return y;
}
int kai(int x) {
	int cnt=1;
	if (x == 0)return 1;
	cnt = kai(x - 1);
	return x * cnt;
}
inline void shoki()
{
	srand((unsigned int)time(NULL));
}
int prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
void prime_factor(int n){
	int cnt = 1;
	map<int, int>res;
	int m = n;
	for (int i = 2; i<= n; i++) {
		if(prime(i)){
			while (m%i == 0) {
				++res[i];
				m /= i;
			}
		}
	}
	cout << n <<":"<< endl;
	for (int i = 2; i<= n; i++) {
		if (res[i]) {
			cout << i << " " << res[i] << endl;
		}
	}
	cout << endl;
}
/*Library End!*/
int x, y, cnt;
signed main() {
	cin >> x >> y;
	if (x >= 0 == y >= 0) {
		if (x > y) {
			if (y == 0)cout << x + 1 << endl;
			else cout << x - y + 2 << endl;
		}
		else cout << abs(x - y) << endl;
	}
	else if (y) {
		cout << abs(abs(x) - abs(y)) + 1 << endl;
	}
	else cout << abs(x) << endl;
end:;
	system("PAUSE");
	return 0;
}



Measured memory_bytes: 504
// This template code suggested by KT BYTE Computer Science Academy
//   for use in reading and writing files for USACO problems.

// https://content.ktbyte.com/problem.java

import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int h = in.nextInt();
        int w = in.nextInt();

        char[][] grid = new char[h + 1][w + 1];

        for (int i = 1; i <= h; i++) {

            String row = in.next();

            for (int j = 1; j <= w; j++) {
                grid[i][j] = row.charAt(j - 1);
            }
        }

        int[][] dp = new int[h + 1][w + 1];

        dp[0][1] = 1;

        for (int i = 1; i <= h; i++) {
            for (int j = 1; j <= w; j++) {
                if (grid[i][j] == '#') continue;
                dp[i][j] = dp[i-1][j] + dp[i][j-1];
                dp[i][j] %= 1000000007;
            }
        }

        int result = dp[h][w];
        out.println(result);
        out.close();
    }
}




Measured memory_bytes: 47468
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int r = sc.nextInt();
    int d = sc.nextInt();
    int x = sc.nextInt();
    for(int i=0;i<10;i++){
      x = r*x-d;
      System.out.println(x);
    }
  }
}


Measured memory_bytes: 21716
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
bool update(vector<int> &score, vector<vector<pair<int, int>>> xy, int person, vector<bool> &honest)
{
	rep(i, xy[person].size()) {
		if (xy[person][i].second == 0) {
			if (score[xy[person][i].first] == 1) {
				return false;
			}
			score[xy[person][i].first] = 2;
		}
		else if (xy[person][i].second == 1) {
			if (score[xy[person][i].first] == 2) {
				return false;
			}
			score[xy[person][i].first] = 1;
			if (honest[xy[person][i].first] == false) {
				honest[xy[person][i].first] = true;
				if (!update(score, xy, xy[person][i].first, honest)) return false;
			}
		}
	}
	return true;
}
int main()
{
	// ABC147-C, 975, 
	int n;
	cin >> n;
	int a;
	vector<vector<pair<int, int>>> xy(n);
	rep(i, n) {
		cin >> a;
		xy[i].resize(a);
		rep(j, a) {
			cin >> xy[i][j].first >> xy[i][j].second;
			xy[i][j].first--;
		}
	}
	int ans = 0;
	rep(i, 1 << n) {
		int tmp = 0;
		bool ok = true;
		vector<bool> honest(n, false);
		vector<int> score(n, 0);	// 0:未定義, 1:正直, 2:不親切
		rep(j, n) {
			if (i >> j & 1) {
				if (score[j] == 2) {
					ok = false;
					break;
				}
				score[j] = 1;
				if (honest[j] == false) {
					honest[j] = true;
					if (!update(score, xy, j, honest)) {
						ok = false;
						break;
					}
				}
			}
		}
		if (!ok)	continue;
		rep(j, honest.size())	tmp += honest[j];
		ans = max(ans, tmp);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3588
#include<stdio.h>
int main()
{
	int n;
	int a[100];
	int i,min,max;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	min=1000;
	for(i=0;i<n;i++){
		if(min>a[i]){
			min=a[i];
		}
	}
	max=-1;
	for(i=0;i<n;i++){
		if(max<a[i]){
			max=a[i];
		}
	}
	printf("%d\n",max-min);
	return 0;
}


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

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a+b == c || a+c == b || b+c == a){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
cards = []
cards = ["%s %s" % (s, n) for s in ['S', 'H', 'C', 'D'] for n in range(1,14,1)]

input_cards = []
input_cards_num = int(raw_input())
for i in range(1, input_cards_num + 1, 1) :
    input_card = raw_input()
    cards.remove(input_card)

for card in cards:
    print(card)

Measured memory_bytes: 4640
fn main() {
    let n = read::<usize>();

    let mut sum = 0;
    for _ in 0..n {
        let v = read_vec::<u32>();
        let l = v[0];
        let r = v[1];
        sum += r - l + 1;
    }
    println!("{}", sum);
}

#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}


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


using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef long long ll;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef vector<PII> VP;
typedef vector<VP> VVP;

const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
ll fact[maxn];

ll inv(int x) {
	int e = mod-2;
	ll sol = 1;
	ll base = x;
	while (e) {
		if (e&1) sol = (sol * base)%mod;
		e >>= 1;
		base = (base * base)%mod;
	}
	return sol;
}

int main() {
	ios::sync_with_stdio(false);
	fact[0] = fact[1] = 1;
	for (int i = 2; i < maxn; ++i) fact[i] = (fact[i-1] * i)%mod;
	int n;
	cin >> n;
	VI A(n);
	for (auto& x : A) cin >> x;
	VI pos(n, 0);
	pos[0] = 1;
	int cur_pos = 1;
	for (int i = 1; i < n; ++i) {
		pos[i] = cur_pos;
		if (A[i] <= 2*(i-cur_pos+1)) cur_pos++;
	}
	int used = 0;
	ll sol = 1;
	for (int i = 1; i < n; ++i) {
		if (pos[i] != pos[i-1]) {
			sol = (sol * (i-used))%mod;
			++used;
		}
	}
	sol *= fact[n-used];
	sol %= mod;
	cout << sol;
}

Measured memory_bytes: 1792
package main

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

func main() {
        var n, m int
        fmt.Scan(&n, &m)
        sc := bufio.NewScanner(os.Stdin)
        sc.Split(bufio.ScanWords)
        roads := make([]int, n)
        for i := 0; i < 2*m; i++ {
                sc.Scan()
                i, _ := strconv.Atoi(sc.Text())
                roads[i-1]++
        }
        for _, k := range roads {
                fmt.Printf("%d\n", k)
        }
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int dx[]={-1,0,1,-1,1,-1,0,1};
int dy[]={-1,-1,-1,0,0,1,1,1};
int main(){
    int h,w;
    cin>>h>>w;
    vs vec;
    vec.pb(string('.',w+2));
    REP(i,h){
        string t;
        cin>>t;
        string st=".";
        st+=t;
        st+=".";
        vec.pb(st);
    }
    vec.pb(string('.',w+2));
    FOR(i,1,h+1){
        FOR(j,1,w+1){
            if(vec[i][j]=='#'){
                cout<<"#";
                continue;
            }
            int t=0;
            REP(k,8){
                if(vec[i+dx[k]][j+dy[k]]=='#'){
                    t++;
                }
            }
            cout<<t;
        }cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    for (int i = 0; i < 3000; i++)
    {
        int x;
        int y;
        cin >> x >> y;
        if (x == 0 && y == 0)
        
            break;
        
        if (x > y)
        {
            int sus;
            sus = x;
            x = y;
            y = sus;
        }
            cout << x <<" "<< y << endl;
        
    }
}


Measured memory_bytes: 3120
from itertools import product

N = int(input())
F = []
P = []
for _ in range(N):
    temp = list(map(int, input().split()))
    F.append([temp[:2], temp[2:4], temp[4:6], temp[6:8], temp[8:]])
for _ in range(N):
    P.append(list(map(int, input().split())))

prod = list(product((0, 1), (0, 1), (0, 1), (0, 1), (0, 1),
                    (0, 1), (0, 1), (0, 1), (0, 1), (0, 1)))
MAX = -float("inf")


def compute(pattern):
    x = 0
    for i in range(N):
        c = 0
        for j in range(5):
            for k in range(2):
                if pattern[j][k] == 1 and F[i][j][k] == 1:
                    c += 1
        x += P[i][c]
    return x


del prod[0]
for e in prod:
    pattern = [e[:2], e[2:4], e[4:6], e[6:8], e[8:]]
    MAX = max(compute(pattern), MAX)

print(MAX)


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

using db = double;
const db eps = 1e-12;
int sgn(db a, db b = 0) {
	a -= b;
	return (a > eps) - (a < -eps);
}

struct poi {
	db x, y;
	void r() { cin >> x >> y; }
	poi operator -(poi p) {
		return {x - p.x, y - p.y};
	}
	db len() {
		return sqrt(x * x + y * y);
	}
};

int main() {
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		poi a, b; db ra, rb;
		a.r(); cin >> ra;
		b.r(); cin >> rb;
		db d = (b - a).len();
		if(sgn(d, ra + rb) <= 0 &&
			sgn(d, abs(ra - rb)) >= 0)
			cout << "1\n";
		else if(sgn(ra + d, rb) < 0)
			cout << "-2\n";
		else if(sgn(rb + d, ra) < 0)
			cout << "2\n";
		else
			cout << "0\n";
	}
	return 0;
}

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

void solve() {
	int N; cin >> N;
	vector<int> A(N), rev(N);
	rep(i, N) scanf("%d", &A[i]);

	rep(i, N) {
		rev[A[i] - 1] = i + 1;
	}
	rep(i, N) {
		if (i) printf(" ");
		printf("%d", rev[i]);
	}
	printf("\n");
}

int main(void) {
	solve();

	return 0;
}

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

long long read(){
    long long x=0,f=1;
    char ch;
    do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
    do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
    return x*f;
}

long long x,y,ans=0;
int main(){
    x=read();
    y=read();
    while(x<=y){
        ans++;
        x*=2;
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
from collections import Counter
C = Counter(a)
if n%2==0 and not a.count(0)==0:
    print(0)
    exit()
elif n%2==1 and not a.count(0)==1:
    print(0)
    exit()
for c in set(a):
    if not c==0 and not C[c]==2:
        print(0)
        exit()
print(2**(n//2)%(10**9+7))

Measured memory_bytes: 15200
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

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 rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define REP(i,n,m) for(int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

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


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

	ll a, b , n ;  cin>> a >> b >> n;

	if (n >= b-1) cout << (a*(b-1)/b) << endl;
	else cout << (a*n/b) << endl;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define fr(i,c,b) for(int i=c;i<b;i++)
#define frl(i,c,b) for(ll i=c;i<b;i++)
#define si(x) int x; scanf("%d", &x)
#define sll(x) ll x; scanf("%lld", &x)
#define pi(x) printf("%d", x)
#define pll(x) printf("%lld", x)
#define nl printf("\n")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define MAX 100001
#define M 1000000007
#define pb push_back

typedef long long int ll;

using namespace std;

int main()
{
    si(h); si(w);
    char ch[h+1][w+1]; fr(i,1,h+1) { fr(j,1,w+1) cin>>ch[i][j]; }
    ll dp[h+1][w+1];
    
    bool flag=false;
    
    for(int i=w;i>=1;i--)
    {
        if(ch[h][i]=='#')   flag=true;
        if(flag)    dp[h][i]=0;
        else    dp[h][i]=1;
    }
    
    flag=false;
    
    for(int i=h;i>=1;i--)
    {
        if(ch[i][w]=='#')   flag=true;
        if(flag)    dp[i][w]=0;
        else    dp[i][w]=1;
    }
    
    for(int i=h-1;i>=1;i--)
    {
        for(int j=w-1;j>=1;j--)
        {
            if(ch[i][j]=='#')   dp[i][j]=0;
            else
                dp[i][j]=(dp[i][j+1]%M+dp[i+1][j]%M)%M;
        }
    }
    
    /*fr(i,0,h+1)
    {
        fr(j,0,w+1)
            cout<<dp[i][j]<<" ";
        nl;
    }*/
    
    cout<<dp[1][1];
}

Measured memory_bytes: 12480
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll n;
    cin >> n;
    if (n % 2 == 1) {
        cout << (n - 1) / 2 * ((n - 1) / 2 + 1) << endl;
    } else {
        cout << n / 2 * n / 2 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reprep(i,j,w,h) rep(j,h)rep(i,w)
#define rrep(i,m, n) for(int i = m; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<int>(n,a)));
typedef long long ll;
const int INF = 2000000000;
const long INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
int main(){
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    rep(i,n)std::cin >> a[i];
    int ans=0;
    rep(i,n){
        bool han=1;
        rep(j,i){
            if(a[j]>a[i])han=0;
        }
        if(han)ans++;
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
V = IL()
C = IL()

ans = 0
for i in range(N):
    v = V[i]
    c = C[i]
    if v-c > 0:
        ans += v-c

print(ans)

Measured memory_bytes: 12464
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define ll long long
#define FOR(i, n, m) for(int i=n; i<m; ++i)

int main(){
  int K;
  cin >> K;
  int ans;
  if(K%2==0) ans = K*K/4;
  else ans = (K+1)*(K-1)/4;
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <vector>
#include <set>
#include <cstdio>
using namespace std;

int main(){
	int N;
	long long W,tV=0,tW=0,x=0;
	scanf("%d%lld",&N,&W);
	vector<pair<long long,long long> >v(N);
	for(int i=0;i<N;i++)scanf("%lld%lld",&v[i].second,&v[i].first),tV+=v[i].first,tW+=v[i].second;
	if(W>tW)W=tW;
	if(tW<2000000){
		vector<long long>bag(W+1);
		bag[0]=1;
		for(auto &e:v){
			x+=e.second;
			if(x>W)x=W;
			for(int j=x;j>=e.second;j--)if(bag[j-e.second]&&bag[j]<bag[j-e.second]+e.first)
				bag[j]=bag[j-e.second]+e.first;
		}
		for(int i=0;i<W;i++)bag[i+1]=max(bag[i+1],bag[i]);
		printf("%lld\n",bag[W]-1);
	}else if(tV<2000000){
		vector<long long>bag(tV+1);
		bag[0]=1;
		for(auto &e:v){
			x+=e.first;
			for(int j=x;j>=e.first;j--)if(bag[j-e.first]&&(!bag[j]||bag[j]>bag[j-e.first]+e.second))
				bag[j]=bag[j-e.first]+e.second;
		}
		int i=0,mi;
		for(;i<=tV;i++)if(bag[i]&&bag[i]-1<=W)mi=i;
		printf("%d\n",mi);
	}else if(N<=40){
		int n=N/2;
		set<pair<long long,long long> >se1,se2;
		for(int i=0;i<1<<n;i++){
			long long V=0,w=0;
			for(int j=0;j<n;j++)if(i&(1<<j))V+=v[j].first,w+=v[j].second;
			se1.emplace(w,V);
		}
		for(int i=0;i<1<<(N-n);i++){
			long long V=0,w=0;
			for(int j=0;j<(N-n);j++)if(i&(1<<j))V+=v[j+n].first,w+=v[j+n].second;
			se2.emplace(w,V);
		}
		for(auto it=se1.begin();it!=se1.end();){
			auto it2=it;
			for(++it2;it2!=se1.end()&&it->second>=it2->second;)it2=se1.erase(it2);
			++it;
		}
		for(auto it=se2.begin();it!=se2.end();){
			auto it2=it;
			for(++it2;it2!=se2.end()&&it->second>=it2->second;)it2=se2.erase(it2);
			++it;
		}
		long long r=0;
		for(auto &e1:se1){
			auto it=se2.lower_bound({W-e1.first+1,0});
			if(it!=se2.begin()){
				--it;
				r=max(r,e1.second+it->second);
			}
		}
		printf("%lld\n",r);
	}else{
		return 1;
	}
}

Measured memory_bytes: 1024
#include<stdio.h>

char f(char x)
{
  char y;
  if(x=='Z'){
    y='A';
  }else{
    y=x+1;
  }
  
  return y;
}

int main(void)
{
  int N,i,j,k;
  char S[10000],T[10000];
  scanf("%d\n%s",&N,S);
  
  k=0;
  while(S[k]!=NULL){
    k++;
  }
  
  for(i=0;i<=k-1;i++){
    T[i]=S[i];
    for(j=1;j<=N;j++){
      T[i]=f(T[i]);
    }
    printf("%c",T[i]);
  }
  
  return 0;
}

Measured memory_bytes: 128
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
 
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		String ans = "";
		Stack<Character> seq = new Stack<Character>();
		while (N>0) {
			N--;
			char cur = (char)(N%26+97);
			seq.push(cur);
			N/=26;
		}
		while (!seq.isEmpty()) {
			char cur = seq.pop();
			System.out.print(cur);
		}
	}
}

Measured memory_bytes: 26968
a, b, m = map(int, input().split())
q = list(map(int, input().split()))
w = list(map(int, input().split()))
ans = min(q)+min(w)
for i in range(m):
  x, y, c = map(int, input().split())
  ans = min(q[x-1]+w[y-1]-c, ans)
print(ans)
  

Measured memory_bytes: 70892
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
#define ll long long
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}

vector<int>v[100001];
int maxi=INT_MIN;
set<int>s[100001];
map<pair<int,int>,int>f;

void dfs(int st, int p, int color){
	// s[st].insert(color);
	// 	s[p].insert(color);
	// 	f[{p,st}]=color;
	// 	f[{st,p}]=color;
	for(auto i:v[st]){	
		if(i!=p){
			int k;
			for(int j=1;j<=maxi;j++){
				if(s[st].count(j)==0){
					k=j;
					s[i].insert(k);
					s[st].insert(k);
					 	f[{i,st}]=k;
					 	f[{st,i}]=k;
					break;
				}
			}
			dfs(i,st,k);
		}
	}
}
int main(){
	fastio();
	int n;
	cin>>n;
	vector<pair<int,int>>vv;
	for(int i=1;i<=n-1;i++){
		int a,b;
		cin>>a>>b;
		v[a].push_back(b);
		v[b].push_back(a);
		vv.push_back({a,b});
	}
	int mark;
	for(int i=1;i<=n;i++){
		if((int)v[i].size()>maxi){
			maxi=(int)v[i].size();
			mark=i;
		}
	}
	int j=1;
	//cout<<mark<<"\n";
	for(int i=0;i<v[mark].size();i++){
		s[v[mark][i]].insert(j);
		s[mark].insert(j);
		f[{mark,v[mark][i]}]=j;
		f[{v[mark][i],mark}]=j;
		dfs(v[mark][i],mark,j);
		j++;
	}
	//cout<<f[{1,2}];
	cout<<maxi<<"\n";
	for(auto i:vv){
		cout<<f[{i.ff,i.ss}]<<"\n";
	}

}

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

class Program
{
    static void Main(string[] args)
    {
            var input = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            int n = (int)input[0];
            long m = input[1];
            var rtm = Math.Pow(m, 0.5);
            if (n == 1)
            {
                Console.WriteLine(m);
                return;
            }
            var prev = m;
            for (int i = 1; i <= rtm; i++)
            {
                if (m % i != 0) continue;
                if (n <= i)
                {
                    Console.WriteLine(m/i);
                    return;
                }


                if (m / i < n)
                {
                    Console.WriteLine(prev);
                    return;
                }
                prev = i;
            }
            Console.WriteLine(prev);
    }
}



Measured memory_bytes: 13268
<?php
// Your code here!
// ランクを出力する。
// 400min で200置きに上がっていく
$n = fgets(STDIN);

switch($n){
    case $n < 600:
        echo 8;
        break;
    case $n < 800:
        echo 7;
        break;
    case $n < 1000:
        echo 6;
        break;
    case $n < 1200:
        echo 5;
        break;
    case $n < 1400:
        echo 4;
        break;
    case $n < 1600:
        echo 3;
        break;
    case $n < 1800:
        echo 2;
        break;
    case $n < 2000:
        echo 1;
        break;
}
?>


Measured memory_bytes: 16192
#include <iostream>
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
void solve()
{
   double h,a;
   cin>>h>>a;
   ll ans=ceil(h/a);
   cout<<ans;
}
int main() {
	ll t;
// 	cin>>t;
// 	while(t--)
	    solve();
	return 0;
}

Measured memory_bytes: 256
def main():
    N = int(input())

    ans = 100000

    for i in range(1, N):
        tmp = sum(map(int, str(i)))
        tmp += sum(map(int, str(N-i)))
        if tmp < ans:
            ans = tmp

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9160
import java.io.*;
	import java.util.*;
    public class Main{
    	public static void main(String args[]) throws IOException{
         	BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
          	StringTokenizer st=new StringTokenizer(in.readLine());
          	int a=Integer.parseInt(st.nextToken());
          	int b=Integer.parseInt(st.nextToken());
          	System.out.println(a*b);
        }
    }

Measured memory_bytes: 25332
from sys import stdin
import math
import fractions

s = stdin.readline().rstrip()
rs = s[::-1]
n = int((len(s) - 1) / 2)
s2 = s[0:n]
rs2 = s2[::-1]
n2 = int((len(s) + 3) / 2) - 1
n22 = int(len(s))
s3 = s[n2:n22]
rs3 = s3[::-1]

if s == rs and s2 == rs2 and s3 == rs3:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 5716
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define int long long
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false),cin.tie(nullptr);
#endif
#define ff first
#define ss second
#define endl '\n'
#define all(c) c.begin(),c.end()
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" "; cout<<endl;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int is_square(int n){
   double x=sqrt(n);
   return (x-floor(x)==0);
}
void solve(){
   int x,a,b;
   cin>>x>>a>>b;
   cout<<(x-a)%b<<endl;
}
int32_t main(){
  IOS;
  solve();
  //debug();
 #ifdef LOCAL_DEFINE
 cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
 #endif	
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
using namespace std;

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

bool isN(char c) {
	return '0'<=c && c<='9';
}

bool comp(string s1, string s2) {
	if( s1.length() < s2.length() ) {
		for(int i=0; i<s2.length()-s1.length()+1; i++) {
			s1 = '0' + s1;
		}
	} else if( s1.length() > s2.length() ) {
		for(int i=0; i<s1.length()-s2.length()+1; i++) {
			s2 = '0' + s2;
		}
	}
	return (s1 < s2);
}

int main() {
	int w, h;
	while( cin >> w >> h, w||h ) {
		vector<string> f(h);
		rep(i,h) cin >> f[i];
		string dp[70][70];
		rep(x,w)  rep(y,h)  dp[y][x] = "";
		if( isN(f[0][0]) ) dp[0][0] += f[0][0];
		string res = "";
		rep(y, h) {
			rep(x, w) {
				if( isN(f[y][x]) ) {
					string con = "";
					if(x-1>=0 && comp(con, dp[y][x-1]))
						con = dp[y][x-1];
					if(y-1>=0 && comp(con, dp[y-1][x]))
						con = dp[y-1][x];
					dp[y][x] = con + f[y][x];
				}
				if( comp(res, dp[y][x]) )
					res = dp[y][x];
			}
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 1392
#include<stdio.h>
int main(void){
    int a,b[11]={0};
    int i,j,k,l,m,n,o,p,q;
    scanf("%d",&b[0]);
    for(i=1;i<10;i++){
        scanf("%d",&a);
        n=0;
        for(k=0;k<i+1;k++){
            if(n==i){
                b[k]=a;
                break;
            }
            if(a>b[k]){
                for(l=i;l>k;l--){
                    b[l]=b[l-1];
                }
                b[l]=a;
                break;
            }
            n++;
        }
    }
    for(m=0;m<3;m++){
        printf("%d\n",b[m]);
    }
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define f0(i, a, n) for(i = a; i < n; i++)
#define f1(i, a, n) for(i = a; i <= n; i++)
#define tc(t) int t;cin >> t;while(t--)
#define ini(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define ll long long int
#define vi vector<int>
#define si set<int>
#define pb push_back
#define mp make_pair
#define M 1e9+7
#define rr return 0
#define endl '\n'

using namespace std;

void solve() {
    int n;
    cin >> n;
    cout << (n >= 30 ? "Yes" : "No") << endl;
}

int main () {
    IOS;
    solve();
    rr;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
#define bg begin()
#define ed end()
#define all(x) x.bg, x.ed
#define vi vector<int>
template <class t, class u>
bool chmax(t &a, u b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class t, class u>
bool chmin(t &a, u b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}
int h, w, k;

bool kblack(vector<vector<int>> vvi, int n)
{
    rep(i, h)
    {
        if (n & (1 << i))
        {
            rep(j, w)
            {
                vvi[i][j] = 2;
            }
        }
    }
    rep(i, w)
    {
        if (n & (1 << (h + i)))
        {
            rep(j, h)
            {
                vvi[j][i] = 2;
            }
        }
    }
    int cnt = 0;
    rep(i, h)
    {
        rep(j, w)
        {
            if (vvi[i][j] == 1)
            {
                cnt++;
            }
        }
    }
    return cnt == k;
}

signed main()
{
    int n;
    cin >> n;
    vi as(n);
    rep(i, n)
    {
        cin >> as[i];
    }
    sort(all(as));
    reverse(all(as));
    ll ans = 0;
   priority_queue<pair<int,int>> pq;
   pq.push({as[0],as[0]});
   for(int i=1;i<n;i++){
       auto p=pq.top();
       pq.pop();
       ans += p.first;
       pq.push({min(p.first,as[i]),max(p.first,as[i])});
       pq.push({min(p.second, as[i]), max(p.second, as[i])});
   }
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define reps(i,f,n) for(int i=(f); i<=(n); ++i)
#define outl(x) cout<< (x) << '\n'
#define FAST() cin.tie(0), ios::sync_with_stdio(false)

int main()
{
   FAST();
   int n,a,b;
   cin >> n >> a >> b;
   outl( min( a*n , b) );
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int n, r; // Rの数
char a[200001];

int main() {
  cin >> n;
  
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 'R') r += 1;
  }
  
  int ans = 0;
  for (int i = 0; i < r; i++) {
    if (a[i] == 'W') ans += 1;
  }
  
  cout << ans;
}

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

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	ll N, A, B, C, D, E;
	cin >> N >> A >> B >> C >> D >> E;
	ll x = min({A, B, C, D, E});
	ll ans = 4 + (N+x-1)/x;

	cout << ans << endl; 
}

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

struct union_find{
	int N;
	vector<int> parent;
	vector<int> siz;

	union_find(int N) : parent(N), siz(N, 1){
		for (int i = 0; i < N; i++) parent[i] = i;
	}

	int root(int x){
		if(parent[x] == x) return x;
		else return parent[x] = root(parent[x]);
	}

	void merge(int x, int y){
		x = root(x), y = root(y);
		if(x == y) return;
		if(siz[x] < siz[y]) swap(x, y);
		parent[y] = x;
		siz[x] += siz[y];
		siz[y] = 0;
	}

	bool are_same(int x, int y){
		return root(x) == root(y);
	}

	int size(int x){
		return siz[root(x)];
	}
};

int main(){
	int N, M, X, Y, Z, i;
	scanf("%d%d", &N, &M);
	union_find uf(N);
	for(i = 0; i < M; i++){
		scanf("%d%d%d", &X, &Y, &Z);
		uf.merge(X - 1, Y - 1);
	}
	int ans = 0;
	for(i = 0; i < N; i++){
		ans += i == uf.root(i);
	}
	printf("%d\n", ans);
	return 0;
}

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

int main() {
	int a, b;
	cin >> a >> b;

	if (a > 9 || b > 9) {
		cout << "-1" << "\n";
	}
	else {
		cout << a * b << "\n";
	}

	return 0;
}

Measured memory_bytes: 256