akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#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;

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

void solve(long long A, long long B)
{
    if (A == B)
    {
        cout << "Draw" << endl;
        return;
    }

    if (A == 1 || (B < A && B != 1))
    {
        cout << "Alice" << endl;
    }
    else
    {
        cout << "Bob" << endl;
    }
}

int main()
{
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int n,b=100000;
	scanf("%d",&n);
	for(;n;n--){
		b*=1.05;
		if(b%1000!=0) b=(b+1000)/1000*1000;
	}
	printf("%d\n",b);
	return 0;
}

Measured memory_bytes: 592
import std.stdio;
import std.string;
import std.conv;

void main()
{
    int[] a = readln.chomp.split.to!(int[]);
    if (a[0] <= 8 && a[1] <= 8) {
        writeln("Yay!");
    }
    else {
        writeln(":(");
    }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int l,i,cnt=0;
  scanf("%d",&l);
  int num[l];
  for(i=0;i<l;i++){
    scanf("%d",&num[i]);
    if(num[i]!=i+1){
      cnt++;
    }
  }
  if(cnt==0||cnt==2){
    printf("YES");
  }else{
    printf("NO");
  }
  return 0;
}

Measured memory_bytes: 128
# coding: utf-8
n, x = list(map(int, input().split()))
l  = list(map(int, input().split()))
s = 0
l2 = [0]
c = 1
for _l in l:
    s += _l
    if s > x:
        break
    else:
        c += 1
print(c)


Measured memory_bytes: 2940
n = int(input())

xu = [[str(i) for i in input().split()] for _ in range(n)]

ans = 0

for i in range(n):
  if xu[i][1] == "JPY":
    ans += int(xu[i][0])
  else:
    ans += float(xu[i][0])*380000.0
    
print(ans)



Measured memory_bytes: 3060
//#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
const int MX = 2001;
int ans,k,m,n,u,v;
vector<int> g[MX];
void dfs(int now,int pre,int dep) {
    m++;
    if (dep==0) return ;
    for (auto i:g[now])
        if (i!=pre) dfs(i,now,dep-1);
}
int main() {
    scanf("%d%d",&n,&k);
    for (int i=1; i<n; ++i) {
        scanf("%d%d",&u,&v);
        g[u].push_back(v);
        g[v].push_back(u);
    }
    if (k&1) {
        for (int i=1; i<=n; ++i)
            for (auto p : g[i])
                if (p>i) {
                    m=0;
                    dfs(i,p,k/2);
                    dfs(p,i,k/2);
                    if (m>ans) ans=m;
                    if (ans==n) break;
                }
    } else {
        for (int i=1; i<=n; ++i) {
            m=0;
            dfs(i,0,k/2);
            if (m>ans) ans=m;
            if (ans==n) break;
        }
    }
    printf("%d\n",n-ans);
    return 0;
}


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

int main() {
  string S;
  cin>>S;
  vector<int>a(4);
  for(int i=0;i<4;i++){
    a.at(i)=S.at(i);
  }
  int sum=0;
  string ans;
  for(int i=0;i<8;i++){
    sum=0;
    ans="";
    sum+=a.at(0)-'0';
    ans+=a.at(0);
    for(int j=0;j<3;j++){
      if(i&(1<<j)){
        sum+=a.at(j+1)-'0';
        ans+="+";
        ans+=a.at(j+1);
      }
      else{
        sum-=a.at(j+1)-'0';
        ans+="-";
        ans+=a.at(j+1);
      }
    }
    if(sum==7){
      cout<<ans<<"=7"<< endl;
      return 0;
    }
  }
}
    

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int maxC = C <= (A + B + 1) ? C :(A + B+1);
        int max = maxC + B;

        System.out.println(max);
    }

}


Measured memory_bytes: 22740
#include <bits/stdc++.h>
#define int long long
#define N 10011

using namespace std;

const int MOD = (int)1e9 + 7;

int n, d;
int p[N], cnt[N][2][100];
string k;

int solve(int idx, int ok, int mod) {
	if(idx == n) return mod == 0;
	if(cnt[idx][ok][mod] != -1) return cnt[idx][ok][mod];
	int res = 0;
	if(ok) {
		for(int i=0; i<10; i++) {
			res = (res + solve(idx+1, ok, (mod + i) % d)) % MOD;
		}
	}
	else {
		res = solve(idx+1, 0, (mod + (k[idx] - '0')) % d);
		for(int i=0; i<k[idx]-'0'; i++) res = (res + solve(idx+1, 1, (mod + i) % d)) % MOD;
	}
	return cnt[idx][ok][mod] = res;
}

