akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<numeric>
#include<cctype>
#include<random>

//#include<boost/circular_buffer.hpp>
using namespace std;

//cout << fixed << setprecision(10);
typedef long long ll;
#define PI 3.141592653589793
#define Yes(a) a ? "Yes" : "No";
#define YES(a) a ? "YES" : "NO";
#define rep(i,n) for(int i=0;i<n;i++)

int gcd(int a, int b) {
	if (a < b) {
		int tmp = a;
		a = b;
		b = tmp;
	}
	int r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}

int lcm(int a, int b) {
	long long int L;
	L = (a * b) / gcd(a, b);
	return L;
}

vector<long long  int> Prime;
void Eratosthenes(long long int n) {
	vector<bool> is_prime(n, true);
	for (int i = 2; i * i <= n; i++) {
		;
		if (is_prime.at(i)) {
			for (int j = i * i; j <= n; j += i) {
				is_prime.at(j) = false;
			}
		}
		Prime.emplace_back(i);
	}
}

/*
map<int, int> prime;
void Prime_number(long long int n) {
	for (int i = 2; i <= n; i++) {
		int count = 0;
		while (n % i == 0) {
			count++;
			n /= i;
		}
		if (count != 0) {
			prime.insert(make_pair(i, count));
		}
	}
}
*/
//std::cout.fill('0');

int keta(long long int N) {
	int k = 0;
	while (N > 0) {
		N /= 10;
		k++;
	}
	return k;
}



int Combination(int n, int m) {
	long long int s = 1, t = 1;
	int tmp = n;
	while (n - m != tmp) {
		s *= tmp;
		tmp--;
	}
	tmp = m;
	while (tmp != 1) {
		t *= tmp;
		tmp--;
	}
	return s / t;
}


int main() {
	long long int n;
	string s, t, ans = {};

	cin >> n;
	cin >> s >> t;
	for (int i = 0; i < n; i++) {
		ans += s[i];
		ans += t[i];
	}
	cout << ans << endl;
}


