akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int n;
    cin >> n;
    int a = 0, w = 0, r = 0, t = 0;
    rep(i, n){
        string s;
        cin >> s;
        if(s == "AC")a++;
        if(s == "WA")w++;
        if(s == "RE")r++;
        if(s == "TLE")t++;
    }
    cout << "AC x " << a << endl;
    cout << "WA x " << w << endl;
    cout << "TLE x " << t << endl;
    cout << "RE x " << r << endl;
}


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

for i in range(n+1):
    for j in range(n-i+1):
        k = n-i-j
        if (10000*i+5000*j+1000*k == y):
            print(i,j,k)
            sys.exit()
print(-1,-1,-1)


Measured memory_bytes: 40684
#!/usr/bin/python3

import sys
#import math
import fractions as math

def input():
    return sys.stdin.readline().rstrip('\n')

#N = int(input())
A,B = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A,B))


Measured memory_bytes: 5048
#include <iostream>
#include <stdio.h>       // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>  //sort,binarySearch
#include <functional> 
#include <iomanip> // setprecision
#include <utility>    // c+11 Array
#include <set>
#include <sstream>
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;

using namespace std;

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

  int sum = 0;
  int cnt = 0;

  if ( B == 1) {
    cout << 0 << endl;
    return 0;
  }

  while(sum < B) {
    if (cnt != 0) sum--;
    sum += A;
    cnt++;
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;
int main(){
	unsigned long long int a,b,x,ans;
	cin>>a>>b>>x;
	
	ans = b/x;
	if(a!=0){
		cout<<ans-((a-1)/x)<<endl;
	}else{
		cout<<ans+1<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        int n;
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		
		int a[] = new int [n];
		
		for(int i = 0;i < n;i++){
			a[n-1-i] =  scanner.nextInt();			
		} 
		
		for(int i = 0;i < n;i++){
			System.out.print(a[i]);
			if(i != n-1){
				System.out.print(" ");
			}
			else{
				System.out.println();
			}		
		}
    	scanner.close();
    }
}

Measured memory_bytes: 26060
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    a,b = map(int, input().split())
    if b == 0:
        print(0)
        exit()
    if a == 0:
        a = 1
    a -= 1
    bb = format(b, 'b')
    ba = format(a, 'b')
    def bin_sum(a):
        empty = []
        bottom = a[-1]
        try:
            two = (int(a[-2])+int(a[-1]))%2
        except IndexError:
            two = int(a[-1])%2
        for i in a:
            if bottom == '0' and i == '1':
                empty.append('1')
            else:
                empty.append('0')
        empty[-1] = str(two)
        return empty
    sum_bb = bin_sum(bb)
    sum_ba = bin_sum(ba)
    sum_ba = ['0']*(len(sum_bb)-len(sum_ba)) + sum_ba
    sum_all = []
    for i,j in zip(sum_ba, sum_bb):
        if i == j:
            sum_all.append('0')
        else:
            sum_all.append('1')
    str_sum_all = ''.join(sum_all)
    print(int(str_sum_all,2))


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

fn main() {
    input! {
        a: usize,
        b: usize,
        mut s: Chars
    };
    for _ in 0..b {
        match s.pop().unwrap() {
            '-' => {
                println!("No");
                return;
            }
            _ => (),
        }
    }
    match s.pop().unwrap() {
        '-' => (),
        _ => {
            println!("No");
            return;
        }
    }
    for _ in 0..a {
        match s.pop().unwrap() {
            '-' => {
                println!("No");
                return;
            }
            _ => (),
        }
    }
    println!("Yes");
}


Measured memory_bytes: 2164
n,m,c = map(int,input().split())	
b = list(map(int,input().split()))	
ans=0
for i in range(0,n):
  a=list(map(int,input().split()))
  wa=c
  for(x,y)in zip(a,b):
    wa+=(x*y)
  if wa>0:
    ans+=1
    
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll mod= 1e9 + 7;


int main(){
  int n;
  cin >> n;
  if(n<1200){cout << "ABC" << endl;}else{cout << "ARC" << endl;}
}

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

using ll = long long;
using Field = vector<vector<ll>>;
using Graph = vector<vector<ll>>;
using VI = vector<int>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VC = vector<char>;
using PI = pair<int, int>;

#define FOR(i, s, n) for (int i = s; i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(x) x.begin(), x.end()

const long long INF = 1LL<<60;
const int MOD = 1000000007;

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

bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; i++) {
        if (N % i == 0) return false;
    }
    return true;
}

vector<long long> enum_divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            res.push_back(i);
            if (N / i != i) res.push_back(N / i);
        }
    }
    sort(res.begin(), res.end());
    return res;
}

vector<pair<long long, long long>> prime_factorize(long long N) {
    vector<pair<long long, long long>> res;
    for (long long a = 2; a * a <= N; a++) {
        if (N % a != 0) continue;
        long long ex = 0;

        while (N % a == 0) {
            ex++;
            N /= a;
        }

        res.push_back({a, ex});
    }

    if (N != 1) res.push_back({N, 1});
    return res;
}

const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll N, M;

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

    cin >> N >> M;

    vector<pair<ll, ll>> a = prime_factorize(M);

    ll ans = 1;

    COMinit();

    for ( auto x:a) {
        ll n = x.second;
        ans *= COM(N + n - 1, N - 1);
        ans %= MOD;

    }


    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 15612