signed main() {
	memset(cnt, -1, sizeof cnt);
	cin >> k >> d;
	n = k.size();
	cout << (solve(0,0,0) + MOD - 1) % MOD << endl;
	return 0;
}


Measured memory_bytes: 16640
m, k = map(int, input().split())

if m == 1:
    if k == 0:
        print("0 0 1 1")
    else:
        print(-1)
else:
    if 2**m <= k:
        print(-1)
    else:
        ANS = []
        for i in range(2**m):
            if i != k:
                ANS.append(i)
        ANS.append(k)
        for i in range(2**m-1,-1,-1):
            if i != k:
                ANS.append(i)
        ANS.append(k)
        print(*ANS)

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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define rrepa(i,a,n) for(int i=n;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;

int main(){

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

    if((d+a-1)/d>=(b+c-1)/b)cout<<"Yes\n";
    else cout<<"No\n";

    return 0;
}

Measured memory_bytes: 3636
#pragma GCC optimize ("O3")
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <stack>
#include <unordered_map>
#define lld long long int
#define dbg1(vari1) cerr<<#vari1<<" = "<<(vari1)<<endl;
#define dbg2(vari1,vari2) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<endl;
#define dbg3(vari1,vari2,vari3) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<" "<<#vari3<<" = "<<(vari3)<<endl;
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	lld n,w;
	cin >> n >> w;
	lld dp[n+1][w+1];
	for(int i=0;i<w+1;i++)
	{
		dp[0][i]=0;
	}
	for(int i=0;i<n+1;i++)
	{
		dp[i][0]=0;
	}
	lld arr[n][2];
	for(int i=0;i<n;i++)
	{
		cin >> arr[i][0] >> arr[i][1] ;
	}
	for(int i=1;i<=n;i++)
	{
		lld we = arr[i-1][0];
		lld va = arr[i-1][1];
		for(int j=1;j<=w;j++)
		{
			if(j-we>=0)
			{
				dp[i][j]=max(dp[i-1][j],dp[i-1][j-we]+va);
			}
			else
			{
				dp[i][j]=dp[i-1][j];
			}
		}
	}
	lld ans=-1;
	for(int i=0;i<=w;i++)
	{
		ans=max(ans,dp[n][i]);
	}
	cout << ans;
}

Measured memory_bytes: 79232
#include <iostream>
#include <algorithm>
#include <string>
#include <deque>
#include <vector>
#include <cmath>
using namespace std;
#define fi first
#define se second
#define ll long long int
ll llmin (ll a, ll b){
    if (a<=b) return a;
    return b;
}
int main(){
    ll a, b, c, num;
    cin>>a>>b>>c;
    a=abs(a);
    num=a/c;
    if (b>=num){
        a-=c*num, b-=num;
        if (b==0) cout<<a<<endl;
        else {
            if (b%2==1) cout<<abs(a-c)<<endl;
            else cout<<a<<endl;
        }
    }
    else {
        cout<<a-b*c<<endl;
    }
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
#define eb emplace_back
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr ll MOD = 1e9 + 7;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
struct UnionFind {
    vector<int> par, siz;
    UnionFind(int n) {
        par.resize(n);
        siz.resize(n, 1);
        for (int i = 0; i < n; i++)
            par[i] = i;
    }
    int find(int x) {
        if (par[x] == x) {
            return x;
        } else {
            return par[x] = find(par[x]);
        }
    }
    bool unite(int u, int v) {
        u = find(u), v = find(v);
        if (u == v)
            return false;
        if (siz[u] < siz[v])
            swap(u, v);
        par[v] = u;
        siz[u] += siz[v];
        return true;
    }
    bool same(int u, int v) { return find(u) == find(v); }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, m, k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    vector<int> cnt(n);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        uf.unite(a, b);
        cnt[a]++;
        cnt[b]++;
    }
    for (int i = 0; i < k; i++) {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        if (uf.same(a, b)) {
            cnt[a]++;
            cnt[b]++;
        }
    }
    for (int i = 0; i < n; i++) {
        cout << uf.siz[uf.find(i)] - 1 - cnt[i];
        if (i + 1 < n) {
            cout << " ";
        }
    }
    cout << endl;
}
/*
・Gで繋がれてない
・Hで繋がれてない
・Gで同じ連結成分にある
Hの関係は、Gで同じ成分内にあるもののみに定義すればOK
*/

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

