akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#define REL

#pragma GCC target ("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <string>
#include <set>
#include <bitset>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <complex>
#include <stack> 
#include <random>

using namespace std;

typedef int64_t i64;
typedef long long LL;
typedef long long ll;
typedef long double LD;
typedef complex <LD> cld;
typedef unsigned int uint;
typedef complex <double> cd;
typedef unsigned long long ULL;

//#define endl "\n"
#define dendl "\n\n"
#define mp make_pair
#define mt make_tuple
#define size(v) (int)v.size()
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

/////////////////////////////////////////////////////////////////////

template <typename T>
T sqr(T a) {
	return a * a;
}

template <typename T>
int sign(T a) {
	if (a == 0)
		return 0;
	return (a > 0 ? 1 : -1);
}

template <typename T>
bool uax(T& a, const T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

template <typename T>
bool uin(T& a, const T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

template <typename T1, typename T2>
istream& operator >> (istream& in, pair<T1, T2>& p) {
	in >> p.first >> p.second;
	return in;
}

template <typename T1, typename T2>
ostream& operator << (ostream& out, pair<T1, T2>& p) {
	out << p.first << ' ' << p.second;
	return out;
}

mt19937_64 rnd(0);

const int LOG = 64;
const int N = (int)2e5 + 7;
const int MAXN = (int)4e5 + 7;
const int MOD = (int)998244353;
const int INF = (int)2e9 + 7;
const int CONST = 450;
const LL LINF = (i64)1e18;
const LD PI = 3.1415926535897932384626433832795;
const LD EPS = 1;

/////////////////////////////////////////////////////////////////////

void solve() {
	LL n; cin >> n;
	int ans = 0;
	for (int i = 2; 1LL * i * i <= n; i++) {
		if (n % i)
			continue;
		int cnt = 0;
		while (n % i == 0)
			cnt++, n /= i;
		int val = 0, nxt = 1;
		while (val + nxt <= cnt)
			val += nxt, nxt++;
		ans += nxt - 1;
	}
	ans += n > 1;
	cout << ans;
}

int main() {
	double start = clock();
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	cout << fixed << setprecision(20);
	cerr << fixed << setprecision(20);
#else
	cout << fixed << setprecision(20);
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	rnd.seed(time(0));
#endif

	int t = 1;
	for (int i = 0; i < t; i++) {
		solve();
	}

#ifdef _DEBUG
	cout << endl << "Time is " << (clock() - start) / 1000.0;
#endif
}

Measured memory_bytes: 3652
#include <cstdio>
#include <cstring>

const int maxn = 100005;

int a[maxn], n, k;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x % y);
}

int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  int d = a[0];
  for (int i = 1; i < n; ++i) {
    d = gcd(d, a[i]);
  }
  bool res = false;
  for (int i = 0; i < n; ++i) {
    if (k > a[i]) continue;
    if (k == a[i]) res = true;
    if ((a[i] - k) % d == 0) res = true;
  }
  puts(res ? "POSSIBLE" : "IMPOSSIBLE");
  return 0;
}



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

namespace AtCoder
{
    static class Program
    {
        static void Main()
        {
            //ここから

            var vs = IO.ReadLineToLongList();
            var A = vs[0];
            var B = vs[1];
            var C = vs[2];
            var X = vs[3];
            var Y = vs[4];

            long ans = 0;
            if (A + B > 2 * C)
            {
                var num = Math.Min(X, Y);
                ans += num * 2 * C;
                X -= num;
                Y -= num;
            }
            ans += X * Math.Min(A, 2 * C);
            ans += Y * Math.Min(B, 2 * C);

            //ここまで

            Console.WriteLine(ans);
            Console.ReadKey();
        }

    }

    static class Func
    {
        static public long mod = 1000000007;
        static public void Swap<T>(ref T a, ref T b) { T temp = a; a = b; b = temp; }
        static public long GCD(long a, long b) { return b != 0 ? GCD(b, a % b) : a; }
        static public long LCM(long a, long b) { return (long)a * b / GCD(a, b); }
        static public long Factorial(long a) { return a == 1 ? a : a * Factorial(a - 1); }


        public static double ToAngle(this double radian)
        {
            return (double)(radian * 180 / Math.PI);
        }

        public static double ToRadian(this double angle)
        {
            return (double)(angle * Math.PI / 180);
        }

        static public long Conbination(long n,long m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * Conbination(n - 1, m - 1) / m;
        }

        static public void Factoring(long num, ref long[] vs)
        {
            if (num == 1)
            {
                vs[1]++;
            }
            for (long i = 2; i < Math.Sqrt(num); i++)
            {
                if (num % i == 0)
                {
                    vs[i]++;
                    Factoring(num / i, ref vs);
                }
            }
            vs[1]++;
        }
    }