/*
int main() {
	int n; cin >> n;
	vector<int> f(n);
	vector<int> t(n,1);
	int x[15][15], y[15][15];
	int p[15][15], q[15][15];
	vector<int> a(n);
	int count = 0, ans = 0;

	for (int i = 0; i < n; i++) {
		cin >> f.at(i);
		for (int j = 0; j < f.at(i); j++) {
			cin >> p[i][j] >> q[i][j];
		}
	}
	for (int k = 0; k < n; k++) {
		for (int i = 0; i < n; i++) {
			a.at(i) = f.at(i);
			for (int j = 0; j < a.at(i); j++) {
				x[i][j] = p[i][j]; y[i][j] = q[i][j];
			}
		}

		for (int i = 0 ; i < n; i++) {
			if (t.at((i+k)%n) == 0) {
				for (int j = 0; j < a.at((i + k) % n); j++) {
					if (y[(i + k) % n][j] == 1)
						y[(i + k) % n][j] = 0;
					else
						y[(i + k) % n][j] = 1;
				}
			}
			for (int j = 0; j < a.at(i); j++) {
				a.at(x[(i + k) % n][j] - 1) *= y[(i + k) % n][j];
			}
		}
		count = 0;
		for (int i = 0; i < n; i++) {
			if (a.at(i) == 1)
				count++;
		}
		ans = max(ans, count);
	}
	cout << ans << endl;
}
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define mod2 998244353
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define sz(v) ((ll)(v).size())
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define pb push_back
	#define f first
	#define s second
	#define dbg(a) cout<<#a<<" --> "<<(a)<<"\n";
	#define forn(i,n) for (ll i=0; i<(n); ++i)
	#define fornd(i,n) for (ll i=(n)-1; i>=0; --i)
	#define forab(i,a,b) for (ll i=(a); i<=(b); ++i)
	#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
	using namespace std;
	bool isPowerOfTwo(int x) {
    return x && (!(x & (x - 1)));
	}
	int takemod(int x) {
    return (x % mod + mod) % mod;
	}
 
	int fpow(int base, int power, int MOD) {
    int result = 1;
    base = base % MOD;
    while (power) {
        if (power & 1)
            result = (result * base) % MOD;
        base = (base * base) % MOD;
        power = power >> 1;
    }
    return result;
	}
	const int mx=10;
		int n,m,po;
	vector <vector <char> >A(mx, vector <char> (mx));
vector <vector <char> >temp(mx, vector <char> (mx));
 		set<ll> col;
 		set<ll> row;  
 	ll fun()
 	{
 		temp.clear();
 		temp=A;
 		forn(i,n)
 		{
 			forn(j,m)
 			{
 				if(row.count(i) || col.count(j) )
 					temp[i][j]='.';
 			}
 		}
 		ll res=0;
 		forn(i,n)
 		{
 			forn(j,m)
 			{
 				if(temp[i][j]=='#')
 					res++;
 			}
 		}
 		return res;
 	}
	int modinv(int x) {return fpow(x, mod - 2, mod);}

	void solve()
	{
		cin>>n>>m>>po;
		
		int bk=0;
		
		
		forn(i,n)
		{
			string x;
			cin>>x;

			forn(j,m)
				{
					if(x[j]=='.')
						A[i][j]='.';
					else
					{
						A[i][j]='#';
						bk++;
					}
				}
	
		}	

		
		
		int ans=0;
		for( int i = 0 ; i < ( 1 << (n) ) ; ++ i ) {
        row.clear();
        for ( int j = 0; j < n ; ++ j ) {   
            if ( ( i & ( 1 << j ) ) != 0 )
            {
            	row.insert(j);
  
            } 
        }
        	for( int k = 0 ; k < ( 1 << (m) ) ; ++ k ) {
        col.clear();
        for ( int j = 0; j < m ; ++ j ) {   
            if ( ( k & ( 1 << j ) ) != 0 )
            {
            	col.insert(j);
  
            } 
        }
           
     	int rty=fun();
  //   	dbg(rty);
     	if(rty == po)
     	{
     		ans++;      

     	}
    }
           
    }

    cout<<ans<<endl;		

	}
	int main()
	{	
		#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
		#endif
		fast_io;
		int T=1;
	//	cin>>T;
		// cin.ignore(); must be there when using getline(cin, s)
		while(T--)
		{
			solve();
		}
		return 0;
	}


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

using ll    = long long;
using ull   = unsigned long long;
using veci  = vector<int>;
using vecll = vector<ll>;
#define EPS (1e-7)
#define INF (1e9)
#define PI  (acos(-1))
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define REP(i,n) for(int i= 0;i<(int)(n);++i)
#define pb push_back

veci enum_div(int n){
	veci ret;
	ret.pb(1);
	for(int i=1;i*i<n;i++){
		if(n%i==0){
			ret.pb(i);
			if(i != n/i){ret.pb(n/i);}
		}
	}
	ret.pb(n);
	return ret;
}
int gcb(int a,int b){return ((b == 0)? a : gcb(b,a%b));}
int gcd(int a,int b){return (a*b) / gcb(a,b);}

int main(){
    int n,lt;
    int ans = 10000;
    cin >> n >> lt;
    REP(i,n){
        int tmp1,tmp2;
        cin >> tmp1 >> tmp2;
        if(tmp2 <= lt){
            ans = min(ans,tmp1);
        }
    }
    if(ans == 10000){
        cout << "TLE" << endl;
        return 0;
    }
    cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
	int A,B;
	scanf("%d%d",&A,&B);
	int ans = A + B;
	ans = max(A + A - 1,ans);
	ans = max(B + B - 1,ans);
	printf("%d\n",ans);
	return 0;
} 

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int N, K;
    cin >> N >> K;
    
    double ans = 0;
    FOR(i,1,N+1) {
        double tmp = 1.0 / N;
        int p = i;
        while(p < K) {
            p*=2;
            tmp /= 2;
        }
        ans += tmp;
    }

    cout << fixed << setprecision(10) << ans << '\n';

    return 0;
}

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

using namespace std;
using ll =long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }

void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}
 
//Write From this Line

//const ll mod = 1e9+7;
//const ll mod = 998244353;
int main()
{
	int l, r, d;
	cin >> l >> r >> d;
	int ans = 0;
	ans = r / d - (l + d - 1) / d + 1;
	ans = max(0,ans);
	cout << ans << endl;
}


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

int main() {
    int n;
    cin >> n;
    int ans = 0, d[3] = {3,5,7};
    //以下、わからんかったらi=3,bit=0,って書き出そう
    for (int i = 3; i < 10; i++){ // 桁数
        for (int bit = 0; bit < pow(3, i); bit++){ //各桁の数を決めるのに何通りあるか
            int a = 0, p = bit;
            for (int j = 0; j < i; j++){ //下で各桁の数決める 桁はi桁
                a += d[p%3] * pow(10, j);
                p /= 3; //pはdのindex これで3,5,7になる
            }
            if(a > n) break;
            // 以下,条件に合うかチェック
            string s = to_string(a);
            bool check[4] = {0};
            for (int j = 0; j < s.size(); j++){
                if(s[j] == '3') check[0] = 1;
                else if(s[j] == '5') check[1] = 1;
                else if(s[j] == '7') check[2] = 1;
                else check[3] = 1;
            }
            if(check[0] && check[1] && check[2] && !check[3]){
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}



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

#define ll                  long long
#define ld                  long double
#define pb                  push_back
#define mp                  make_pair
#define fi                  first
#define se                  second
#define all(c)              (c).begin(),(c).end()
#define for0(i, n)          for (ll i = 0; i < n; ++i)
#define for1(i, n)          for (ll i = 1; i <= n;++i)
#define for2(i, n)          for (ll i = 1; i < n; ++i)
#define for3(i, k, n)       for (ll i = k; i < n; ++i)
#define input(a, i, n)      for (int i = 0; i < n; ++i) {cin >> a[i]; }
#define output(a, i, n)     for (int i = 0; i < n; ++i) {cout << a[i] << ' '; }
//cout.precision(12);

using namespace std;

int64_t TN = 1;

void solve()
{
    int64_t a, b, c, k = 0, t;
    cin >> a >> b >> c;
    t = c;
    while (t <= 100) {
        if (t >= a && t <= b) k++;
        t += c;
    }
    cout << k;
}

int main()
{
    //cin >> TN;
    for (int i = 0; i < TN; ++i) {
        solve();
    }
    return 0;
}


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

using namespace std;

long long check(long long a, int h, int n, int w){

    long long l = 4LL * h * n * w;
    long long r = a * (n * w + h * w + h * n);

    return r - l;
}

int main(){

    long long a;
    int l, r, m;
    cin >> a;

    for (int h = 1; h <= 3500; h++){

        for (int n = h; n <= 3500; n++){

            l = n;
            r = 3500;

            while(l < r){
                m = (l + r) / 2;
                long long b = check(a, h, n, m);
                if (check(a, h, n, m) == 0){
                    cout << h << ' ' << n << ' ' << m << endl;
                    goto end;
                }
                if(b > 0LL){
                    l = m + 1;
                }else{
                    r = m;
                }
            }

        }

    }

end:

    return 0;

}


Measured memory_bytes: 256
A,B,C,D,E,F = gets.split.map(&:to_i)

mx = -1 # 最大濃度
max_ws = 0
max_su = 0
33.times do |a|
  break if 100*A*a > F
  33.times do |b|
    break if 100*B*b > F
    s = (A*a + B*b) * E # 砂糖の最大値
    100.times do |c|
      break if C*c > s
      100.times do |d|
        su = C*c + D*d # 砂糖の量
        ws = 100*A*a + 100*B*b + su # 水+砂糖全体
        break if su > s
        break if ws > F
        if (mx < 100 * su / ws.to_f) # 濃度最大の時の質量と砂糖の量を記録
          mx = 100 * su / ws.to_f
          max_ws = ws
          max_su = su
        end
      end
    end
  end
end

puts "#{max_ws} #{max_su}"

Measured memory_bytes: 1788
# Your code here!
gets.chop
arr = gets.chop.split(" ").map(&:to_i)
evens = arr.select(&:even?)
valid_evens = evens.select{|num| num % 3 == 0 || num % 5 == 0}
puts evens.length == 0 || valid_evens.length == evens.length ? "APPROVED" : "DENIED"

Measured memory_bytes: 1788
#include<stdio.h>
#include<stdlib.h>

int main()
{
 char a;
 char b;
 char ans;
 scanf("%c %c",&a, &b);
 if((a=='H')&(b=='H')) printf("H");
 if((a=='H')&(b=='D')) printf("D");
 if((a=='D')&(b=='H')) printf("D");
 if((a=='D')&(b=='D')) printf("H");
 return 0;
}

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

int main()
{
    string s;
    int k;
    cin>>k>>s;
 if(s.length()<=k){
    cout<<s;
    }

    else{
        for(int i=0;i<k;i++){
            cout<<s[i];
        }
        cout<<"...";
    }
}


Measured memory_bytes: 3624
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        long last = a[0];
        System.out.print(last);
        for(int i = 1 ; i < n ; i++){
            if(a[i] == last);
            else{
                last = a[i];
                System.out.print(" " + last);
            }
        }
        System.out.println();
    }
}


Measured memory_bytes: 71948
#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lpin(a,i,n) for(int i=0;i<n;i++){cin>>a[i];}
int  main(){
  vector<char> x;
  x.push_back('y');
  x.push_back('h');
  x.push_back('n');
  x.push_back('m');
  x.push_back('j');
  x.push_back('u');
  x.push_back('i');
  x.push_back('k');
  x.push_back('l');
  x.push_back('o');
  x.push_back('p');
  while(1){
    char a;
    int count=0,memo=0;
    while(1){
      scanf("%c",&a);
      if(a=='#') return 0;
      if('a'<=a &&a<='z') 1;
      else {
	break;
      }
      if(find(x.begin(),x.end(),a)!=x.end()){
	if(memo==0){
	  memo=1;
	}
	else if(memo==2){
	  count++;
	  memo=1;
	}
      }
      else{
	if(memo==0) memo=2;
	else if(memo==1){
	  count++;
	  memo=2;
	}
      }
    }
    cout<<count<<endl;
  }
  return 0;
}



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

/* typedef */
/* long系 */
typedef long long ll;   // long long
typedef long double ld; // long double
/* vector系 */
typedef vector<int> vi;                    // intのvector
typedef vector<double> vd;                 // doubleのvector
typedef vector<ll> vll;                    // llのvector
typedef vector<ld> vld;                    // ldのvector
typedef vector<vector<int>> vvi;           // intの2次元vector
typedef vector<vector<double>> vvd;        // doubleの2次元vector
typedef vector<vector<ll>> vvll;           // llの2次元vector
typedef vector<vector<ld>> vvld;           // ldの2次元vector
typedef vector<pair<int, int>> vi_i;       // i_iのvector
typedef vector<pair<double, double>> vd_d; // d_dのvector
typedef vector<pair<ll, ll>> vl_l;         // l_lのvector
typedef vector<pair<ld, ld>> vld_ld;       // ld_ldのvector
typedef vector<string> vs;                 // stringのvector
/* pair系 */
typedef pair<int, int> i_i;       // int同士のpair
typedef pair<double, double> d_d; // double同士のpair
typedef pair<ll, ll> l_l;         // ll同士のpair
typedef pair<ld, ld> ld_ld;       // ld同士のpair

