akhauriyash/Code-Regression huggingface dataset:
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        v: [usize; n]
    }
    let mut ans = v[0];
    for i in 1..n {
        ans = lcm(ans, v[i]);
    }
    println!("{}", ans);
}

fn gcd(n: usize, m: usize) -> usize {
    let mut l = min(n, m);
    let mut r = max(n, m);
    while l > 0 {
        let t = l;
        l = r % l;
        r = t;
    }
    r
}

fn lcm(n: usize, m: usize) -> usize {
    n / gcd(n, m) * m
}


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

/**
 * Created by Ayushi on 04 Apr 2020.
 * Problem:
 * Round:
 */

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine(), " ");
        long n = Long.parseLong(st.nextToken());
        long k = Long.parseLong(st.nextToken());
        br.close();

        long x;
        n -= k * (n / k);
        while (true) {
            x = Math.abs(n-k);
            if (x >= n) {
                break;
            }
            else n = x;
        }
        System.out.println(n);
    }
}


Measured memory_bytes: 21460
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

#define PI 3.14159265358979

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

  double theta_h = 2 * PI * (h * 60.0  + m) / (12.0 * 60.0);
  double theta_m = 2 * PI * m / 60.0;
  double theta = abs(theta_h - theta_m);

  double c = a*a + b*b - 2.0*a*b*cos(theta);
  c = sqrt(c);
  cout << fixed << setprecision(15) << c << endl;
}


Measured memory_bytes: 4180
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long int

ll n,abc[4],a,b,c;
char let[4];
char s[100001][3];
char ans[100001];

void swap(int i,int p,int q){
  if(abc[p]>abc[q]){
      ans[i] = let[q];
      abc[p]--; abc[q]++;}
    else{
      ans[i] = let[p];
      abc[q]--; abc[p]++;}
  return;
}

int part2(){
  int p,q;
  for(ll i=0;i<n;i++){
    p = s[i][0]-'A';
    q = s[i][1]-'A';
    if(abc[p]==0 && abc[q]==0) return 0;
    swap(i,p,q);
  }
  return 1;
}

int part1(){
  int p,q;
  for(ll i=0;i<n;i++){
    p = s[i][0]-'A';
    q = s[i][1]-'A';
    if(abc[p]==0 && abc[q]==0) return 0;
    if(abc[p]==1 && abc[q]==1){
      int pnext = s[i+1][0]-'A';
      int qnext = s[i+1][1]-'A';
      if(p==pnext || p==qnext){
	ans[i] = let[p];
	abc[p]++; abc[q]--;}
      else{
	ans[i] = let[q];
	abc[q]++; abc[p]--;}}
    else{
      swap(i,p,q);}}
  return 1;
}

int main(){
  scanf("%lld%lld%lld%lld",&n,&abc[0],&abc[1],&abc[2]);
  a = abc[0];
  b = abc[1];
  c = abc[2];
  let[0] = 'A';
  let[1] = 'B';
  let[2] = 'C';
  for(int i=0;i<n;i++){
    scanf("%s",s[i]);}

  int kano=1;
  if(a+b+c==2) kano = part1();
  else kano = part2();

  if(kano == 1){
    printf("Yes\n");
    for(ll i=0;i<n;i++){
      printf("%c\n",ans[i]);}
  }
  else{
    printf("No\n");}

  return 0;
}


Measured memory_bytes: 2108
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        for(int i = 0 ; i < n ; i ++){
          list.add(sc.nextInt());
        }
		 List<Integer> listB = new ArrayList<Integer>(new HashSet<>(list));
      
      	 System.out.print(listB.size());

    }
}






Measured memory_bytes: 35936
#include <iostream>
using namespace std;
int Mizar(int N){
  int r = 0, count = 0;
  while(N > 0){
  r = N % 10;
  count = count + r;
  N = N / 10;
  }

  return count;
}
int main(){
  int N, A, B;
  int sum = 0;
  cin >> N >> A >> B;
  for(int i = 1; i <= N; i++){
    int count = Mizar(i);
    if(count >= A && count <= B) {
      sum = sum + i;
    }
  }
  cout << sum << endl;
  return 0;
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var texts = Console.ReadLine().ToArray();
            var o = texts[0];
            bool or = true;

            foreach (var i in texts)
            {
                if (o != i)
                {
                    or = false;
                    break;
                }
            }

            if (or)
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }
        }
    }
}

Measured memory_bytes: 13268
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;
struct edge { ll from; ll to; ll cost; };


void err() {
	cout << 0 << endl;
	exit;
}

void mul(ll &a, ll b) {
	a = a * b % MOD;
}


