akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ff first
#define ss second
#define forn(i,n) for (int i=0;i<int(n);i++)
#define nfor(i,n) for (int i=int(n)-1;i>=0;i--)
#define rep(i,a,b)for (int i=a;i<=int(b);i++)
#define rev(i,a,b)for (int i=a;i>=int(b);i--)
#define hell 2000000000
#define fuck 2000000000000000000
using namespace std;
const int N = 100010;
const int M = 1000010;
const double PI = acos(-1.0);
const int MOD = 1000000007;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int gcd(int a,int b){return (b==0)?a:gcd(b,a%b);}

int n,m,k;

int main() {
	
	scanf("%d%d",&n,&m);	
	scanf("%d",&k);
	forn(i,n+1){
		forn(j,m+1){
			int tmp = m*i + j*n;
			tmp -= j * 2 * i;
			if (tmp == k)
				return !printf("Yes");
		}
	}
	printf("No");
	return 0;
}


Measured memory_bytes: 256
var
	n,i:Longint;
	a,b,x,y,c,d:int64;
begin
	read(n);
	a:=1;
	b:=1;
	for i:=1 to n do begin
		read(x,y);
		c:=(a-1)div x+1;
		d:=(b-1)div y+1;
		if c<d then c:=d;
		a:=c*x;
		b:=c*y;
	end;
	writeln(a+b);
end.


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

		int N = sc.nextInt();
		long[] a = new long[N];
		long ans = 0;
		for( int i=0; i<N; i++ ){
			a[i] = sc.nextLong();
			long count = 0;
			for( int j=0; j<30; j++ ){
				if( a[i]%2!=0 ){
					a[i] = count;
					break;
				}else{
					a[i] = a[i]/2;                  
					count++;
				}
			}
			ans += a[i];
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 34328
#include<iostream>
#include<functional>
#include<iomanip>
#include<algorithm>
#include<vector>

using namespace std;
using ll = long long;

#define rep(i,n) for(int i = 0; i <(n); ++i)
#define ALL(n) (n).begin(),(n).end()
#define pb push_back
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}

int main(){
  int a,b,q;  cin >> a>> b >> q;
  vector<ll> jinja(a);  rep(i,a) cin >> jinja[i];
  vector<ll> tera(b);   rep(i,b) cin >> tera[i];
  
  vector<ll> jinja_m(a);  rep(i,a) jinja_m[a-i-1] = -jinja[i];
  vector<ll> tera_m(b);   rep(i,b) tera_m[b-i-1]  = -tera[i];
  
  jinja.pb(10000000000000000LL);
  tera.pb(10000000000000000LL);
  jinja_m.pb(10000000000000000LL);
  tera_m.pb(10000000000000000LL);

  
  sort(ALL(jinja_m)); sort(ALL(tera_m));
    
  rep(i,q){
    ll ans = 1000000000000000LL;
    ll x; cin >> x;
    ll n_jinja = *lower_bound(jinja.begin(), jinja.end(), x) -x;
    ll n_tera = *lower_bound(tera.begin(), tera.end(), x) - x;
    ll p_jinja = x +(*lower_bound(jinja_m.begin(), jinja_m.end(),-x)) ;
    ll p_tera =  x +(*lower_bound(tera_m.begin(), tera_m.end(),-x));
    //cerr << n_jinja << " " << n_tera << " " << p_jinja << " " << p_tera << endl;
    if(n_jinja < 0)  n_jinja = 1000000000000000LL;
    if(p_jinja < 0)  p_jinja = 1000000000000000LL;
    if(n_tera < 0)  n_tera = 1000000000000000LL;
    if(p_tera < 0)  p_tera = 1000000000000000LL;

    
    ans = min(ans, max(n_jinja,n_tera));
    ans = min(ans, max(p_jinja,p_tera));
    ans = min(ans, 2*n_jinja + p_tera);
    ans = min(ans, 2*p_jinja + n_tera);
    ans = min(ans, 2*n_tera + p_jinja);
    ans = min(ans, 2*p_tera + n_jinja);
    cout << ans << endl;
  }
}

Measured memory_bytes: 4416
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define rep0(i,n) for (int i=0; i<=(int)(n); ++i)
#define rep1(i,n) for (int i=1; i<=(int)(n); ++i)
#define rrep(i,n) for (int i=(int)(n)-1; i>=0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;
using llGraph = vector<vl>;
using vb = vector<bool>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = 1e9+7;
const int MOD2 = 998244353;
const double EPS = 1e-9;

template<typename T>
struct is_vector : false_type{};

template<typename T>
struct is_vector<vector<T>> : true_type{};

template<typename T>
ostream &operator << (ostream &ostr, const vector<T> &vec) {
  if (vec.empty()) {
    return ostr;
  }
  ostr << vec.front();
  for (auto itr = ++vec.begin(); itr != vec.end(); ++itr) {
    if (is_vector<T>()) ostr << "\n" << *itr;
    else ostr << ' ' << *itr;
  }
  return ostr;
}