int main() {
    string S;
    cin >> S;
    int S_len = S.size();
    int count1 = 0, count2 = 0;
    for(int i=0; i < S_len; i += 2){
        if(S[i] != '0')
            count1++;
    }
    for(int i=1; i<S_len; i += 2){
        if(S[i] != '1')
            count1++;
    }
    
    for(int i=0; i < S_len; i += 2){
        if(S[i] != '1')
            count2++;
    }
    for(int i=1; i<S_len; i += 2){
        if(S[i] != '0')
            count2++;
    }
    
    cout << (count1 < count2 ? count1 : count2) << endl; 
	return 0;
}


Measured memory_bytes: 512
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define double long double
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
#define ALL(a)  (a).begin(),(a).end()
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int n, int r) {
	int ans = 1;
	for (ll i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
int per(int n, int r) {
	r = n - r;
	int sum = 1;
	int i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}
struct union_find {
	int par[200010], size_[200010];
	void init(int x) {
		rep(i, x) { par[i] = i; size_[i] = 1; }
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (size_[x] < size_[y]) {
			par[x] = y;
			size_[y] += size_[x];
		}
		else {
			par[y] = x;
			size_[x] += size_[y];
		}
	}
};

int ctoi(const char c) {
	return c - '0';
}
int keta(int a) {
	return to_string(a).size();
}
signed main() {
	int n, m;
	cin >> n >> m;
	if (n % m == 0)cout << n / m << endl;
	else cout << (n / m) + 1 << endl;
}

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

int ans = 0;
string s, t;

int main()
{
    cin >> s >> t;
    for (int i = 0; s[i] != NULL; i++) {
        if (s[i] != t[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3912
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSData *stdinData = [[NSFileHandle fileHandleWithStandardInput] availableData];
        NSString *s = [[NSString alloc] initWithData:stdinData encoding:NSUTF8StringEncoding];
        NSMutableString *answer = [NSMutableString stringWithString:s];
        [answer replaceCharactersInRange:NSMakeRange(3,1) withString:@"8"];
        
        NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardOutput];
        [fileHandle writeData:[answer dataUsingEncoding:NSUTF8StringEncoding]];
        [fileHandle writeData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];
        [fileHandle closeFile];
    }
    
    return 0;
}


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

#define fastIO ios::sync_with_stdio(false);cout.tie(0);cin.tie(0);
#define endl '\n'
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define MP make_pair
#define inf INT_MAX
#define minf INT_MIN

typedef long long int lli;

ofstream outfile;
ifstream infile;

int main()
{
	infile.open("input.txt");
	outfile.open("output.txt");

	int h, w, n;
	int arr[10003];

	cin >> h >> w >> n;
	int i, j, k;
	for(i = 1; i <= n; ++i)
		cin >> arr[i];

	int color[102][102];

	j = 1;
	k = 1;

	for(i = 1; i <= n; ++i)
	{
		while(arr[i])
		{
			--arr[i];
			color[j][k] = i;

			if(j%2){
				++k;
				if(k == w+1)
				{
					k = w;
					++j;
				}
			}
			else{
				--k;
				if(!k){
					k = 1;
					++j;
				}
			}
		}
	}
	//cout << c << '\n';

	for(i =1 ; i <= h; ++i)
	{
		for(j = 1; j <= w; ++j)
		{
			cout << color[i][j] << " ";
		}
		cout << "\n";
	}
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

void solve()
{
	int res = 0;
	for (int i = 0; i < 3; i++) {
		char tmp;
		cin >> tmp;
		res += tmp - '0';
	}
	cout << res << endl;
}

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

Measured memory_bytes: 256
package main

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

type Scanner struct {
	sc *bufio.Scanner
}

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

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

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

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

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

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

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

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

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

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

func main() {
	sc := NewScanner()
	N := sc.nextInt()
	d := len(strconv.Itoa(N))
	ans := 0
	var dfs func(nums []int, n, digit int)
	dfs = func(nums []int, n, digit int) {
		if n == digit {
			set := make(map[int]bool)
			for _, v := range nums {
				set[v] = true
			}
			if len(set) == 3 && toNum(nums) <= N {
				ans++
			}
			return
		}
		dfs(append(nums, 3), n+1, digit)
		dfs(append(nums, 5), n+1, digit)
		dfs(append(nums, 7), n+1, digit)
	}
	for i := 3; i <= d; i++ {
		dfs([]int{}, 0, i)
	}
	fmt.Println(ans)
}

func toNum(nums []int) int {
	res := 0
	for _, n := range nums {
		res *= 10
		res += n
	}
	return res
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
typedef long long ll;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define forn(i,a,b) for(int i=a;i<(int)b;i++)
int main()
{
    int a,b;
    cin>>a>>b;
    ll sum=0;
    for(int i=0;i<b;i++)
    {
        int x;
        cin>>x;
        sum+=x;
    }
    if(sum>=a)
    cout<<"Yes\n";
    else
    cout<<"No\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <vector>
#include <bitset>
#include <stack>
#include <iomanip>
#include <set>
#include <queue>
#include <map>


typedef long long ll;
typedef unsigned long long ull;
#define mk make_pair
#define mkt make_tuple

using namespace std;
int const N = 100000;
vector<vector<pair<int, int>>> v;
int ans[N]; bool was[N];
int maxdeg;

void dfs(int u, int edge) {
	was[u] = true;
	int k = 1;
	for (auto e : v[u])
		if (!was[e.first]) {
			ans[e.second] = (edge + k) % maxdeg + 1;
			dfs(e.first, ans[e.second]-1);
			k++;
		}
}

int main()
{
	int n;
	cin >> n; 
	for (int i = 0; i < n; i++) v.push_back(vector<pair<int, int>>());
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b; a--; b--;
		v[b].push_back(mk(a, i));
		v[a].push_back(mk(b, i));
	}

	maxdeg = v[0].size();
	for (int i = 1; i < n; i++)
		maxdeg = max(maxdeg, (int)v[i].size());

	dfs(0, -1);

	cout << maxdeg << endl;
	for (int i = 0; i < n - 1; i++)
		cout << ans[i] << endl;
}



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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 20;

char g[MAXN][MAXN];

int g1[MAXN][MAXN], g2[MAXN][MAXN];
int used[MAXN], pp[MAXN], single;

int n, m;

int cnt1[200], cnt2[200];
int used2[MAXN], single2;

int rec_sol2() {
	int cur = -1;
	REP(i, 0, m) {
		if (!used2[i]) {
			cur = i;
			break;
		}
	}
	if (cur == -1) {
		return 1;
	}
	
	used2[cur] = 1;
	REP(j, cur + 1, m) {
		if (!used2[j] && g2[cur][j]) {
			used2[j] = 1;
			if (rec_sol2()) {
				return 1;
			}
			used2[j] = 0;
		}
	}
	
	if (single2 == -1 && m % 2 == 1) {
		single2 = cur;
		if (rec_sol2()) {
			return 1;
		}
		single2 = -1;
	}
	
	used2[cur] = 0;
	return 0;
}

int check() {
	REP(i, 0, m) {
		REP(j, i + 1, m) {
			g2[i][j] = 1;
			REP(k, 0, n) {
				if (k == single) {
					if (g[k][i] != g[k][j]) {
						g2[i][j] = 0;
					}
				} else {
					if (g[k][i] != g[pp[k]][j]) {
						g2[i][j] = 0;
					}
				}
			}
			g2[j][i] = g2[i][j];
		}
	}
	
	single2 = -1;
	return rec_sol2();
}

int rec_sol() {
	int cur = -1;
	REP(i, 0, n) {
		if (!used[i]) {
			cur = i;
			break;
		}
	}
	if (cur == -1) {
		return check();
	}
	
	used[cur] = 1;
	REP(j, cur + 1, n) {
		if (!used[j] && g1[cur][j]) {
			pp[j] = cur;
			pp[cur] = j;
			used[j] = 1;
			if (rec_sol()) {
				return 1;
			}
			used[j] = 0;
		}
	}
	if (single == -1 && n % 2 == 1) {
		single = cur;
		if (rec_sol()) {
			return 1;
		}
		single = -1;
	}
	
	used[cur] = 0;
	return 0;
}

void solve(){
	scanf("%d%d", &n, &m);
	REP(i, 0, n) {
		scanf("%s", &g[i][0]);
	}
	
	REP(i, 0, n) {
		REP(j, i + 1, n) {
			REPN(k, 'a', 'z') {
				cnt1[k] = cnt2[k] = 0;
			}
			REP(k, 0, m) {
				cnt1[g[i][k]]++;
				cnt2[g[j][k]]++;
			}
			int fl = 0;
			REPN(k, 'a', 'z') {
				if (cnt1[k] != cnt2[k]) {
					//putchar(k);
					fl = 1;
				}
			}
			g1[i][j] = g1[j][i] = 1 - fl;
		}
	}
	
	/*REP(i, 0, n) {
		REP(j, 0, n) {
			printf("%d ", g1[i][j]);
		}
		putchar('\n');
	}*/
	
	single = -1;
	int ans = rec_sol();
	if (ans) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


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

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

    vector<vector<double>> A(N, vector<double>(2));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 2; j++) {
            cin >> A.at(i).at(j);
        }
    }
    
    double distance = 0;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            double x=(A.at(i).at(0)-A.at(j).at(0));
            double y=(A.at(i).at(1)-A.at(j).at(1));
            double r =sqrt(pow(x,2)+pow(y,2));
            distance += r;
        }
    }

    cout << fixed << setprecision(7) << distance / N << endl;
}

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

    public static void main(String[] args){
            Scanner sc=new Scanner(System.in);
        int h1=sc.nextInt();
        int h2=sc.nextInt();
        if((h1<=100)&&(h2<=100))
        System.out.println(h1*h2);


    }
}