int main() {
	int n, m;
	cin >> n >> m;
	vector<int>a(n), b(m);

	rep(i, 0, n)cin >> a[i];
	rep(i, 0, m)cin >> b[i];
	sort(all(a)); reverse(all(a));
	sort(all(b)); reverse(all(b));
	a.pb(-1);
	b.pb(-1);
	
	
	int apt = 0; int bpt = 0; int num = n * m;
	ll ans = 1;
	while (num > 0) {
		if (a[apt] == num && b[bpt] == num) {
			apt++;
			bpt++;
		}
		else if (a[apt] == num) {
			mul(ans,bpt);
			apt++;
		}
		else if (b[bpt] == num) {
			mul(ans, apt);
			bpt++;
		}
		else {
			mul(ans,apt*bpt - (n*m-num));
		}
		num--;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var K = parseInt(input[0].split(" ")[1]);
  var ans ="NO";
  if(Math.ceil(N/2)>=K){
    ans="YES";
  }

  
  
  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <stdio.h>
int main(void){
    int h, m, s;
    scanf("%d",&s);
    h = s / 3600;
    s %= 3600;
    m = s / 60;
    s %= 60;
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}

Measured memory_bytes: 2716
/***********************************************************
	When you are inspired by passion 
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

					huzaifa242©

***********************************************************/
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define MAX 100005
#define x first 
#define y second

int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l=0,int r=INT_MAX)
{return uniform_int_distribution<int>(l,r)(rng);}

template <typename T,typename G>
ostream& operator << (ostream& out, const pair<T,G> &a) 
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename T>
ostream& operator << (ostream& out, const vector<T> &a) 
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]"<<endl;}

template <typename T>
ostream& operator << (ostream& out, const set<T> &a) 
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}"<<endl;}

template <typename T,typename G>
ostream& operator << (ostream& out, const map<T,G> &a) 
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">"<<endl;}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out <<"]"<<endl;return out;}

int calc(pair<int,int> p, pair<int,int> q){
	int sm=0;
	if(p.x<=p.y)
		sm+=p.y-p.x+1;
	if(q.x<=q.y)
		sm+=q.y-q.x+1;
	return sm;
}

pair<int,int> mrg(pair<int,int> p, pair<int,int> q){
	return {max(p.x,q.x), min(p.y,q.y)};
}

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	int n,i,l,r;
	cin>>n;
	vector<pair<int,int> > a(n);
	for(i=0;i<n;i++){
		cin>>a[i].x>>a[i].y;
	}
	sort(a.begin(),a.end());
	pair<int,int> p,q;
	int ans;
	p=a[0];
	q=a[1];
	ans=calc(p,q);
	// cout<<p<<" "<<q<<" "<<ans<<endl;
	for(i=2;i<n;i++){
		int pq=calc(mrg(p,q),a[i]);
		int pa=calc(mrg(p,a[i]),q);
		int qa=calc(mrg(q,a[i]),p);
		int mx=max(pq,max(pa,qa));
		if(mx==pq){
			p=mrg(p,q);
			q=a[i];
		}else if(mx==pa){
			p=mrg(p,a[i]);
		}else{
			q=mrg(q,a[i]);
		}
		ans=mx;
		// cout<<p<<" "<<q<<" "<<ans<<endl;
	}
	// cout<<p<<" "<<q<<endl;
	cout<<ans;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	vector<int> A(n);
	for (int i = 0; i < n; ++i) {
		scanf("%d", &A[i]);
		if (i >= k) {
			printf(A[i] > A[i - k] ? "Yes\n" : "No\n");
		}	
	}
}


Measured memory_bytes: 4068
#include <iostream>

using namespace std;

int main()
{
    long long ans,m,n;
    cin>>n>>m;
    if(n==1 && m==1)
    {
        ans=1;
    }
    else if(m==1 || n==1)
    {
        ans=m*n-2;
    }
    else if(m==2 || n==2)
    {
        ans=0;
    }
    else
    {
        ans=m*n-2*m-2*n+4;
    }
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define int long long int
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mii map<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define FOR(i,a,n) for(int i=a;i<n;i++)
#define FORD(i,a,n) for(int i=n-1;i>=0;i--)
using namespace std;
 
 
int32_t main(){
 
   
    
    int n,k,a[101];
    cin>>n>>k;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int dp[100001];   //dp[i] reps at stones i whteher pl 1 lose ornwin
    memset(dp,0,sizeof(dp));
    for(int i=1;i<=k;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(i>=a[j])
            {
            if(dp[i-a[j]]==0)
                dp[i]=1;
            }
        }
        dp[i]=max(dp[i],0LL);
       // cout<<dp[i]<<" ";
    }
    if(dp[k]==1)
        cout<<"First"<<endl;
    else
        cout<<"Second"<<endl;


 
    return 0;
 
}


Measured memory_bytes: 1024
#pragma GCC optimize ("-O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<complex>
#include<deque>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<utility>
#include<valarray>
#include<vector>
#include<array>
#include<forward_list>
#include<random>
#include<ratio>
#include<tuple>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
 
