akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    long long L,R;
    cin >> L >> R;
    unsigned long long min = (L * (L+1))%2019;
    int count = 0;
    for(unsigned long long i = L;i<=R;i++){
        count = 0;
        for(unsigned long long j = i+1;j<=R;j++){
            count += 1;
            unsigned long long ans = (i*j)%2019;
            if(ans < min) min = ans;
            if(ans == 0) {
                cout << min << endl;
                return 0;
            }
            if(count == 2500) break;
        }
    }
    cout << min << endl;
}


Measured memory_bytes: 256
(N, M), *ABs = readlines.map{|l| l.split.map(&:to_i)}

G = ABs.each_with_object(Hash.new{|h, k| h[k] = []}){|(a, b), h| h[a] << b; h[b] << a}
puts (G[1] & G[N]).empty? ? 'IMPOSSIBLE' : 'POSSIBLE'

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

int main(){
  int n;

  while(cin>>n,n){
    vector<int> taro(n);
    vector<int> hanako;

    for(int i=0;i<n;i++){
      cin>>taro[i];
    }
    for(int i=1;i<=2*n;i++){
      if(find(taro.begin(),taro.end(),i) == taro.end()){
        hanako.push_back(i);
      }
    }

    sort(taro.begin(),taro.end());
    sort(hanako.begin(),hanako.end());

    bool now = true; //true:taro, false:hanako
    int baNiDeteruCard = -1; //-1:naniMoDetenai

    while(!taro.empty() && !hanako.empty()){
      if(baNiDeteruCard == -1){
        if(now){
          baNiDeteruCard = taro[0];
          taro.erase(taro.begin());
        }
        else{
          baNiDeteruCard = hanako[0];
          hanako.erase(hanako.begin());
        }
      }

      else{
        if(now){
          int idx = 0;
          while(idx < taro.size() && baNiDeteruCard >= taro[idx]){
            idx++;
          }

          if(idx == taro.size()){
            baNiDeteruCard = -1;
          }
          else{
            baNiDeteruCard = taro[idx];
            taro.erase(taro.begin()+idx);
          }
        }
        else{
          int idx = 0;
          while(idx < hanako.size() && baNiDeteruCard >= hanako[idx]){
            idx++;
          }

          if(idx == hanako.size()){
            baNiDeteruCard = -1;
          }
          else{
            baNiDeteruCard = hanako[idx];
            hanako.erase(hanako.begin()+idx);
          }
        }
      }

      now = !now;
    }

    cout<<hanako.size()<<endl<<taro.size()<<endl;
  }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 9223372036854775807;
const ll half_inf = 0x3f3f3f3f;
const ll inf = 0x7fffffff;
const ll mod = 1e9 + 7;
const ll maxn = 200005;
int a[100]={0};
int main(){  
	//cin.tie(0);
    //ios::sync_with_stdio(false);
	int T,n,m,s,c,flag=1,t1=0,t2=0;
	//scanf("%d",&T);
	/*while(T--){
				
	}*/
	for(int i=1;i<=50;i++) a[i]=-1;
	scanf("%d%d",&n,&m);
	while(m--){
		scanf("%d%d",&s,&c);
		/*if(s!=1){
			if(c==0) t1=1; 


		}
		else{
			/*if(c==0&&n!=1) flag=0;
			if(t2&&a[1]!=c) flag=0;
			else{
				a[1]=c;
				t2=1;
			}
		}*/
		if(a[s]!=-1&&a[s]!=c) flag=0;
		else a[s]=c;
	}
	if(n==2&&a[1]==0){
		flag=0;
	} 
	if(n==3&&a[1]==0){
		flag=0;
	} 
	if(a[1]<0&&n!=1) a[1]=1;
	if(a[1]<0&&n==1) a[1]=0;
	if(a[2]<0) a[2]=0;
	if(a[3]<0) a[3]=0;
	if(flag){
		for(int i=1;i<=n;i++) printf("%d",a[i]);
	}
	else printf("-1");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;
#define _GLIBCXX_DEBUG

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}


int main() {
  ll N;
  cin >> N;
  
  vector<pair<ll, int>> fs;//素数・係数のペア
  //素因数分解
  for (ll i = 2; i * i <= N; ++i) {
		int x = 0;//係数
		while (N % i == 0)
		{
			N /= i;
			++x;
		}
		fs.emplace_back(i, x);
	}
	if (N != 1)fs.emplace_back(N, 1);

    int ans = 0;


    for (auto i: fs){
        int x = i.second;
        int temp=1;
        while(temp <= x){
            x -= temp;
            temp++;
            ans++;
        }
    }

    cout << ans << endl;


  return 0;
}


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

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


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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        String line = r.readLine();
        int opIndex = 0;
        int[] ops = new int[100];
        for (String elem : line.split(" ")) {
            if (elem.equals("+")) {
                ops[opIndex - 2] += ops[opIndex - 1];
                opIndex--;
            } else if (elem.equals("-")) {
                ops[opIndex - 2] -= ops[opIndex - 1];
                opIndex--;
            } else if (elem.equals("*")) {
                ops[opIndex - 2] *= ops[opIndex - 1];
                opIndex--;
            } else {
                ops[opIndex++] = Integer.parseInt(elem);
            }
        }
        System.out.println(ops[0]);
    }
}

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