template<typename T>
bool CompareBySecond(pair<T, T> a, pair<T, T> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

template<typename T>
bool CompareBySlope(pair<T, T> a, pair<T, T> b) {
// counterclockwise from 12 o'clock direction
  if (a.first * b.first < 0) {
    return a.first < b.first;
  } else if (a.first == 0) {
    if (a.second >= 0) {
      return true;
    } else {
      return a.first < b.first;
    }
  } else if (b.first == 0) {
    if (b.second >= 0) {
      return false;
    } else {
      return a.first < b.first;
    }
  }
  return a.second * b.first < a.first * b.second;
}

template<typename T>
T GCD(T a, T b) {
  T c = a % b;
  while (c != 0) { a = b; b = c; c = a % b; }
  return b;
}


/* -------- <templates end> -------- */


void solve() {
  int n; cin >> n;
  vi arr(1<<n);
  rep(i,(1<<n)) cin >> arr[i];
  multiset<int, greater<int>> ms;
  rep(i,(1<<n)) ms.insert(arr[i]);
  vi slimes(1<<n);
  slimes[0] = *begin(ms);
  ms.erase(ms.find(slimes[0]));
  rep(i,n) {
    rep(j,(1<<i)) {
      if (*rbegin(ms) >= slimes[j]) {
        cout << "No\n";
        return;
      }
      slimes[j+(1<<i)] = *ms.upper_bound(slimes[j]);
      ms.erase(ms.find(slimes[j+(1<<i)]));
    }
  }
  cout << "Yes\n";
}


/* -------- <programs end> -------- */


int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}


Measured memory_bytes: 14592
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <limits>
#include <deque>
#include <valarray>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#include <array>
#include <bitset>
#include <complex>
#include <tuple>