Measured memory_bytes: 35764
#include<cstdio>
#include<algorithm>
#define N 11
#define inf 10000000
using namespace std;
int d[N][N],V;
void warshall_floyd(void)
{
	for(int k=0;k<=V;k++)
	{
		for(int i=0;i<=V;i++)
		{
			for(int j=0;j<=V;j++)
			d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
		}
	}
	return ;
}
void init(void)
{
	for(int i=0;i<N;i++)
	fill(d[i],d[i]+N,inf);
	for(int i=0;i<N;i++)
	d[i][i]=0;
	return ;
}
int main(void)
{
	int n;
	while(scanf("%d",&n)==1)
	{
		if(n==0)
		break;
		init();
		int s,e,c;
		V=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d%d%d",&s,&e,&c);
			d[s][e]=d[e][s]=c;
			V=max(V,max(s,e));
		}
		warshall_floyd();
		int ans=inf;
		int sum=0;
		int id=0;
		for(int i=0;i<=V;i++)
		{
			sum=0;
			for(int j=0;j<=V;j++)
			sum+=d[i][j];
			if(sum<ans)
			{
				ans=sum;
				id=i;
			}
		}
		printf("%d %d\n",id,ans);
	}
	return 0;
}

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


int main() {
	string S;
	cin >> S;

	int cnt=0; bool f;
	if(S[0]=='B') f=true;
	else f=false;

	for (int i = 0; i < S.length(); i++) {
		if (S[i] == 'B' && f == false) {
			f=true;
			cnt++;
		}
		else if (S[i] == 'W' && f == true) {
			f=false;
			cnt++;
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n, a, ans = 0; cin >> n;
	int test[1001] = { 0 };
	for (int h = 0; h < n; h++) {
		cin >> a; test[h] = a;
	}
	for (int h = 0; h < n - 1; h++) {
		for (int i = h + 1; i < n; i++) {
			ans += test[h] * test[i];
		}
	}
	cout << ans << endl;
	cin >> n;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD = 1000000007;
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 (b<a) {a=b; return 1;} return 0;}

#ifdef _DEBUG
#include "debug.h"
#else
#define debug(...)
#define print(...)
#endif

int main() {
	int n; cin >> n;
	vector<int> a(3);
	rep(i, 3) cin >> a[i];
	sort(all(a));
	vector<int> l(n);
	rep(i, n) cin >> l[i];

	// 4^nの全探索
	int ans = INF;
	rep(bit, pow(4, n)) {
		int tmp = bit;
		vector<int> s(4, 0);
		int cost = 0;
		rep(i, n) {
			if (tmp%4!=0 && s[tmp%4]!=0) cost += 10;
			s[tmp%4] += l[i];
			tmp/=4;
		}
		if (!s[1]||!s[2]||!s[3]) continue;
		rep(i, 3) {
			cost += abs(a[i]-s[i+1]);
		}
		chmin(ans, cost);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
n = gets.to_i

ans = []
if n.even?
  1.upto(n) do |i|
    (i+1).upto(n) do |j|
      next if i == j
      next if j == n + 1 - i
      ans << [i, j]
    end
  end
else
  1.upto(n) do |i|
    (i+1).upto(n) do |j|
      next if i == j
      next if j == n - i
      ans << [i, j]
    end
  end
end

puts ans.size
ans.each do |i, j|
  puts "#{i} #{j}"
end


Measured memory_bytes: 14760
N=int(input())
F=[list(map(int,input().split())) for i in range(N)]
P=[list(map(int,input().split())) for i in range(N)]

ans = (-1)*float('inf')

for i in range(1,1024):
    tmp = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i>>k)&1)&F[j][k]:
                count+=1
        tmp+=P[j][count]
    ans=max(ans,tmp)

print(ans)

Measured memory_bytes: 3064
#include <stdio.h>

int		main(void)
{
	int		A;//各秒に
	int		B;//増えるビスケットの量は
	int		T;//秒に何枚か

	scanf("%d%d%d", &A, &B, &T);
	printf("%d", ((T / A) * B));
	return (0);
}


Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <iterator>
#include <numeric>
#include <cstdint>
#include <cmath>
#include <bitset>
#include <string>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )

namespace IntegerMath
{
  int64_t sqrt(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::sqrtl( 
        static_cast<long double>(x)
      ) )
    );
  }
};