using namespace std;

int main(int argc, const char *argv[])
{
    string s, t;
    cin >> s >> t;
    if (s == t.substr(0, t.length() - 1))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <string>
using namespace std;
int main(void){
  int n;
  cin>>n;
  vector<long long int> hoge(87);
  hoge.at(0)=2;
  hoge.at(1)=1;
  for(int i=2; i<87; i++){
    hoge.at(i)=hoge.at(i-1)+hoge.at(i-2);
  }

  cout<<hoge.at(n)<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    char a[100][100];
    for(int i = 0; i < 100; i++){
        for(int j = 0; j < 50; j++){
            a[j][i] = '.';
        }
        for(int j = 50; j < 100; j++){
            a[j][i] = '#';
        }
    }

    int A, B;
    scanf("%d", &A);
    scanf("%d", &B);

    for(int i = 0; i < B - 1; i++){
        a[(i / 50) * 2][(i % 50) * 2] = '#';
    }
    for(int i = 0; i < A - 1; i++){
        a[99 - (i / 50) * 2][(i % 50) * 2] = '.';
    }

    printf("100 100\n");
    for(int i = 0; i < 100; i++){
        for(int j = 0; j < 100; j++){
            printf("%c", a[i][j]);
        }
        printf("\n");
    }

    return 0;
}


Measured memory_bytes: 256
n,m = map(int,input().split())
r = [[int(I) for I in input().split()] for i in range(m)]
c = [0 for i in range(n)]
for i in range(m):
    for j in [0,1]:
        c[r[i][j]-1] += 1
for i in range(n):
    print(c[i])

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

#define rep(i, n) for(int i=0; i < n; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

using namespace std;
using ll=long long;


int asxz(int num, ll ans){
    int syo;
    for(int i=2;i<=num;i++){
        //cout << i << endl;
        if(num % i == 0){
            syo = num/i;  
            break;
        }
    }
    if(syo == 1LL){
        return ans+1LL;
    }else{
        asxz(syo,ans+1);
    }
}

int main() {
  int N;
  cin >> N;
  ll ansa;
  ll ans = 0;
  
  for(int i = 1; i<=N;i=i+2){
  ansa = 0;
      reps(j,i){
        if(i % j == 0){
            ansa += 1;
        }
      }
    if(ansa == 8){
        ans += 1;
    }
  }

  cout << ans;

}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
using ll = long long;

int main() {
	int n;
	cin >> n;
	int sum = 0;
	for (int i = 0;i < n;i++) {
		int a;
		cin >> a;
		sum += a;
	}
	cout << sum - n << endl;
}

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

public class Main {
    public void main(Scanner sc) {
        int n = sc.nextInt();
        int k = sc.nextInt();
        int l = sc.nextInt();

        int road[] = new int[n];
        init(n, road);
        for (int i = 0; i < k; i++) {
            link(sc.nextInt(), sc.nextInt(), road);
        }

        int train[] = new int[n];
        init(n, train);
        for (int i = 0; i < l; i++) {
            link(sc.nextInt(), sc.nextInt(), train);
        }

        String keys[] = new String[n];
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            keys[i] = root(road[i], road) + "," + root(train[i], train);
            map.compute(keys[i], (key, value) -> value == null ? 1 : (value + 1));
        }

        System.out.println(Arrays.stream(keys).map(tgt -> String.valueOf(map.get(tgt)))
            .collect(Collectors.joining(" ")));
    }

    public void init(int n, int data[]) {
        for (int i = 0; i < n; i++) {
            data[i] = i + 1;
        }
    }

    public void link(int x, int y, int data[]) {
        data[root(x, data) - 1] = root(y, data);
    }

    public boolean isSame(int x, int y, int data[]) {
        return root(x, data) == root(y, data);
    }

    public int root(int p, int data[]) {
        return (data[p - 1] == p) ? p : (data[p - 1] = root(data[p - 1], data));
    }

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


Measured memory_bytes: 131352
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=200010;
const ll mod=1e9+7;

int main(){
  int n,m;
  cin >> n >> m;
  vector<ll> a(n);
  rep(i,n){
    cin >> a[i];
  }
  vector<ll> r(n+1,0);
  vector<ll> p(n+1,0);
  rep(i,n){
    r[i+1] = r[i]+a[i];
    p[i+1] = p[i]+(a[i]>0?a[i]:0);
  }

  ll ans = 0;
  rep(i,n-m+1){
    ll tmp = p[i]+p[n]-p[i+m] + (r[i+m]-r[i]>0? r[i+m]-r[i]:0);
    ans = max(tmp,ans);
  }
  cout << ans << endl;
  return 0;
}

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

// priceをキーに降順でソート
//sort(fruits.begin(), fruits.end(),
//     [](const fruit& x, const fruit& y) { return x.price > y.price;});

/*
int main() {
    int N, A, B;
    std:cin >> N >> A >> B;
    std::cout << min(N*A, B) << std::endl;
    return 0;
}
 */

int main(){
    int N, D;
    std::cin >> N >> D;
    int X[N][D];
    float dist;
    int ans=0;
    for(int i=0; i<N; i++){
        for(int j=0; j<D; j++){
            std:cin >> X[i][j];
        }
    }
    for(int i=0; i<N; i++){
        for(int j=i+1; j<N && i!=j; j++){
            int sum = 0;
            for(int k=0; k<D; k++){
                sum += pow(X[i][k]-X[j][k],2.0);
            }
            dist = sqrt(sum);
            if(dist==(int)dist){
                ans++;
            }
        }
    }
    std::cout << ans << std::endl;
    return 0;
}


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

int main(void)
{
long N, P[200000], index, Pmin, ans;

  scanf("%ld", &N);
  Pmin = 999999;
  ans = 0;
  for (index = 0; index < N; ++index) {
    scanf("%ld", &P[index]);
    if (P[index] <= Pmin) {
      ans++;
      Pmin = P[index];
    }
  }
  printf("%ld\n", ans);

  return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include<cctype>
#define INF 0x3f3f3f3f
#define lb long double
#define LINF 0x3f3f3f3f3f3f3f3f
#define ull unsigned long long
#define random(x) (rand()%x)
#define rep(i, a, b) for(int i=a;i<b;i++)
#define req(j, a, b) for(int j=a;j<b;j++)
#define mem(a, b) memset(a, b, sizeof(a))
#define PI 3.14
#define K 20

using namespace std;
typedef long long ll;
const int maxn = 1e6+5;
const double eps = 1e-14;
const double pi = acos(-1);
const ll mod = 1e9 + 7;
const int hash_mod = 19260817;

inline int read()
{
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}

inline double dbread()
{
    double X=0,Y=1.0; int w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=X*10+(ch^48),ch=getchar();
    ch=getchar();//读入小数点
    while(isdigit(ch)) X+=(Y/=10)*(ch^48),ch=getchar();
    return w?-X:X;
}

inline void write(int x)
{
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar(x%10+'0');
}

int v[1005];
double w[1005];
int dp[1005][1005];

int sum = 0;

ll gcd(ll a,ll b)//辗转相除法（欧几里德算法）求最大公约数
{
    return b ? gcd(b,a%b) : a;
}
ll lcm(ll a,ll b)
{
    return a*b/gcd(a,b);//最小公倍数
}
int main()
{
    ll a, b;
    scanf("%lld%lld",&a,&b);
    cout << lcm(a, b) << endl;
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include<iostream>
#include<math.h>

using namespace std;

int main() {
	int N;
	int count = 0;
	int max_height = 0;
	cin >> N;

	int height = 0;
	for (int i = 0; i < N; i++) {
		cin >> height;
		if (height >= max_height) {
			max_height = height;
			count++;
		}
	}
	cout << count << endl;
}



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

int main(){
  int n; cin >> n;
  vector<double> arr(n);
  for(int i = 0; i < n; i++){
    cin >> arr[i];
  }
  double sum = 0.0;
  for(int i = 0; i < n; i++){
    sum += 1/arr[i];
  }
  cout << fixed << setprecision(10) << 1/sum << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#define base 334334334334334317
#define llinf 4154118101919364364

long long llmax(long long a,long long b){if(a>b){return a;}return b;}

long long ctoll(char x){
  return x-'a';
}

long long dp[524288];
bool isvalid[524288];
bool ispassed[524288];
long long sl,tl;

long long rep(long long pt){
  //printf("<%lld>\n",pt);
  if(ispassed[pt]==true){return llinf;}
  if(dp[pt]!=-1){return dp[pt];}
  if(isvalid[pt]==false){
    dp[pt]=0;
  }
  else{
    ispassed[pt]=true;
    dp[pt]=1+rep((pt+tl)%sl);
    ispassed[pt]=false;
  }
  return dp[pt];
}

int main(){
  long long i,sh,th,k=1;
  long long res=0;
  char s[1048576],t[524288];
  scanf("%s%s",s,t);
  sl=strlen(s);tl=strlen(t);
  for(i=sl;i<1048576;i++){
    s[i]=s[i%sl];
  }
  th=0;
  for(i=0;i<tl;i++){
    th*=26;
    th+=ctoll(t[i]);
    th%=base;
    k*=26;
    k%=base;
  }
  sh=0;
  for(i=0;i<tl;i++){
    sh*=26;
    sh+=ctoll(s[i]);
    sh%=base;
  }
  for(i=0;i<sl;i++){
    if(sh==th){isvalid[i]=true;}
    else{isvalid[i]=false;}
    sh*=26;
    sh%=base;
    sh-=((k*ctoll(s[i]))%base);
    while(sh<0){sh+=base;}
    sh+=ctoll(s[tl+i]);
    sh%=base;
  }
  for(i=0;i<sl;i++){
    ispassed[i]=false;
    dp[i]=-1;
  }
  for(i=0;i<sl;i++){
    res=llmax(res,rep(i));
  }
  if(res>llinf){
    printf("-1\n");
    return 0;
  }
  printf("%lld\n",res);
  return 0;
}


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

int main() {
  char a;
  cin >> a;
  if (a == 'A') cout << 'T';
  else if (a == 'T') cout << 'A';
  else if (a == 'G') cout << 'C';
  else if (a == 'C') cout << 'G';
  cout << endl;
}

Measured memory_bytes: 256
import math

A, B, H, M=map(int,input().split())

ha = (M / 60 + H)*30
ma = M*6
ang = ha - ma

cosa =math.cos(ang*math.pi/180)

c = math.sqrt(A**2 + B**2 - 2 * A * B * cosa)


print(c)


Measured memory_bytes: 9432
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("No"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;

// Binary Indexed Tree
struct bit {
  typedef int TT;
  int n; vector<TT> d;
  bit() {}
  bit(int mx): n(mx), d(mx) {}
  void add(int i, TT x=1) {
    for (++i;i<n;i+=i&-i) d[i] += x;
  }
  TT sum(int i) {
    TT x = 0;
    for (++i;i;i-=i&-i) x += d[i];
    return x;
  }
};
//

int f(vi& s) {
  int n = sz(s);
  bit t(n+5);
  ll res = 0;
  rep(i,n) {
    res += i-t.sum(s[i]);
    t.add(s[i]);
  }
  return res&1;
}

int main() {
  int n;
  scanf("%d",&n);
  vvi na(3, vi(n));
  rep(i,3)rep(j,n) na[i][j] = in()-1;
  vi a, b;
  rep(i,n) {
    int x = na[0][i]/3;
    a.pb(x);
    rep(j,3) if (na[j][i]/3 != x) dame;
    if (na[1][i]%3 != 1) dame;
    b.pb(na[0][i]%3/2);
  }
  rep(i,n) if ((a[i]&1) != (i&1)) dame;
  vvi s(2);
  vi cnt(2);
  rep(i,n) {
    s[i&1].pb(a[i]/2);
    cnt[i&1] += b[i];
  }
  rep(i,2) {
    cnt[i^1] += f(s[i]);
  }
  rep(i,2) if (cnt[i]&1) dame;
  puts("Yes");
  return 0;
}







Measured memory_bytes: 3192
#include<bits/stdc++.h>
using namespace std;
template<typename T>
inline void read(T &x)
{
	x=0;
	int f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9')
	{
		if(ch=='-') f=-1;
		ch=getchar();
}
	while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
	x*=f;
	return;
}	
template<typename T>
void write(T x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>=10) write(x/10);
	putchar(x%10+'0');
	return;
}
int n,k;
int ans=0;
int main()
{
    cin>>n>>k;
    while(n) n/=k,ans++;
    cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
long long MOD = 1e9 + 7;
const long long INF = 1LL << 60;
using namespace std;

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

int main() {
  int n, m;
  cin >> n >> m;
  n == m ? cout << "Yes" << endl : cout << "No" << endl;
  return 0;
  }

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define endl "\n"
using ll=long long;
using ld=long double;
using namespace std;
const ll mod= 1e9+7;
const ll INF = 1LL<<40;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main(){
  ll n,k,ans=0;
  string s;
  cin>>s;
  if(s=="hi"||s=="hihi"||s=="hihihi"||s=="hihihihi"||s=="hihihihihi")cout<<"Yes";
  else cout<<"No";
}

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

int main() {
	map<string, long long> dic;
	int n;
	long long ans = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		dic[s]++;
	}
	for (auto d : dic) {
		long long t = d.second * (d.second - 1) / 2;
		ans += t;
	}
	cout << ans << endl;
}

Measured memory_bytes: 11136
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long
struct edge { int to, cost; };
typedef pair<int, int> P;
vector<edge> G[2010];
int ans[2010];
int d[2010];
int N, X, Y;


int V;
void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d + V + 1, INF2);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
        P p = que.top(); que.pop();
        int v = p.second;
        if (d[v] < p.first) continue;
        for (int i = 0; i < G[v].size(); i++){
            edge e = G[v][i];
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
    rep(i, N) ans[d[i]]++;
}

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> N >> X >> Y;
    V = N;
    X--; Y--;
    rep(i, N - 1) {
        G[i].push_back({i + 1, 1});
        G[i + 1].push_back({i, 1});
    }
    G[X].push_back({Y, 1});
    G[Y].push_back({X, 1});
    rep(i, N) dijkstra(i);
    rep(i, N - 1) {
        cout << ans[i + 1]/2 << endl;
    }

    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
 
const int N = 1e5 + 5;
 
int n, m, k;
int x11, y11, x2, y2;
int dx[4]={-1, +1, 0, 0};
int dy[4]={0, 0, +1, -1};
vector<vector<char> > a;
vector<vector<int> > vis, ways, dist;
 
void bfs(int x, int y)
{
	queue<pair<int, int> > q;
	q.push({x, y});
	vis[x][y] = 1;
	dist[x][y] = 0;
	while(!q.empty())
	{
		int x=q.front().first;
		int y=q.front().second;
		q.pop();
		for(int dir=0;dir<4;dir++)
		{
			for(int len = 1; len <= k; len++)
			{
				int nx=x+dx[dir] * len;
				int ny=y+dy[dir] * len;
				if(nx<1 || ny<1 || nx>n || ny>m)
					break;
				if(vis[nx][ny] && dist[x][y] + 1 > dist[nx][ny])
					break;
				if(a[nx][ny] == '@')
					break;
				if(vis[nx][ny])
					continue;
				dist[nx][ny]=dist[x][y]+1;
				vis[nx][ny]=1;
				q.push({nx, ny});
			}
		}
	}
}
 
int32_t main()
{
	IOS;
	cin >> n >> m >> k;
	cin >> x11 >> y11 >> x2 >> y2;
	a = vector<vector<char> > (n + 1, vector<char> (m + 1));
	vis = ways = dist = vector<vector<int> > (n + 1, vector<int> (m + 1, 0));
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			cin >> a[i][j];
	bfs(x11, y11);
	if(!vis[x2][y2])
		cout << -1;
	else
		cout << dist[x2][y2];
	return 0;
}

Measured memory_bytes: 32484
#coding:utf-8
import random

D = int(input())

C = [int(y) for y in input().split()]

S = []

ans = []

def scoring(inp,poi):
    
    score = 0
    day = 1
    last = [0] * 26
    
    for I in inp:
        score += poi[day-1][I-1]
        last[I-1] = day
        for ind,J in enumerate(last):
            score -= C[ind] * (day - ind - 1)
        day += 1
        
    return score

for i in range(D):
    s = [int(y) for y in input().split()]
    S.append(s)

for i in S:
    k = 0
    num = 0
    for f,t in enumerate(i):
        k = max(k,t)
        if k == t:
            num = f + 1
    ans.append(num)

counter = 10

base = scoring(ans,S)
nbase = 0
d = 0
ansc = ans.copy()

for i in range(counter):
    p = random.randint(0,25)
    q = random.randint(0,D-1)
    ansc[q] = p
    nbase = scoring(ansc,S)
    if nbase > base:
        ans = ansc.copy()
    else:
        ansc = ans.copy()

for i in ans:
    print("{}".format(int(i)))

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

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = (int)2e5 + 9;
const int D = 50;

struct Item{
  ll A;
  ll B;
  bool operator<(const Item &T) const {
    return T.A * (B + 1) < A * (T.B + 1);
  }
};

ll dp[D];

int main(){
  fastIO;
  int n;
  cin >> n;
  ll T;
  cin >> T;
  vector<ll> pref;
  vector<Item> ff;
  ll a, b;
  for(int i = 0 ; i < n; i ++ ){
    cin >> a >> b;
    if(a == 0) pref.push_back(b);
    else ff.push_back({a,b});
  }
  sort(pref.begin(), pref.end());
  sort(ff.begin(), ff.end());
  if(!pref.empty())pref[0]++;
  for(int i = 1; i < pref.size(); i ++ )
    pref[i] += pref[i - 1]+1;
  for(int i = 0 ; i < D; i ++ )
    dp[i] = (ll)1e18;
  dp[0] = 0;
  for(int i = 0 ; i < ff.size(); i ++ ){
    for(int j = D-1 ; j >= 0; j -- ){
      if(dp[j] <= T){
        dp[j + 1] = min(dp[j + 1], dp[j] + 1 + (dp[j] + 1) * ff[i].A + ff[i].B);
      }
    }
  }
  int ans = 0;
  int id=0;
  for(int j = 0 ; j < D; j ++ ){
    if(dp[j] <= T){
      id = upper_bound(pref.begin(), pref.end(), T - dp[j]) - pref.begin();
      ans = max(ans, j + id);
    }
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 6512
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    char N;
    cin >> N;
    if (N <= 'Z') {
        cout << 'A' << endl;
    }
    else {
        cout << 'a' << endl;
    }

    return 0;
}

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

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

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

    sort(H, H + N, greater<>());

    long long ans = 0;
    for (int i = 0; i < N; i++) {
        if (i + 1 <= K) continue;
        ans += H[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m-1); i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;


int main() {
  ll n, q; cin >> n >> q;
  string s; cin >> s;
  s = "#" + s + "#";

  vector<pair<char, int>> m(q);
  rep(i, q) {
    char x; cin >> m[i].first >> x;
    if (x == 'L') m[i].second = -1;
    if (x == 'R') m[i].second = 1;
  }

  auto fun = [&] (ll x) {
    rep(i, q) if (s[x] == m[i].first) x += m[i].second;
    return (x == 0);
  };
  auto fun2 = [&] (ll x) {
    rep(i, q) if (s[x] == m[i].first) x += m[i].second;
    return (x == n+1);
  };

  ll ans = n;

  ll ok = 0;
  ll ng = n+1;
  while (llabs(ok - ng) > 1) {
    ll mid = (ok + ng) / 2;
    if (fun(mid)) ok = mid;
    else ng = mid;
  }
  ans -= ok;

  ok = n+1;
  ng = 0;
  while (llabs(ok - ng) > 1) {
    ll mid = (ok + ng) / 2;
    if (fun2(mid)) ok = mid;
    else ng = mid;
  }
  ans -= n+1-ok;
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 2192
l,r = map(int,input().split())
a = []
if r-l >= 2018:
	print(0)
else:
	ans = 2100
	while l<=r:
		a.append(l%2019)
		l += 1
	for i in range(len(a)-1):
		for j in range(len(a)-i-1):
			x = (a[i] * a[i+j+1])%2019
			ans = min(ans,x)
	print(ans)

Measured memory_bytes: 3060
# 解説放送見てAC
# 包除原理の演習が足りてないのを感じた
MOD = 10**9 + 7
m = 5 * 10**5 + 500
fac = [0] * m
finv = [0] * m
inv = [0] * m


def COMBinitialize(m):
    fac[0] = 1
    finv[0] = 1
    if m > 1:
        fac[1] = 1
        finv[1] = 1
        inv[1] = 1
        for i in range(2, m):
            fac[i] = fac[i-1] * i % MOD
            inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
            finv[i] = finv[i - 1] * inv[i] % MOD


def COMB(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


def PERM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[n - k] % MOD) % MOD


COMBinitialize(m)


def main():
    N, M = (int(i) for i in input().split())
    if N == M == 1:
        return print(0)
    ans = 0
    for k in range(N+1):
        ans += PERM(M-k, N-k) * COMB(N, k) * (-1)**(k % 2)
        ans %= MOD
    print(ans * PERM(M, N) % MOD)


if __name__ == '__main__':
    main()


Measured memory_bytes: 79012
n=int(input())
a=list(map(int,input().split()))[1:]
b=list(map(int,input().split()))[1:]
c=list(map(int,input().split()))[1:]
x = 0
y = 0
for i in range(1,n+1):
    if (i not in a) and (i not in b) and (i in c):
        x += 1
    elif (i in b) and (i in c):
        y += 1
print(x+y)


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

namespace ClassLibrary1
{
    public class ListNode
    {
        public int val;
        public ListNode next;
        public ListNode(int x) { val = x; }
    }


    public class Class1
    {

        static void Main(string[] args)
        {
//            string[] s = Console.ReadLine().Split(' ');
            long a = Int64.Parse(Console.ReadLine());
            //           int b = Int32.Parse(s[1]);

            long max = 1;
            for( long i= 0; i< a; i++)
            {
                max = i;
                if ( a < Math.Pow(max, 2))
                {
                    break;
                } 
            }
            long div = 1;
            for (long i=1; i<max; i++)
            {
                if( a % i == 0)
                {
                    div = i;
                }
            }

            var res = (a / div) + div - 2;

            Console.WriteLine(res);


        }

        static int rec(int[] n, int i, int j, int x)
        {
            if (i + 1 == j)
            {
                return Math.Min(n[j], x);
            }
            return rec(n, i + 1, j, n[i]) + rec(n, i, j - 1, n[j]);
        }


    }
}


Measured memory_bytes: 13140
#include<iostream>
using namespace std;
int a[33]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main(){
	int n;
	cin>>n;
	cout<<a[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>

using namespace std;

struct Node
{
	int num,cnt[3];
} ;

const int M=3e6+44;

map<int,bool> mp;
int num[3]={3,5,7};
int s[M];
int ls;
int bas[10];

void init()
{
	ls=0;
	s[0]=0;
	bas[0]=1;
	for(int i=1;i<10;i++)
		bas[i]=bas[i-1]*10;
}

bool checkpush(Node tmp)
{
	if(tmp.cnt[0]+tmp.cnt[1]+tmp.cnt[2]>9 || mp[tmp.num]) return false;
	return true;
}

bool checkcount(Node tmp)
{
	if(tmp.cnt[0]==0 || tmp.cnt[1]==0 || tmp.cnt[2]==0) return false;
	return true;
}

void bfs()
{
	mp.clear();
	Node now,tmp;
	queue<Node> q;
	while(!q.empty()) q.pop();
	tmp.num=tmp.cnt[0]=tmp.cnt[1]=tmp.cnt[2]=0;
	q.push(tmp); mp[0]=1;
	while(!q.empty())
	{
//		cout<<mp.size()<<endl;
		now=q.front(); q.pop();
		for(int i=0;i<3;i++)
		{
			tmp=now;
			tmp.num=tmp.num*10+num[i],tmp.cnt[i]++;
			if(checkpush(tmp))
			{
				mp[tmp.num]=1;
				if(tmp.cnt[0]+tmp.cnt[1]+tmp.cnt[2]<=8)
					q.push(tmp);
				if(checkcount(tmp))
					s[ls++]=tmp.num;
			}
			tmp=now;
			tmp.num=tmp.num+num[i]*bas[tmp.cnt[0]+tmp.cnt[1]+tmp.cnt[2]],tmp.cnt[i]++;
			if(checkpush(tmp))
			{
				mp[tmp.num]=1;
				if(tmp.cnt[0]+tmp.cnt[1]+tmp.cnt[2]<=8)
					q.push(tmp);
				if(checkcount(tmp))
					s[ls++]=tmp.num;
			}
		}
	}
	sort(s,s+ls);
}

bool check(int id,int q)
{
	if(s[id]<=q) return true;
	return false;
}

int solve(int q)
{
	if(q<s[0]) return 0;
	int li,ri,mid;
	li=0; ri=ls;
	while(li<ri-1)
	{
		mid=(li+ri)/2;
		if(check(mid,q)) li=mid;
		else ri=mid;
	}
	return li+1;
}

int main()
{
	init();
	bfs();
	int q;
	scanf("%d",&q);
	int ans=solve(q);
	printf("%d\n",ans);
	return 0;
}



Measured memory_bytes: 1792
from heapq import heappop, heappush

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

B = []
for i in range(N):
  heappush(B,-A[i])

for i in range(M):
  a = heappop(B)
  a /= 2
  heappush(B,a)

print(sum([int(-B[i]) for i in range(N)]))

Measured memory_bytes: 20776
import sys, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
# from itertools import permutations,combinations
def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var): sys.stdout.write(' '.join(map(str, var)) + '\n')
def out(var): sys.stdout.write(str(var) + '\n')
from decimal import Decimal
# from fractions import Fraction
# sys.setrecursionlimit(100000)
INF = float('inf')
mod = int(1e9) + 7


d,t,s=mdata()
if d/s<=t:
    out("Yes")
else:
    out("No")

Measured memory_bytes: 70824
#include <iostream>
#include <stdio.h>

int main(int argc, char const *argv[]) {
  int a,b;
  char op = 'a';
  while (op != '?') {
    std::cin >> a >> op >> b;
    if (op == '?') {
      break;
    } else if (op == '+') {
      printf("%d\n", a+b);
    } else if (op == '-') {
      printf("%d\n", a-b);
    } else if (op == '*') {
      printf("%d\n", a*b);
    } else if (op == '/'){
      printf("%d\n", a/b);
    }
  }
  return 0;
}

Measured memory_bytes: 3192
// Best practice
 
#include<bits/stdc++.h>
 
#define int         long long
#define pb          push_back
#define pf          emplace_front
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define pii 		pair<int,int>
#define psi 		pair<string,int>
#define vi 			vector<int>
#define vpii  		vector<pii>
#define vvi 		vector<vi>
#define sz(x)	    (int)(x).size()
#define x           first
#define y           second
#define endl        '\n'
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD         1000000007
#define hell        998244353
#define prec(n) 	fixed<<setprecision(n)
#define ini(a, i) 	memset(a, i, sizeof(a))
#define output(x)   cout << (x ? "Yes" : "No")<<endl;
using namespace std;
 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge {c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
	#ifndef LOCAL
	~debug() { cerr << endl; }
	eni(!=) cerr << boolalpha << i; ris; }
	eni(==) ris << range(begin(i), end(i)); }
	sim, class b dor(pair < b, c > d) {
	  ris << "(" << d.first << ", " << d.second << ")";
	}
	sim dor(rge<c> d) {
	  *this << "[";
	  for (auto it = d.b; it != d.e; ++it)
	    *this << ", " + 2 * (it == d.b) << *it;
	  ris << "]";
	}
	#else
	sim dor(const c&) { ris; }
	#endif
};
#define imie(...) "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
 
// const int dx[4] = { -1, 1, 0, 0};
// const int dy[4] = {0, 0, -1, 1};
// int dX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
// int dY[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
 
 
// Code from Here -------------------------------------------------------------------------------

signed main() {
	tezz
 
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	output(n>=30);
 
	return 0;
}  

Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,a=0,b=0,c=0,d=0;
  string s;
  cin >>s;
  N = s.size();
  
  for (int i=0; i<(N+1)/2;i++){    
    if(s[i*2] =='0'){
      a++;
    }
    else if(s[i*2] =='1'){
      b++;
    }
   
  }
  for (int i=0;i<(N+1)/2;i++){
    if(s[1+i*2] =='1')c++;
    else if(s[1+i*2] =='0')d++;
  }
 
  if (a+c>=b+d) cout << b+d << endl; 
  else cout << a+c <<endl;
}
  


Measured memory_bytes: 512
#include <iostream>
typedef long long ll;
using namespace std;
int main()
{
	ll a, b, c, ans = 0;
  	cin >> a >> b >> c;
  	while (c > 0){
    	if (b > 0){
        	c--; b--;
          	ans += 2;
        } else if (a > 0){
        	c--; a--;
          	ans++;
        } else {
          	c--; ans++;
        	break;
        }
    }
  	if (b > 0){
    	ans += b;
    }
  	cout << ans;
}

Measured memory_bytes: 256
#include <iostream>

typedef long long ll;

#define FOR(i,a,b) for(ll i = (a);i < (b);++i)
#define REP(i,n) FOR(i,0,n)

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

  int N,A;
  cin >> N;
  cin >> A;
  cout << N*N-A << endl;
    
  return 0;
}


Measured memory_bytes: 256
from __future__ import print_function
while(1):
    x = raw_input()
    if(x == "0 0"):
        break
    x = x.split(" ")
    h = int(x[0])
    w = int(x[1])
    count = 0
    count2 = 0
    for i in range(0,h):
        if(count2 < h):
            count = 0
            for j in range(0,w):
                if(count < w):
                    print("#",end="")
                else:
                    break
                count += 1
                if(count < w):
                    print(".",end="")
                else:
                    break
                count += 1
            print("\n",end="")
        else:
            print("\n",end="")
            break
        count2 += 1
        if(count2 < h):
            count = 0
            for k in range(0,w):
                if(count < w):
                    print(".",end="")
                else:
                    break
                count += 1
                if(count < w):
                    print("#",end="")
                else:
                    break
                count += 1
            print("\n",end="")
        else:
            print("\n",end="")
            break
        count2 += 1


Measured memory_bytes: 4704
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

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

#ifdef LOCAL
  #define dprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define dprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

//const double PI = 3.1415926535897932384626433832795;

int main() {
  int a;
  string s;
  cin >> a >> s;

  string ans = s;

  if(a < 3200) {
    s = "red";
  }

  cout << s << '\n';

  return 0;
}


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

int main() {
    long long int n, total = 0;
    scanf("%lld", &n);


    for (int i = 1; i <= n; i++) {
        if (i % 3 != 0 && i % 5 != 0) {
            total = total + i;
        }
    }

    printf("%lld", total);
    

    return 0;
}

Measured memory_bytes: 1688
INF=10**30
H,N=map(int,input().split())
A,B=[],[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a);B.append(b)
dp=[[INF]*(H+10) for i in range(N+1)]
dp[0][0]=0
for i in range(N):
    for j in range(H+1):
        if(j<A[i]):
            dp[i+1][j]=min(dp[i][j],dp[i][0]+B[i])
        else:
            dp[i+1][j]=min(dp[i][j],dp[i+1][j-A[i]]+B[i])
print(dp[N][H])

Measured memory_bytes: 257416
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; }                            /* 1,2,3,4.. */
int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; }                     /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
int a[100001], b[100001] = {0}, c[100001], idx[100001];

int des(const void *a, const void *b)
{
  return c[*(int *)b] - c[*(int *)a];
}

int main(void)
{
  int n, m;

  scanf("%d %d", &n, &m);

  int i, j;
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);

  for (i = 0; i < m; i++)
    scanf("%d %d", &b[i], &c[i]);

  for (i = 0; i < m; i++)
    idx[i] = i;

  qsort(a, n, sizeof(int), acs);
  qsort(idx, m, sizeof(int), des);

  long long int max = 0;
  int now = 0;
  for (i = 0; i < n; i++)
  {
    if (b[idx[now]] > 0 && a[i] < c[idx[now]])
    {
      a[i] = c[idx[now]];
      b[idx[now]]--;
      if (b[idx[now]] < 1)
        now++;
    }
    else
      break;
  }

  for (i = 0; i < n; i++)
    max += a[i];

  printf("%lld\n", max);
  return 0;
}


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