using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main()
{
  int a, b, k;
  cin >> a >> b >> k;
  int cnt = 0;
  for (int i = 100; i >= 1; --i)
  {
    if (a % i == 0 && b % i == 0)
    {
      cnt++;
    }
    if (cnt == k)
    {
      cout << i << endl;
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int h, w, t;
    int i, j;
    
    scanf("%d%d", &h, &w);
    
    while(h||w){
        for(i=0; i<h; i++){
            if(i%2==0){
                t=0;
            }
            else{
                t=1;
            }
            for(j=0; j<w; j++){
                if(t==0){
                    printf("#");
                    t=1;
                }
                else{
                    printf(".");
                    t=0;
                }
            }
            printf("\n");
        }
        printf("\n");
        
        scanf("%d%d", &h, &w);
    }
    
    return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h> 
 
using namespace std;
 
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
 
//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<long, long> PLL;
 
//container util
//------------------------------------------
#define PB emplace_back
#define MP make_pair 
#define SZ(a) int((a).size())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a)  (a).begin(),(a).end()
//constant
//--------------------------------------------
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
const double EPS=1e-10;

int main(){
    int N,M;
    cin>>N>>M;vector<int>X(M);
    REP(i,M)cin>>X[i];
    SORT(X);
    vector<int>d;
    REP(i,M-1){
        d.PB(X[i+1]-X[i]);
    }
    SORT(d);
    long res=0;
    REP(i,SZ(d)-N+1){
        res+=d[i];
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 1276
#include<stdio.h>
#include<map>
#include<algorithm>
using namespace std;

map<int,int> M;
int mn[100005],mx[100005],m[100005],a[100005];

int main()
{
    int n,T,i,res=0,cnt=0;
    scanf("%d %d", &n, &T);
    mn[0]=1e9;
    for(i=1;i<=n;i++){
        scanf("%d", &a[i]);
        m[i]=a[i];
        mn[i]=min(mn[i-1],a[i]);
    }
    for(i=n;i>=1;i--)mx[i]=max(mx[i+1],a[i]);
    for(i=1;i<=n;i++)res=max(res,mx[i]-mn[i]);
    sort(m+1,m+n+1);
    for(i=1;i<=n;i++){
        if(M[a[i]-res])cnt++;
        M[a[i]]++;
    }
    printf("%d", cnt);
    return 0;
}


Measured memory_bytes: 11136
def money(n):
  if n==1:
    return 300000
  elif n==2:
    return 200000
  elif n==3:
    return 100000
  else:
    return 0

a,b=map(int,input().split())

ans=money(a)+money(b)+400000 if a==b==1 else money(a)+money(b)
print(ans)

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

int main(){
  int x;
  cin>>x;
  if(x==25) cout<<"Christmas"<<endl;
  if(x==24) cout<<"Christmas Eve"<<endl;
  if(x==23) cout<<"Christmas Eve Eve"<<endl;
  if(x==22) cout<<"Christmas Eve Eve Eve"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define lint                     long long 
#define setbits(x)              __builtin_popcountll(x)
#define zrbits(x)               __builtin_ctzll(x)
#define zlbits(x)               __builtin_clzll(x)
#define parsbits(x)             __builtin_parityll(x)
#define mem(a, b)               memset(a, (b), sizeof(a))
#define MOD                     1000000007
#define inf                     1e17 
#define neginf                  -1e17 
#define sp(x,y)                 fixed<<setprecision(x)<<y
#define testcase(t)             lint t; cin>>t; while(t--)
#define power(a,b)              (double)pow((double)a,(double)b)
#define FOR(i,n)                for(lint i=0;i<n;i++)
#define gcd(a,b)                __gcd(a,b)
#define PI                      3.1415926535
#define pb                      push_back
#define ss                      second
#define ff                      first
#define umap                    unordered_map           
#define ummap                   unordered_multimap
#define uset                    unordered_set
#define umset                   unordered_multiset

             
typedef unsigned long long   ull;

typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
         
void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  //  #ifndef ONLINE_JUDGE
    //freopen("C:\\Users\\pranjal bhatt\\Desktop\\code contests\\input1.txt", "r", stdin);
   /// freopen("C:\\Users\\pranjal bhatt\\Desktop\\code contests\\output1.txt", "w", stdout);
   // #endif
}

lint me(lint x, lint y, lint p)  
{  
    lint res = 1;     
     
    x = x % p; 
           
    if (x == 0) return 0; 
          
    while (y > 0)  
    {  
                
        if (y & 1)  
        res = (res*x) % p;  
          
                  
        y = y>>1;  
        x = (x*x) % p;  
    }  
    return res;  
}

    /*---------------------------SOLUTION---------------------------------*/

void solve()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    lint n,k;
    cin>>n>>k;
    lint arr[10]={0};
    for(lint i=0;i<k;i++)
    {
        lint u;
        cin>>u;
        arr[u]=1;
    }
    for(lint i=n;i<=100000;i++)
    {
        lint x=i;
        lint flg=0;
        while(x>0)
        {
            lint p=x%10;
            x=x/10;
            if(arr[p]==1)
                flg=1;
        }
        if(flg==0)
        {
            cout<<i<<endl;
            return;
        }
    }

}


int main()
{
    c_p_c();
    lint flg99=0;
    if(flg99==1)
    {
        testcase(t)
        {
             solve();
        }
    }
    else
    {
        solve();
    }
    return 0;
            
}
                
            
                

                

                



Measured memory_bytes: 3652
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset

#include <math.h>
#include <stdlib.h>


#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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_MAX	2,147,483,647 = 2*1.0e9

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

  map<int, int> even;
  map<int, int> odd;
  set<int> eSet;
  set<int> oSet;

  for(int i = 0; i < n; i++){
    int v; cin >> v;
    if(i%2 == 0){
      even[v]++;
      eSet.insert(v);
    } else {
      odd[v]++;
      oSet.insert(v);
    }
  }

  int eMax = -1, eMaxID = -1, eSec = -1, eSecID= -1;
  for(auto i : eSet){
    if(even[i] > eMax){
      eSec = eMax;
      eSecID = eMaxID;
      eMax = even[i];
      eMaxID = i;
    } else if(even[i] > eSec){
      eSec = even[i];
      eSecID = i;
    }
  }


  int oMax = 0, oMaxID = 0, oSec = 0, oSecID= 0;
  for(auto i : oSet){
    if(odd[i] > oMax){
      oSec = oMax;
      oSecID = oMaxID;
      oMax = odd[i];
      oMaxID = i;
    } else if(odd[i] > oSec){
      oSec = odd[i];
      oSecID = i;
    }
  }

  int ans = 0;
  if(oMaxID == eMaxID){
    if(oMax > eMax) ans = n - oMax - eSec;
    else if(oMax < eMax) ans = n - oSec - eMax;
    else {
      if (oSec > eSec) ans = n - oSec - eMax;
      else ans = n - oMax - eSec;
    }
  } else {
    ans = n - oMax - eMax;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<int,int>
#define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
#define FORR(I,A,B) for(ll I = int((B)-1); I >= int(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;

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

	ll n,m;
	cin >> n >> m;
	vector<ll> x(n+2,0);
	FOR(i,0,m){
		ll a,b;
		cin >> a >> b;
		x[a]++;
		x[b+1]--;
	}
	ll ans = 0;
	FOR(i,1,n+2){
		x[i] += x[i-1];
		if(x[i]==m)ans++;
	}
	cout << ans << endl;
	
}


Measured memory_bytes: 1024
s=input()
n=int(input())

s_n=len(s)
s_s=[]
s=str(s+'z')
chk=0

if n>=s_n:
	for i in range(s_n):
		for j in range(i+1,s_n+1):
			s_s.append(s[i:j])
	res=list(sorted(set(s_s)))
	print(res[n-1])
else:
	for i in range(s_n-n+1):
		j=i+n
		s_s.append(s[i:j])
	for i in range(s_n-n,s_n):
		for j in range(i+1,s_n+1):
			s_s.append(s[i:j])
	res=list(sorted(set(s_s)))
	#print(res)
	if len(res[0])==n:
		print(res[0])
		chk=1    
	for i in range(1,n-1): 
		if chk==0 and len(res[i])==n:
			print(res[i][0:n-i+1])
			chk=1
			break
	if chk==0 and len(res[n-1])==n:
		if res[n-1]!=s[(s_n-n):s_n]:
			print(res[n-1][0])
			chk=1
	if chk==0:
		print(res[n-1])

Measured memory_bytes: 3532
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define reptr(i,n) for(int (i)=(n);(i)>=0;--(i))
#define All(x) (x).begin(),(x).end()
#define mp make_pair
const ll MOD=1e9+7;
const ll MAX=1e8+7;
using namespace std;
int n;
bool IsPrime[10005];
//判定する対象の素数
int M[10005];

void eratos(){
  for(int i=2;i<=10000;i++){
    if(IsPrime[i]){
      int j = i + i;
      while(j <= 10000){
        IsPrime[j] = false;
        j += i;
      }
    }
  }
}

bool OrPrime(int x){
  if(x<2) return false;
  if(x==2) return true;
  if(x%2==0) return false;
  for(int i=3;i<=10000;i+=2){
    if(!IsPrime[i]) continue;
    if(i*i>x) return true;
    if(x%i==0) return false;
  }
  return true;
}

int main(){
  cin >> n;
  rep(i,n){
    cin >> M[i];
  }
  for(int i=0;i<=10000;i++){
    IsPrime[i] = true;
  }
  IsPrime[0] = IsPrime[1] = false;
  eratos();
  int cnt = 0;
  rep(i,n){
    if(OrPrime(M[i])) cnt++;
  }
  cout << cnt << endl;
}



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

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>

#define INF 10e9
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;

int main(){
    long long int l, r;
    cin >> l >> r;

    if(r-l+1 >= 2019){
        cout << 0 << endl;
        return 0;
    }else{
        long long int i, j;
        long long int m = 10000;
        long long int mod_i, mod_j;
        for(i = l; i <= r; i++){
            for(j = i+1; j <= r; j++){
                mod_i = i % 2019;
                mod_j = j % 2019;
                m = min(m ,mod_i * mod_j % 2019);
            }
        }
        cout << m << endl;
        return 0;
    }


}










Measured memory_bytes: 256
// ~maqsat~
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
#define F first
#define S second
#define in insert
#define pb push_back
#define eb emplace_back
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define count1 __builtin_popcountl
#define debug(x) cerr << (#x) << " = " << (x) << "\n";
#define TEZ ios_base::sync_with_stdio(false),cin.tie(nullptr);
#define fre(f) if(fopen(f".in", "r")) freopen(f".in", "r", stdin),freopen(f".out", "w", stdout);
 
using namespace std;
using namespace __gnu_pbds;
 
using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
using db = double;
using ld = long double;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef vector<ii> vii;
typedef vector<pll> vll;
typedef vector<int> vi;
typedef vector<ll> vl;
 
template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T, class U> inline void cmin(T &a, U b) { a = min(a, b); }
template <class T, class U> inline void cmax(T &a, U b) { a = max(a, b); }
template <class T, class U, class X, class Y> inline void psmn(T &a, U b, X &p, Y i) { if(b < a)a = b,p = i; }
template <class T, class U, class X, class Y> inline void psmx(T &a, U b, X &p, Y i) { if(b > a)a = b,p = i; }
 
const int oo = 0x3f3f3f3f;
const ll N = 1e5 + 345;
const ll MOD = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const db EPS = 1e-9;
const db PI = acos(-1); // 3.14159265358979323846
 
int main() {
	fre(""); TEZ;

	int n;
	cin >> n;
	cout << n* n * n;

	return 0;
}


Measured memory_bytes: 256
///WRONG LIFE
///DIE(RETRY)
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

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

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
#define endl '\n'

using ll = long long;
using db = long double;
using row = vector<int>;
using ii = pair<int, int>;

const int N = 2e5 + 5, M = 26, A = 6561, LG = 19, MOD = 998244353;
const int BLOCK = 500;
const long double EPS = 1e-7;
using pii = pair<int,int>;

int main(){
#ifdef ONLINE_JUDGE
  ios_base::sync_with_stdio(0);
  cin.tie(0);
#endif // ONLINE_JUDGE

  int A,B,C;
  cin >> A >> B >> C;

  int ans = min(A,C);
  C-=ans;
  A-=ans;
  ans += min(B,C)*2;
  ans += (B - min(B,C));
  if(B<C)ans++;
  cout<<ans<<'\n';

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
  int N,div=0,ans=0;
  cin >> N;
  for(int i=1;i<=N;i+=2){
    div=0;
    for(int j=1;j<=i;j++){
      if(i%j==0)  div++;
    }
    if(div==8)  ans++;
  }
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int dir[4][2] = {{0,0},{0,1},{1,0},{1,1}};

int query(int left,int now,char c) {
  if(now==0) {
    return (c=='o')?left:(left+1)%2;
  }
  return (c=='x')?left:(left+1)%2;
}
string solve(int n,string s) {
  int arr[100001];
  for (int x=0; x<4; x++) {
    for (int i=0; i<n; i++) {
      arr[i]=(-1);
    }
    arr[0]=dir[x][0];
    arr[1]=dir[x][1];
    for (int i=2; i<n; i++) {
      arr[i]=query(arr[i-2],arr[i-1],s[i-1]);
    }
    if (arr[0]==query(arr[n-2],arr[n-1],s[n-1]) &&
        arr[1]==query(arr[n-1],arr[0],s[0])) {
      string t="";
      for (int i=0; i<n; i++) {
        t+=(arr[i]==0)?"S":"W";
      }
      return t;
    }
  }
  return "-1";
}
int main() {
  int N;
  string s;
  cin >> N >> s;
  cout << solve(N,s) << endl;
  return 0;
}



Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    string S; int Q; cin >> S >> Q;
    deque<char> D(S.size());
    REP(i, 0, S.size()) D[i] = S[i];

    int state = 0;
    REP(i, 0, Q) {
        int q; cin >> q;
        if (q == 1) {
            state = (state + 1) % 2;
            continue;
        }

        int f; char c; cin >> f >> c;
        if (f == 1) {
            if (state == 0) D.push_front(c);
            else D.push_back(c);
        } else {
            if (state == 0) D.push_back(c);
            else D.push_front(c);
        }
    }

    if (state == 0) {
        REP(i, 0, D.size()) cout << D[i];
        cout << endl;
    } else {
        for (int i = D.size() - 1; i >= 0; i--) cout << D[i];
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <string>
using namespace std;
int main()
{
    // 文字列の入力
    string S;
    cin >> S;

    int num = atoi(S.c_str());

    if (num / 100 <= 12 && num % 100 <= 12)
    {
        if (num / 100 == 0 && num % 100 == 0)
            S = "NA";
        else if (num / 100 == 0)
            S = "YYMM";
        else if (num % 100 == 0)
            S = "MMYY";

        else
            S = "AMBIGUOUS";
    }
    else if (num % 100 <= 12 && num % 100 > 0)
        S = "YYMM";
    else if (num / 100 <= 12 && num / 100 > 0)
        S = "MMYY";
    else
        S = "NA";

    // 出力
    cout << S << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
my_dict = dict()

for _ in range(n):
    tmp = input()
    if tmp in my_dict:
        my_dict[tmp] += 1
    else:
        my_dict[tmp] = 1

for item in ['AC', 'WA', 'TLE', 'RE']:
    if item in my_dict:
        print(item + ' x ' + str(my_dict[item]))
    else:
        print(item + ' x ' + str(0))


Measured memory_bytes: 9132
#include<bits/stdc++.h>
using namespace std;
#define int long long int
signed main()
{
    string s;
    cin>>s;
    int f=0;
    for(int i=0;i<s.length();i+=2)
    {
        if(s[i]!='h' || s[i+1]!='i')
        {
            f=1;
            break;
        }
    }
    if(f==1)
    cout<<"No"<<endl;
    else
    cout<<"Yes"<<endl;
}

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

using namespace std;

typedef long long ll;
#define int ll
typedef long double ld;

typedef pair<int,int> pii;
#define x first
#define y second

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    string s;
    cin>>n>>s;
    int r=0,g=0,b=0;
    for(int i=0;i<n;i++)
        if(s[i]=='R')
            r++;
        else if(s[i]=='G')
            g++;
        else
            b++;
    int bad=0;
    for(int i=0;i<n;i++)
        for(int j=i+1;j<n;j++)
        {
            int k=j+j-i;
            if(k<n&&s[i]!=s[j]&&s[i]!=s[k]&&s[j]!=s[k])
                bad++;
        }
    cout<<r*g*b-bad;
}


Measured memory_bytes: 3652
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e18
using ll = long long;
using namespace std;
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; }

int main(){
  int x,y;  cin >> x >> y;
  int ans = 0;
  rep0(i,2){
    int a;
    if(i == 0){
      a = x;
    }else{
      a = y;
    }
    if(a == 1){
      ans += 300000;
    }else if(a == 2){
      ans += 200000;
    }else if(a == 3){
      ans += 100000;
    }
  }
  if(x == 1 && y == 1){
    ans += 400000;
  }
  cout << ans;
}


Measured memory_bytes: 256
use std::io;
use std::str::FromStr;
use std::cmp;

fn input_int_tuple() -> (i32, i32) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<i32> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn input_i32_vec() -> Vec<i32> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
    let (n, k) = input_int_tuple();
    let x_vec = input_i32_vec();
    if k == 1 {
        println!("{}", x_vec[0]);
        return;
    }
    let mut min = 1000000000u64;
    for i in 0..((n-k + 1) as usize) {
        let mut len = 0;
        // println!("{}, {}", x_vec[i], x_vec[i + k as usize - 1]);
        if (x_vec[i] <= 0 && x_vec[i + k as usize - 1] <= 0) || (x_vec[i] >= 0 &&(x_vec[i + k as usize - 1] >= 0)) {
            len += cmp::max(x_vec[i].abs(), x_vec[i + k as usize - 1].abs());            
        } else {            
            len += cmp::min(x_vec[i].abs(), x_vec[i + k as usize - 1].abs());
            // print!("{} ", len);
            len += x_vec[i + k as usize - 1] - x_vec[i];
            // println!("{}", len);
        }
        // println!("{}", len);
        if (len as u64) < min {
            min = len as u64;
        }
    }
    println!("{}", min);
}


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

using namespace std;

typedef long long ll;



int main() {
    ll n, x;
    cin >> x >> n;
    vector<ll> val(n);
    for(ll i = 0; i < n; i++)cin >> val[i];
    map<int, int> mp;
    for(ll i = 0; i < n; i++)mp[val[i]]++;
    ll l = x;
    ll r = x;
    while(mp.count(l) && mp.count(r)){
        l--;
        r++;
    }
    if(mp.count(l)){
        cout << r << endl;
    }else{
        cout << l << endl;
    }
}


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

//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define RES(a,i,j) a.resize(i);rep(ii,i)a[ii].resize(j); 
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 
#define gre(n) greater<n>()

typedef long long ll;
typedef pair<dou,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
const int INF = 1000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;
//メモ
//二次元配列のresizeのしかた

//vv.resize(n);
//for(size_t i=0; i<n; i++){
// vv[i].resize(n);
//}

//メモ
//負の辺を持つ最短経路問題では到達不可経路でも初期化値より小さくなりうるので注意しよう！
map< ll, int > prime_factor(ll n) {//素因数分解
  map< ll, int > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}


int main(){
    int n;
    std::cin >> n;
    std::map<ll, int> m=prime_factor(n);
    std::cout << n << ":";
    erep(i,m){
        rep(j,i.se){
            std::cout <<' '<< i.fi ;
        }
    }
    std::cout << std::endl;
}


Measured memory_bytes: 3220
n,t=map(int,raw_input().split())
a=map(int,raw_input().split())
now=a[0]
cnt=[]
for i in xrange(1,n):
    if now<a[i]:
        cnt.append(a[i]-now)
    else:
        now=a[i]
print(cnt.count(max(cnt)))

Measured memory_bytes: 11328
N, K = [int(i) for i in input().split()]
res = 0

for i in range(K, N + 2) :
	sum_lasti = i * (2 * N + 1 - i)/2 #初項 N + 1 - i 項数 i 公差1 末項 Nの等差数列の和
	sum_firsti = ( i * i - i )/ 2 #初項 0 項数 i 公差1 末項 i-1の等差数列の和
	
	res += sum_lasti - sum_firsti + 1

print(int(res%1000000007))


Measured memory_bytes: 9108
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;

int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
    
  i32 N, K;
  cin >> N >> K;
  
  vector<i8> D(K);
  for(i32 i=0 ; i < K; ++i) {
    i8 d;
    cin >> d;
    D[i] = d;
  }
  
  for(i32 i = N; i < 100000; ++i) {
    bool is_k_num = false;
	string ss = to_string(i);    
  	for(auto d : D) {
      if(ss.find(d) != string::npos) {
        is_k_num = true;
      }
    }
    if(!is_k_num) {
      cout << i << endl;
      break;
    }
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

int dp[3333][3333][2];
int n, t;
int a[3333], b[3333];

int main() {
    cin >> n >> t;
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    
    t -= 1;

    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= t; j++) {
            if (i < n) {
                dp[i + 1][j][1] = max(dp[i + 1][j][1], dp[i][j][0] + b[i]);
            }
            for (int k = 0; k < 2; k++) {
                if (j < t) {
                    dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k]);
                }
                if (i < n) {
                    dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j][k]);
                }
                if (i < n && j + a[i] <= t) {
                    dp[i + 1][j + a[i]][k] = max(dp[i + 1][j + a[i]][k], dp[i][j][k] + b[i]);
                }
            }
        }
    }
    cout << dp[n][t][1] << endl;

    return 0;
}