int main()
{
  uint64_t N, M;
  cin >> N >> M;

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

  uint64_t K = 0;
  for (int64_t k = IntegerMath::sqrt(M) + 1; k >= 1; --k) {
    if (M % k != 0) { continue; }
    
    uint64_t d1 = k, d2 = M / k;

    if (M / d1 >= N) { K = max(K, d1); }
    if (M / d2 >= N) { K = max(K, d2); }
  }

  cout << K << endl;

  return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)

int main(){
	ll n;
	while(scanf("%lld",&n),n){
		n*=2;
		ll k=sqrt(n);
		if(k*k==n)k--;
		while(n%k||k%2==(n/k)%2)k--;
		ll x=(n/k-(k-1))/2;
		printf("%lld %lld\n",x,k);
	}
}


Measured memory_bytes: 2044
import math
n = int(input())
l = sorted(list(map(int,input().split())))
c = 0
b = {}
for i in range(len(l)):
    if l[i] in b:
        b[l[i]] += 1
    else:
        b[l[i]] = 1

for i in range(len(l) - 1, -1, -1):
    if  b[l[i]] == 0:
        continue
    t = l[i]
    b[l[i]] -= 1
    s = 2 ** math.floor(math.log2(t))
    st = 2*s - t 
    if l == []:
        break
    if st in b and b[st] > 0:
        b[2 * s - t] -= 1
        c += 1
