akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;

int main(){
    int a[3];
    rep(i, 3){
        int x;
        cin >> x;
        a[i] = x;
    }
    string ans = "No";
    if(a[0]==a[1]&&a[0]!=a[2]){
        ans = "Yes";
    }
    if (a[2] == a[1] && a[0] != a[2]) {
      ans = "Yes";
    }
    if (a[0] == a[2] && a[0] != a[1]) {
      ans = "Yes";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3512
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<cmath>
#include<iomanip>
using namespace std;

int INF = 1e9 + 7;

typedef long long ll;
typedef pair<int, int> P;

int main() {
	int n, k;
	cin >> n >> k;
	vector<ll> x(n + 1), y(n + 1);
	for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];

	int sum = 0;
	ll MIN = 9e18;
	for (int xi = 1; xi <= n; xi++) {
		for (int xj = 1; xj <= n; xj++) {
			for (int yi = 1; yi <= n; yi++) {
				for (int yj = 1; yj <= n; yj++) {
					if (x[xi] < x[xj] && y[yi] < y[yj]) {
						for (int i = 1; i <= n; i++) {
							if (x[xi] <= x[i] && x[i] <= x[xj] && y[yi] <= y[i] && y[i] <= y[yj]) {
								sum++;
							}
						}
						if (sum >= k) {
							MIN = min(MIN, (x[xj] - x[xi])*(y[yj] - y[yi]));
						}
						sum = 0;
					}
				}
			}
		}
	}
	cout << MIN << endl;
}


Measured memory_bytes: 256
import java.util.Scanner
object Main extends App{
  val sc = new Scanner(System.in)
  val time  = sc.nextInt
  val h0  = time/3600
  val h1  = time%3600
  val m   = h1/60
  val d   = h1%60
  println(h0+":"+m+":"+d)
}

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

int main() {
  int N,K;
  cin >> N >> K;
  int d[K];
  bool A[N];
  for (int i=0; i<N; i++)
    A[i] = false;
  
  for (int i=0; i<K; i++) {
    cin >> d[i];
    for (int j=0; j<d[i]; j++) {
      int tmp;
      cin >> tmp;
      A[tmp-1] = true;
    }
  }

  int sum=0;
  for (int i=0; i<N; i++)
    if (!A[i]) sum++;
  cout << sum << endl;
  
  return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 200005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
bool kai(string s){
    string t = s;
    reverse(all(t));
    return s == t;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    ll n = s.length();
    Yes(kai(s) && kai(s.substr(0,(n-1)/2)) && kai(s.substr((n+3)/2-1,n-(n+3)/2+1)));
}


Measured memory_bytes: 3660
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <climits>
#include <cmath>
#include <unordered_map>

using namespace std;

typedef long long ll;

int main(void) {
  int N; cin >> N;
  vector<pair<string, int>> org;
  vector<pair<string, int>> name;
  vector<pair<pair<string, int>, int>> inv;
  for (int i = 0; i < N; i++) {
    string si; int di;
    cin >> si >> di;
    org.push_back(make_pair(si, di));
    name.push_back(make_pair(si, -di));
  }
  sort(name.begin(), name.end());

  for (int i = 0; i < N; i++) {
    inv.push_back(make_pair(name[i], i));
  }

  for (auto kv : name) {
    // cout << kv.first << " " << kv.second << endl;
  }

  for (int j = 0; j < N; j++) {
    for (int i = 0; i < N; i++) {
      if (org[i].first == inv[j].first.first &&
        org[i].second == -inv[j].first.second)
        // cout << (inv[j].second + 1) << endl;
        cout << (i + 1) << endl;
    }
  }

}


Measured memory_bytes: 256
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
using pll = pair<ll,ll>;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
using mat = vector<vector<ll>>;
using vec = vector<ll>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/
const int mod = 1000000007;



int main(){

// エラトステネスのふるい
    int MAX = 101010;
    vector<int> is_prime(MAX, 1);
    is_prime[0] = 0, is_prime[1] = 0;
    for (int i = 2; i < MAX; ++i) {
        if (!is_prime[i]) continue;
        for (int j = i*2; j < MAX; j += i) is_prime[j] = 0;
    }

    int N;
    cin>>N;
    vector<int> ans;
    int p=2;
    while(ans.size()<N){
        if((p%5==2)&&(is_prime[p]))ans.push_back(p);
        p++;

    }
    rep(i,N){
        cout<<ans[i];
        if(i!=N-1)cout<<" ";
        else cout<<endl;
    }

return 0;
}

Measured memory_bytes: 3660
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define LL long long
using namespace std;
const LL Maxn = 200010;
const LL Maxm = 4010;
const LL N = 2000;
const LL Mod = 1e9+7;
LL f[Maxm][Maxm], res[Maxm][Maxm];
LL a[Maxn], b[Maxn];
LL jc[Maxm<<1], inv[Maxm<<1];
LL n;
void up(LL &x, LL y) { x = (x+y)%Mod; }
void down(LL &x, LL y) { x = (x-y+Mod)%Mod; }
int main() {
	LL i, j, k;
	jc[0] = 1;
	for(i = 1; i <= N<<2; i++) jc[i] = jc[i-1]*i%Mod;
	inv[0] = inv[1] = 1;
	for(i = 2; i <= N<<2; i++) inv[i] = inv[Mod%i]*(Mod-Mod/i)%Mod;
	for(i = 2; i <= N<<2; i++) inv[i] = inv[i-1]*inv[i]%Mod;
	scanf("%lld", &n);
	for(i = 1; i <= n; i++) scanf("%lld%lld", &a[i], &b[i]), f[N-a[i]][N-b[i]]++, res[N+a[i]][N+b[i]]++;
	LL ans = 0;
	for(i = 0; i <= N<<1; i++){
		for(j = 0; j <= N<<1; j++){
			if(i) up(f[i][j], f[i-1][j]);
			if(j) up(f[i][j], f[i][j-1]);
			if(res[i][j]) up(ans, res[i][j]*f[i][j]);
		}
	}
	for(i = 1; i <= n; i++) down(ans, jc[2*(a[i]+b[i])]*inv[2*a[i]]%Mod*inv[2*b[i]]%Mod);
	printf("%lld\n", ans*inv[2]%Mod);
	return 0;
}

Measured memory_bytes: 192896
N = int(raw_input())
A = raw_input().split(" ")
count = 0
flag = 1

i = 0
while flag == 1:
    flag = 0
    for j in reversed(range(i+1, N)):
        if int(A[j]) < int(A[j-1]):
            temp = A[j]
            A[j] = A[j-1]
            A[j-1] = temp
            count += 1
            flag = 1
    i += 1
    
print " ".join(A)
print count

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

using namespace std;

#define vit vector<int>::iterator
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fr first
#define sc second
#define skip continue
#define PI 3.14159265

typedef unsigned long long ull;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

const int INF = 1e9 + 5;
const long long MAXN=2e5 + 5;;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool cmp(const string& a, const string& b) {
	return (a + b) < (b + a);
}

vector<int> Reversed(const vector<int>& s){
   vector<int> d = s;
   reverse(all(d));
   return d;
}

void solve(){
    int a,b;
    char c;
    cin >> a >> c >> b;
    if(c == '+')
        cout << a + b;
    else cout << a - b;
}


int main(){
    //freopen("slalom.in","r",stdin);
    //freopen("slalom.out","w",stdout);
    //faster();
    int n = 1;
    //cin >> n;
    while(n--){
        solve();
        cout << endl;
    }
    //fclose(stdout);
}


Measured memory_bytes: 3532
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
int main(){
  int N;
  cin>>N;
  int A;
  int count = 0;
  for(int i=1; i<=N; i++){
    cin>>A;
    if(A!=i)count++;
  }
  cout<<(count==0||count==2 ? "YES\n" : "NO\n");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(long long i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

const int INF=1e18;
const int MOD=1e9+7;

signed main(){
    int n;cin>>n;
    int ans=0;
    if(n==1){
        cout<<0<<endl;
        return 0;
    }
    int c=n;
    map<int,int>memo;
  	memo.clear();
    for(int i=2;i<=sqrt(n);i++){
        while(c%i==0){
            c/=i;
            memo[i]++;
        }
    }
    if(c!=1)memo[c]++;
    for(auto v:memo){
      	int sum=0;
        for(int i=1;sum+i<=v.second;i++){
          ans++;	
          sum+=i;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3724
#include <cstdio>
// A - Colorful Subsequence

#define MOD 1000000007

using namespace std;

int cnt[30];

int main() {
    int N,i,ans;
    char c;

    scanf("%d",&N);

    for (i = 0;i < N;i++) {
        scanf(" %c",&c);
        cnt[c - 'a']++;
    }

    ans = 1;
    for (i = 0;i < 26;i++)
        ans = (1LL * ans * (cnt[i] + 1)) % MOD;
    ans--;

    printf("%d\n",ans);

    return 0;
}


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

int main()
{
    char x,y;
    cin >> x >> y;
    if(x - '0' > y - '0'){
        cout << '>' << endl;
    }else if(x - '0' == y -'0'){
        cout << '=' << endl;
    }else{
        cout << '<' << endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <bitset>
#define MAXN 5005
#define MAXBS 5005
using namespace std;
bitset<MAXBS> bs;
int a[MAXN];
int main(void){
    int n,k;
    int ll,rr;
    scanf("%d%d",&n,&k);
    for (int i=0;i<n;i++){
        scanf("%d",a+i);
    }
    sort(a,a+n);
    n=lower_bound(a,a+n,k)-a;
    //(ll,rr] 
    ll=-1,rr=n;
    while (rr-ll>1){
        int mid=(ll+rr+1)>>1;
        int necessary=0;
        bs.reset(); // bs=0
        bs.set(0); // bs[0]=1;
        for (int i=0;i<n;i++)
            if (i!=mid)
                bs|=(bs<<a[i]);
        bs>>=(k-a[mid]);
        for (int i=0;i<a[mid];i++){
            if (bs.test(i)){
                necessary=1;
                break;
            }
        }
        if (necessary)
            rr=mid;
        else
            ll=mid;
    }
    printf("%d\n",ll+1);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
    string s;
    
    while (true) {
        cin >> s;
        if (s == "0") break;
        int d = 0;
        for (int i = 0; i < s.size(); i++) {
            d += s[i] - '0';
        }
        cout << d << endl;
    }
    
    return 0;
}


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

int main(){
	int s;
	cin >> s;
	string k;
	cin >> k;
	int n = k.length();
	if(n>s){
		for(int i = 0;i<s;i++){
			cout << k[i];
		}
			cout << "...";
	}
	else{
		cout << k;
	}
}

Measured memory_bytes: 3636
#include<iostream>
#include<algorithm>
 
using namespace std;
 
int main(void){
 
int n,m,ans;
 
while(cin >> n >> m){
ans=0;
for(int i=0;i<n;i++){
int sum=0;
for(int j=0;j<m;j++){
int in;
cin >> in;
sum+=in;
}
ans=max(ans,sum);
}
cout << ans << endl;
}
 
return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
#define P pair<int,int>
int V,E;
struct edge{int to,cost;};
vector<edge>G[110000];
int ans[110000];
const int INF=pow(2,30);
int main(){
	fill(ans,ans+100000,INF);
	int r;
	cin>>V>>E>>r;
	for(int i=0;i<E;i++){
	int s,t,d;
	cin>>s>>t>>d;
	edge tmp;
	tmp.to=t,tmp.cost=d;
	G[s].push_back(tmp);
	}
	ans[r]=0;
	priority_queue<P,vector<P>,greater<P> >que;
	que.push(make_pair(0,r));//距離、番号
	while(true){
		if(que.size()==0)break;
		//for(int i=0;i<V;i++)cout<<ans[i]<<" ";cout<<" ";
		P tmp=que.top();//ここで使われていないものの中で最も距離が小さい頂点vの番号を求める
		que.pop();
		//cout<<tmp.first<<" "<<tmp.second<<endl;
		int v=tmp.second;
		//if(ans[v]<tmp.first)cout<<ans[v]<<" "<<tmp.first<<" "<<tmp.second<<endl;;
		if(ans[v]<tmp.first)continue;
		for(int i=0;i<G[v].size();i++){
			if(ans[G[v][i].to]>ans[v]+G[v][i].cost){
			ans[G[v][i].to]=ans[v]+G[v][i].cost;
			que.push(P(ans[G[v][i].to],G[v][i].to));
			}
		}
	}
	for(int i=0;i<V;i++){
	if(ans[i]==INF)cout<<"INF"<<endl;
	else cout<<ans[i]<<endl;
	}
	return 0;
}

Measured memory_bytes: 11548
N, K = [int(s) for s in input().split()]
S = input()
group0 = []
group1 = []
now = '1'
now_n = 0
for c in S:
    if c == now:
        now_n += 1
    else:
        if now == '1':
            group1.append(now_n)
        else:
            group0.append(now_n)
        now = c
        now_n = 1
if now == '1':
    group1.append(now_n)
else:
    group0.append(now_n)
    group1.append(0)

first = 0
last = min(K, len(group0))
now_group = sum(group0[first:last]) + sum(group1[first:last+1])
max_group = now_group
for i in range(last, len(group0)):
    now_group += group0[i] + group1[i+1] - group0[first] - group1[first]
    max_group = max(max_group, now_group)
    first += 1
print(max_group)


Measured memory_bytes: 4352
#![allow(non_snake_case)]

use std::io;

macro_rules! parse_tuple {
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        io::stdin().read_line(&mut a_str).expect("read error");
        let mut a_iter = a_str.split_whitespace();
        (
            $(
                a_iter.next().unwrap().parse::<$t>().expect("parse error"),
            )+
        )
    })
}

fn main() {
    let (D, N) = parse_tuple!(u32, u64);
    let mut int = 100u64.pow(D) * N;
    if N == 100 {
        int += 100u64.pow(D);
    }
    println!("{}", int);
}

Measured memory_bytes: 4352
N = int(input())
a = [int(i) for i in input().split()]
n2,n4,odd = 0, 0, 0

for i in a:
  if i % 2 == 1:
    odd += 1
  elif i % 4 == 0:
    n4 += 1
  else:
    n2 += 1
if n2 == 0 and n4 >= odd-1:
  print("Yes")
elif n2 > 0 and n4 >= odd:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main(){
    ll n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    string s;cin>>s;
    if(c>d){
        rep(i,a-1,c-2){
            if(s[i]=='#' && s[i+1]=='#'){
                cout<<"No"<<endl;
                return 0;
            }
        }
        bool bol=false;
        rep(i,b-1,d-1){
            if(s[i-1]=='.' && s[i]=='.' && s[i+1]=='.'){
                bol=true;
            }
        }
        if(bol){
            cout<<"Yes"<<endl;
            return 0;
        }
        cout<<"No"<<endl;
        
    }
    
    if(c<d){
        rep(i,a-1,c-2){
            if(s[i]=='#' && s[i+1]=='#'){
                cout<<"No"<<endl;
                return 0;
            }
        }
        rep(i,b-1,d-2){
            if(s[i]=='#' && s[i+1]=='#'){
                cout<<"No"<<endl;
                return 0;
            }
        }
        cout<<"Yes"<<endl;
    }else{
        
        
    }
    
    
    return 0;
}



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

int n, h, w;
int main() {
    cin >> n >> h >> w;
    if(n < h || n < w) puts("0");
    else cout << (n - h + 1) * (n - w + 1) << '\n';
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int n;
	int a[100] = {0};
	int i, j;
	int sum;
	int p, q;

while(1){
	scanf("%d", &n);
	sum = 0;
	if(n == 0) break;
	for (i = 0; i < n; ++i)
	{
		scanf("%d", &a[i]);
		sum += a[i];
	}
	p = a[0];
	q = a[0];
	for (i = 1; i < n; ++i)
	{
		if(p < a[i]) p = a[i];  
		if(q > a[i]) q = a[i];
	}

	sum = sum - p - q;

	printf("%d\n", sum / (n - 2));
}
	return 0;
}

Measured memory_bytes: 600
#include <stdio.h>
#define num 10

int main(void){
	int w[num], k[num], i, j, temp, W = 0, K = 0;
	for (i = 0; i < num; i++){
		scanf("%d", &w[i]);
	}
	for (i = 0; i < num; i++){
		scanf("%d", &k[i]);
	}
	for (i = 0; i < num-1; i++){
		for (j = num-1; j > i; j--){
			if (w[j] > w[j-1]){
				temp = w[j-1];
				w[j-1] = w[j];
				w[j] = temp;
			}
			if (k[j] > k[j-1]){
				temp = k[j];
				k[j] = k[j-1];
				k[j-1] = temp;
			}
		}
	}
	for (i = 0; i < 3; i++){
		W += w[i];
		K += k[i]; 
	}
	printf("%d %d\n", W, K);
	return 0;
}

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


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

signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    cout << fixed << setprecision(20);

    ll n,m;
    cin>>n>>m;
    ll now = 1;
    int cnt = 0;
    for(int i=0;i<n;i++){
        ll a;
        int ret = 0;
        cin>>a;
        now *= a/gcd(now,a);
        if(now/2>m){
            cout << 0 << endl;
            return 0;
        }
        while(a%2==0){
            ret++;
            a/=2;
        }
        if(i==0)cnt=ret;
        else if(cnt!=ret){
            cout << 0 << endl;
            return 0;
        }
    }    
    now/=2;
    cout << (m/now +1)/2 << endl;
}

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

int main(){
  long long L, R;
  cin >> L >> R;

  long long ans = 2018;

  if (R - L >= 2019) {
    cout << 0 << endl;
    return 0;
  }
  else {
    for(long long i = L; i < R; i++) {
      for(long long j = i + 1; j - 1 < R; j++){
        ans = min(ans, (i * j) % 2019);
      }
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>

using namespace std;

int main(){

int N;
cin >>N;
multimap<long long,int>A;
long long a;
for(int i=1;i<=N;i++){
    cin >>a;
 A.insert(make_pair(-a,i));
}

for(int i=1;i<=N;i++){
auto iter=A.begin();
    if(iter->second!=i){
    cout <<-iter->first<<endl;;
    }
    else{
    iter++;
    cout <<-iter->first<<endl;;
    }
 
}

    

 return 0;
}

Measured memory_bytes: 16128
import java.util.Scanner;
 
class Main {
	public static void main(String[] args) {
 
	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    
	    switch (N % 10) {
	      case 2:
	      case 4:
	      case 5:
	      case 7:
	      case 9:
	        System.out.println("hon");
	        break;
	      case 0:
	      case 1:
	      case 6:
	      case 8:
	        System.out.println("pon");
	        break;
	      case 3:
	        System.out.println("bon");
	        break;
	    }
	    
	  }
}

Measured memory_bytes: 27028
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n;
    cin >> n;
    VL a(3*n);
    REP(i,3*n) scanf("%lld", &a[i]);
    sort(ALL(a));
    ll ans = 0;
    REP(i,n){
        ans += a[3*n-2*i-2];
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
using namespace std;
const ll maxn = 1e6 + 7;
const ll mod = 1e9 + 7;
ll q, t, n, m, k, ans;
priority_queue<ll> pr;
string s, ss, str;
void sol()
{
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    while(a > 0 && c > 0)
    {
        c -= b;
        if(c <= 0)
        {
            cout << "Yes";
            return;
        }
        a -= d;
        if(a <= 0)
        {
            cout << "No";
            return;
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    sol();
}


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

namespace TYC
{
	typedef long long ll;

	const int N = 16 + 3;
	const ll INF = 0x3f3f3f3f3f3f3f3fLL;

	int n, cnt, A[N];
	ll F[1 << 16 | 3][N][N];

	inline int read()
	{
		int x = 0, f = 0, ch = getchar();
		while (!isdigit(ch))
			f |= (ch == '-'), ch = getchar();
		while (isdigit(ch))
			x = x * 10 + ch - '0', ch = getchar();
		return f ? -x : x;
	}

	ll f(const int l, const int r, const int o, const int a, const int b)
	{
		if (l > r)
			return 0;
		ll &ans = F[o][l][r];
		if (ans < INF)
			return ans;
		for (int i = l; i <= r; i++)
			ans = min(ans, f(l, i - 1, o << 1, a, a + b) + f(i + 1, r, o << 1 | 1, a + b, b) + (ll)(a + b) * A[i]); 
		return ans;
	}

	void work()
	{
		n = read() - 2;
		for (int i = 0; i <= n; i++)
			A[i] = read();
		memset(F, 0x3f, sizeof(F));
		printf("%lld\n", f(1, n, 1, 1, 1) + A[0] + read()); 
	}
}

int main()
{
	TYC::work();
	return 0;
}

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

using namespace std;

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

    int A[N], B[N], C[N - 1];

    int t;
    for (int i = 0; i < N; i++)
    {
        cin >> t;
        A[i] = t;
    }

    for (int i = 0; i < N; i++)
    {
        cin >> t;
        B[i] = t;
    }
    
    for (int i = 0; i < N - 1; i++)
    {
        cin >> t;
        C[i] = t;
    }

    int points = 0;
    for (int i = 0; i < N; i++)
    {
        if (i > 0 && A[i] == A[i - 1] + 1)
        {
            points += B[A[i] - 1] + C[A[i - 1] - 1];
        } else {
            points += B[A[i] - 1];
        }
    }

    cout << points;
}


Measured memory_bytes: 256
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int h,w,a,b;
    scanf("%d %d %d %d", &h, &w, &a, &b);
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if( (2 * i - 2 * b + 1) * (2 * j - 2 * a + 1) > 0){
                printf("%d", 0);
            } else {
                printf("%d", 1);
            }
        }
        printf("\n");
    }
    
    return 0;
}


Measured memory_bytes: 3228
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int y = scan.nextInt();
		int z = scan.nextInt();
		x = x - z;
		x = x/(y + z);
		System.out.println(x);
	}
}

Measured memory_bytes: 23636
N = int(input())
B = []
for i in range(N):
    s,p = map(str,input().split())
    tmp = [i+1,s,int(p)]
    B.append(tmp)
B.sort(key=lambda x:x[2],reverse=True)
B.sort(key=lambda x:x[1])
for x in B:
    print(x[0])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define maxN 100005
#define rep(i,n) for(int i=0;i<n;i++)
#define refv(i,l,r) for(int i=l;i<r;i++)
#define rerv(i,l,r) for(int i=r;i>=r;i--)
#define pi pair<ll,ll>
#define pii pair<ll,pair<ll,ll> > 
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
#define printvector(v) for(int i= 0;i<v.size();i++) {cout<<v[i]<<" ";} cout<<endl;
#define printset(s) for(auto it = s.begin();it!=S.end();it++){cout<<*it<<" ";} cout<<endl;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); 
using namespace std;

vector<int> v;
bool comp(int a,int b)
{
    if(v[a]>v[b])
        return true;
    return false;    
}

int32_t main()
{
	int n;
    cin>>n;
    map<string,vector<int>>m;
    
    rep(i,n)
    {
        string s;
        int x;
        cin>>s>>x;
        v.pb(x);
        m[s].pb(i);
    }
    
    for(auto it=m.begin();it!=m.end();it++)
    {
        vector<int> temp;
        temp=it->second;
        sort(temp.begin(),temp.end(),comp);
        rep(i,temp.size())
        {
            cout<<temp[i]+1<<endl;
        }
    }

}

Measured memory_bytes: 256
#include<stdio.h>
#include <string.h>

int main(void) {
	int i,l;
	char N[ 200000 ];
	int total=0;

	scanf("%s", N);
	l = strlen(N);
	for (i = 0; i < l ; i++) {
		total += N[i] -'0';
	}

	if (total % 9 == 0) {
		printf("Yes");
	}
	else {
		printf("No");
	}
}


Measured memory_bytes: 1852
#include <bits/stdc++.h>    
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
#pragma GCC optimize("O3")
//using namespace __gnu_pbds; 
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb  push_back
#define show(x) cout<<(#x)<<" : "<<x<<endl;
#define ll  long long
#define ld  long double
#define fill(a,val) memset(a,val,sizeof(a))
#define mp  make_pair
#define ff  first
#define ss  second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define int long long 
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
const ll MOD     = 1000*1000*1000+7;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7;
const ll MOD2    = 998244353;
const ll N       = 1000*1000+15;
const ll N2      = 2000*1000*10;
const ld PI  = 3.141592653589793;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> tree_set;
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} 
ll power(ll x,ll y,ll p ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll lcm(ll a , ll b){return (a*b)/gcd(a,b);}
int prime[N];
unordered_map<int,int> actual;
void sieve() 
{ 
    prime[0] = prime[1] = 1; 
    for (int i = 2; i < N; i++) { 
        if (prime[i] == 0) { 
            for (int j = i * 2; j < N; j += i) { 
                if (prime[j] == 0) { 
                    prime[j] = i; 
                } 
            } 
            prime[i] = i; 
        } 
    } 
}
int lcmfunc(int a[] , int n)
{
    for (int i = 0; i < n; ++i)
    {
        int num = a[i];
        unordered_map<int,int> temp;
        while(num>1)
        {
            int fact = prime[num];
            if(fact==0)
            {
                cout<<i<<endl;
                break;
            }
            temp[fact]++;
            num/=fact;
        }
        for(auto x : temp)
        {
            actual[x.ff] = max(actual[x.ff],x.ss);
        }
    }

    int ans = 1;
    for(auto x : actual)
    {
        ans*=power(x.ff,x.ss,MOD);
        ans%=MOD;
    }
    return ans;

}
signed main()
{
    fastio();
    //cout<<fixed<<setprecision(20);
    //CHECK for LONG LONG and LONG DOUBLE
    /*comment for all except cc/cf    
    #ifndef ONLINE_JUDGE    
           freopen("input.txt","r",stdin);
           freopen("output.txt","w",stdout);
    #endif//*/
    int n;
    cin>>n;
    int a[n];
    sieve();
    for (int i = 0; i < n; ++i)
    {
        cin>>a[i];
    }
    int ans = 0;
    for (int i = 0; i < n; ++i)
    {
        int req = power(a[i],MOD-2,MOD);
        ans+=req;
        ans%=MOD;
    }
    int res = lcmfunc(a,n);
    ans*=res;
    ans%=MOD;
    cout<<ans;

}

Measured memory_bytes: 8576
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int a, b, sum;
	public static void main(String[] args) {
		while(read()){
			solve();
		}
	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		a = sc.nextInt(); b = sc.nextInt();
		return true;
	}
	static void solve(){
		sum = a + b;
		String line = Integer.toString(sum);
		System.out.println(line.length());
	}
}

Measured memory_bytes: 12000
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

S_int = int(readline())
S_str = str(S_int)

if len(S_str) == 1:
    print(S_int)
    quit()

pattern = []
fmt = '0' + str(len(S_str)-1) + 'b'
for i in range(2**(len(S_str)-1)):
    pattern.append(format(i, fmt))

answer = 0
for plus_flags in pattern:
    tmp = []
    tmp_str = S_str[0]
    for i, is_plus in enumerate(plus_flags, start=1):
        if is_plus == "1":
            tmp.append(int(tmp_str))
            tmp_str = ""
        tmp_str += S_str[i]
    if tmp_str:
        tmp.append(int(tmp_str))
    answer += sum(tmp)
print(answer)

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args)throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader (is);
		br.readLine();
		long result = 0;
		int card1 = Integer.parseInt(br.readLine());
		while(br.ready()) {
			int card2 = Integer.parseInt(br.readLine());
			if(card1>0 && card2>0) {
				if(card1%2 !=0) {
					card2 -= 1;
					result += 1;
				}
			}
			result  += card1/2;
			card1 = card2;
		}
		result  += card1/2;
		System.out.println(result);
	}
}

Measured memory_bytes: 32172
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	void run() {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		
		if(a+b > c+d)System.out.println("Left");
		else if(a+b == c+d)System.out.println("Balanced");
		else System.out.println("Right");
		
		sc.close();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

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

int main () {
  int n;
  cin >> n;
  vector<int> a (n + 1), b (n);
  for (int i = 0; i < n + 1; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  long long s = 0;
  for (int i = 0; i < n; i++) {
    s += min (a[i], b[i]);
    b[i] -= min (a[i], b[i]);
    s += min (a[i + 1], b[i]);
    a[i + 1] -= min (a[i + 1], b[i]);
  }
  cout << s << '\n';
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, int>;
using vpii = vector<pair<int, int>>;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep1(i, n) for (int i = 1; i < (int)n; i++)
const ll mod = 1e9 + 7;
const ll inf = 1e12;
const double pi = 3.141592;
const int di[4] = {1, 0, -1, 0};
const int dj[4] = {0, 1, 0, -1};

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> h(n);
    rep(i,n){
        int tmp;
        cin >> tmp;
        ++h[tmp];
        if(h[tmp] > 2){
            cout << 0 << "\n";
            return 0;
        }
    }
    int r = n % 2;
    rep(i,n){
        if(i%2 == r){
            if(h[i]){
                cout << 0 << "\n";
                return 0;
            }
        }
        else{
            int a = (i == 0) ? 1 : 2;
            if(h[i]!=a){
                cout << 0 << "\n";
                return 0;
            }
        }
    }
    ll ans = 1;
    rep(i, n / 2) ans = ans * 2 % mod;
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 640
/**
 *    author:  tourist
 *    created: 14.07.2019 15:46:31       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ++cnt[a[i]];
  }
  if (cnt[0] == n) {
    cout << "Yes" << '\n';
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << '\n';
    return 0;
  }
  vector<int> all;
  for (auto& p : cnt) {
    for (int i = 0; i < p.second / (n / 3); i++) {
      all.push_back(p.first);
    }
  }
  if (all.size() == 3 && (all[0] ^ all[1] ^ all[2]) == 0) {
    cout << "Yes" << '\n';
  } else {
    cout << "No" << '\n';
  }
  return 0;
}


Measured memory_bytes: 7176
import java.util.Scanner;

public class Main {

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

        for (int i = 0; i <= n / 4; i++) {
            if ((n - 4 * i) % 7 == 0) {
                System.out.println("Yes");
                return;
            }
        }
        System.out.println("No");
    }

}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int r;
	cin>>r;
	ld Radius = r;
	ld pi = 3.14;
	cout<<fixed<<setprecision(2)<<(ld)2*pi*Radius<<"\n";
	return 0;
}

Measured memory_bytes: 3796
#include <cstdio>

int main()
{
	int k, a, b;
	scanf("%d%d%d", &k, &a, &b);
	for (int i = a; i <= b; ++i)
	{
		if (i % k == 0)
		{
			puts("OK");
			return 0;
		}
	}
	puts("NG");
	return 0;
}


Measured memory_bytes: 1660
import java.util.Scanner;

public class Main {
	private static Scanner sc = new Scanner(System.in);
	private static int INF = Integer.MAX_VALUE/3;
	public static void main(String[] args) {
		int n = sc.nextInt();
		int ma = sc.nextInt();
		int mb = sc.nextInt();
		int[][][] dp = new int[41][401][401];
		for (int i = 0;i < 41;i++) {
			for (int j = 0;j < 401;j++) {
				for (int k = 0;k < 401;k++) {
					dp[i][j][k] = INF;
				}
			}
		}

		dp[0][0][0] = 0;

		for (int i = 0;i < n;i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			for (int j = 0;j < 401;j++) {
				for (int k = 0;k < 401;k++) {
					int t = dp[i][j][k];
					if (t!=INF) {
						dp[i+1][j][k] = Math.min(t,dp[i+1][j][k]);
						dp[i+1][j+a][k+b] = Math.min(t+c,dp[i+1][j+a][k+b]);
					}
				}
			}
		}

		int ret = INF;

		for (int i = 0;i <= n;i++) {
			for (int j = 1;j < 401;j++) {
				int a = j*ma;
				int b = j*mb;
				if (a<=400&&b<=400) {
					ret = Math.min(ret, dp[i][a][b]);
				}
			}
		}

		System.out.println(ret==INF?-1:ret);
	}
}


Measured memory_bytes: 41168
#include <stdio.h>

int main(void)
{
    int a[4][13];
    int i, j;

    for (i = 0; i < 4; ++i) {
        for (j = 0; j < 13; ++j) {
             a[i][j] = 0;
        }
    }

    int n;
    scanf("%d", &n);
    
    for (i = 0; i < n; ++i) {
       int x;
       char c;
       scanf(" %c %d", &c, &x);
        switch(c) {
            case 'S':
                a[0][x - 1] = 1;
                break;
            case 'H':
                a[1][x - 1] = 1;
                break;
            case 'C':
                a[2][x - 1] = 1;
                break;
            case 'D':
                a[3][x - 1] = 1;
                break;
        }
    }
    for (i = 0; i < 4; ++i) {
        for (j = 0; j < 13; ++j) {
            if (a[i][j] == 0) {
                switch (i) {
                    case 0:
                        printf("S %d\n", j + 1);
                        break;
                    case 1:
                        printf("H %d\n", j + 1);
                        break;
                    case 2:
                        printf("C %d\n", j + 1);
                        break;
                    case 3:
                        printf("D %d\n", j + 1);
                        break;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
using namespace std;
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

int main(void)
{
    char s;
    cin >> s;
    if ('a' <= s && s <= 'z')
    {
        cout << 'a' << endl;
    }
    else
    {
        cout << 'A' << endl;
    }

    return 0;
}


Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
int a[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",&a[i]);
    if(n==1)
    {
        printf("%d\n",a[0]);
        return 0;
    }
    for(int i=n-1; i>=0; i-=2)
    {
        if(i==(n-1))
            printf("%d",a[i]);
        else
            printf(" %d",a[i]);
    }
    if(n&1)
        for(int i=1; i<n; i+=2)
            printf(" %d",a[i]);
    else
    {
        for(int i=0;i<n;i+=2)
            printf(" %d",a[i]);
    }
    printf("\n");
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=1;i<=n;i++)
#define ford(i,n) for(int i=n;i>=0;i--) 
#define REP(i,a,n) for(int i=a;i<n;i++)
#define foreach(itr,c) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define re return
#define INF 1e9
#define LINF 1e18
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi > vpi; 
int main(){
	int a[2];
	int cnt[4]={0,0,0,0};
	rep(i,2){
		cin>>a[i];
		cnt[a[i]]++;
	}
	REP(i,1,4){
		if(cnt[i]==0){
			cout<<i;
		}
	}
	re 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

struct S {
  int h, m;
  S(int h, int m) : h(h), m(m) {}
  bool operator == (const S &s) const {
    return h == s.h && m == s.m;
  }
  bool operator < (const S &s) const {
    if (h != s.h) return h < s.h;
    return m < s.m;
  }
};

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int N, M;
  cin >> N;
  vector<S> v;
  for (int i = 0; i < N; i++) {
    int h, m;
    cin >> h >> m;
    v.emplace_back(h, m);
  }
  cin >> M;
  for (int i = 0; i < M; i++) {
    int h, m;
    cin >> h >> m;
    v.emplace_back(h, m);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  for (int i = 0; i < int(v.size()); i++) {
    if (i) printf(" ");
    printf("%d:%02d", v[i].h, v[i].m);
  }
  printf("\n");

  return 0;
}


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

const int Size=1<<20;
const int Mod=1e9+7;

int N,M,K,Ans;
int Nxt[Size][20],Tag[25][25];
int F[2][25][Size];

int main(){
	int i,j,k,t,a,b,c,lst=0,now=1;
	scanf("%d%d%d",&N,&M,&K),N--;
	memset(Tag,-1,sizeof(Tag));
	while(K--){
		scanf("%d%d%d",&a,&b,&c);
		Tag[a][b]=c^1;
	}
	for(i=0;i<1<<N;i++)
		for(k=-1,j=N-1;~j;j--){
			Nxt[i][j]=k;
			if(i>>j&1)
				k=j;
		}
	F[0][N][0]=1;
	for(i=1;i<=M;i++){
		memset(F[now],0,sizeof(F[now]));
		memmove(F[now][0],F[lst][N],sizeof(F[now][0]));
		for(j=0;j<N;j++)
			for(k=0;k<1<<N;k++)
				if(F[now][j][k])
					for(t=k>>j&1;t<2;t++)
						if(Tag[i][j+1]^t){
							if((k>>j&1)==t)
								(F[now][j+1][k]+=F[now][j][k])%=Mod;
							else if(~Nxt[k][j])
								(F[now][j+1][k+(1<<j)-(1<<Nxt[k][j])]+=F[now][j][k])%=Mod;
							else (F[now][j+1][k+(1<<j)]+=F[now][j][k])%=Mod;
						}
		swap(lst,now);
	}
	for(i=0;i<1<<N;i++)
		Ans=(Ans+F[lst][N][i])%Mod;
	printf("%d\n",Ans);
	return 0;
}

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

int main() {
	int a,b;
	cin >> a >> b;
	if(a + b == 15){
		cout << '+' << '\n';
	}else if(a * b == 15){
		cout << '*' << '\n';
	}else{
		cout << 'x' << '\n';
	}
}

Measured memory_bytes: 256
a,b,c,d=map(int,input().split())
if a<0 and b<0 and c>=0 and d>=0:
  print(b*c)
elif a<0 and b<0 and c<0 and d>=0:
  print(a*c)
elif a<0 and b>=0 and c<0 and d<0:
  print(a*c)
elif a<0 and b<0 and c<0 and d<0:
  print(a*c)
elif a<0 and b>=0 and c<0 and d>=0 and abs(a*c)>=abs(b*d):
  print(a*c)
elif a>=0 and b>=0 and c<0 and d<0:
  print(a*d)
else:
  print(b*d)

Measured memory_bytes: 9212
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1ll<<60;

char field[110][110];

int main(int argc, char **argv)
{
	ll H, W; cin >> H >> W;
	for (ll i = 0; i < H; ++i)
		for (ll j = 0;j < W; ++j)
			cin >> field[i][j];

	vector<bool> col(W, false), row(H, false);

	for (ll h = 0; h < H; ++h)
		for (ll w = 0; w < W; ++w)
			if (field[h][w] == '#')
				col[w] = true;

	for (ll w = 0; w < W; ++w)
		for (ll h = 0; h < H; ++h)
			if (field[h][w] == '#')
				row[h] = true;

	for (ll h = 0; h < H; ++h)
	{
		if (!row[h]) continue;
		for (ll w = 0; w < W; ++w)
		{
			if (!col[w]) continue;
			std::cout << field[h][w];
		}
		std::cout << std::endl;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mo 998244353
#define ny 499122177
#define maxn 1000000000000000000LL
#define pi 3.1415926535898
#define eps 1e-9 
using namespace std;
long long read(){
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
int n,a[300005],b[300005],now;
bool solve(int l,int r) {
    int x=0,y=0;
    for(int i=l;i<=r;i++)
        if(b[i]<i){
            if(x>b[i]||b[i]<l||b[i]>r) 
				return 0;
            x=b[i];
        }
		else if(b[i]>i){
            if(y>b[i]||b[i]<l||b[i]>r) 
				return 0;
            y=b[i];
        }
    return 1;
}
int i,l,r;
int main(){
    n=read();
    for(i=1;i<=n;i++){
        b[i]=read();
        if(b[i]==i)
        	a[i]=1;
	}
    for(i=2;i<n;i++) 
		if(a[i-1]==0&&a[i]==0&&a[i+1]==0){
			printf("No\n");
			return 0;
		}
    for(i=1;i<=n;i++){
        if(a[i]==0){
            now=1;
            l=i;
			r=i;
            while((a[r]^now)&&r<=n){
				r++;
				now^=1;
			}
            r--;
            if(solve(l,r)==0){
				printf("No\n");
				return 0;
			}
            i=r;
        }
    }
    puts("Yes");
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
struct UnionFind {
    vector<ll> par, rank, cnt;

    UnionFind(ll N) : par(N), rank(N), cnt(N) {
        rep(i, N) par[i] = i, rank[i] = 0, cnt[i] = 1;
    }

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

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        int cntx = cnt[rx], cnty = cnt[ry];
        if (rx == ry) return;
        if (rank[rx] < rank[ry]) {
            par[rx] = ry;
        }
        else {
            par[ry] = rx;
            if (rank[rx] == rank[ry]) rank[rx]++;
        }
        cnt[rx] += cnty; cnt[ry] += cntx;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }

    ll getCnt(int x) {
        return cnt[root(x)];
    }
};

int main()
{
    ll N, M;
    cin >> N >> M;
    vector<ll> A(M), B(M);
    UnionFind tree(N);

    ll ans = N * (N - 1);
    ans /= 2;

    rep(i, M) {
        cin >> A[i] >> B[i];
        A[i]--; B[i]--;
    }

    vector<ll> res(M);
    res[M - 1] = ans;

    for (ll i = M - 1; i >= 1; i--) {
        if (tree.same(A[i], B[i])) {
            res[i - 1] = res[i];
            continue;
        }
        ll size_b1 = tree.getCnt(A[i]);
        ll size_b2 = tree.getCnt(B[i]);
        // cout << i << " " << size_b1 << " " << size_b2 << endl;
        tree.unite(A[i], B[i]);
        ll size_a = tree.getCnt(A[i]);
        size_b1 = (size_b1 * (size_b1 - 1)) / 2;
        size_b2 = (size_b2 * (size_b2 - 1)) / 2;
        size_a = (size_a * (size_a - 1)) / 2;
        ans -= size_a - size_b1 - size_b2;
        res[i - 1] = max(0LL, ans);
    }

    rep(i, M) cout << res[i] << endl;
    return 0;
}


Measured memory_bytes: 6016
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	for i := 1; i <= 9; i++ {
		if N%i == 0 {
			if 1 <= N/i && N/i <= 9 {
				fmt.Println("Yes")
				return
			}
		}
	}
	fmt.Println("No")
}


Measured memory_bytes: 512