Measured memory_bytes: 80128
#include<bits/stdc++.h>
using namespace std;
#pragma region Macros
#define ios\
    ios::sync_with_stdio(false);\
    cin.tie(nullptr);
#define VEC(type, name, size)\
    V<type> name(size);\
    IN(name)
#define VVEC(type, name, h, w)\
    VV<type> name(h, V<type>(w));\
    IN(name)
#define INT(...)\
    int __VA_ARGS__;\
    IN(__VA_ARGS__)
#define LL(...)\
    ll __VA_ARGS__;\
    IN(__VA_ARGS__)
#define STR(...)\
    string __VA_ARGS__;\
    IN(__VA_ARGS__)
#define CHAR(...)\
    char __VA_ARGS__;\
    IN(__VA_ARGS__)
#define DOUBLE(...)\
    DOUBLE __VA_ARGS__;\
    IN(__VA_ARGS__)
#define LD(...)\
    LD __VA_ARGS__;\
    IN(__VA_ARGS__)
template <class T> void scan(T &a) { cin >> a; }
template <class T> void scan(vector<T> &a) { for(auto &i : a) scan(i); }
template <class T, class L> void scan(pair<T, L> &p){ scan(p.first); scan(p.second); }
void IN() {}
template <class Head, class... Tail> void IN(Head &head, Tail &... tail) { scan(head); IN(tail...); }
template <class T> inline void print(T x){ cout << x << '\n';}
#define ll long long
#define ld long double
#define FOR(i,l,r) for(ll 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(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define pb push_back
#define eb emplace_back
#define SZ(x) ((ll)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
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; }
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
inline void err(bool b = true) {if(b) {cout << -1 << '\n'; exit(0);}}
template<class T> inline void fin(bool b = true, T e = 0) {if(b) {cout << e << '\n'; exit(0);}}
template<class T> T Roundup_div(T x, T y) {return (x+(y-1))/y;}
template <typename T> T pow(T a, long long n, T e = 1) {T ret = e; while (n) {if (n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
const ll INF = 1e18;
#pragma endregion

int main(){
    ios;
    STR(s);
    ll ren = 0;
    ll res = 0;
    REP(i, 3){
        if(s[i] == 'R')ren++;
        else chmax(res, ren), ren = 0;
    }
    chmax(res, ren);
    print(res);
}

Measured memory_bytes: 3648
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int               long long
#define ff                first
#define ss                second
#define md                1000000007
#define md1               998244353
#define inf               1000000000000000
#define minf              -1000000000000000
#define pb                push_back
#define in                insert
#define mkp               make_pair
#define mpll              map<ll,ll>
#define len(p)            (ll)p.size()
#define pll               pair<ll,ll>
#define all(v)            v.begin(),v.end()
#define mem(a,t)          memset(a,t,sizeof(a))
#define endl              "\n"
#define ar                array
#define vl                vector<ll>
#define vpll              vector<pair<ll,ll>>
#define f(i,yha,wha)      for(ll i=yha;i<wha;i++)
#define rf(i,wha,yha)     for(ll i=wha;i>=yha;i--)
#define f0(n)             for(ll i=0;i<n;i++)
#define f1(n)             for(ll i=1;i<=n;i++)
#define fg(i,yha,wha,gap) for(ll i=yha;i<wha;i+=gap)


void flash()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
const ll N = 1e5 + 10;
ll h[N];
vl v[N];




void solve()
{
    ll n, m;
    cin >> n >> m;
    f(i, 1, n + 1)
    cin >> h[i];
    f(i, 0, m)
    {
        ll x, y;
        cin >> x >> y;
        v[x].pb(y);
        v[y].pb(x);
    }

    ll cnt = 0;

    f(i, 1, n + 1)
    {
        int ok = 1;

        for (auto it : v[i])
        {
            if (h[it] >= h[i])
            {
                ok = 0;
                break;
            }
        }
        if (ok == 1)
            cnt++;

    }
    cout << cnt << endl;


}

int32_t main()
{
    flash();
    int t;
    t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 10288
import java.util.Scanner;

public class Main {

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

	    int ok = 0;
	    for (int i=0; i<ninzu; i++) {
	    	int height_temp = scanner.nextInt();
	    	if (height_temp >= height) ok++;
	    }

	    System.out.println(ok);
	}

}


Measured memory_bytes: 49100
# pragma GCC optimize("O3")
# include <bits/stdc++.h>
# define maxn 100005
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
# define pb push_back
# define mp make_pair
# define sz(x) (int)((x).size())
# define int ll
using namespace std;

int n,a,b;

int32_t main(){_
    //freopen("input","r",stdin);
    cin >> n >> a >> b;
    if(a > b) rc(0);
    if(n == 1 && (a != b)) rc(0);
	int x = a * (n - 1);
	x += b;
	int y = b * (n - 1);
	y += a;
	rc(y - x + 1);
}


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

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

    cout << (x ^ 1) << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORR(x, arr) for(auto& x:arr)
#define ITR(x, c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
typedef pair<int, int> P;

ll a[200005];
int n;

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> n;
	map<ll, int> mp;
	ll sum = 0, cnt = 0;
	FOR(i, n) {
		ll x;
		cin >> x;
		sum += x;
		cnt += mp[sum];
		if (sum == 0) cnt++;
		mp[sum]++;
	}
	cout << cnt << endl;
	return 0;
}

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

const int N = 100010;
const int mod = 1e9 + 7;

char s[N]; int pre[N], dp[N], nxt[3];

int main() {
    scanf("%s", s + 1); int n = strlen(s + 1);
    for (int i = 1; i <= n; i++) 
        pre[i] = (pre[i - 1] + s[i] - 'a' + 1) % 3;
    bool flag = true;
    for (int i = 2; i <= n; i++)
        if (s[i] == s[i - 1]) {
            flag = false; break;
        }
    if (flag) return puts("1"), 0;
    nxt[0] = nxt[1] = nxt[2] = n + 1, dp[n + 1] = 1;
    for (int i = n; i >= 1; i--) {
        if (pre[i - 1] == pre[n] && i != 1) dp[i] = 1;
        dp[i] = (dp[i] + dp[i + 1]) % mod;
        int nw = s[i] - 'a' + 1, t = (pre[i - 1] + 3 - nw) % 3;
        dp[i] = (dp[i] + dp[nxt[t] + 1]) % mod, nxt[pre[i]] = i;
    }
    printf("%d\n", dp[1]);
}

Measured memory_bytes: 1152
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main (){
    string s;
    cin >> s;
    if(s=="Sunny"){
        cout << "Cloudy" << endl;
    }
    else if(s=="Cloudy"){
        cout << "Rainy" << endl;
    }
    else {
        cout << "Sunny" << endl;
    }
    return 0;
}

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

#define LLINF (1LL<<60)
typedef long long ll;

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)


//C++14 (GCC 5.4.1)
int main() {
    int A,B;
    cin >>A>>B;
    int ans=0;
    if(13<=A){
        ans=B;
    }else if(6<=A){
        ans=B/2;
    }

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

Measured memory_bytes: 256
while True:
    a,b=map(int,raw_input().split())
    if a==b==0:break
    n=input()
    stop=[map(int,raw_input().split()) for i in range(n)]
    stop=[[i-1,j-1] for i,j in stop]
    dp=[[0]*a for i in range(b)]
    for i in range(a):
        if [i,0] not in stop:
            dp[0][i]=1
        else:
            break
    for i in range(b):
        if [0,i] not in stop:
            dp[i][0]=1
        else:
            break
    for i in range(1,b):
        for j in range(1,a):
            if [j,i] not in stop:
                dp[i][j]=dp[i-1][j]+dp[i][j-1]
    print dp[b-1][a-1]

Measured memory_bytes: 4284
#Detectando Ciclos en un grafo
from collections import deque
import sys

def dfs(G,u):
    n = len(G)
    vis=[-1]*n
    stackV = []
    pila = deque()
    pila.append(u)
    vis[u]=1
    stackV.append(u)
    while(pila):
        w = pila.pop()
        for v in G[w]:
            if(vis[v]==-1):
                vis[v]=1
                pila.append(v)
                stackV.append(v)
            elif(vis[v]==1 and v==u):
                return True
    return False

def main():
    G =[]
    val = [int(x) for x in sys.stdin.readline().strip().split()]
    for i in range(val[0]):
        G.append([])
    for i in range(val[1]):
        L = [int(x) for x in sys.stdin.readline().strip().split()]
        G[L[0]].append(L[1])
    veri=[]

    for i in range(val[0]):
        veri.append(dfs(G,i))
    
    if(True in veri):print(1)
    else:print(0)
        
main()
        
        



Measured memory_bytes: 6016
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            long[] a = new long[N];

            #region 自作
            /*for (int i = 0; i < N; i++)
            {
                a[i] = long.Parse(s[i]);
            }

            long ans = 0;

            for (int i = 0; i < N - 1; i++)
            {
                for (int j = i+1; j < N; j++)
                {
                    ans += a[i] * a[j];
                }
            }*/
            #endregion

            #region 解説より
            long sum = 0;
            long ans = 0;
            long mod = 1000000007;

            for (int i = 0; i < N; i++)
            {
                a[i] = long.Parse(s[i]);
                sum += a[i];
                sum %= mod;
            }

            for (int i = 0; i < N - 1; i++)
            {
                sum -= a[i];
                if (sum < 0) sum += mod;
                ans += a[i] * sum;

                ans %= mod;
            }
            #endregion

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 47224
#include <stdio.h>
int main(void)
{
  int x,y,f,i;
  while(1){
    f=0;
    scanf("%d %d",&x,&y);
    if(x==0&&y==0)
      break;
    if(x<y){
      i=x;
      x=y;
      y=i;
    }
    while(y){
      i=y;
      y=x%y;
      x=i;
      f++;
    }
    printf("%d %d\n",x,f);
  }

  return 0;
}

Measured memory_bytes: 600
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long LL;
const int N=6005;
const int MOD=998244353;
int add (int x,int y)   {x=x+y;return x>=MOD?x-MOD:x;}
int mul (int x,int y)   {return (LL)x*y%MOD;}
int dec (int x,int y)   {x=x-y;return x<0?x+MOD:x;}
int Pow (int x,int y)
{
	if (y==1) return x;
	int lalal=Pow(x,y>>1);
	lalal=mul(lalal,lalal);
	if (y&1) lalal=mul(lalal,x);
	return lalal;
}
int n,x;
int JC[N],inv[N];
void Init (int n)
{
	JC[0]=1;for (int u=1;u<=n;u++) JC[u]=mul(JC[u-1],u);
	inv[n]=Pow(JC[n],MOD-2);
	for (int u=n-1;u>=0;u--) inv[u]=mul(inv[u+1],u+1);
}
int C (int x,int y)	{return mul(inv[x-y],mul(JC[x],inv[y]));}
int calc (int x,int y)
{
	if (x<0) return 0;
	if (y<0) return 0;
	if (x>y) return 0;
	return C(x,y-x);
}
int main()
{
	Init(6000);
	scanf("%d%d",&n,&x);
	int ans=0;
	for (int u=0;u<=n;u++)
	{
		int tmp=0;
		for (int i=u;i<=2*u;i++)
		{
			if (i<x) 
			{
			//	printf("%d %d %d\n",u,i,calc(u,i));
				tmp=add(tmp,calc(u,i));
			}
			else
			{
				int t=i-x;
				if (t%2==0) continue;
				int tt=t/2+1;
				int a=u-2*tt;
				//printf("%d %d %d %d\n",a,i,t,tt);
				if (a<=0) 
				{
					if (i==u*2)	tmp=add(tmp,1);
				}
				else
				{
					int b=i-tt*2*2;
					//printf("%d %d %d %d\n",i,t,a,b);
					tmp=add(tmp,calc(a,b));
				}
			}
		}
		//printf("u:%d %d\n",u,tmp);
		ans=add(ans,mul(tmp,C(n,u)));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <climits>
#include <bitset>
#include <fstream>
#include <algorithm>
#include <functional>
#include <stack>
#include <string>
#include <cmath>
#define fi first
#define se second
#define re register
#define ls i << 1
#define rs i << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007

#define endl puts("")
//#define int long long

using namespace std;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1.0);

inline int rd(){
    re int res = 0,flag = 0;char ch;
    if ((ch = getchar()) == '-')flag = 1;
 	else if(ch >= '0' && ch <= '9')res = ch - '0';
	while ((ch = getchar()) >= '0' && ch <= '9')res = (res<<1) + (res<<3) + (ch - '0');
    return flag ? -res : res;
}

void out(int a) {
    if (a < 0) {
        putchar('-');a = -a;
    }
    if (a >= 10) out(a / 10);
    putchar(a % 10 + '0');
}

//signed main(){
int main() {
	int ans = 0;
	string s, t;
	cin >> s >> t;
	for (int i = 0; i < s.size(); i++) {
		if(s[i] != t[i]) ans ++;
	}
	out(ans);
	return 0;
}


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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string  str = Console.ReadLine();
            Console.WriteLine(str.Length - str.Replace('1'.ToString(), "").Length);
        }
    }
 }


Measured memory_bytes: 11092
package main

import (
	"fmt"
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	var a, b, c, x, y int
	fmt.Scan(&a, &b, &c, &x, &y)

	normal := a * x + b * y
	ab := c * max(x, y) * 2

	add := 0
	if x < y {
		add = (2 * x * c) + (y - x) * b
	} else {
		add = (2 * y * c) + (x - y) * a
	}

	min := normal
	if min > ab {
		min = ab
	}
	if min > add {
		min = add
	}

	fmt.Println(min)
}

Measured memory_bytes: 512
#include <iostream>
#include <stdlib.h>
using namespace std;

int main() {
  unsigned long x;
  cin >> x;

  unsigned long val;
  unsigned long p = x/11;
  if(x % 11 == 0) {
    val = p*2;
  } else if(x % 11 <= 6) {
    val = p*2+1;
  } else {
    val = p*2+2;
  }

  cout << val << endl;
}


Measured memory_bytes: 256