using namespace std;
using Int = long long; using uint = unsigned; using uInt = unsigned Int;
typedef pair<int,int> Pi; typedef pair<Int,Int> Pl;
const int mod = 1e9+7;
const Int Inf = 1e17;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int(i)=0; i<n; ++i)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(pri2i,n-1)cout<<a[pri2i]<<' '; cout<<a[n-1]<<'\n';}
#define prip(p) cout<<p.fi<<' '<<p.se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int n,m,q,_,x,y;
string s,sb;
bool key;
char ch;

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

  cin>>n; cout<<n<<':';
  while(n!=1){
    m=sqrt(n);
    if(m<2){cout<<' '<<n<<'\n'; return 0;}
    rer(i,2,m){
      if(!(n%i)){cout<<' '<<i; n/=i; break;}
      else if(i==m){cout<<' '<<n<<'\n'; return 0;}
    }
  }
  cout<<'\n';
}


Measured memory_bytes: 3208
#include<stdio.h>
int main(void)
{
	int H,W;
		int i,j,k,n;
	while(1){
		scanf("%d %d",&H,&W);
		if(H == 0 && W == 0)break;
			for(i = 0; i < H; i++){
				for(j = 0; j < W; j++){
					k = i % 2;
					n = j % 2;
					if(k == 0 && n == 0){
						printf("#");
					}
					else if(k == 1 && n == 0){
						printf(".");
					}
					else if(k == 0 && n == 1){
						printf(".");
					}
					else if(k == 1 && n == 1){
						printf("#");
					}
			}
				printf("\n");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 2548
#include <iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  while(n!=0)
  {
    int a=n%10;
    if(a==7)
    {
      cout<<"Yes"<<"\n";
      return 0;
    }
    n=n/10;
  }
  cout<<"No"<<"\n";
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 30;
 
int main() {
    string n;
    cin >> n;
    int ans = 0;
    bool all9 = true;
    rep(i,n.size()-1) {
        ans += 9;
        if (n[i+1] != '9') all9 = false;
    } 
    ans += n[0] - '0';
    if (!all9) ans--;
    cout << ans << endl; 
    return 0;
}

Measured memory_bytes: 3588
X = int(input())
d = []
cnt = 0
for _ in range(X):
    d.append(int(input()))

now_d = d.pop(d.index(max(d)))
cnt +=1
while(d):
    if now_d == max(d):
        now_d = d.pop(d.index(max(d)))
        continue
    else:
        now_d = d.pop(d.index(max(d)))
        cnt += 1
print(cnt)

Measured memory_bytes: 3064
//void _(){
//    int h,w,n;
//    cin >> h >> w >> n;
//    ll total = (h-2ll)*(w-2);
//    map<ll,int> cnt;
//    vl ans(10);
//    rep(i,1,n){
//        int x,y;
//        cin >> x >> y;
//        rep(r,max(x-2,1),min(x,h-2))
//            rep(c,max(y-2,1),min(y,w-2)){
//                cnt[(ll(r)<<30)+c]++;
//            }
//    }
//    ans[0] = total-sz(cnt);
//    for(auto _ : cnt)
//        ans[_.Y]++;
//    print(ans,"\n");
//}
#include <map>
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define REP_INT(i,l,r) for(int i = l; i <= r; ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define Y second
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 ostream& print(T b, T e, string sep = " ", ostream& stream = cout){
    for(T it = b; it != e; ++it){
        stream << *it;
        if(it + 1 != e)
            stream << sep;
    }
    return stream;
}
T1 void print(vector<T> arr, string sep = " "){
    if(arr.empty()){
        return;
    }
    print(arr.begin(), arr.end(), sep);
    cout << '\n';
}
void _(){
    int h,w,n;
    cin >> h >> w >> n;
    ll total = (h-2ll)*(w-2);
    map<ll,int> cnt;
    vl ans(10);
    rep(i,1,n){
        int x,y;
        cin >> x >> y;
        rep(r,max(x-2,1),min(x,h-2))
            rep(c,max(y-2,1),min(y,w-2)){
                cnt[(ll(r)<<30)+c]++;
            }
    }
    ans[0] = total-sz(cnt);
    for(auto _ : cnt)
        ans[_.Y]++;
    print(ans,"\n");
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        _();
}


Measured memory_bytes: 56576
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
const ll mod = 1e9 + 7;
const int Max = 1e6 + 10;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }

void solve() {
	char c;
	cin >> c;
	if (c >= 'a'&&c <= 'z') {
		cout << "a" << endl;
	}
	else {
		cout << "A" << endl;
	}
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
	solve();
	//}
	return 0;
}






Measured memory_bytes: 3656
#include <iostream>
#include <vector>
using namespace std;
int main()
{
  int c[8];
  for(int i=0; i<9; ++i) cin >> c[i];
  bool ans = false;
  //a1-a2
  if(
      (c[0]-c[3] == c[1]-c[4] && c[1]-c[4] == c[2]-c[5]) // a1 - a2
      &&
      (c[3]-c[6] == c[4]-c[7] && c[4]-c[7] == c[5]-c[8]) // a2 - a3
      &&
      (c[0]-c[1] == c[3]-c[4] && c[3]-c[4] == c[6]-c[7]) // b1 - b2
      &&
      (c[1]-c[2] == c[4]-c[5] && c[4]-c[5] == c[7]-c[8]) // b2 - b3
    )
  {
    ans = true;
  }
  printf("%s\n",ans ? "Yes":"No");
  return 0;
}

Measured memory_bytes: 256
//26
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
  for(string r,a;cin>>r>>a,r!="0"&&a!="0";){
    int h=0,b=0;
    for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
	*((i==j)?&h:&b)+=r[i]==a[j];
      }
    }
    cout<<h<<' '<<b<<endl;
  }
  return 0;
}