/* define */
#define all(v) v.begin(), v.end() // コンテナ全体
#define PI (acos(-1))             // 円周率pi

/* stringstream */
stringstream ss;
stringstream init_ss; // save default formatting

struct ToUpper
{
    char operator()(char c) { return toupper(c); }
};
struct ToLower
{
    char operator()(char c) { return tolower(c); }
};

/* main */
void Main(void)
{
    string s;
    vi a;
    a.resize(26);
    fill(all(a), 0);
    while (cin >> s)
    {
        transform(s.cbegin(), s.cend(), s.begin(), ToLower());
        for (int i = 0; i < s.size(); i++)
        {
            int j = 0;
            for (char c = 'a'; c <= 'z'; c++)
            {
                if (s[i] == c)
                    a[j]++;
                j++;
            }
        }
    }
    int i = 0;
    for (char c = 'a'; c <= 'z'; c++)
    {
        cout << c << " " << ':' << " " << a[i] << endl;
        i++;
    }
}

int main(int argc, char const *argv[])
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();

    return 0;
}



Measured memory_bytes: 3156
import java.util.Scanner;

public class Main {
	public static boolean bunarySearch(int key, int n, int[] A) {
		int left = 0;
		int right = n;
		while (left < right) {
			int mid = (left + right) / 2;
			if (A[mid] == key) {
				return true;
			} else if (A[mid] < key) {
				left = mid + 1;
			} else {
				right = mid;
			}
		}
		return false;
	}

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = 0;
		int num1 = scanner.nextInt();
		int[] suretu1 = new int[num1 + 1];
		for (int i = 0; i < num1; i++) {
			suretu1[i] = scanner.nextInt();
		}
		int num2 = scanner.nextInt();
		int[] suretu2 = new int[num2];
		for (int i = 0; i < num2; i++) {
			suretu2[i] = scanner.nextInt();
		}
		for (int i = 0; i < num2; i++) {
			int key = suretu2[i];
			if (bunarySearch(key, num1, suretu1)) {
				count++;
			}
		}
		System.out.println(count);
		scanner.close();
	}

}



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

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