print(c)

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

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    int r=a+b+c;
    if(r>=22)
    {
        cout<<"bust"<<endl;
    }
    else
    {
        cout<<"win"<<endl;
    }
    return 0;
}


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


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        //var n = int.Parse(Console.ReadLine());
        double[] abx = Console.ReadLine().Split().Select(double.Parse).ToArray();
        var a = abx[0];
        var b = abx[1];
        var x = abx[2];

        double c = 2 * x / (a * b);
        double radian = Math.Atan(b / c);
        double ans = radian * 180 / Math.PI;
        if (x / a > a * b / 2)
        {
            c = (2 * a * a * b - 2 * x) / (a * a);
            radian = Math.Atan(c / a);
            ans = radian * 180 / Math.PI;
        }

        // 出力
        Console.WriteLine(ans);

    }
}


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

int main(void){
    int N; cin >> N;
    string S; cin >> S;
    char now_char = S[0];
    int now_cnt = 1;
    vector<pair<char, int>> ans_list;
    for (int i = 0; i < N; ++i){
        if (now_char != S[i]){
            ans_list.push_back({now_char, now_cnt});
            now_char = S[i];
            now_cnt = 1;
        }else{
            now_cnt++;
        }
    }
    ans_list.push_back({now_char, now_cnt});

    cout << ans_list.size() << endl;

    return 0;
}

Measured memory_bytes: 1528
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc160/tasks/abc160_c>
 問題文============================================================
 C - Traveling Salesman around Lake
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll K,N; cin >> K >> N;
    vector<ll> A(N); for(auto& in:A) cin >> in;
    res = LINF;
    
    for(int i = 0; i < N;i++) A.push_back(A[i]+K);
    for(int i = 0; i < N;i++){
        res = min(res,A[i+N-1]-A[i]);
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 4864
#include <cstdio>
#include <cmath>
using namespace std;

int main(){
    double r, PI, L, S;
    scanf("%lf", &r);
    PI = acos(-1);
    L = r * 2 * PI;
    S = r * r * PI;
    printf("%f %f", S, L);
    return 0;
    
}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
#define SortAsc(c) std::sort(c.begin(), c.end())
#define SortDesc(c) std::sort(c.rbegin(), c.rend())
int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};

int main() {
  ll X;
  cin >> X;
  ll m = 100;
  int year = 1;
  for (int i = 0; i < 10000; i++) {
    m = m * 1.01;
    if (m >= X) {
      cout << year << endl;
      return 0;
    }
    year++;
  }

  cout << m << endl;
}

Measured memory_bytes: 3596
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

using namespace std;
typedef long long int ll;

#define INF (1e9)

int N, W;