Measured memory_bytes: 912
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan =new Scanner(System.in);
		String S =scan.next();
		String T =scan.next();
		int result =T.indexOf(S);
		if(result==0&&S.length()+1==T.length()) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

}


Measured memory_bytes: 35752
import math
n, d = (int(x) for x in input().split())
r = math.pow(d,2)
list = []
count=0
for i in range(n):
    x, y = (int(x) for x in input().split())
    if math.pow(x,2)+math.pow(y,2)<=r:
        count+=1
print(count)

Measured memory_bytes: 70048
#include <bits/stdc++.h>
using namespace std;
int main () {
  int A, B, M;
  cin >> A >> B >> M;
  vector<int> ap(A), bp(B);
  for(int i = 0; i < A; i++)cin >> ap.at(i);
  for(int i = 0; i < B; i++)cin >> bp.at(i);
  int x, y, c, ans = INT_MAX;
  for(int i = 0; i < M; i++){
    cin >> x >> y >> c;
    ans = min(ans, ap.at(x - 1) + bp.at(y - 1) - c);
  }
  sort(ap.begin(), ap.end());
  sort(bp.begin(), bp.end());
  cout << min(ans, ap.at(0) + bp.at(0)) << endl;
  return 0;
}

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

#define ll long long int
#define watch(x) cout << (#x) << " is " << (x) << endl
#define f(i,x,n)  for(int i=x;i<n;i++)
#define FASTIO cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define eb(x) emplace_back(x)
#define mp(a,b) make_pair(a,b)
#define sz(a) int((a).size())
#define mod 1000000007
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define inf LLONG_MAX
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }


void seethis(vector<ll>vect)
{
    for(ll x:vect)
        cout<<x<<" ";
    cout<<"\n";
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
//LCM
int lcm(int a, int b) {  return a * (b / __gcd(a, b)); }

//For sort by second
bool cmp(const pair<int,int> &a)
{ return a.first<a.second; }

//Tree
/* const int MAXN = 1e5 + 5;
vector<ll> adj[MAXN];*/

//ModPower
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}

int main()
{
	FASTIO;
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	ll n;
	cin>>n;
	map<string,int>mp;

	for(int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		mp[s]++;
	}

	cout<<"AC x "<<mp["AC"]<<"\n";
	cout<<"WA x "<<mp["WA"]<<"\n";
	cout<<"TLE x "<<mp["TLE"]<<"\n";
	cout<<"RE x "<<mp["RE"]<<"\n";

	
	return 0;
}