    static class IO
    {
        static public string ReadLineToString() { return Console.ReadLine(); }
        static public long ReadLineToLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> ReadLineToStringList() { return Console.ReadLine().Split(' ').ToList(); }
        static public List<long> ReadLineToLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }

        static public List<double> ReadLineToDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }

        static public void WriteStrings(object[] strings) { foreach (var o in strings) { Console.Write(o + " "); } }
    }
}

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

int main() {
  string s; cin >> s;
  bool ok1 = false, ok2 = false;
  for (int i=0; i<s.size(); ++i) {
    if (!ok1 && s[i] == 'C') {
      ok1 = true;
    }
    if (!ok2 && ok1 && s[i] == 'F') {
      ok2 = true;
    }
  }
  cout << (ok2 ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod  = 1e9 + 7;
const ll N = 1e6 + 5;

ll n,cnt;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n;
    for(int i=1;i<n;i++){
        cnt+=(n-1)/i;
    }
    cout<<cnt<<'\n';
    return 0;
}

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

int top,A[1000];

void push(int x){
  top=top+1;
  A[top]=x;
}

int pop(){
  top--;
  return A[top+1];
}

int main(){
  int a,b;
  int top=0;
  char s[100];

  while(scanf("%s",s)!=EOF){
    if(s[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(s[0]=='-'){
      b=pop();
      a=pop();
      push(a-b);
    }
    else if(s[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else{
      push(atoi(s));
    }
  }
  printf("%d\n",pop());

  return 0;
}



Measured memory_bytes: 2104
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

int main(void){
    int a, b, c;
    cin >> a >> b >> c;

    if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0){
        cout << 0 << endl;
        return 0;
    }

    ll ans = 0;
    while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0){
        int tmpa = a;
        int tmpb = b;
        a = b / 2 + c / 2;
        b = tmpa / 2 + c / 2;
        c = tmpb / 2 + tmpa / 2;
        ans++;
        if(ans >= 1e5){
            cout << -1 << endl;
            return 0;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() { 
    vector<vector<int>> v(3, vector<int>(3, 0));
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> v[i][j];
        }
    }
    int last1 = 0x3f3f3f3f, last2 = 0x3f3f3f3f;
    for (int i = 0; i < 3; i++) {
        if (last1 != 0x3f3f3f3f && v[i][0] - v[i][1] != last1) {
            cout << "No" << endl;
            return 0;
        } else {
            last1 = v[i][0] - v[i][1];
        }
        if (last2 != 0x3f3f3f3f && v[i][2] - v[i][1] != last2) {
            cout << "No" << endl;
            return 0;
        } else {
            last2 = v[i][2] - v[i][1];
        }
    }
    last1 = 0x3f3f3f3f, last2 = 0x3f3f3f3f;
    for (int i = 0; i < 3; i++) {
        if (last1 != 0x3f3f3f3f && v[0][i] - v[1][i] != last1) {
            cout << "No" << endl;
            return 0;
        } else {
            last1 = v[0][i] - v[1][i];
        }
        if (last2 != 0x3f3f3f3f && v[2][i] - v[1][i] != last2) {
            cout << "No" << endl;
            return 0;
        } else {
            last2 = v[2][i] - v[1][i];
        }
    }
    cout << "Yes" << endl;
}




Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<unordered_map>
#include<set>
#include<cstring>
#include<iomanip> //cout << fixed << setprecision(15) << x << endl;

using namespace std;
typedef long long ll;
const ll INF = 1e9 + 6;
const ll MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
//#define P pair<int, int>
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
/* -- template -- */

int main() {
    int N; cin >> N;
    int a[N]; rep(i, N) cin >> a[i];
    int ans = 0;
    rep(i, N - 1) {
        if(a[i] == a[i + 1]) {
            a[i + 1] = 10001;
            ++ans;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#define limit 100010

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

int main(void){
  int N,C;
  scanf("%d%d",&N,&C);

  int s[N],t[N],c[N];
  for (int i = 0; i < N; i++) {
    scanf("%d%d%d",&s[i],&t[i],&c[i]);
    c[i]--;
  }

  int time[limit];
  int sum[limit];
  for (int i = 0; i < limit; i++) {
    sum[i] = 0;
  }

  for (int i = 0; i < C; i++) {
    for (int i = 0; i < limit; i++) {
      time[i] = 0;
    }
    for (int j = 0; j < N; j++) {
      if(i == c[j]){
        time[s[j]]++;
        time[t[j]+1]--;
      }
    }
    for (int j = 0; j < limit; j++) {
      time[j+1] += time[j];
    }
    for (int j = 0; j < limit; j++) {
      if(time[j] > 0) sum[j]++;
    }
  }

  int ans = 0;
  for (int i = 0; i < limit; i++) {
    ans = max(ans,sum[i]);
  }

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

  return 0;
}

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

#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028L;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

struct union_find_tree {
    int n;
    std::vector<int> par, size;
    union_find_tree(int n) : n(n), par(n), size(n) {
        for (int i = 0; i < n; i++) {
            par[i] = i;
            size[i] = 1;
        }
    }
    int get_root(int i) {
        if (par[i] == i) { return i; }
        else { return par[i] = get_root(par[i]); }
    }
    void unite(int i, int j) {
        if ((i = get_root(i)) == (j = get_root(j))) { return; }
        if (size[i] < size[j]) { std::swap(i, j); }
        par[j] = i;
        size[i] += size[j];
    }
    bool are_same(int i, int j) { return get_root(i) == get_root(j); }
    int get_size(int i) { return size[get_root(i)]; }
};

int N, M;
int X[110000], Y[110000], Z[110000];
signed main() {
    cin >> N >> M;
    union_find_tree uf(N);
    int cc = N;
    rep(i, M) {
        cin >> X[i] >> Y[i] >> Z[i];
        if (!uf.are_same(X[i], Y[i])) { cc--, uf.unite(X[i], Y[i]); }
    }
    cout << cc << endl;
}

Measured memory_bytes: 4224
#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 <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main()
{
        int N, A, B, ans = 0;
        cin >> N >> A >> B;
        rep(i, N + 1)
        {
                int t = i, cnt = 0;
                while (t > 0)
                {
                        cnt += t % 10;
                        t /= 10;
                }
                if (A <= cnt && cnt <= B)
                        ans += i;
        }
        cout << ans << endl;

        return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int main(void){
    int d;cin>>d;
    switch(d){
        case 22:
            cout<<"Christmas Eve Eve Eve"<<endl;
            break;
        case 23:
            cout<<"Christmas Eve Eve"<<endl;
            break;
        case 24:
            cout<<"Christmas Eve"<<endl;
            break;
        default:
            cout<<"Christmas"<<endl;
            break;
    }
}


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
  int a,count=0,i,j,k=0,n[100],swap=0;
  scanf("%d",&a);
  for(i=0;i<a;i++)
    {
      scanf("%d",&n[i]);
    }

  for(j=0;j<=a-1;j++){
    for(k=a-1;k>=j+1;k--){
      if(n[k]<n[k-1]){
	swap=n[k];
	n[k]=n[k-1];
	n[k-1]=swap;
	count++;
      }
    }
  }
  for(i=0;i<a-1;i++)
    {
      printf("%d ",n[i]);
    }
  printf("%d",n[a-1]);
  printf("\n%d\n",count);
  return 0;
}

Measured memory_bytes: 600
s=int(input())
def sosuu(n):
    arr=[]
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
c=0
for j in range(1,s+1,2):
  a=sosuu(j)
  b=1
  for i in range(len(a)):
    b *= (a[i][1]+1)
  if b==8:
    c+=1
print(c)

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)
 
using ll = long long;
using ld = long double;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
	string s;
	cin >> s;
	reverse(s.begin(), s.end());
	int n = s.size();
	vector<vector<ll> > dp(n + 1, vector<ll>(13));
	dp[0][0] = 1;
	ll t = 1;
	rep (i, n) {
	  if (s[i] == '?') {
		rep (j, 10) {
		  rep (k, 13) {
			dp[i + 1][((j * t % 13) + k) % 13] += dp[i][k];
			dp[i + 1][((j * t % 13) + k) % 13] %= MOD;
		  }
		}
	  } else {
		int m = s[i] - '0';
		rep (j, 13) {
		  dp[i + 1][((m * t % 13) + j) % 13] += dp[i][j];
		  dp[i + 1][((m * t % 13) + j) % 13] %= MOD;
		}
	  }
	  t = t * 10 % 13;
	}
	cout << dp[n][5] << endl;
    
    return 0;
}



Measured memory_bytes: 16652
#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>;

const vector<int> v = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

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


Measured memory_bytes: 256
#include <cstdio>

int main()
{
	int n; scanf("%d", &n);
	
	for (int i = 1; i <= n; ++i) {
		if (i % 3 == 0 || i % 10 == 3) printf(" %d", i);
		else {
			int x = i;
			while (x) {
				x /= 10;
				if (x % 10 == 3) {
					printf(" %d", i);
					break;
				}
			}
		}
	}

	printf("\n");
}

Measured memory_bytes: 1028
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
 
using namespace std;
 
const double eps=1e-10;
 
int main()
{
	map<string,int> m;
	int fre=0,len=0;
	string s,s_fre,s_len;

	while(cin>>s){
		m[s]++;
		if(s.size()>len){
			s_len=s;
			len=s.size();
		}
		if(m[s]>fre){
			s_fre=s;
			fre=m[s];
		}
	}

	cout<<s_fre<<" "<<s_len<<endl;


	return 0;
}

Measured memory_bytes: 1196
#include<stdio.h>
void bfs(int ,int);
void bbfs(int,int);
int A[101][101];
int Ans[101];
int n;
int main(){
  int i,j,num,d,x;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d",&num,&d);
    for(j=0;j<d;j++){
      scanf("%d",&x);
      A[num][x]=1;
    }

  }
  for(i=1;i<=n;i++){

      Ans[i]=-1;
    

  }
  bfs(1,0);
 
  for(i=1;i<=n;i++){
    printf("%d %d\n",i,Ans[i]);
  }
  return 0;
}
void bfs(int u,int num){
  int i;
  Ans[u]=num;
  for(i=1;i<=n;i++){
    if(A[u][i]==1){
      if(Ans[i]==-1||Ans[i]>num+1)
      bfs(i,num+1);
    }
  }

}



Measured memory_bytes: 2104
package main

import (
	"fmt"
)

func solve(hw []string, h, w, k int) int {
	answer := 0

	for is := 0; is < (1<<h); is++ {
		for js := 0; js < (1<<w); js++ {
			cnt := 0
			for i := 0; i < h; i++ {
				for j := 0; j < w; j++ {
					if (is >> i)&1 == 1 {
						continue
					}
					if (js >> j)&1 == 1  {
						continue
					}
					if string(hw[i][j]) == "#" {
						cnt++
					}
				}
			}
			if cnt == k {
				answer++
			}
		}
	}

	return answer
}

func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}

func scanStrings(len int) (strings []string) {
    var str string
    for i := 0; i < len; i++ {
        fmt.Scanf("%s", &str)
        strings = append(strings, str)
    }
    return
}

func main() {
	nums := scanNums(3)
	h := nums[0]
	w := nums[1]
	k := nums[2]
	table := scanStrings(h)

	result := solve(table, h,w,k)
	fmt.Println(result)
}


Measured memory_bytes: 1836
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
const ll inf = 1LL << 50;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
///////////////////////////////////////

int main() {
	int N; cin >> N;
	int h[100100];
	for (int i = 0; i < N; ++i)cin >> h[i];
	int ans = 0;
	for (int i = 0; i < N - 1;) {
		int cnt = 0;
		while (h[i] >= h[i + 1]) {
			if (i == N - 1) {
				break;
			}
			cnt++;
			i++;
		}
		ans = max(ans, cnt);
		i++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
def amigos(a, b, c)
	return (a == b) && (b == c)
end

def main
	line = gets.chomp.split(/\s/)
	m = line[0].to_i
	x = line[1].to_i
	y = line[2].to_i

	if amigos(m, x, y)
		print "#{x} #{y}\n"
		return
	end

	ab = (x - y).abs
	ma = (x >= y) ? x - ab : y - ab
	mi = x+y <= m ? 0 : x+y-m
	print "#{ma} #{mi}\n"
end

main


Measured memory_bytes: 1916
#include <bits/stdc++.h> 
#define int long long
#define quickie ios_base::sync_with_stdio(false); cin.tie(NULL);
#define rep(i, a, b) for(int i=a; i<b; i++)
#define rep1(i, a, b) for(int i=a; i<=b; i++)
#define repp(i, a, b) for(int i=b-1; i>=a; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define db double
#define mi map<int, int>
#define mc map<char, int>
#define ms map<string, int>
#define vi vector<int>
#define qi queue<int>
#define MI(x) power(x, mod-2)
#define test int t; cin >> t;
//#define mod 1000000007LL
#define mod 998244353 
using namespace std;
int power(int x, int y) ;
int gcd(int a, int b) ;

signed main() {
    quickie
    int n ;
    cin >> n ;
    int sum = 0 ;
    rep(i, 1, n+1) {
        if(i%3 !=0 && i%5 !=0 )sum += i ;
    }
    cout << sum << endl ;
}

int power(int x, int y) {
    int res = 1; x %= mod;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res%mod;
}
 
int gcd(int a,int b){
    if(a==0) return b;
    return gcd(b%a,a);
}

Measured memory_bytes: 3612
# -*- coding: utf-8 -*-
# B

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

n = int(input())
A = list(map(int, input().split()))

ans = 0
for idx, a in enumerate(A):
    idx += 1
    if idx % 2 == 1 and a % 2 == 1:
        ans += 1
print(ans)

Measured memory_bytes: 65268
#include<bits/stdc++.h>
typedef long long     ll;
#define fast          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fr            first
#define sc            second
#define com(i,n)      for(int i=0;i<n;i++)
#define dom(i,n)      for(int i=1;i<=n;i++)
#define mom(i,n)      for(int i=n;i>=0;i--)
#define sortI(a,n)    sort(a,a+n)
#define sortD(a,n)    sort(a,a+n,greater<int>())
#define sortvi(a)     sort(a.begin(),a.end())
#define sortvd(a)     sort(a.begin(),a.end(),greater<int>())
#define sumall(a,x)   accumulate(a.begin(),a.end(),x)
#define pi            3.14159265358979323846264338327950
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    if(y%2==0 && y>=2*x && y<=4*x)
        cout << "Yes\n";
    else
        cout << "No\n";
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>
#include <iomanip>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000

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

  int n, m;
  cin >> n >> m;
  pair<int, bool> h[n];
  rep(i, 0, n) {
    int _h;
    cin >> _h;
    h[i] = make_pair(_h, true);
  }

  rep(i, 0, m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    if(h[a].first <= h[b].first) h[a].second = false;
    if(h[b].first <= h[a].first) h[b].second = false;
  }

  int rsl = 0;
  rep(i, 0, n) {
    if (h[i].second) ++rsl;
  }
  cout << rsl << endl;
}


Measured memory_bytes: 4472
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<tuple>
#include<utility>
#include<stack>
#include<set>
#include<iomanip>
using ll=long long int;
using namespace std;


int main() {

	ll n;
	cin >> n;

	ll ans = 1000000000;

	for (ll i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			ll b = n / i;

			ll digit = 0;
			while (b > 0) {
				digit++;
				b /= 10;
			}
			ans = min(ans, digit);
		}
	}

	cout << ans << endl;

	return 0;
}





Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int i,j,m,n,h,a,b;
	scanf("%d%d%d",&m,&n,&h);
//	for(i=0;i<m;i++)
	int max=n;
	if(m>n) max=m;
	if(h%max==0)printf("%d",h/max);
	else printf("%d",h/max+1);
	
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<vector>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <stdio.h>

using namespace std;
 
int main(){

  int n;
  cin >> n;
  vector<string>Taro(n);
  vector<string>Hanako(n);
  
  for(int i =0; i<2*n; i++){
  	if(i%2==0)
    	cin >> Taro.at(i/2);
    if(i%2!=0)
    	cin >> Hanako.at((i-1)/2);
  }
  
  int T_score=0;
  int H_score=0;
  for(int i=0; i<n; i++){
  	if(Taro.at(i)> Hanako.at(i))
      	T_score +=3;
    else if(Taro.at(i)< Hanako.at(i))
      	H_score +=3;
    else{
    	T_score++;
      	H_score++;
    }
  }
  
  cout << T_score << " " << H_score << endl;
      
  return 0;

  
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

#define PI (2*acos(0.0))
#define eps 1e-9
#define pcase cout<<"Case "<<++cs<<": "
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define show(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define mp make_pair
#define ff first
#define ss second
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define lb lower_bound
#define up upper_bound
#define vscan for(i = 0;i<n;i++){cin>>in; v.pb(in);}
#define all(a) a.begin(), a.end()

int main()
{
    int i = 0, j = 0, cs = 0, in;    
    string a, b; cin>>a>>b;
    int cnt = 0; 
    for(i = 0; i < 3; i++){
        if(a[i] == b[i]) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
# = str(input())
# = map(int, input().split())
a = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]
count= 0

for i in range(N):
    if (i+1) %2 ==1:
        if a[i] %2 == 1:
            count += 1


print(count)


Measured memory_bytes: 9092
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=1000*1007;

int main()
{
	int a, b;
	cin >> a >> b;
	b=2*b+1;
	cout << (a+b-1)/b << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	void Solve() {
		UL N; cin >> N;
		vector<UL> A(N), B(N);
		rep(i, N) cin >> A[i];
		rep(i, N) cin >> B[i];
		priority_queue<pair<UL, UL>> Q;
		rep(i, N) {
			if (A[i] > B[i]) { cout << -1 << endl; return; }
			if (A[i] < B[i]) Q.push({ B[i], i });
		}
		ULL ans = 0;
		while (Q.size()) {
			UL i = Q.top().second; Q.pop();
			UL l = (i + N - 1) % N;
			UL r = (i + 1) % N;
			UL d = B[l] + B[r];
			UL t = (B[i] - A[i]) / d;
			ans += t;
			B[i] -= d * t;
			//rep(i, N) cout << B[i] << " "; cout << endl;
			if (A[i] == B[i]) continue;
			if(B[i] > B[l] && B[i] > B[r]) { cout << -1 << endl; return; }
			Q.push({ B[i], i });
		}
		cout << ans << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}


Measured memory_bytes: 3956
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;

ll modpow(ll x, ll n, ll MOD) {
  ll ans = 1;
  while(n > 0) {
    if(n % 2 == 1) {
      ans *= x;
      ans %= MOD;
    }
    x *= x;
    x %= MOD;
    n >>= 1;
  }
  return ans;
}
int bin(int n) {
  int ans = 0;
  while(n > 0) {
    ans += n % 2;
    n /= 2;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int mod = 0;
  for(int i = 0; i < n; i++) {
    if(s[i] == '1') {
      mod++;
    }
  }
  vector<ll> a(n, 0), b(n, 0);
  int num1 = 0, num2 = 0;
  for(int i = 0; i < n; i++) {
    a[i] = modpow(2, n - i - 1, mod + 1);
    if(mod > 1) {
      b[i] = modpow(2, n - i - 1, mod - 1);
    }
    if(s[i] == '1') {
      num1 += a[i];
      num1 %= (mod + 1);
      if(mod > 1) {
        num2 += b[i];
        num2 %= (mod - 1);
      }
    }
  }
  for(int i = 0; i < n; i++) {
    int tmp = 0;
    if(s[i] == '1') {
      if(mod == 1) {
        cout << 0 << '\n';
        continue;
      }
      tmp = num2 - b[i];
      if(tmp < 0) {
        tmp += (mod - 1);
      }
      tmp %= (mod - 1);
    } else {
      tmp = num1 + a[i];
      tmp %= (mod + 1);
    }
    int ans = 1;
    while(tmp > 0) {
      ans++;
      int pc = bin(tmp);
      tmp %= pc;
    }
    cout << ans << '\n';
  }
  return 0;
}

Measured memory_bytes: 6828
from collections import deque

H, W = map(int, input().split())
ch, cw = map(lambda x: int(x)-1, input().split())
dh, dw = map(lambda x: int(x)-1, input().split())
S = [list(input()) for _ in range(H)]
dist = [[-1] * W for _ in range(H)]

move = []
for i in range(-2, 3):
    for j in range(-2, 3):
        if i == 0 and j == 0:
            continue
        move.append((i, j))
q = deque()
q.append((0, ch, cw))
while q:
    c, h, w = q.popleft()
    if dist[h][w] >= 0:
        continue
    dist[h][w] = c
    for hh, ww in move:
        if 0 <= h+hh < H and 0 <= w+ww < W and S[h+hh][w+ww] == "." and dist[h+hh][w+ww] < 0:
            if (hh, ww) in ((0,1), (1,0), (-1,0), (0,-1)):
                q.appendleft((c, h+hh, w+ww)) # 徒歩は前に追加
            else:
                q.append((c+1, h+hh, w+ww)) # ワープは後ろに追加

print(dist[dh][dw])

Measured memory_bytes: 208532
#include <cstdio>
#include <algorithm>
#include <cmath>

#define EPS (0.0001)

using namespace std;

typedef struct {
	int no;
	int dist;
	int money;
} Store;

Store data[16];
double dp[1 << 16][16];
int n;
double mT;

void print(int S, int v, double sum)
{
	printf("%d%c", data[v].no, S == (1 << n) - 1 ? '\n' : ' ');
	
	if (S == (1 << n) - 1) return;
	
	int sumMoney = 0;
	for (int i = 0; i < n; i++){
		if ((S >> i) & 1) sumMoney += data[i].money;
	}
	
	int nxt;
	double nowTime;
	for (int i = 0; i < n; i++){
		int dx = abs(data[v].dist - data[i].dist);
		double nv = 2000.0 / (70 + 20 * sumMoney);
		nowTime = dx / nv;
		if (!((S >> i) & 1) && fabs(sum + nowTime + dp[S | (1 << i)][i] - mT) <= EPS){
			nxt = i;
			break;
		}
	}
	
	print(S | (1 << nxt), nxt, sum + nowTime);
}

double getTime(int S, int v)
{
	int ans[16];
	if (~v && dp[S][v] >= 0){
		return (dp[S][v]);
	}
	
	if (S == (1 << n) - 1){
		return (dp[S][v] = 0);
	}
	
	int sumMoney = 0;
	for (int i = 0; i < n; i++){
		if ((S >> i) & 1) sumMoney += data[i].money;
	}
	
	int minNode;
	double minTime = -1;
	for (int i = 0; i < n; i++){
		if (!((S >> i) & 1)){
			int dx = abs((~v ? data[v].dist : 0) - data[i].dist);
			double nv = 2000.0 / (70 + 20 * sumMoney);
			double nowTime = (~v ? dx / nv : 0) + getTime(S | (1 << i), i);
			if (minTime < 0) minTime = nowTime;
			else minTime = min(minTime, nowTime);
			if (minTime == nowTime){
				minNode = i;
			}
		}
	}
	if (~v){
		return (dp[S][v] = minTime);
	}
	else {
		mT = minTime;
		print(1 << minNode, minNode, 0);
		return (minTime);
	}
}

int main()
{
	int route[16];
	scanf("%d", &n);
	
	for (int i = 0; i < n; i++){
		scanf("%d %d %d", &data[i].no, &data[i].dist, &data[i].money);
	}
	
	for (int i = 0; i < 1 << 16; i++){
		for (int j = 0; j < 16; j++){
			dp[i][j] = -1;
		}
	}
	getTime(0, -1);
	
	return (0);
}

Measured memory_bytes: 9212
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 10:34-

            long l = sc.nextLong();
            long r = sc.nextLong();
            long x = 2019;

            if (l == 0 || r / x - (l - 1) / x > 0) {
                out.println(0);
            } else {
                long min = Long.MAX_VALUE;
                for (long i = l; i < r + 1; i++) {
                    for (long j = i + 1; j < r + 1; j++) {
                        min = Math.min(min, (i * j) % x);
                    }
                }
                out.println(min);
            }
        }
    }

}


Measured memory_bytes: 23124
import sys
from itertools import accumulate
from collections import defaultdict
input = sys.stdin.readline
n,k = map(int,input().split())
a = list(map(int,input().split()))
a = [i-1 for i in a]
suma = [0]+list(accumulate(a))
suma = [i%k for i in suma]
rem = defaultdict(int)
ans = 0
if k > n:
    for i in range(n+1):
        x = suma[i]
        rem[x] += 1
    for s in rem.values():
        ans += s*(s-1)//2
    print(ans)
    exit()
for i in range(k):
    x = suma[i]
    rem[x] += 1
for s in rem.values():
    ans += s*(s-1)//2
for i in range(n-k+1):
    rem[suma[i]%k] -= 1
    rem[suma[i+k]%k] += 1
    ans += rem[suma[i+k]] -1
print(ans)

Measured memory_bytes: 41400
def main():
    n=int(input())
    l = list(map(int,input().split(' ')))
    res = 0
    tmp = 0
    for i in range(n-1):
        if l[i] >= l[i+1]:
            tmp += 1
        else:
            if res < tmp:
                res = tmp
            tmp = 0
    if res < tmp:
        res = tmp
    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 14252
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
// typedef long  l;
typedef pair<int,int> P;
const ll INF=100000000000000001;
const double PI=3.141592653589;


int main(){
  int n,m; cin>>n>>m;
  vector<int> p(m);
  vector<int> y(m);
  vector<vector<int>> j(n);

  rep(i,m){
    cin>>p[i]>>y[i];
    j[p[i]-1].push_back(y[i]);
  }
  rep(i,n){
    sort(j[i].begin(),j[i].end());
  }
  rep(i,m){
    ll ans=(ll)p[i]*1000000;
    auto itr=lower_bound(j[p[i]-1].begin(),j[p[i]-1].end(),y[i]);
    ans+=(int)((itr-j[p[i]-1].begin())+1);
    printf("%012lld\n",ans);
  }


  return 0;
}


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

int main() {
    string s[3];
    cin >> s[0] >> s[1] >> s[2];

    string ans = "";
    for (int i = 0; i < 3; i++) {
        ans += s[i][0] - 'a' + 'A';
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
K = 32
P = 998244353
pa = (1 << 30) - ((1 << 30) % P)
M = []
N, S = map(int, input().split())
m = int(("1" * 2 + "0" * 30) * (S + 1), 2)
mm = (1 << K * (S + 1)) - 1
A = [int(a) for a in input().split()]
s = 0
ans = 0
for a in A:
    s += 1
    s += s << a * K
    s &= mm
    s -= ((s & m) >> 30) * pa
    ans += s >> S * K

print(ans % P)

Measured memory_bytes: 3316
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author c0117321c5
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = a * b;
        if (c % 2 == 0) {
            System.out.println("Even");
        } else if (c % 2 == 1) {
            System.out.println("Odd");
        }
    }

}

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

int main() {
    int N, W, H; cin >> N >> W >> H;
    vector<int> row(W + 1), column(H + 1);
    while (N--) {
        int x, y, w; cin >> x >> y >> w;
        row[max(0, x - w)]++;
        row[min(x + w, W)]--;
        column[max(0, y - w)]++;
        column[min(y + w, H)]--;
    }
    bool ok1 = true, ok2 = true;
    rep(i, W) {
        row[i + 1] += row[i];
        if (row[i] > 0) continue;
        ok1 = false;
        break;
    }
    rep(i, H) {
        column[i + 1] += column[i];
        if (column[i] > 0) continue;
        ok2 = false;
        break;
    }
    cout << (ok1 | ok2 ? "Yes" : "No") << endl;
}

Measured memory_bytes: 3628
#include <stdio.h>
int main(void){
    int i,j,a,H[10];
    for(i=0;i<=10;i++) scanf("%d",&H[i]);
    
    for(i=0;i<9;i++){
        for(j=i+1;j<10;j++){
            if(H[j]<H[i]){
                a=H[i];
                H[i]=H[j];
                H[j]=a;
            }
        }
    }
    printf("%d\n%d\n%d\n",H[9],H[8],H[7]);
    return 0;
}



Measured memory_bytes: 2104
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;

int a[11];
int n, k, t;
bool judge(int x)
{
    while(x)
    {
        if(a[x%10]) return false;
        x /= 10;
    }
    return true;
}
int main()
{
    cin >> n >> k;
    for(int i = 0; i < k; ++i)
    {
        cin >> t;
        a[t] = 1;
    }
    for(int i = n; ; ++i)
    {
        if(judge(i))
        {
            cout << i << "\n";
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1e17;
const int inf = 1e5;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

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

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};
struct SegmentTree{
  int N;
  vector<int> node;
  public :
    void intit(vector<int>v){
      int sz = v.size();
      N=1;
      while(N<sz) N*=2;
      node.resize(N);
      for(int i=0 ; i<sz ; i++) node[i+N-1] = v[i];
      for(int i=N-2 ; i>=0 ; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
    void update(int x, int val){
      x += N-1;
      node[x+N-1] = val;
      while(x>0){
        x = (x-1)/2;
        node[x] = min(node[x*2+1], node[x*2+2]);
      }
    }
    int getmin(int a, int b, int k, int l, int r){
      if(b<=l || r<=a) return inf;
      else if(a<=l && r<=b) return node[k];
      else{
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
      }
    }
};
int main(){
  int N;  cin>>N;
  vector<ll> v(N);
  rep(i,0,N) cin>>v[i];
  vector<int> d(50, 0);
  int ok = 1;
  rep(i,0,N) if(v[i] != 0) ok = 0;
  if(ok){
    cout << "Yes" << endl;
    return 0;
  }
  if(N%3 != 0){
    cout << "No" << endl;
    return 0;
  }
  map<ll, ll> ma;
  rep(i,0,N){
    ma[v[i]]++;
  }
  ll n = 0;
  for(auto j : ma){
    n++;
  }
  string ans = "No";
  int i = 0;
  vector<ll> m(n);
  for(auto j : ma){
    m[i++] = j.se;
  }
  sort(all(m));
  if(n == 2 && (2*m[0]==m[1])){
    ans = "Yes";
  }else if(n==3 && m[0]==m[1] && m[1]==m[2]){
    rep(i,0,N){
      for(int j=0 ; j<=20 ; j++){
        if(1<<j & v[i]) d[j]++;
      }
    }
    ok = 1;
    rep(i,0,21){
      if(d[i]%2 == 1) ok = 0;
    }
    if(ok) ans = "Yes";
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 9160
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int[] a = new int[4];
        for (int i = 0; i < 4; i++) {
            a[i] = cin.nextInt();
        }
        System.out.println(Math.min(a[0], a[1]) + Math.min(a[2], a[3]));
    }

}


Measured memory_bytes: 21844
# -*- coding: utf-8 -*-
N = int(input())
INF = 10**6

dp = [INF] * (N + 100)
dp[0] = 0

for n in range(1, N + 1):
    dp[n] = dp[n - 1] + 1

    power = 6
    while n - power >= 0:
        dp[n] = min(1 + dp[n - power], dp[n])
        power *= 6

    power = 9
    while n - power >= 0:
        dp[n] = min(1 + dp[n - power], dp[n])
        power *= 9

print(dp[N])


Measured memory_bytes: 3828
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll beki[200020];
ll l[200020],r[200020];

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  ll ans=n/(a+b)*a;
  ans+=min(n%(a+b),a);
  cout << ans << endl;
return 0;}


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

int main()
{
	int x,a,b;
	
	scanf("%d",&x);
	scanf("%d",&a);
	scanf("%d",&b);
	
	a = x-a;
	b = x-b;
	
	if(a < 0)
	{
		a = -a;
	}
	
	if(b < 0)
	{
		b = -b;
	}
	
	
	if(a < b)
	{
		printf("A");
	}else printf("B");
	
	return 0;
}


Measured memory_bytes: 128