int main(void){
    int n;
    cin >> n;
    vector<pair<int, int> > v;
    rep(i,n){
        pair<int, int> tmp;
        cin >> tmp.first;
        tmp.second = i;
        v.push_back(tmp);
    }
    sort(v.begin(),v.end());
    int med1 = v.at((n-2)/2).first;
    int med2 = v.at((n-2)/2+1).first;
    vector<pair<int, int> > rank;
    rep(i,n){
        pair<int, int> tmp;
        tmp.first = v.at(i).second;
        tmp.second = i;
        rank.push_back(tmp);
    }
    sort(rank.begin(),rank.end());
    rep(i,n){
        if(rank.at(i).second>(n-2)/2){
            cout << med1 << endl;
        }else{
            cout << med2 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 6384
import java.util.*;

class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int a, b, c;
	String[] line = sc.nextLine().split(" ");
	a = Integer.parseInt(line[0]);
	b = Integer.parseInt(line[1]);
	c = Integer.parseInt(line[2]);

	if (a < b && b < c) {
	    System.out.println("Yes");
	} else {
	    System.out.println("No");
	}
    }
}

Measured memory_bytes: 17124
#include<stdio.h>
int main() {
	int a[10], i, j, c;
	while (c=getchar(), c!=EOF) {
		for (i = 0; i < 10; i ++) {
			a[i] = c-'0';
			c = getchar();
		}
		for (i = 9; i >= 1; i --)
			for (j = 0; j < i; j ++)
				a[j] += a[j+1];
		printf("%d\n", a[0]%10);
	}
	return 0;
}

Measured memory_bytes: 0
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("trapv")
#pragma GCC target("sse4")

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

#define deb(x) cout << #x << " is " << x << "\n"
#define int long long
#define mod 1000000007
#define PI acos(-1)

void solve() {
	int x, n, ele;
	cin >> x >> n;
	unordered_map<int, int> mp;
	while(n--) {
		cin >> ele;
		mp[ele]++;
	}
	for(int d = 0; d <= x; d++) {
		for(auto s : {-1, +1}) {
			int a = x + (s * d);
			if(mp[a] == 0) {
				cout << a;
				return;
			}
		}
	}
}

int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int tc = 1;
	// cin >> tc;
	while(tc--) {
	    solve();
	}
	return 0;
}
*/
#include<bits/stdc++.h>
using namespace std;
void part(){
  int x,n,p;
  cin>>x>>n;
  unordered_map<int,int> unmp;
  while(n--){
    cin>>p;
    ++unmp[p];
  }
  for(int i=0;i<=x;i++){
    for(auto j:{-1,1}){
      int a=x+i*j;
      if(unmp[a]==0){
        cout<<a;
        return;
      }
    }
  }
}
int main(void){
  int num=1;
  while(num--){
    part();
  }
  return 0;
}

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

void solve() {
  int a,b;
  cin >> a >> b;
  if(a == 1) a = 14;
  if(b == 1) b = 14;
  if(a == b){
    cout << "Draw" << endl;
  }else{
    cout << (a > b ? "Alice" : "Bob") << endl;
  }
}

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

  solve();

  return 0;
}


Measured memory_bytes: 256
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5+5;

const int mod = 1e9+7;

int n;
int k;
long long ans = 1;
vector < int > adj[N];

void dfs(int u , int p){
    int st;
    if(p == 0){
        st = k - 1;
    } else {
        st = k - 2;
    }
    if(p != 0 && adj[u].size() - 1 > k)
        ans = 0;
    //cout << u << endl;
    //system("PAUSE");
    for(auto v : adj[u]){
        if(v == p)
            continue;
        ans *= st;
        st--;
        ans %= mod;
        dfs(v , u);
    }
}