Measured memory_bytes: 3668
/*
オーダー
10**6	余裕を持って間に合う	
10**7	おそらく間に合う	余裕を持って間に合う
10**8	非常にシンプルな処理でない限り厳しい	おそらく間に合う
10**9		非常にシンプルな処理でない限り厳しい
logn	:OK
n		:10^7
nlogn	:10^6
n**2	:10^4
n**3	:300
2**n	:20
n!		:10



// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/

#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <string.h>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18
// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
ll gcd(ll a, ll b) {
	if(b == 0) return a;
	return gcd(b, a % b);
}

// const ll MAX_N = 1e5;
// ll N;
// ll h[MAX_N];
// ll dp[MAX_N+1]; // メモ化テーブル
 
// // i番目以降の品物から重さの総和がj以下になるように選ぶ
// void rec(ll i){
// 	if (i==0) dp[i] = 0;
// 	else if (i==1) dp[i] = abs(h[1]-h[0]);
// 	else dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
// 	return;
// }
 
 
int main() {
	// 入力
	ll N;
	cin >> N;
	ll A[5] = {0};
	for (ll i = 0; i < 5; ++i) cin >> A[i];
 
	// 解法
	sort(A,A+5);
	ll ans = (N-1)/A[0]+5;
	
	//出力
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include <stdio.h>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<vector>
#include <set>
#define ll long long
using namespace std;
char maps[7][7];
int sum;
int ans;
int a[7];
int b[7];

int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
            cin>>maps[i][j];
            if(maps[i][j]=='#')
            {
                sum++;
                a[i]++;
                b[j]++;
            }
        }
    }
    //if(sum==k)
    //{
       // ans++;
  //  }
    for(int i = 0; i < (1<<n); i++)
    {
        for(int x = 0; x < (1<<m); x++)
        {
            int t=sum;
            for(int j = 0; j < n; j++)
            {

                if(i & (1 << j))
                {
                    t=t-a[j];
                }
            }
            for(int y = 0; y < m; y++)
            {
                if(x & (1 << y))
                {
                    t=t-b[y];
                }
            }
            for(int j = 0; j < n; j++)
            {
                for(int y = 0; y < m; y++)
                {
                    if(i & (1 << j)&&x & (1 << y))
                    {
                        if(maps[j][y]=='#')
                        {
                            t++;
                        }
                    }
                }
            }
            if(t==k)
            {
                //cout<<i<<y<<endl;
                ans++;
            }

        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3620
K, N = map(int, input().split())
A = list(map(int, input().split()))
diff_list = []

diff_list.append(K-A[-1] + A[0])

for i in range(1, N):
    diff_list.append(A[i]-A[i-1])


print(sum(diff_list)-max(diff_list))

Measured memory_bytes: 26436
#[allow(unused_macros)]
macro_rules! invec {
    ( $t:ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(), Ok(n) => s.trim().split_whitespace().map(|s| s.parse::<$t>().unwrap()).collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }}
}

#[allow(unused_macros)]
macro_rules! input {
    ( $($t:ty),* ) => {{
        let mut s = String::new();
        std::io::stdin().read_line(&mut s);
        let mut splits = s.trim().split_whitespace();
        ($(
            {
                 splits.next().unwrap().parse::<$t>().unwrap()
            },
        )*)
    }}
}

#[allow(unused_must_use)]
#[allow(unused_variables)]
fn solve() {
    let (n,q) = input!(usize, usize);
    let (s,) = input!(String);

    let mut cumulative_sum = vec![];

    let mut a = false;
    let mut total = 0;

    for c in s.chars() {
        match c {
            'A' => {
                a = true;
            },
            'C' => {
                if a {
                    total += 1;
                }
                a = false;
            },
            _ => {
                a = false;
            },
        }
        cumulative_sum.push(total);
    }

    for i in 0..q {
        let (l, r) = input!(u32, u32);
        let (l, r) = (l-1, r-1);
        println!("{}", cumulative_sum[r as usize] - cumulative_sum[l as usize]);
    }

}

fn main() {
    solve();
}


Measured memory_bytes: 4860
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define endl            "\n"
#define forn(i,x,n)     for(int i=x; i<n; i++)
#define forit(it, m)    for(decltype(m)::iterator it = m.begin(); it!=m.end(); ++it)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());


void zeus()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int fast_pow(long long base, long long n, long long M)
{
    if (n == 0)
        return 1;
    if (n == 1)
        return base;
    long long halfn = fast_pow(base, n / 2, M);
    if (n % 2 == 0)
        return ( halfn * halfn ) % M;
    else
        return ( ( ( halfn * halfn ) % M ) * base ) % M;
}
int32_t main() {

    zeus();

    int k; cin >> k;

    int num = 7 % k;

    set<int> s;
    int count = 1;
    while (1) {
        if (s.count(num % k) == 1) {
            cout << -1 << endl;
            break;
        }
        s.insert(num % k);
        if (num % k == 0) {
            cout << count << endl;
            break;
        }
        num = (num * 10 + 7) % k;
        count++;
    }
}

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

// #define ANS  //for answer
#define CMP  //for compe

#ifdef CMP
using namespace std;
#else
#endif

#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()
#define nv(x) #x, (x)
#define ncv(x) #x, ":", (x)
#define ncvc(x) #x, ":", (x), ","
using ll = long long;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
void pPRINT(std::ostream& ost) {}
template <class T, class... U>
void pPRINT(std::ostream& ost, const T t, const U... u) {
  ost << t << " ";
  pPRINT(ost, u...);
}
template <class... T>
void PRINT(const T... t) { pPRINT(std::cout, t...); }
template <class... T>
void PRINTl(const T... t) {
  pPRINT(std::cout, t...);
  std::cout << "\n";
}
template <class T>
void PRINTa(const T* const t, const ll size) {
  REP(i, size)
  PRINT(t[i]);
  PRINTl();
}
template <class T>
void PRINTal(const T* const t, const ll size) {
  REP(i, size)
  PRINTl(i, ":", t[i]);
}
#ifndef DBG
#define DEBUG(...)
void init() {}
#else
#define DEBUG(...)                                                     \
  {                                                                    \
    PRINT("##DEBUG##", "file :", __FILE__, ", line :", __LINE__, "["); \
    PRINT(__VA_ARGS__);                                                \
    PRINTl("]");                                                       \
  }
void init() {
  DEBUG("INIT");
  cin.tie(0);
  ios::sync_with_stdio(false);
}
#endif
#ifdef ANS
#else
#endif

void solve();

int main(int argc, char* argv[]) {
  DEBUG("MAIN");
  init();
  solve();

  return 0;
}

void solve() {
  DEBUG("SOLVE START");

  ll n;
  cin >> n;
  PRINT(n * n * n);

  return;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
using namespace std;

typedef long long ll;

int main(){
    int x;
    cin>>x;
    bool isprime=true;
    for(int i=x;i<=x*2;i++){
        for(int j=2;j<=sqrt(i);j++){
            if(i%j==0){
                isprime=false;
                break;
            }
        }
        if(isprime){
            cout<<i<<endl;
            return 0;
        }
        isprime=true;
    }
    return 0;
}

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

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] days = { "mon", "tue", "wed", "thu", "fri", "sat", "sun" };

        int x = Integer.parseInt(br.readLine());
        System.out.println(days[(x+10)%7]); // x+14(2weeks)-9(base day)+5(sat)
    }
}


Measured memory_bytes: 24408
import math
A, B, C = map(int, input().split())
K = int(input())
x = 0
if A < B < C:
  print("Yes")
if A >= B:
  x = math.ceil(math.log(A/B, 2))
  B =B*(2**x)
  if A != B:
    if x > K:
      print("No")
    elif B < C:
      print("Yes")
  else:
    x += 1
    B = B*2
if B >= C:
  y = math.ceil(math.log(B/C, 2))
  C = C*(2**y)
  if B != C:
    if x+y > K:
      print("No")
    else:
      print("Yes")
  else:
    y += 1
    if x+y > K:
      print("No")
    else:
      print("Yes")

Measured memory_bytes: 9128
#include <iostream>

using namespace std;

int main()
{
    int a,b;
    string op;
    cin>>a;
   cin>>op;
   cin>>b;
   if(op=="+"){
    cout<<a+b;
    }
    else if (op=="-"){
    cout<<a-b;
    }
    return 0;
}


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

int main(){
    int N, L;
    int minab = 1000, minnum=1, sum=0, res=0;
    cin >> N >> L;
    for(int i=1; i<=N; i++){
        sum += L+i-1;
    }
    for(int i=1; i<=N; i++) {
        if(abs(abs(sum)-abs(sum-(L+i-1))) < minab) {
            minnum = i;
            minab = abs(abs(sum)-abs(sum-(L+i-1)));
        }
    }
    for(int i=1; i<=N; i++){
        if(i != minnum) res += L+i-1;
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE long long
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;

int in(void){
    int i;scanf("%d",&i);
    return i;
}
double din(void){
    double i;scanf("%lf",&i);
    return i;
}
void chin(char s[]){
    scanf("%s",s);
}
void print(int a){
    printf("%d\n",a);
}
void llprint(long long a){
    printf("%lld\n",a);
}
void dprint(double a){
    printf("%.10f\n",a);
}
void print2(int a,int b){
    printf("%d %d\n",a,b);
}
double dmax(double a,double b){
    return a>b?a:b;
}
int cmp(const void *a,const void *b){
    return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
    return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
    return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
    return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
    int t=*a;
    *a=*b;
    *b=t;
}

typedef struct tagNode{
    struct tagNode *next;
    
}Node;

void tansaku(int n){
    
}

int main(void){
    int n=in();
    if(n==1) printf("Hello World\n");
    else printf("%d\n",in()+in());
    return 0;
    return 0;
}

Measured memory_bytes: 128
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int r = sc.nextInt();

		if (n<10) {
			int sum = 100*(10-n);
			System.out.println(r+sum);
		}else{
			System.out.println(r);
		}



	}
}


Measured memory_bytes: 22996
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,3);
  var list = [[],[],[],[]];
  for(var i = 0; i < input.length; i++){
    var a = myconv(input[i],4)[0]-1;
    var b = myconv(input[i],4)[1]-1;
    list[a].push(b);
    list[b].push(a);
  }
  
  var output = "YES";
  for(var i = 0; i < list.length; i++){
    if(list[i].length == 3){
       output = "NO";
       }
  }
  myout(output);
}

Main(myin());


Measured memory_bytes: 7496
N,K = map(int,input().split())
if N < 3:
    print(0)
    exit()

mem = [0] * 11
for i in range(11):
    for j in range(2,7):
        n = i*7 + j
        if (9*n)%11 == K: mem[i] += 1

ans = sum(mem) * (N//11)
ans -= mem[0]
if N%11 == 0:
    ans -= mem[-1]
else:
    ans += sum(mem[:N%11 - 1])
print(ans)

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

namespace Contest
{
	class Program
	{
		static void Main(string[] args)
		{
			var ABC = Console.ReadLine().Split();
			string A = ABC[0], B = ABC[1], C = ABC[2];
			if (A[A.Length - 1] == B[0] && B[B.Length - 1] == C[0])
			{
				Console.WriteLine("YES");
			}
			else
			{
				Console.WriteLine("NO");
			}
#if DEBUG
			Console.ReadKey();
#endif
		}
	}
}


Measured memory_bytes: 13140
#include <iostream>
#include<iomanip>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#include<stack>
#include<set>
#include<map>
#define INF long long int(1e18+1)
#define rep(i,n,m) for(int i=n;i<m;i++)

using namespace std;

int main()
{
	int x, y;
	cin >> x >> y;
	if (x * 500 >= y)cout << "Yes" << endl;
	else cout << "No" << endl;
}



Measured memory_bytes: 3548
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define FIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main(){
    FIO;
    ll n, mod = 998244353;
    cin >> n;
    string s;
    cin >> s;
    ll n1 = s.size(), ans = 1;
    ll cnt = n, r=0, g=0, b=0, rb=0, rg=0, gb=0;
    for(ll i = 0 ; i < n1 ; i++){
        if(s[i] == 'R'){
            if(gb > 0){
                ans *= gb;      gb--;
            }else if(g > 0 || b > 0){
                if(g > 0){
                    ans *= g;   rg++;   g--;
                }else{
                    ans *= b;   rb++;   b--;
                }
            }else{
                r++;    ans *= cnt;     cnt--;
            }
        }else if(s[i] == 'G'){
            if(rb > 0){
                ans *= rb;      rb--;
            }else if(b > 0 || r > 0){
                if(b > 0){
                    ans *= b;      b--;     gb++;
                }else{
                    ans *= r;       r--;    rg++;
                }
            }else{
                ans *= cnt;     cnt--;      g++;
            }
        }else{
            if(rg > 0){
                ans *= rg;      rg--;
            }else if(g > 0 || r > 0){
                if(r > 0){
                    ans *= r;       r--;    rb++;
                }else{
                    ans *= g;   g--;    gb++;
                }
            }else{
                ans *= cnt;     cnt--;      b++;
            }
        }
        //cout << ans << endl;
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}


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

bool f(int x) {
  int keta = 0;
  while (x) {
    keta++;
    x /= 10;
  }
  return keta%2 == 1;
}
int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (f(i)) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

#include <cstdio>

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N;
	bool nn[82] = { false };

	cin >> N;

	repc(i, 1, 9) {
		repc(j, 1, 9) nn[i * j] = true;
	}

	if (nn[N]) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
template <typename T> void print(T t) { cout<<t<<endl; }
template<typename T, typename... Args> void print(T t, Args... args) { cout<<t<<" "; print(args...); }
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define double long double

int n;
int fact[200005];
vector<int>v[200005];
int store[200005];
int subtree[200005];
int finans[200005];
int mod=1e9+7;

int inv(int x)
{
    int r,y;
    for(r=1,y=mod-2;y>0;x=(x*x)%mod,y/=2)
        if(y%2==1)
            r=r*x%mod;
    return r;
}

int nCr(int n, int m)
{
    return fact[n] *inv(fact[m])%mod *inv(fact[n-m])%mod ;
}

int dfs(int pos,int par)
{
    if(par!=0 && v[pos].size()==1)
    {
        subtree[pos]=1;
        store[pos]=1;
        return 1;
    }
    int sum=0;
    int product=1;
    for(auto i:v[pos])
    {
        if(i!=par)
        {
            int val=dfs(i,pos);
            product=(product*inv(fact[val]))%mod;
            product=(product*store[i])%mod;
            sum+=val;
        }
    }
    product=(product*fact[sum])%mod;
    store[pos]=product;
    subtree[pos]=sum+1;
    return sum+1;
}
void dfs1(int pos,int par,int parans)
{
    //print(pos,par,parans);
    int ans=store[pos];
    ans=(ans*inv(fact[subtree[pos]-1]))%mod;
    ans=(ans*fact[n-1])%mod;
    ans=(ans*inv(fact[n-subtree[pos]]))%mod;
    ans=(ans*parans)%mod;
    finans[pos]=ans;

    int ans1=1;
    for(auto i:v[pos])
    {
        if(i!=par)
        {
            ans1=(ans1*inv(fact[subtree[i]]))%mod;
            ans1=(ans1*store[i])%mod;
        }
        else
        {
            ans1=(ans1*parans)%mod;
            ans1=(ans1*inv(fact[n-subtree[pos]]))%mod;
        }
    }
    for(auto i:v[pos])
        if(i!=par)
        {
            int get=ans1;
            get=(get*fact[n-subtree[i]-1])%mod;
            get=(get*fact[subtree[i]])%mod;
            get=(get*inv(store[i]))%mod;
            dfs1(i,pos,get);
        }
}
int32_t main() 
{
    IOS;
    fact[0]=1;
    for(int i=1;i<=200004;i++)
        fact[i]=(i*fact[i-1])%mod;
    cin>>n;
    for(int i=0;i<n-1;i++)
    {
        int a,b;
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    dfs(1,0);
    finans[1]=store[1];
    dfs1(1,0,1);
    for(int i=1;i<=n;i++)
        print(finans[i]);
}   


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

int main(){
  int A, B;
  cin >> A >> B;
  int c[4] = {};
  ++c[A];
  ++c[B];
  for(int i = 1; i <= 3; ++i){
    if(!c[i]){
      cout << i << endl;
      return 0;
    }
  }
}


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

string st;

int main() {
  cin >> st;
  int f = stoi(st.substr(0,2)),
      s = stoi(st.substr(2,2));
  if(1 <= f && f <= 12 && 1 <= s && s <= 12)
    cout << "AMBIGUOUS" << endl;
  else if(!(1 <= f && f <= 12) && !(1 <= s && s <= 12))
    cout << "NA" << endl;
  else if(!(1 <= f && f <= 12) && 1 <= s && s <= 12)
    cout << "YYMM" << endl;
  else if(1 <= f && f <= 12 && !(1 <= s && s <= 12))
    cout << "MMYY" << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int n, x;
	while (true)
	{
		cin >> n >> x;
		if (n == 0 && x == 0)
			break;
		int c = 0;
		for (int i = 1; i <= n; i++)
			for (int j = i + 1; j <= n; j++)
				for (int k = j + 1; k <= n; k++)
					if (i + j + k == x)
						c++;
		cout << c << endl;
	}
}




Measured memory_bytes: 3104
#include <stdio.h>
int main(void)
{
    int n,k,l[50],i,j,max,s=0,tmp;
    
    scanf("%d%d",&n,&k);
    for(i=0;i<n;i++)
        scanf("%d",&l[i]);
    for(i=0;i<k;i++){
        max=0;
        for(j=0;j<n;j++)
            if(max<l[j]){tmp=max; max=l[j]; l[j]=tmp;}
        s+=max;
    }
    printf("%d\n",s);
    return 0;
}

Measured memory_bytes: 128
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function permutation(a,n)
	ans = Array{Int,1}[copy(a)]
	c = ones(Int,n)
	i = 1
	while i<=n
		if c[i]<i
			if i%2==1
				tmp = a[1]
				a[1] = a[i]
				a[i] = tmp
			else
				tmp = a[c[i]]
				a[c[i]] = a[i]
				a[i] = tmp
			end
			c[i] += 1
			i = 1
			push!(ans,copy(a))
		else
			c[i] = 1
			i += 1
		end
	end
	ans
end

function main()
    n,m,rn = readline() |> split |> parseMap
    r = readline() |> split |> parseMap
    d = 10^18*ones(Int,n,n)
    for i in 1:n
        d[i,i] = 0
    end
    for i in 1:m
        a,b,c = readline() |> split |> parseMap
        d[a,b] = c
        d[b,a] = c
    end
    for k in 1:n
        for i in 1:n
            for j in 1:n
                d[i,j] = min(d[i,j],d[i,k]+d[k,j])
            end
        end
    end
    prm = permutation(r,rn)
    minim = 10^18
    for i in 1:length(prm)
        x = 0
        for j in 2:rn
            x += d[prm[i][j-1],prm[i][j]]
        end
        minim = min(minim,x)
    end
    println(minim)
end
main()

Measured memory_bytes: 132340
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long int ll;

int h,w;
char fi[2100][2100];
int cnt[2100][2100];
int cnt1[2100][2100];

bool ok(int i,int j){
    if(0<=i&&i<h&&0<=j&&j<w)return true;
    else return false;
}

void dfs(int i,int j){
    int cn=0;
    int y=i,x=j;
    while(ok(y,x)&&fi[y][x]=='.'){
        cn++;
        x++;
    }
    for(int k=j;k<j+cn;k++){
        cnt[i][k]+=(cn-1);
    }
    return;
}
void dfs1(int i,int j){
    int cn=0;
    int y=i,x=j;
    while(ok(y,x)&&fi[y][x]=='.'){
        cn++;
        y++;
    }
    for(int k=i;k<i+cn;k++){
        cnt1[k][j]+=(cn-1);
    }
    return;
}

int main(){
    cin >> h >> w;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin >> fi[i][j];
        }
    }
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(fi[i][j]=='.'&&cnt[i][j]==0){
                dfs(i,j);
            }
            if(fi[i][j]=='.'&&cnt1[i][j]==0){
                dfs1(i,j);
            }
        }
    }
    int ma=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            ma=max(ma,cnt[i][j]+cnt1[i][j]);
        }
    }
    cout << ma+1 << endl;
}

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

int main(void){
  int n, a[1010], wa=1000000007;
  long long int ans=1;
  for(int i=0;i<1010;++i){
    a[i] = 0;
  }
  cin >> n;
  for(int i=2;i<=n;++i){
    int k=i;
    for(int j=2;j<=i;++j){
      while(k%j==0){
        ++a[j];
        k/=j;
      }
    }
  }
  for(int i=2;i<=n;++i){
    if(a[i]==0) continue;
    ans *= (a[i]+1);
    ans %= wa;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<cmath>
#include<stack>
#include <algorithm>
#include <functional>
//#include<stdlib.h>
using namespace std;


int main() {
	int n;
	cin >> n;
	int p;
	double q,s = 0;
	for (int a = 0; a < n; a++) { cin >> p; q = 1.0 / p; s += q; }
	s = 1.0 / s;
	cout << s;
	return 0;
}

Measured memory_bytes: 256