#include <bits/stdc++.h>
using namespace std;
void fib(int *a, int n)
{
    a[0] = 1;
    a[1] = 1;
    for (int i = 2; i <= n; ++i)
    {
        a[i] = a[i - 2] + a[i - 1];
    }
}
int main()
{
    int n;
    cin >> n;
    int a[n + 1] = {};
    fib(a, n);
    cout << a[n] << endl;
}


Measured memory_bytes: 3088
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <cmath>
#include <numeric>
#include <functional>
#include <stack>
#include <iomanip>
#include <map>
#include <cstdio>

int main() {
	long long n, m;

	std::cin >> n >> m;

	long long sum = 0;

	for (long long i = 0; i < m; i++)
	{
		long long a;
		std::cin >> a;
		sum += a;
	}

	if (sum > n) {
		std::cout << -1 << std::endl;
	}
	else {
		std::cout << n - sum << std::endl;
	}

	return 0;
}

Measured memory_bytes: 3644
#include <iostream>

using namespace std;

int G[100][100];

int main() {
	int n; cin >> n;
	for (int i = 0; i < n; ++i) {
		int u, k; cin >> u >> k;
		--u;
		while (k--) {
			int v; cin >> v;
			G[u][v - 1] = 1;
		}
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			if (j) cout << " ";
			cout << G[i][j];
		}
		cout << endl;
	}

	return 0;
}


Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ft first
#define sd second
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int a=0,n=s.length();
    fr(i,n) if(s[i]=='o') a++;
    if(a+15-n>7) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;
 
int main(){
	
	string t; cin>>t;
	for(int i=0; i<t.size(); i++){
		if(t.at(i)=='?') t.at(i)='D';
	}
	cout << t << endl;
	
	
}

Measured memory_bytes: 3728
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;

// ■■■■■■■■■■■■■■■■headerここまで■■■■■■■■■■■■■■■■

int main() {

    int n;
    cin >> n;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }

    ll prod = 1;
    const ll E18 = 1000000000000000000ll;
    for (int i = 0; i < n; i++) {
        ll rest = (ld)E18 / prod;
        if (a[i] > 2 * rest ) {
            cout << -1 << endl;
            return 0;
        }
        prod *= a[i];
        if (prod > E18) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << prod << endl;

    return 0;

}

Measured memory_bytes: 4048
#include <iostream>

using namespace std;

int main(void) {
	char a,b;
	cin >> a >> b;
	if (a > b) {
		swap(a,b);
	}
	for (int i = 0; i < b-'0'; ++i) {
		cout << a;
	}
	cout << endl;
	return 0;
}



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

#define pb push_back
#define ll long long int
#define mpi map<int, int>
#define vi vector<int>
#define qi queue<int>
#define si set<int>
#define pii pair<int, int>
#define vpi vector<pii>
#define vs vector<string>
#define pri priority_queue<int>
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define For(i, n) for (int i = 0; i < n; i++)
#define Ford(i, a, b) for (int i = a; i >= b; i--)
#define Rep(i, x, y) for (int i = x; i <= y; i++)
#define mem(a, b) memset(a, b, sizeof(a))
#define fastio                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)

double tick()
{
    static clock_t oldt, newt = clock();
    double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
    oldt = newt;
    return diff;
}

ll fastExpo(ll a, ll n)
{
    ll res = 1;
    while (n)
    {
        if (n % 2)
            res = res * a;
        n /= 2;
        a = a * a;
    }
    return res;
}

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

int a[110], c[110], mn = 1e9;

int main()
{
    int x, n, res = 0;
    cin >> x >> n;
    mem(c, 0);
    For(i, n)
    {
        cin >> a[i];
        c[a[i]] = 1;
    }

    For(i, 102)
    {
        if (c[i] == 0 && abs(i - x) < mn)
        {
            res = i;
            mn = abs(i - x);
        }
    }

    if (mn == 1e9)
        res = -1;
    cout << res << endl;

    cerr << "execution time is: " << tick() << "\n";
}