int main(){
    scanf("%d%d" , &n , &k);
    for(int i = 1; i < n; i++){
        int u , v;
        scanf("%d%d" , &u , &v);
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    ans = k;
    dfs(1 , 0);
    printf("%d\n" , (int)ans);
}

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

ll n, ans;
void dfs(ll a, ll b, ll c, ll x){
  if(x > n) return;
  if(a && b && c) ans++;

  dfs(1, b, c, 10 * x + 3);
  dfs(a, 1, c, 10 * x + 5);
  dfs(a, b, 1, 10 * x + 7);
}

int main(){
  cin >> n;

  dfs(0, 0, 0, 0);
  
  cout << ans << endl;

  return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define mem(x) memset(x,0,sizeof(x)) 
#define sca(x) scanf("%d",&x)
#define scaa(x,y) scanf("%d%d",&x,&y)
#define inf 0x7f7f7f7f
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#pragma GCC optimize(2)
using namespace std;
const double pi=acos(-1); 
const double eps=1e-6;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;
const int mod=998244353;
#define maxn 300005
pii p[200005];
ll c[200005];
int main()
{
	ll n,d,a;
	cin>>n>>d>>a;
	for(int i=0;i<n;i++)
	{
		cin>>p[i].first>>p[i].second;
	}
	sort(p,p+n);
	int j=0;
	ll ans=0;
	for(int i=0;i<n;i++)
	{
		while(j<n&&p[j].first<=p[i].first+2*d)
		j++;
		ll cc=max((ll)0,(p[i].second-c[i]*a+a-1)/a);
		ans+=cc;
		c[i]+=cc;
		c[j]-=cc;
		c[i+1]+=c[i];
	}
	cout<<ans<<endl;
} 

Measured memory_bytes: 3328
import java.io.PrintWriter
val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val heights = listOfInt()
    if (heights[1] - heights[0] == heights[2] - heights[1]) {
        println("YES")
    } else {
        println("NO")
    }
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { it.toInt() }

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 36008
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<queue>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int> >;
using pii = pair<int, int>;
using ppi = pair<pii, int>;

int f_dir[2][4] = {{-1, 0, 1, 0}, {0, 1, 0, -1}}; //↑→↓←
int e_dir[2][8] = {{-1, -1, -1, 0, 0, 1, 1, 1}, {-1, 0, 1, -1, 1, -1, 0, 1}};
bool is_in_field(int y, int x, int h, int w){
  return (y >= 0 && y < h && x >= 0 && x < w);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  int n, m;
  cin >> n >> m;
  int cnt = 0;
  int s = 0;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
    s+=a[i];
  }
  for(int i = 0 ; i < n; i++){
    if(4 * a[i] * m >= s) cnt++;
  }
  if(cnt >= m) cout << "Yes" << endl;
  else cout << "No" << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[200010],dp[550][550];

int main(){
  cin >> n >> m;
  n %= 500;
  if(n <= m)puts("Yes");
  else puts("No");
  return 0;
}

Measured memory_bytes: 256
n = int(input())
k = int(input())

digit = len(str(n))
# dp[i桁まで検査済み][lessthan][0以外の個数]
dp = [[[0] * (k + 2) for i in range(2)] for j in range(digit + 1)]
dp[0][0][0] = 1

for a in range(1, digit + 1):
    digitvalue = int(str(n)[a - 1])
    for b in range(2):
        for c in range(k + 1):
            for d in range(10 if b == 1 else digitvalue + 1):
                dp[a][1 if b == 1 else 1 if (d < digitvalue) else 0][c if d == 0 else c + 1] += dp[a - 1][b][c]

print(dp[digit][0][k] + dp[digit][1][k])



Measured memory_bytes: 3064
#include<stdio.h>
int main(){
  int n,k,w[100000],l,m,r,i,j,flag,count=0;
  scanf("%d%d",&n,&k);
  for(i=0;i<n;i++){
    scanf("%d",&w[i]);
  }
  l=0;
  r=100000*10000;
  while(l+1<r){
    m=(l+r)/2;
    j=0;
    for(i=0;i<k;i++){    
      count=0;
      flag=0;
      for(;j<n;j++){
	count+=w[j];
	if(count>m && i==k-1){flag=1;break;}
	if(count>m){break;}
      }
      if(flag==1 || j==n)break;
    }
    if(flag==1)l=m;
    else r=m;
  }
  printf("%d\n",r);
  return 0;
}
    
      
    



Measured memory_bytes: 2156
// abc114_a
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
  int x;
  cin >> x;
  if(x==3 || x==5 || x==7){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


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

int main() {
	int a[3];
	int tmp;
	for (int i = 0; i < 3; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < 2; i++) {
		for (int j = i + 1; j < 3; j++) {
			if (a[j] > a[i]) {
				tmp = a[j];
				a[j] = a[i];
				a[i] = tmp;
			}
		}
	}
	
	a[0] = 10 * a[0];
	cout << a[0] + a[1] + a[2] << endl;
	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			(3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
template<class T> void chmax(T &a, const T &b){if(a<b)a=b;}
template<class T> void chmin(T &a, const T &b){if(a>b)a=b;}
void YN(bool b){cout<<(b?"YES":"NO")<<endl;}
void Yn(bool b){cout<<(b?"Yes":"No")<<endl;}
void yn(bool b){cout<<(b?"yes":"no")<<endl;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x,cnt=1;
	while(cin>>x,x){
		cout<<"Case "<<cnt<<": "<<x<<"\n";
		cnt++;
	}
}




Measured memory_bytes: 3180
n,m=map(int,input().split())
route=[[] for _ in range(n+1)]
for _ in range(m):
    a,b=map(int,input().split())
    route[a].append(b)
    route[b].append(a)
from collections import deque
q=deque()
q.append(1)
sigh=[0]*(n+1)
depth=[0]*(n+1)
depth[1]=0
while q:
    a=q.popleft()
    for i in route[a]:
        if depth[i]==0 or depth[i]>depth[a]+1:
            if i!=1:
                depth[i]=depth[a]+1
                q.append(i)
                sigh[i]=a
print('Yes')
for i in range(2,n+1):
    print(sigh[i])
    

Measured memory_bytes: 35008
/*
  mail: mleautomaton@foxmail.com
  author: MLEAutoMaton
  This Code is made by MLEAutoMaton
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define ll long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
inline int gi(){
	int f=1,sum=0;char ch=getchar();
	while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
	return f*sum;
}
const int N=2010,Mod=1e9+7;
int f[N][N];
int qpow(int a,int b){int ret=1;while(b){if(b&1)ret=1ll*ret*a%Mod;b>>=1;a=1ll*a*a%Mod;}return ret;}
int n,k;
int main(){
	n=gi();k=gi();
	f[0][n+1]=1;
	for(int i=1;i<k;i++){
		int sum=f[i-1][n-i+2];
		for(int j=n-i+1;j>=2;j--){
			sum=(sum+f[i-1][j])%Mod;
			f[i][j]=sum;
		}
	}
	int sum=0;
	for(int i=2;i<=n-k+2;i++)sum=(sum+f[k-1][i])%Mod;
	if(k==1)sum=1;
	printf("%lld\n",1ll*qpow(2,max(0,n-k-1))*sum%Mod);
	return 0;
}


Measured memory_bytes: 15360
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vl;
typedef vector<vector<int, int> > vvi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int a, b, c;
    cin >> a >> b >>c;
    vi v;
    v.pb(a);
    v.pb(b);
    v.pb(c);
    sort(all(v));
    if((v[0] + v[1]) == v[2]){
        cout << "Yes";
    }
    else cout << "No";
}

Measured memory_bytes: 256
n = int(input())
total = []
for i in range(1, n + 1):
    if i % 3 == 0 and i % 5 == 0:
        "FizzBuzz"
    elif i % 3 == 0:
        "Fizz"
    elif i % 5 == 0:
        "Buzz"
    else:
        total.append(i)
print(sum(total))

Measured memory_bytes: 30044
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	# 隣接行列読み込み　リンク情報は後々使うため別に保持
	n,m = readline() |> split |> parseMap
	g = zeros(Int,n,n)
	e = Array{Int}(2,m)
	for i in 1:m
		e[:,i] = readline() |> split |> parseMap
		g[e[1,i],e[2,i]] = 1
		g[e[2,i],e[1,i]] = 1
	end

	# ラプラシアン作成
	l = zeros(Int,n,n)-g
	d = g*ones(Int,n)
	for i in 1:n
		l[i,i] = d[i]
	end

	count = 0
	for i in 1:m
		l[e[1,i],e[2,i]] += 1
		l[e[2,i],e[1,i]] += 1
		l[e[1,i],e[1,i]] -= 1
		l[e[2,i],e[2,i]] -= 1
		if rank(l) < n-1
			count += 1
		end
		l[e[1,i],e[2,i]] -= 1
		l[e[2,i],e[1,i]] -= 1
		l[e[1,i],e[1,i]] += 1
		l[e[2,i],e[2,i]] += 1
	end
	println(count)
end

main()

Measured memory_bytes: 125380
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    H, W = MI()
    S =[":"*(W+2)]  + [":"+ST()+":" for _ in range(H)] + [":"*(W+2)]

    checked = set()
    d = [(0, 1), (1, 0), (-1, 0), (0, -1)]
    ans = 0
    for h in range(1, H + 1):
        for w in range(1, W + 1):
            if (h, w) in checked:
                continue
            queue = [(h,w)]
            black = 0
            white = 0
            while queue:
                from_h, from_w = queue.pop()
                if (from_h,from_w) in checked:
                    continue
                checked.add((from_h,from_w))
                if S[from_h][from_w] == "#":
                    black += 1
                else:
                    white += 1
                for dh, dw in d:
                    if S[from_h + dh][from_w + dw] != ":" and (from_h + dh, from_w + dw) not in checked and S[from_h + dh][from_w + dw] != S[from_h][from_w]:
                        queue.append((from_h + dh, from_w + dw))
            ans += black * white
    print(ans)
if __name__ == '__main__':
    main()

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

template<typename G>
void print(vector<G> v) {
    rep(i, v.size()) {
        if (i != 0) cout << " ";
        cout << v[i];
    }
    cout << endl;
}

template<typename T>
void print(vector<vector<T>> v) {
    rep(i, v.size()) {
        print(v[i]);
    }
}


void solve() {
    int h, w, k;
    cin >> h >> w >> k;
    vector<vector<char>> g(h, vector<char>(w));
    vector<vector<int>> field(h, vector<int>(w, -1));

    // いちごに番号付け
    int cnt = 1;
    rep(i, h) {
        rep(j, w) {
            cin >> g[i][j];
            if (g[i][j] == '#') field[i][j] = cnt++;
        }
    }

    // 番号を横方向に伸ばす
    rep(i, h) {
        rep(j, w-1) {
            if (field[i][j+1] < 0) field[i][j+1] = field[i][j];
        }
        for (int j = w-1; j > 0; j--) {
            if (field[i][j-1] < 0) field[i][j-1] = field[i][j];
        }
    }

    // 番号を縦方向に伸ばす
    // まだ番号付けされていない部分の行はひとつもイチゴがない行なので
    // 縦方向に伸ばしても番号付けされた図形が折れ曲がることはない
    rep(j, w) {
        rep(i, h-1)
            if (field[i+1][j] < 0) field[i+1][j] = field[i][j];
        for (int i = h-1; i > 0; i--) {
            if (field[i-1][j] < 0) field[i-1][j] = field[i][j];
        }
    }

    print(field);
}

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


Measured memory_bytes: 4440
/*
 _____ _             _              _           _ 
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|                                                

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_is(x)  cerr << #x << " is " << x << endl;

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005

ll fun(ll n)
{
	return (n*(n-1))/2;
}

void solve()
{
	ll n,m;
	cin>>n>>m;
	cout<<fun(n)+fun(m)<<endl;
	return;
}
int main()
{
	FAST
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		solve();
	}
	TIME
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){

	int n, i, num, cards[52];
	char mark;
	scanf("%d\n", &n);

	for ( i = 0 ; i < 52 ; i++ ) {
		cards[i] = 0;
	}
	for ( i = 0 ; i < n ; i++ ) {
		scanf("%c %d", &mark, &num);
		if ( i != n-1 ) scanf("\n");
		if ( mark == 'S' ) {
			cards[num-1] = 1;
		} else if ( mark == 'H' ) {
			cards[num+12] = 1;
		} else if ( mark == 'C' ) {
			cards[num+25] = 1;
		} else if ( mark == 'D' ) {
			cards[num+38] = 1;
		} else {
			printf("error\n");
			break;
		}
	}

	// printf("\n");

	for ( i = 0 ; i < 52 ; i++ ) {
		if ( cards[i] == 0 ) {
			if ( i/13 == 0 ) {
				printf( "S %d\n", i%13+1 );
			} else if ( i/13 == 1 ) {
				printf( "H %d\n", i%13+1 );
			} else if ( i/13 == 2 ) {
				printf( "C %d\n", i%13+1 );
			} else if ( i/13 == 3 ) {
				printf( "D %d\n", i%13+1 );
			}
		}
	}

    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
using namespace std;

int i,j,k;

int main(){
    string ans="No";
    int n;
    cin>>n;
    if(n%10==7){
        ans="Yes";
    }
    else if((n/10)%10==7){
        ans="Yes";
    }
    else if(n/100==7){
        ans="Yes";
    }
    
    cout<<ans<<endl;
}

Measured memory_bytes: 3604
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
#define INF (1e10)


int n,m,p,a,b;
int tic[8];
int di[30][30];
int main(){
	double dp[1<<8][30];
	while(cin>>n>>m>>p>>a>>b,n|m|p|a|b){
		a--;b--;
		for(int i=0;i<n;i++)cin>>tic[i];
		memset(di,-1,sizeof(di));
		for(int i=0;i<p;i++){
			int x,y,z;
			cin>>x>>y>>z;
			x--;y--;
			if(di[x][y]==-1 || z<di[x][y])
				di[x][y]=di[y][x]=z;
		}
		double ans=INF;
		for(int i=0;i<(1<<n);i++)
			for(int j=0;j<m;j++)dp[i][j]=INF;
		dp[(1<<n)-1][a]=0.0;
		for(int i=(1<<n)-1;i>=0;i--){
			for(int j=0;j<n;j++){
				if((i&1<<j)==0)continue;
				for(int k=0;k<m;k++){
					for(int l=0;l<m;l++){
						if(di[k][l]==-1)continue;
						dp[i&~(1<<j)][l] = min(dp[i&~(1<<j)][l],dp[i][k]+(double)di[k][l]/tic[j]);
						if(l==b)ans = min(ans, dp[i&~(1<<j)][l]);
					}
				}
			}
		}
		if(ans==INF)puts("Impossible");
		else printf("%.3f\n",ans);
	}
	return 0;
}

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

int main(){
	int m,f,r,count=0;
	char x[100]={0};
	while(1){
		cin >> m >> f >> r;
		if(m==-1&&f==-1&&r==-1){
			break;
		}
		if(m==-1||f==-1){
			x[count]='F';
		}else if((m+f)>=80){
			x[count]='A';
		}else if((m+f)>=65&&(m+f)<80){
			x[count]='B';
		}else if((m+f)>=50&&(m+f)<65){
			x[count]='C';
		}else if((m+f)>=30&&(m+f)<50){
			if(r>=50){
				x[count]='C';
			}else{
				x[count]='D';
			}
		}else if((m+f)<30){
			x[count]='F';
		}
		count++;
	}
	for(int i=0;i<count;i++){
		cout << x[i] << endl;
	}
	return 0;
}
	

Measured memory_bytes: 3108
#include<stdio.h>

int main(){
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);

  if(a == b && b == c){
    printf("1");
  }
  else if(a == b || b == c || c == a){
    printf("2");
  }
  else{
    printf("3");
  }

  return 0;
}


Measured memory_bytes: 128
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DMakeThemEven solver = new DMakeThemEven();
        solver.solve(1, in, out);
        out.close();
    }

    static class DMakeThemEven {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int h = in.nextInt();
            int w = in.nextInt();
            boolean[] a = new boolean[w];
            List<DMakeThemEven.Op> ops = new ArrayList<>();
            for (int y = 0; y < h - 1; y++) {
                for (int x = 0; x < w; x++) {
                    a[x] ^= in.nextInt() % 2 == 1;
                    if (a[x]) {
                        ops.add(new DMakeThemEven.Op(x + 1, y + 1, x + 1, y + 2));
                    }
                }
            }
            boolean b = false;
            for (int x = 0; x < w - 1; x++) {
                b ^= a[x];
                b ^= in.nextInt() % 2 == 1;
                if (b) {
                    ops.add(new DMakeThemEven.Op(x + 1, h, x + 2, h));
                }
            }
            out.println(ops.size());
            for (DMakeThemEven.Op op : ops) {
                out.print(op.b);
                out.print(' ');
                out.print(op.a);
                out.print(' ');
                out.print(op.d);
                out.print(' ');
                out.println(op.c);
            }
        }

        public static class Op {
            int a;
            int b;
            int c;
            int d;

            public Op(int a, int b, int c, int d) {
                this.a = a;
                this.b = b;
                this.c = c;
                this.d = d;
            }

        }

    }
}



Measured memory_bytes: 100184
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        

print("Yes")






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

int main() {
	int h, w, row[100] = { 0 }, col[100] = { 0 };
	char a[100][100] = { 0 };
	cin >> h >> w;
	rep(i, h) {
		rep(j, w) {
			cin >> a[i][j];
		}
	}
	rep(i, h) {
		int j;
		for (j = 0; j < w; j++) {
			if (a[i][j] != '.') break;
		}
		if (j == w) row[i]++;
	}
	rep(i, w) {
		int j;
		for (j = 0; j < h; j++) {
			if (a[j][i] != '.') break;
		}
		if (j == h) col[i]++;
	}
	rep(i, h) {
		rep(j, w) {
			if (row[i] == 0 && col[j] == 0) cout << a[i][j];
		}
		if (row[i] == 0) {
			cout << endl;
		}
	}
	return 0;
}

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

// definitions
#define __Imperial_Lord__ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define _cps CLOCKS_PER_SEC
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i, l, r) for (long long i = (l); i < (long long)(r); i++)
#define repb(i, r, l) for (long long i = (r); i > (long long)(l); i--)
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define high(x) __builtin_popcountll(x)
#define pb push_back
#define pf push_front
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c <<endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d <<endl
#define exec cerr<<"Time taken : "<<(ld)(clock())/_cps<<"s"<<endl
#define mod1 998244353
#define mod 1000000007
#define pi 3.1415926535897932384

using namespace std;

// alias name for common data types
typedef vector<long long> vl;
typedef vector<long double> vld;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector< pair<long long, long long> > vp;
typedef vector<tuple<long long , long long , long long> > vtup;
typedef deque <long long> dql;
typedef deque <char> dqc;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

const ll INF=1e18;

template <class ...Args>
istream &read_args(Args &...args) {return (cin >> ... >> args);}
#define read(...)   __VA_ARGS__; read_args(__VA_ARGS__)

// cin and cout overloaded for vectors
template<typename T>    istream& operator>>(istream& is,  vector<T>& v)
{
    for (auto& i : v) 
        is >> i;        
    return is;
}
template<typename T>             
ostream& operator<<(ostream& os,  vector<T>& v)
{
    for (auto& i : v) 
        os << i << ' '; 
        return os;
}

ll none(ll i,ll j,ll n,ll m)
{
	if((i==0&&(j==0||j==m-1)) || (i==n-1&&(j==0||j==m-1))) return 2;
	else if(i==0 || j==0 || i==n-1 || j==m-1) return 3;
	else return 4;
}

// code beigns in main
int main()
{
	__Imperial_Lord__
    ll t=1;
    // cin >> t;
    
    while(t--)
    {
    	ll read(n);
    	ll ac=0,wa=0,tle=0,re=0;
    	rep(i,0,n)
    	{
    		string read(s);
    		if(s=="AC") ac++;
    		else if(s=="WA") wa++;
    		else if(s=="TLE") tle++;
    		else re++;
    	}

    	p2("AC x ",ac);
    	p2("WA x ",wa);
    	p2("TLE x ",tle);
    	p2("RE x ",re);
    }	
    exec;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
#define  rep(i,a,b)for(int i=a;i<b;++i)
#define  rrep(i,a,b)for(int i=a;i>b;--i)
#define  yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
typedef long long ll;
const ll INF=100000000000000000LL;
const ll r197=1000000007;
typedef pair<int,int>P;
int main() {
	int n,a;
	cin>>n>>a;
	if(n%500<=a)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <cmath>
#include <iomanip>

#define vec vector

using namespace std;

using ll = long long;
using vl = vector<long long>;
using vi = vector<int>;
using vvl = vector<vl>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
using ld = long double;

int main()
{
    int n, k;
    cin >> n >> k;
    vi a(n);
    for (auto &e : a)
        cin >> e;
    vector<bool> dp(k + 1, false);
    for (int i = 1; i <= k; i++)
    {
        for (int j = 0; j < n and a[j] <= i; j++)
        {
            if (i - a[j] >= 0 and !dp[i - a[j]])
            {
                dp[i] = true;
                break;
            }
        }
    }
    cout << (dp[k] ? "First" : "Second");
    return 0;
}

Measured memory_bytes: 256
from sys import stdin
def main():
  readline = stdin.readline
  n, q = map(int, readline().split())
  s = input()
  c = [0] * (n + 1)
  for i in range(2, n + 1):
    if s[i - 1] == 'C' and s[i - 2] == 'A':
      c[i] = c[i - 1] + 1
    else:
      c[i] = c[i - 1]
  for _ in range(q):
    l, r = map(int, readline().split())
    t = c[r] - c[l - 1]
    if l >= 2 and s[l - 2: l] == 'AC':
      t -= 1
    print(t)
main()

Measured memory_bytes: 6332