using namespace std;
typedef int ll;

#define pf printf
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define REPSZ(i,v) REP(i,SZ(v))
#define pll pair <ll, ll>

ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }
const int maxn = 100005;
ll n,m;
set<int>s1,s2;
vector<pll > v1,v2;
map<ll,ll> odd,even;

void print(vector <ll> &v){cout << v.size() << endl;for(int i = 0; i < v.size(); i++){pf("%lld ", v[i]);}pf("\n");}
void print(vector <pll> &v){ cout << v.size() << endl; for(int i = 0; i < v.size(); i++){pf("%d %d\n", v[i].first, v[i].second);}}
void print(set<ll> s){set <ll> :: iterator itr;for (itr = s.begin(); itr != s.end(); ++itr){cout << *itr << " ";}cout << endl;}
void print(double d){cout << fixed << setprecision(10) << d << endl;}

void from_file(void){ freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);}

/* ------------------main section-------------! */

void solve() {
    
}


void run() {
    fastio;
    ll n;
    cin >> n;
    REP(i,n)
    {
        ll x;
        cin >> x;
        if(i%2){
            s1.insert(x);
            odd[x]++;
        } 
        else{
            s2.insert(x);
            even[x]++;
        } 
    }

    set <ll> :: iterator itr;
    for (itr = s1.begin(); itr != s1.end(); ++itr)
    {
        ll x = *itr;
        v1.pb(mp(odd[x], x));
    }
    for (itr = s2.begin(); itr != s2.end(); ++itr)
    {
        ll x = *itr;
        v2.pb(mp(even[x], x));
    }
    sort(v1.begin(), v1.end());
    sort(v2.begin(), v2.end());
    //print(v1);
    n/=2;
    ll n1 = s1.size();
    ll n2 = s2.size();

    ll ans = 0;
    ll mx1 = v1[n1-1].first,mx2 = v2[n2-1].first,val1 = v1[n1-1].second,val2 = v2[n2-1].second;
    //cout << mx1 << " " << mx2 << " " << val1 << " " << val2 << endl;
    if(val2 != val1){
        ans = 2*n - (mx2+mx1);
    }
    else
    {
        ll dif1, dif2;
        if(n1 == 1) dif1 = v1[n1-1].first;
        else dif1 = v1[n1-1].first - v1[n1-2].first;
        //cout << dif1 << endl;
        if(n2 == 1) dif2 = v2[n2-1].first;
        else dif2 = v2[n2-1].first - v2[n2-2].first;
        //cout << dif2 << endl;
        if(dif1 < dif2){
            if(n1 == 1) ans = 2*n - mx2;
            else ans = 2*n - (v1[n1-2].first+mx2);
        }
        else{
            if(n2 == 1) ans = 2*n - mx1;
            else ans = 2*n - (v2[n2-2].first+mx1);
        }
    }
    cout << ans << endl;
}


int main() {
    #ifndef ONLINE_JUDGE
        from_file();
    #endif
    run();
    return 0;
}


Measured memory_bytes: 13624
#include "bits/stdc++.h"
using namespace std;
#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<Pll> vPll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<double>> vvd;
typedef vector<vector<Pi>> vvPi;
typedef priority_queue<int, vector<int>, greater<int>> pqli;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi>> pqlP;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
int main(void)
{
	int n, a;

	cin>>n>>a;

	cout<<yn(n%500<=a)<<endl;
}

Measured memory_bytes: 256