Measured memory_bytes: 3788
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class CBuildStairs {
public:
    static constexpr int kStressIterations = 0;

    static void generateTest(std::ostream& test) {
    }

    void solve(std::istream& cin, std::ostream& cout) {
        int N;
        cin >> N;
        vector<int> H(N);
        REP(i, N) cin >> H[i];
        reverse(H.begin(), H.end());

        bool ok = true;
        REP(i, N - 1) {
            if (H[i] >= H[i + 1]) {

            } else if (H[i] == H[i + 1] - 1) {
                H[i + 1]--;
            } else {
                ok = false;
                break;
            }
        }
        cout << (ok ? "Yes" : "No") << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    CBuildStairs solver;
    solver.solve(in, out);
    return 0;
}


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

std::map<std::string, int> m;

int main()
{

        int N;
        cin >> N;
        std::vector<std::string> S;
        std::vector<int> cnt;
        for (int i = 0; i < N; ++i) {
                std::string s;
                cin >> s;
                m[s] += 1;
        }
        int max = 0;
        for (auto const& x : m) {
                int v = x.second;
                if (v > max) max = v;
        }
        for (auto const& x : m) {
                if (x.second == max) {
                        cout << x.first << endl;
                }
        }

}


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

#define     F       first
#define     S       second
typedef pair<int, int>  pi;
typedef long long       ll;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    cout << n/2+n%2;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ll long long
#define all(_v) _v.begin(), _v.end()

int main() {
    ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll x = 1e18;
	cin >> x;
	for(ll i = -4000; i <= 4000; ++i) {
        for(ll j = -4000; j <= 4000; ++j) {
            ll tmp = i * i * i * i * i - j * j * j * j * j;
            if(tmp == x) cout << i << ' ' << j, exit(0);
        }
	}
	return 0;
}


Measured memory_bytes: 3636
#include<iostream>
using namespace std;
int main(){
string s;
while(getline(cin,s) && s != "END OF INPUT"){
int a=0;
for(int i=0;i<(int)s.size();i++){if(s[i]==' '){cout << a;a=0;}else a++;}
cout << a << endl;
}
}

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

struct  CARD {
    int n;
    int order;
    string  C;
};

void    bubble(vector<CARD> &A) {
    int N=A.size();
    for (int i=0; i<N-1; i++)
        for (int j=N-1; j>i; j--)
            if (A.at(j).n<A.at(j-1).n)
                swap(A.at(j), A.at(j-1));
    return;
}

void    selection(vector<CARD> &A) {
    int N=A.size();
    for (int i=0; i<N; i++) {
        int MINI=i;
        for (int j=i; j<N; j++)
            if (A.at(j).n<A.at(MINI).n)
                MINI=j;
        if (i!=MINI)
            swap(A.at(i), A.at(MINI));
    }
    return;
}

int main() {
    int N;
    cin >>N;
    vector<CARD> A(N);
    for (int i=0; i<N; i++) {
        cin >>A.at(i).C;
        A.at(i).n=A.at(i).C.at(1)-'0';
        A.at(i).order=i;
    }
    vector<CARD> B=A;
    bubble(B);
    for (int i=0; i<N; i++)
        if (i!=N-1)
            cout <<B.at(i).C <<' ';
        else
            cout <<B.back().C <<endl;
    bool Stable=true;
    for (int i=0; i<N-1; i++)
        if (B.at(i).n==B.at(i+1).n)
            if (B.at(i).order>B.at(i+1).order)
                Stable=false;
    if (Stable)
        cout <<"Stable" <<endl;
    else
        cout <<"Not Stable" <<endl;
    B=A;
    selection(B);
    for (int i=0; i<N; i++)
        if (i!=N-1)
            cout <<B.at(i).C <<' ';
        else
            cout <<B.back().C <<endl;
    Stable=true;
    for (int i=0; i<N-1; i++)
        if (B.at(i).n==B.at(i+1).n)
            if (B.at(i).order>B.at(i+1).order)
                Stable=false;
    if (Stable)
        cout <<"Stable" <<endl;
    else
        cout <<"Not stable" <<endl;
    return 0;
}


Measured memory_bytes: 3192
#include<iostream>
#include<queue>
using namespace std ;
#define pii pair<int,int>
#define uu first
#define vv second
#define pb(x) push_back(x)
int row,col,fx[]={1,-1,0,0},fy[]={0,0,1,-1},arr[25][25];
int vis[25][25],dis[25][25];
int bfs(int x,int y)
{
    for(int k=1;k<22;k++)
    {
        for(int j=1;j<22;j++)
        {
            vis[k][j]=0;
        }
    }
    int m=-1;
    queue < pii> q ;
    q.push(pii(x,y));
    vis[x][y]=1;
    dis[x][y]=0;
    while(!q.empty())
    {
        pii top=q.front();
        q.pop();
        for(int i=0;i<4;i++)
        {
            int xx = top.uu+fx[i];
            int yy = top.vv+fy[i];
            if(xx>0 && xx<=row && yy>0 && yy<=col && vis[xx][yy]==0 && arr[xx][yy]==0)
            {
                dis[xx][yy]=dis[top.uu][top.vv]+1;
                vis[xx][yy]=1;
                q.push(pii(xx,yy));
                m=max(m,dis[xx][yy]);
            }
        }
    }
    return m ;
}
int main()
{
   int temp=0;
   char s ;
   cin >> row >> col ;
   for(int i=1;i<=row;i++)
   {
       for(int j=1;j<=col;j++)
       {
           cin >> s ;
           if(s=='#'){arr[i][j]=1;}
       }

   }
    for(int i=1;i<=row;i++)
   {
       for(int j=1;j<=col;j++)
       {
           if(arr[i][j]==0)
           {
               int ans = bfs(i,j);
               temp=max(temp,ans);
           }
       }
   }
   cout << temp << endl;
   return 0;
}


Measured memory_bytes: 256
/*  CREATED BY
    STREAM_CIPHER
    26-sep-2020
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define debug1(a) cout<<#a<<"="<<(a)<<"\n"
#define debug2(a,b) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<"\n"
#define debug3(a,b,c) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<","<<#c<<"="<<(c)<<"\n"
#define fix_precision(n) cout<<fixed<<setprecision(n)
#define all(a) a.begin(),a.end()
const double pi=acos(-1.0);
int inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int mx=5*1000000;//5*64M bit ->5*8M byte ->40MB size for long long int (64 bit)
bool vis[mx];
vector<int>g[mx];
int ans=0;
void dfs(int s)
{
	vis[s]=1;
	for(auto i:g[s])
		if(vis[i]==0)
			dfs(i);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout);
    #endif
        int n,m;
        cin>>n>>m;
        for(int i=0;i<m;i++)
        {
        	int u,v;
        	cin>>u>>v;
        	u--,v--;
        	g[u].push_back(v);
        	g[v].push_back(u);
        }
        for(int i=0;i<n;i++)
        {
        	if(vis[i]==0)
        	{
        		// cout<<i<<endl;
        		dfs(i);
        		ans++;
        	}
        }
        cout<<ans-1<<endl;
}

Measured memory_bytes: 125260
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
 
int main() {
 int N;
  cin>>N;
  
  int H = N/100;
  //cout<<H<<endl;
  if(H==7){
     cout<<"Yes"<<endl;
    return 0;
  }
  int T = (N-100*H)/10;
    // cout<<T<<endl;
    if(T==7){
     cout<<"Yes"<<endl;
      return 0;
    }
  int I = N-100*H-10*T;
    // cout<<I<<endl;
    if(I==7){
     cout<<"Yes"<<endl;
      return 0;
    }
  else{
    cout<<"No"<<endl;
  
  }
     
  return 0;

}

Measured memory_bytes: 3636
/*pata hai na?*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

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

//#define     int          long long int
#define     ld           long double
#define     fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)       x.begin(),x.end()
#define     mem(a,b)     memset(a,b,sizeof(a))
#define     gcd(a,b)     (__gcd((a),(b)))
#define     lcm(a,b)     (((a)*(b))/gcd((a),(b)))
#define     pb           push_back
#define     ins          insert
#define     pii          pair<int,int>
#define     F            first
#define     S            second
#define     makep        make_pair
#define     maket        make_tuple
#define     show(x)      for(auto c:x)cout<<c<<" ";cout<<"\n";
#define     show2(x)     for(auto c:x)cout<<c.F<<" "<<c.S<<"\n";

const ld pi=acos(-1);
//const int inf=1e18,M=1e9+7;
const int N=2e4+5;

set<int> st[26];

int type[N],idx[N],l[N],r[N];
char c[N];

void solve()
{
    int N;
    cin >> N;

    string S;
    cin >> S;

    int Q;
    cin >> Q;

    for(int i=0;i<Q;++i) {
        cin >> type[i];
        if (type[i] == 1) {
            cin >> idx[i] >> c[i];
        }
        else {
            cin >> l[i] >> r[i];
        }
    }

    for(int i=0;i<26;++i) {
        st[i].insert(N);
    }

    for(int i=0;i<N;++i) {
        st[(S[i] - 'a')].insert(i);
    }

    for(int i=0;i<Q;++i) {
        if (type[i] == 1) {
            st[(S[idx[i] - 1] - 'a')].erase(idx[i] - 1);
            S[idx[i] - 1] = c[i];
            st[(S[idx[i] - 1] - 'a')].insert(idx[i] - 1);
        }
        else {
            int ANS = 0;
            for(int j=0;j<26;++j) {
                auto itr = st[j].lower_bound(l[i] - 1);
                if (*itr <= r[i] - 1) ANS++;
            }
            cout << ANS << '\n';
        }
    }
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}




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



int main()
{
	std::string S;	

	cin >> S;

	int a = stoi(S.substr(0, 4));
	int b = stoi(S.substr(5, 2));
	int c = stoi(S.substr(8, 2));

	if (a >= 2019 && b > 4 )
	{
		cout << "TBD";
	}
	else
	{
		cout << "Heisei";
		
	}


}


Measured memory_bytes: 256
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main() {
	string S;
	int sum = 700;
	cin >> S;
	size_t size = S.size();
	for (int i = 0; i < size; i++) {
		if (S[i] == 'o')sum += 100;
	}
	cout << sum << endl;
	return(0);
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <utility>
#include <cstdio>
#include <queue>
std::priority_queue<std::pair<int, int> > que;
int a[100005], b[100005], c[100005], ans[100005];
int pre[100005], lst[100005], lazy[100005];
bool flg[100005];
int main()
try
{
	// freopen("AGC013-F.in", "r", stdin);
	memset(lst, -1, sizeof(lst));
	int n, ans_all = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d%d", a + i, b + i);
	for (int i = 0; i <= n; i++)
		scanf("%d", c + i);
	std::sort(c, c + n + 1);
	for (int i = 0; i < n; i++)
	{
		a[i] = std::lower_bound(c, c + n + 1, a[i]) - c + 1;
		b[i] = std::lower_bound(c, c + n + 1, b[i]) - c + 1;
		lazy[a[i] - 1]--;
		if (b[i] < a[i])
		{
			pre[i] = lst[a[i] - 1];
			lst[a[i] - 1] = i;
		}
		flg[i] = true;
	}
	for (int i = n + 1, cur = -1; i; i--, cur++)
	{
		cur += lazy[i];
		for (int j = lst[i]; ~j; j = pre[j])
			que.push({ -b[j], j});
		while (cur < -1)
		{
			if (que.empty() || -que.top().first > i)
				throw false;
			flg[que.top().second] = false;
			cur++;
			lazy[-que.top().first - 1]--;
			que.pop();
			ans_all++;
		}
	}
	while (!que.empty())
		que.pop();
	memset(lst, -1, sizeof(lst));
	memset(lazy, 0, sizeof(lazy));
	for (int i = 0; i < n; i++)
	{
		lazy[flg[i] ? a[i] : b[i]]++;
		if (flg[i])
		{
			pre[i] = lst[b[i]];
			lst[b[i]] = i;
		}
	}
	int en = 0;
	for (int i = 1; i <= n + 1; i++)
	{
		lazy[i] += lazy[i - 1];
		ans[i] = ans[i - 1];
		for (int j = lst[i]; ~j; j = pre[j])
			que.push({a[j] - 1, j});
		if (lazy[i] - i == -1 && en < i)
		{
			if (que.empty() || que.top().first < i)
				ans[i] = 1e9;
			else
			{
				en = que.top().first;
				que.pop();
				ans[i]++;
			}
		}
		// printf("%d %d\n", i, ans[i]);
	}
	int q;
	scanf("%d", &q);
	while (q--)
	{
		int l, r;
		scanf("%d%d", &l, &r);
		l = std::lower_bound(c, c + n + 1, l) - c;
		r = std::lower_bound(c, c + n + 1, r) - c;
		int res = std::min(ans[l], ans[r] + 1) + ans_all;
		printf("%d\n", res > n + 1 ? -1 : n + 1 - res);
	}
	return 0;
}
catch (bool)
{
	int q;
	scanf("%d", &q);
	while (q--)
		puts("-1");
	return 0;
}


Measured memory_bytes: 4596
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
using namespace std;
typedef long long ll;
//#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i =0;i<n;++i)
//#define mod (ll)(1e9+7)
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll K;
    cin >> K;
    if(K%2==0)cout << K << endl;
    else cout << K*2 << endl;
    return 0;
}


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

public class Main{
    public static void main(String Args[])throws IOException{
      Scanner sc = new Scanner(System.in);
      int input = sc.nextInt();
      int result = 0;

      if((input%2) != 0){
        result = input/2;
      }else{
        result = input/2 -1;
      }
      
      System.out.println(result);
      sc.close();
    }
}

Measured memory_bytes: 22740
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > > 
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll A, B , K ;
    cin >> A >> B >>  K;
    
    vector<ll> ans;
    
    rep(i,K){
        ll a = A + i;
        if(A <= a && a <= B){
            ans.pb(A + i);
        }
    }
    rep(i, K){
        ll a = B - i;
        if(A <= a && a <= B){
            ans.pb(B - i) ;
        }
    }
    
    rmsame(ans);
    rep(i, ans.size()) cout << ans[i] << endl;
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  long long tv = N + 1;
  long long fv = 0;
  while (tv - fv > 1){
    long long mid = (tv + fv) / 2;
    if (mid * mid <= N){
      fv = mid;
    } else {
      tv = mid;
    }
  }
  cout << fv * fv;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] xi = new int[N];
        int[] yi = new int[N];
        int[] hi = new int[N];

        for(int i = 0; i < N; i++) {
            xi[i] = scanner.nextInt();
            yi[i] = scanner.nextInt();
            hi[i] = scanner.nextInt();
        }

//        int index = -1;
//        for(int i = 0; i < N; i++) {
//            if(hi[i] > 0) index = i; break;
//        }
//
//        for(int cx = 0; cx <= 100; cx++) {
//            for(int cy = 0; cy <= 100; cy++) {
//                int H = hi[index] + Math.abs(cx - xi[index]) + Math.abs(cy - yi[index]);
//                boolean stop = true;
//                for(int i = 0; i < N; i++) {
//                    if(hi[i] != Math.max(0, H - Math.abs(xi[i] - cx) - Math.abs(yi[i] - cy))) {
//                        stop = false;
//                        break;
//                    }
//                }
//                if(stop) {
//                    System.out.println(cx + " " + cy + " " + H);
//                    return;
//                }
//            }
//        }

        int xt = 0, yt = 0, ht = 0;
        for(int i = 0; i < N; i++) {
            if(hi[i] > 0) {
                xt = xi[i];
                yt = yi[i];
                ht = hi[i];
                break;
            }
        }

        for(int cx = 0; cx <= 100; cx++) {
            for(int cy = 0; cy <= 100; cy++) {
                int H = ht + Math.abs(xt - cx) + Math.abs(yt - cy);
                boolean stop = true;
                for(int i = 0; i < N; i++) {
                    if(hi[i] != Math.max(0, H - Math.abs(xi[i] - cx) - Math.abs(yi[i] - cy))) {
                        stop = false;
                        break;
                    }
                }
                if(stop) {
                    System.out.println(cx + " " + cy + " " + H);
                    return;
                }
            }
        }

    }
}

Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

void solve(long long K, long long T, std::vector<long long> a)
{
}

int main()
{
    long long K;
    scanf("%lld", &K);
    long long T;
    scanf("%lld", &T);
    std::priority_queue<long long> a;
    for (int i = 0; i < T; i++)
    {
        ll tmp;
        cin >> tmp;
        a.push(tmp);
    }
    ll maximum = a.top();

    cout << max(maximum - 1 - (K - maximum), 0LL) << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace test
{
    class Program {
        public static void Main(string[] args)
        {
            var postalFormat = 
                Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var target = Console.ReadLine();
            if (Regex.IsMatch(
                target,
                PostalFormat.ToPostalFormat(postalFormat[0], postalFormat[1])))
            {
                Console.WriteLine("Yes");
            }
            else Console.WriteLine("No");
        }
    }

    static class PostalFormat {
        public static string ToPostalFormat(
            int former,
            int later)
        {
            return String.Concat(Enumerable.Repeat(@"\d", former).ToArray()) +
                         "-" +
                         String.Concat(Enumerable.Repeat(@"\d", later).ToArray());
        }
    }
}


Measured memory_bytes: 14756
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    ll n, m, k, ans = 0;
    cin >> n >> m >> k;
    vector<ll> a(n + 1), b(m + 1);
    for (ll i = 1; i <= n; ++i) cin >> a.at(i), a.at(i) += a.at(i - 1);
    for (ll i = 1; i <= m; ++i) cin >> b.at(i), b.at(i) += b.at(i - 1);
    for (ll i = 0; i <= n; ++i) {
        if (a.at(i) > k) break;
        ans = max(ans, i + (ll(upper_bound(b.begin(), b.end(), k - a.at(i)) - b.begin()) - 1));
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

void solve(string str ){
	long long n = str.length();
	long long sum=0;
	if(n==1) sum=0;
	else{
		long long c=0;
		for(long long  i=0;i<n;i++){
			if(str[i]=='B') c++;
			else sum+=c;
		}
	}
	cout<<sum<<endl;
}

int main() {
	string str; cin>>str;
	solve(str);
	return 0;
}

Measured memory_bytes: 772
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
)

var (
	reader io.Reader = os.Stdin
	writer io.Writer = os.Stdout
)

type input [][]int

func (in input) Len() int { return len(in) }
func (in input) Less(i, j int) bool {
	return in[i][0] < in[j][0]
}
func (in input) Swap(i, j int) { in[i], in[j] = in[j], in[i] }

func main() {
	run()
}

func run() {
	var N int
	fmt.Fscan(reader, &N)

	// prevTime, prevX, prevY := 0, 0, 0
	reader := bufio.NewReaderSize(reader, 21)
	inputs := make(input, 0, N)

	for i := 0; i < N; i++ {
		buffer, isPrefix, err := reader.ReadLine()
		buf := make([]byte, 0, 21)

		if err != nil || isPrefix {
			panic(err)
		}

		buf = append(buf, buffer...)

		var t, x, y int
		fmt.Sscan(string(buf), &t, &x, &y)

		inputs = append(inputs, []int{t, x, y})
	}

	sort.Sort(&inputs)

	prevTime, prevX, prevY := 0, 0, 0

	for _, ints := range inputs {
		t, x, y := ints[0], ints[1], ints[2]
		distance := abs(x-prevX) + abs(y-prevY)
		time := t - prevTime

		if t == prevTime || distance > time || (time-distance)%2 != 0 {
			fmt.Fprintln(writer, "No")

			return
		}

		prevTime, prevX, prevY = t, x, y
		// fmt.Println(inputs)
	}

	fmt.Fprintln(writer, "Yes")
}

func abs(a int) int {
	if a < 0 {
		return -a
	}

	return a
}


Measured memory_bytes: 9472
#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<climits>
#include<set>
#include<map>
#include<cmath>
#include<iomanip>
#include<iterator>
#include<queue>
#include<stack>
#include<cctype>
#include<deque>
#include<time.h>
#include<bitset>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<sstream>
#include<random>

//by Skeef79

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#define pb push_back
#define en '\n'
#define for0(i,n) for(int i = 0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

const int INF = 2000000000;
const ll LINF = 2000000000000000000;

template<typename T> void print(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}

template <typename T> void input(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
		for (int j = 0; j < a[i].size(); j++)
			cin >> a[i][j];
}

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

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

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif

	int tst = 1;
	//cin >> tst;
	while (tst--)
	{
		solve();
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
// 1 = R 2 = B 3 = G 4 = RG 5 = RB 6 = GB

int main()
{
	ll n,ans = 1;
	ll a[7] = {0};
	string s;
	cin >> n >> s;
	a[0] = n;
	
	for(int i = 0;i < s.size();i++){
		if(s[i] == 'R'){
			if(a[6]) {ans = ans*a[6]%MOD;a[6]--;}
			else if(a[2]) {ans = ans*a[2]%MOD;a[2]--;a[5]++;}
			else if(a[3]) {ans = ans*a[3]%MOD;a[3]--;a[4]++;}
			else {ans = ans*a[0]%MOD;a[0]--;a[1]++;}
		}
		else if(s[i] == 'B'){
			if(a[4]) {ans = ans*a[4]%MOD;a[4]--;}
			else if(a[1]) {ans = ans*a[1]%MOD;a[1]--;a[5]++;}
			else if(a[3]) {ans = ans*a[3]%MOD;a[3]--;a[6]++;}
			else {ans = ans*a[0]%MOD;a[0]--;a[2]++;}
		}
		else{
			if(a[5]) {ans = ans*a[5]%MOD;a[5]--;}
			else if(a[2]) {ans = ans*a[2]%MOD;a[2]--;a[6]++;}
			else if(a[1]) {ans = ans*a[1]%MOD;a[1]--;a[4]++;}
			else {ans = ans*a[0]%MOD;a[0]--;a[3]++;}
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 900
#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<set>
#include<string>
#include <sstream>
#include<bitset>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>
const int INF = 0x7fffffff;
using lll = long long;
using ull = unsigned long long;
using namespace std;


int main(){
  lll ii,jj,kk;
  vector<int> ret;

  string alpha;
  char   res;
  cin >> alpha;

  if('a' <= alpha[0] && alpha[0] <= 'z'){
    res = 'a';
  }
  else{
    res = 'A';
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3636
#設定
import sys
input = sys.stdin.buffer.readline

from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	L = []
	for i in range(N):
		P = int(input())
		L.append([P, i])
	L = sorted(L)
	ans_pre = 1
	val = 1
	for i in range(N - 1):
		if L[i + 1][1] > L[i][1]:
			val += 1
		else:
			ans_pre = max(ans_pre, val)
			val = 1
	ans_pre = max(ans_pre, val)

	ans = N - ans_pre
	print(N - ans_pre)

if __name__ == '__main__':
	main()

Measured memory_bytes: 40612
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);
  static boolean[][] bomb = new boolean[50][50];

  public static void main(String[] args) {
    int H = sc.nextInt();
    int W = sc.nextInt();
    int N = sc.nextInt();
    int K = sc.nextInt();

    rec(0, H, 0, W, N);
    long ans = 0;
    long mul = 1;
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        if (bomb[i][j]) ans += mul;
        mul *= 2;
        mul %= K;
      }
    }
    System.out.println("! " + (ans % K));
    System.out.flush();
  }

  static void rec(int t, int b, int l, int r, int c) {
    if (c == 0) return;
    if ((b - t) * (r - l) == c) {
      for (int i = t; i < b; i++) {
        for (int j = l; j < r; j++) {
          bomb[i][j] = true;
        }
      }
      return;
    }
    if (r - l == 1) {
      int upper = query(t, (t + b) / 2, l, r);
      rec(t, (t + b) / 2, l, r, upper);
      rec((t + b) / 2, b, l, r, c - upper);
    } else {
      int left = query(t, b, l, (l + r) / 2);
      rec(t, b, l, (l + r) / 2, left);
      rec(t, b, (l + r) / 2, r, c - left);
    }
  }

  static int query(int t, int b, int l, int r) {
    System.out.printf("? %d %d %d %d\n", t, l, b - 1, r - 1);
    System.out.flush();
    return sc.nextInt();
  }

}




Measured memory_bytes: 19492
#include <bits/stdc++.h>
 
using namespace std;
 
const int MOD=1e9+7;
const double PI=3.14159265359;



int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int a,b;
    cin>>a>>b;
    cout<<(a==2 || b==2?"No":"Yes");
    
    return 0;
}

Measured memory_bytes: 256
N = int(input())
originalN = 0 +N
if N == 2:
  print(1)
  exit()
ans = 0
"""
primenum = [2]
count = [0 for _ in range(int(N**0.5)+2)]
for k in range(3, len(count), 2):
  if count[k] == 0:
    primenum.append(k)
    for j in range(k, len(count), k):
      count[j] = 1
    
def factorization(n):
  lis = []
  k = 0
  while primenum[k] <= n:
    if n%primenum[k] == 0:
      c = 0 
      while n%primenum[k] == 0:
        n //= primenum[k]
        c += 1
      lis.append([primenum[k], c])
    else:
      k += 1
      if k > len(primenum)-1:
        break
  if n > 1:
    lis.append([n, 1])
  return lis
"""
def factorization(n):
  lis = []
  if n % 2 == 0:
    c = 0
    while n%2 == 0:
      n //= 2
      c += 1
    lis.append([2, c])
  k = 3
  while k*k <= n:
    if n%k == 0:
      c = 0 
      while n%k == 0:
        n //= k
        c += 1
      lis.append([k, c])
    else:
      k += 2
  if n > 1:
    lis.append([n, 1])
  return lis

list1 = factorization(N-1)
#print(factorization(N-1))
ans1 = 1
for k in range(len(list1)):
  ans1*= list1[k][1]+1
ans1 -= 1
ans += ans1

#print(ans1)

def operation(K):
  N = originalN
  while N%K == 0:
    N //= K
  if N%K == 1:
    return True
  else:
    return False

list2 = factorization(N)
#print(list2)
factorlist = [1]

for l in range(len(list2)):
  list3 = []
  for j in range(list2[l][1]):
    for k in range(len(factorlist)):
      list3.append(factorlist[k]*list2[l][0]**(j+1))
  factorlist += list3

factorlist = factorlist[1:-1]
#print(factorlist)
ans2 = 1
for item in factorlist:
  if operation(item):
    #print(item)
    ans2 +=1


ans += ans2
#print(ans2)

print(ans)

Measured memory_bytes: 9404
// C.

#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long LL;

int main(int argc, char *argv[]) {
	int n, y;
	cin >> n >> y;
	y /= 1000;
	int ma = y / 10;
	int a, b, c;
	for (a = 0; a <= ma; ++a) {
		int rn = n - a;
		int ry = y - a * 10;
		b = (ry - rn) / 4;
		c = rn - b;
		if (b >= 0 && c >= 0 && (a + b + c) == n && (a * 10 + b * 5 + c) == y) {
			break;
		}
	}
	if (a > ma) {
		a = b = c = -1;
	}
	cout << a << " " << b << " " << c << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main()
{
    int a;
    cin>>a;
    set<int > s1,c;
    set<int > s2;
    while (a--)
    {
        int t;
        cin>>t;
        s1.insert(t);
    }
    cin>>a;
    while (a--)
    {
        int t;
        cin>>t;
        s2.insert(t);
    }

    set_symmetric_difference(s1.cbegin(),s1.end(),s2.begin(),s2.end(),inserter(c,c.begin()));

    auto it=c.begin();
    auto its=c.end();
    for (auto i = it; i !=its ; ++i)
    {
        cout<<*i<<endl;
    }

}


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

int main()
{


long long a,b,c,d;
cin>>a>>b>>c>>d;

long long ans1 = max(a*c,a*d);
long long ans2 = max(b*c,b*d);
long long ans = max(ans1,ans2);

cout<<ans<<endl;

return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define printP(x) "(" << (x).first << ", " << (x).second << ")"
#define mod 1000000007
using namespace std;
typedef pair<llint, llint> P;
typedef pair<P, P> E;
typedef pair<P, E> F;

struct SegTree{
	int size;
	vector<P> seg;
	
	SegTree(){}
	SegTree(int size){
		this->size = size;
		seg.resize(1<<(size+1));
	}
	
	void init()
	{
		for(int i = 0; i < (1<<(size+1)); i++) seg[i] = P(inf, inf);
	}
	
	void update(int i, P val)
	{
		i += (1 << size);
		seg[i] = val;
		while(i > 1){
			i /= 2;
			seg[i] = min(seg[i*2], seg[i*2+1]);
		}
	}

	P query(int a, int b, int k, int l, int r)
	{
		if(b < l || r < a) return P(inf, inf);
		if(a <= l && r <= b) return seg[k];
		P lval = query(a, b, k*2, l, (l+r)/2);
		P rval = query(a, b, k*2+1, (l+r)/2+1, r);
		return min(lval, rval);
	}
	P query(int a, int b)
	{
		return query(a, b, 1, 0, (1<<size)-1);
	}
};

llint n;
llint p[200005];
SegTree seg[2];
vector<llint> ans;
priority_queue<F, vector<F>, greater<F> > Q;

P get(llint l, llint r)
{
	llint retl = seg[l%2].query(l, r).second;
	llint retr = seg[r%2].query(retl, r).second;
	return P(retl, retr);
}

void add(llint l, llint r)
{
	P res = get(l, r);
	Q.push(F(P(p[res.first], p[res.second]), E(P(res.first, res.second), P(l, r))));
}

int main(void)
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> p[i];
	
	seg[0] = SegTree(18), seg[1] = SegTree(18);
	seg[0].init(), seg[1].init();
	for(int i = 1; i <= n; i++){
		seg[i%2].update(i, P(p[i], i));
	}
	add(1, n);
	
	while(Q.size()){
		llint l = Q.top().second.first.first, r = Q.top().second.first.second;
		llint L = Q.top().second.second.first, R = Q.top().second.second.second;
		ans.push_back(Q.top().first.first);
		ans.push_back(Q.top().first.second);
		Q.pop();
		if(L <= l-1) add(L, l-1);
		if(l+1 <= r-1) add(l+1, r-1);
		if(r+1 <= R) add(r+1, R);
	}
	
	for(int i = 0; i < ans.size(); i++) cout << ans[i] << " "; cout << endl;
	
	return 0;
}


Measured memory_bytes: 25008
#include<bits/stdc++.h>
using namespace std;
#define MN 100000
inline int read()
{
    int x=0,f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}
int d[MN+5],n,m,num,X,Y;
vector<int> v[MN+5];
int main()
{
    n=read();m=read();
    for(int i=1;i<=m;++i)
    {
        int x=read(),y=read();++d[x];++d[y];
        v[x].push_back(y);
        v[y].push_back(x);
    }
    for(int i=1;i<=n;++i) 
    {
        if(d[i]&1) return 0*puts("No");
        if(d[i]>4) num+=1000;
        if(d[i]>2) num+=1;
    }
    if(num<=1) return 0*puts("No");
    if(num>=3) return 0*puts("Yes");
    for(int i=1;i<=n;++i) if(d[i]>2) X?(Y=i):(X=i);
    for(int i=0;i<v[X].size();++i)
    {
        int fa=X,x=v[X][i];
        while(x!=Y&&x!=X) for(int k=0;k<v[x].size();++k) if(v[x][k]!=fa) {fa=x,x=v[x][k];break;}
        if(x==X) return 0*puts("Yes");
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 6144
#include<bits/stdc++.h>
using namespace std;
using ll =  long long;
set<ll> s;
void go(ll n)
{
	if(n>4e9)
		return;
	s.insert(n);
	ll last = n%10;
	if(last-1>=0)
		go(n*10+last-1);
	go(n*10+last);
	if(last+1<=9)
		go(n*10+last+1);
}
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);
	for(int i=1;i<=9;i++)
		go(i);
	vector<ll> v;
	for(ll x: s)v.push_back(x);
	int n;
	cin>>n;
	cout<<v[n-1]<<'\n';
}

Measured memory_bytes: 6644