int main() {
    cin >> N >> W;
    int sumV = 0;

    vector<ll> w(N), v(N);
    for (int i = 0; i < N; i++) {
        cin >> w[i] >> v[i];
        sumV += v[i];
    }

    vector<vector<ll> > dp(N + 1, vector<ll>(sumV + 1, INF));

    dp[0][0] = 0;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j <= sumV; j++) {
            if (j < v[i])
                dp[i + 1][j] = dp[i][j];
            else
                dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i]);
        }
    }

    for (int i = sumV; i >= 0; i--) {
        if (dp[N][i] <= W) {
            cout << i << endl;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 80256
#include<stdio.h>

int absolute(int n){
    if(n < 0){
        n = n * -1;
    }
    return n;
}

void func(int n, int* t, int* x, int* y){
    int pt = 0, px = 0, py = 0;
    for(int i=0; i<n; i++){
        int buf_t = *(t+i) - pt;
        int len = absolute(*(x+i) - px) + absolute(*(y+i) - py);
        if(len > buf_t){
            printf("No");
            return;
        }
        if((buf_t - len) % 2 == 1){
            printf("No");
            return;
        }
        pt = *(t+i);
        px = *(x+i);
        py = *(y+i);
    }
    printf("Yes");
    return;
}

int main(){
    int n;
    scanf("%d", &n);
    int t[n], x[n], y[n];
    for(int i=0; i<n; i++){
        scanf("%d %d %d", &t[i], &x[i], &y[i]);
    }
    func(n, t, x, y);

    return 0;
}

Measured memory_bytes: 1280
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
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; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
 
struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

int n;
int a[101010];
int A, B;

int main(){
    cin >> n;
    REP(i, n)cin >> a[i];
    sort(a, a + n);
    reverse(a, a + n);
    REP(i, n)(i % 2 ? B : A) += a[i];
    cout << A - B << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>

using namespace std;

int main()
{
  int n;
  cin >> n;
  set<int> v;
  int a;
  for(int i=0;i<n;i++){
    cin >> a;
    v.insert(a);
  }
  cout << v.size() << endl;


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LLI long long int
#define FOR(v, a, b) for(LLI v = (a); v < (b); ++v)
#define FORE(v, a, b) for(LLI v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(LLI v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define popcount __builtin_popcount
#define UNIQ(v) v.erase(unique(ALL(v)), v.end())
#define bit(i) (1LL<<i)
#define sz(v) ((LLI)(v).size())

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(...) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){is >> p.first >> p.second; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}

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

  int X,A;
  while(cin >> X >> A){
    cout << (X<A ? 0 : 10) << endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

ll BS(ll l ,ll r, ll X){
    if(r-l == 1){
        return l;
    }
    ll m = (l + r) / 2;
    if(pow(m,5) <= X) return BS(m,r,X);
    else              return BS(l,m,X);
}

int main(){
    ll X; cin>>X;
    ll B = 0;
    while(pow(B+1,5)-pow(B,5) <= X){
        ll A = BS(0L,1000L,X+pow(B,5));
        if(pow(A,5) == X+pow(B,5)){
            cout<<A<<" "<<B<<endl;
            return 0;
        }
        B++;
    }
    B = -1;
    while(-pow(B,5) <= X){
        ll A = BS(0L,1000L,X+pow(B,5));
        if(pow(A,5) == X+pow(B,5)){
            cout<<A<<" "<<B<<endl;
            return 0;
        }
        B--;        
    }
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

int main()
{
    cout << fixed << setprecision(15);
    ll A, B, C;
    cin >> A >> B >> C;

    if(C>=A && C<=B){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3596
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let k: usize = sc.read();
    let q: usize = sc.read();
    let d: Vec<usize> = sc.vec(k);
    for _ in 0..q {
        let n: usize = sc.read();
        let first: usize = sc.read();
        let m: usize = sc.read();
        let d = d.iter().map(|&d| d % m).collect::<Vec<_>>();
        let sum = d.iter().sum::<usize>();
        let last =
            first + (n - 1) / d.len() * sum + (0..((n - 1) % d.len())).map(|i| d[i]).sum::<usize>();
        let count = last / m - first / m;
        let total = n - 1;

        let zero_sum = d.iter().filter(|&&d| d == 0).count();
        let zero_count =
            (n - 1) / d.len() * zero_sum + (0..((n - 1) % d.len())).filter(|&i| d[i] == 0).count();

        println!("{}", total - count - zero_count);
    }
}

// 3 4 5 5 6

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#include<set>
#include<cstdio>
#include<cstring>
#define N 200010
#define ll long long
using namespace std;
void read(int&x)
{
	x = 0;char s = getchar();
	while(s<'0'||s>'9')s = getchar();
	while(s>='0'&&s<='9')x = (x<<3)+(x<<1)+s-48,s = getchar();
}
int n,p[N],f[N],w[N],n0[N],n1[N];
ll ans;
int fd(int x){return x==f[x]?x:f[x] = fd(f[x]);}
struct node
{
	int id,n0,n1;
	friend bool operator<(node a,node b)
	{
		if(1ll*a.n0*b.n1==1ll*a.n1*b.n0)
		{
			if(a.n0==b.n0&&a.n1==b.n1)return a.id<b.id;
			if(a.n0==b.n0)return a.n1<b.n1;
			return a.n0>b.n0;
		}return 1ll*a.n0*b.n1>1ll*a.n1*b.n0;
	}
};
set<node>s;
set<node>::iterator it;
int main()
{
	read(n);
	for(int i = 2;i<=n;i++)read(p[i]);
	for(int i = 1;i<=n;i++)read(w[i]),f[i] = i,w[i]?n1[i] = 1:n0[i] = 1;
	for(int i = 2;i<=n;i++)s.insert((node){i,n0[i],n1[i]});
	for(int i = 1;i<n;i++)
	{
		it = s.begin();
		int u = (*it).id,v = fd(p[u]);
		s.erase(*it);
		if(v^1)s.erase((node){v,n0[v],n1[v]});
		ans+=1ll*n1[v]*n0[u];
		f[u] = v,n0[v]+=n0[u],n1[v]+=n1[u];
		if(v^1)s.insert((node){v,n0[v],n1[v]});
	}printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 16516
#include "bits/stdc++.h"
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<iomanip>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<stack>
#include<complex>
#include<memory>

#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
using Graph=vector<vector<int>>;
	
#define WHATS(var)cout<<__LINE__<<' '<<#var<<"="<<var<<endl;
	
template<class S, class T> ostream& operator <<(ostream &os, const pair<S, T> v){
	os << "( " << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<T> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<vector<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<set<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const set<T> &v){
	int i=0;
	for(auto it:v){
		if(i > 0){os << ' ';}
		os << it;
		i++;
	} 
	return os;
}
//1. maskの部分集合を列挙する
	// 	a. i==0を評価しない
	// 	for(int i=mask; i>0; i=(i-1)&mask) {
	// 	}

	// b. i==0を評価する
	// 	for(int i=mask; i>=0; i--) {
	// 		i&=mask;
	// 	}
// 2. maskを含む集合を列挙する

// 少し目的は変わりますが同じようなやり方でできる処理が、maskを含む集合の列挙です。

// 	for(int i=mask; i<(1<<n); i=(i+1)|mask) {
// 	}

	
using ll = long long int;
const int MAX_N=5000000;
    vector<int>min_divs(MAX_N+1);

int main() {
	ios::sync_with_stdio(false);
	cin.tie();
    int H,W;cin>>H>>W;
    vector<string>field(H);
    for(int i=0;i<H;++i){
        cin>>field[i];


    }
    vector<string>ans_a(H,string(W,'.'));
    vector<string>ans_b(H,string(W,'.'));
    for(int i=0;i<W;++i){
        ans_a[0][i]='#';
        ans_b[H-1][i]='#';
    }
    for(int r=1;r<H-1;++r){
        for(int c=1;c<W-1;++c){
            if(c%2==1){
                ans_a[r][c]='#';
            }else{
                ans_b[r][c]='#';
            }
            if(field[r][c]=='#'){
                ans_a[r][c]='#';
                ans_b[r][c]='#';
            }

        }
    }
    for(int i=0;i<H;++i){
        cout<<ans_a[i]<<endl;
    }
    cout<<endl;
	for(int i=0;i<H;++i){
        cout<<ans_b[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 21120
n=gets.to_i
x=[];y=[];z=[]
kai=0
ans=0
n.times{|i|x[i],y[i],z[i]=gets.split.map &:to_i;kai=i if z[i]>0}
for i in 0..100
  for j in 0..100
    ans=1
    h=z[kai]+(i-x[kai]).abs+(j-y[kai]).abs
    n.times{|g|
      if z[g] != [h-(i-x[g]).abs-(j-y[g]).abs,0].max
        ans=0
      end
    }
    break if ans==1
  end
  break if ans==1
end
puts [i,j,h]*' '


Measured memory_bytes: 14384
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(all(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define PII         pair<int, int>
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;

mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    double n;
    cin >> n;
    double x = (n + 1) / (1.08);
    int xx = x;
    if(int(xx * 1.08) == n){
        cout << xx;
    }else cout << ":(";
    return 0;
}


Measured memory_bytes: 256