akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

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

    vector<string> s(n); for (int i = 0; i < n; i++) cin >> s[i];
    
    sort(s.begin(), s.end());

    int ans = 0;
    int tmpCnt;
    for (int i = 0; i < n; i +=tmpCnt) {

        int endIndex = -1;
        tmpCnt = 1;
        for (int j = i + 1; j < n; j++) {
            if (s[i] == s[j]) {
                tmpCnt++;
            }
            else {
                endIndex = j;
                break;
            }
        }

        if (i == 0 && tmpCnt == 1 &&  endIndex == -1) {
            ans = n;
            break;
        }
        else if (i != n - 1 && tmpCnt == 1 && endIndex == -1) {
            break;
        }
        else {
            ans++;
        }

    }

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

Measured memory_bytes: 9536
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter
    n = int(readline())
    count = Counter()

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                count[a] += 1

    for i in range(1, n + 1):
        print(count[i])


if __name__ == '__main__':
    main()


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

int main(){
  int N, x=0, y=0, max_value=0;
  cin >> N;
  int V[N],C[N];

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

  for(int k=0;k<N;k++){
    if((V[k]/C[k])>=1){
      x += V[k];
      y += C[k];
    }
  }

  max_value = x - y;

  cout << max_value << endl;
}


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

using namespace std;

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i += 2) {
    cout << s[i];
  }
  cout << endl;
}

Measured memory_bytes: 512
#include <vector>
#include <array>
#include <algorithm>
#include <iostream>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <math.h>
#include <assert.h>
#include <queue>
#include <deque>
#include <iomanip>
#include <numeric>
#include <fstream>

using namespace std;

typedef long long ll;
typedef long double ld;

#define fi first
#define se second

#define mp make_pair
#define pb push_back
#define sz(x) ((int)(x).size())

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ld> vld;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<ld>> vvd;
typedef vector<string> vs;
typedef vector<bool> vb;

typedef pair <int, int> pii;
typedef pair <ll, ll> pll;



int main() {
    cout << setprecision(30);
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    ll n;
    cin >> n;
    vl a(n);
    ld kek = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        kek += 1. / (ld)(a[i]);
    }
    cout << (1 / kek) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
// ModInt begin
 
using ll = long long;
template<ll mod>
struct ModInt {
    ll v;
    ll mod_pow(ll x, ll n) const {
        return (!n) ? 1 : (mod_pow((x*x)%mod,n/2) * ((n&1)?x:1)) % mod;
    }
    ModInt(ll a = 0) : v((a %= mod) < 0 ? a + mod : a) {}
    ModInt operator+ ( const ModInt& b ) const {
        return (v + b.v >= mod ? ModInt(v + b.v - mod) : ModInt(v + b.v));
    }
    ModInt operator- () const {
        return ModInt(-v);
    }
    ModInt operator- ( const ModInt& b ) const {
        return (v - b.v < 0 ? ModInt(v - b.v + mod) : ModInt(v - b.v));
    }
    ModInt operator* ( const ModInt& b ) const {return (v * b.v) % mod;}
    ModInt operator/ ( const ModInt& b ) const {return (v * mod_pow(b.v, mod-2)) % mod;}
    
    bool operator== ( const ModInt &b ) const {return v == b.v;}
    bool operator!= ( const ModInt &b ) const {return !(*this == b); }
    ModInt& operator+= ( const ModInt &b ) {
        v += b.v;
        if(v >= mod) v -= mod;
        return *this;
    }
    ModInt& operator-= ( const ModInt &b ) {
        v -= b.v;
        if(v < 0) v += mod;
        return *this;
    }
    ModInt& operator*= ( const ModInt &b ) {
        (v *= b.v) %= mod;
        return *this;
    }
    ModInt& operator/= ( const ModInt &b ) {
        (v *= mod_pow(b.v, mod-2)) %= mod;
        return *this;
    }
    ModInt pow(ll x) { return ModInt(mod_pow(v, x)); }
    // operator int() const { return int(v); }
    // operator long long int() const { return v; }
};
 
template<ll mod>
ostream& operator<< (ostream& out, ModInt<mod> a) {return out << a.v;}
template<ll mod>
istream& operator>> (istream& in, ModInt<mod>& a) {
    in >> a.v;
    return in;
}
 
// ModInt end
 
using mint = ModInt<998244353>;
 
int main(){
    int N; cin >> N;
    vector<int> D(N);
    for(int i = 0; i < N; i++) cin >> D[i];
    vector<int> A(N);
    for(int i = 0; i < N; i++)A[D[i]]++;
    if(D[0]!=0 || A[0] != 1){
        cout << 0 << endl;
        return 0;
    }
    
    mint ans(1);
    int max_val = *max_element(D.begin(),D.end());
    for(int i = 1; i <= max_val; i++){
        if(A[i] == 0) ans = mint(0);
        for(int j = 0; j < A[i]; j++){
            ans *= A[i-1];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3964
//omajinai c++
#include <iostream>
#include<cmath>
#include<vector>
#include <algorithm>
#include <limits>
#include <numeric>
#include <type_traits>
#include <map>
#include <string>
#include <iomanip>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define itn int
typedef long long ll;
constexpr auto mod = 1000000007;
using namespace std;
int main() {
string s;
  cin>>s;
  if(s[2]==s[3]&&s[4]==s[5]){
    cout<<"Yes";
  }
  else{
    cout<<"No";
  }
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <limits>
#include <random>
#include <utility>
#include <vector>

namespace procon {
  class UnionFind {
  private:
    struct nodeinfo {
      int par;
      int rank;
      nodeinfo(int par) : par(par), rank(0) {}
    };
    std::vector<nodeinfo> node;

  public:
    UnionFind(int n) : node() {
      node.reserve(n);
      for (int i = 0; i < n; ++i) {
	node.push_back(nodeinfo(i));
      }
    }
    int root(int x) {
      if (node[x].par == x) {
	return x;
      }
      return node[x].par = root(node[x].par);
    }
    void unite(int x, int y) {
      x = root(x);
      y = root(y);
      if (x == y) {
	return;
      }
      if (node[x].rank < node[y].rank) {
	node[x].par = y;
      } else {
	node[y].par = x;
	if (node[x].rank == node[y].rank) {
	  ++node[x].rank;
	}
      }
    }
    bool is_same_set(int x, int y) { return root(x) == root(y); }
  };
}
  
int main(void) {
  int size, n_query, n_block;
  std::cin.read((char *)&size, sizeof(int));
  std::cin.read((char *)&n_query, sizeof(int));
  std::cin.read((char *)&n_block, sizeof(int));

  std::vector<uint64_t> query(n_query);
  std::vector<int> block(n_block);
  std::cin.read((char *)query.data(), sizeof(uint64_t) * n_query);
  std::cin.read((char *)block.data(), sizeof(int) * n_block);
  

  const int mask = (1 << 30) - 1;

  uint64_t res = 123456789;
  for(int b: block) {
    procon::UnionFind uf(size);
    for (int i = 0; i < n_query; ++i) {
      uint64_t q = query[(b + i) % n_query];
      const int com = q >> 60;
      const int x = (q >> 30) & mask;
      const int y = (q >> 0) & mask;
      assert(0 <= x && x < size);
      assert(0 <= y && y < size);
      if (com) {
        res = res * 17 + (uf.is_same_set(x, y) ? 1 : 0);
      } else {
        uf.unite(x, y);
      }
    }
  }
  std::cout << res << std::endl;
  return 0;
}


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

int main(){
    long N;
    cin >> N;
    string A, B, C;
    cin >> A >> B >> C;
    long ans(0);
    for(int i = 0; i < N; ++i){
        long t = !(A[i] ^ B[i]) + !(C[i] ^ B[i]) + !(A[i] ^ C[i]);
        if(t == 1)ans += 1;
        if(t == 0)ans += 2;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
  int A,B,C,D,E,F;cin >> A >> B >> C >> D >> E >> F;
  int ansW,ansS;
  // rest. 1 ) 100(iA+jB)+kC+lD<=F
  // rest. 2 ) kC+lD<=E(iA+jB)
  for(int i=0;100*i*A<=F;i++){
    for(int j=0;100*(i*A+j*B)<=F;j++){
      int W = 100*(i*A+j*B);
      if(W>0){
        for(int k=0;k*C<=min(E*W/100,F-W);k++){
          for(int l=0;(k*C+l*D)<=min(E*W/100,F-W);l++){
            int S = k*C+l*D;
            if(ansS*W<=S*ansW){
              ansS = S;
              ansW = W;
            }
          }
        }
      }
    }
  }
  cout << ansS+ansW << " " << ansS << endl;
}

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

#define rep(i, n) for (int i = 0; i < n; i++)
#define vi vector<int>

#define ll long long
#define vl vector<ll>
#define vll vector<vl>

const int INF = 1e9;

ll mod=1000000007;

int main() {
	string s;
	ll k;
	cin >> s >> k;
	int n=s.size();
	int eq[110]={};
	int tmp=0;
	rep(i, n-1)
	{
		if(s[i]==s[i+1]) eq[tmp]++;
		else tmp++;
	}
	tmp++;
	if(tmp==1)
	{
		cout << (ll)n*k/(ll)2 << endl;
	}
	else if(s[0]==s[n-1])
	{
		ll ans=0;
		for(int i=1; i<tmp-1; i++)
		{
			ans+=((ll)1+eq[i])/(ll)2;
		}
		ans*=k;
		ans+=(eq[0]+eq[tmp-1]+2)/(ll)2*(k-1);
		ans+=((ll)1+eq[0])/(ll)2;
		ans+=((ll)1+eq[tmp-1])/(ll)2;
		cout << ans << endl;
	}
	if(s[0]!=s[n-1])
	{
		ll ans=0;
		for(int i=0; i<tmp; i++)
		{
			ans+=((ll)1+eq[i])/(ll)2;
		}
		ans*=k;
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
    string s, ans = "No";
    cin >> s;
    
    set<int> buf;
    for (int i = 0; i < 4; i++) {
        buf.insert(s[i]);
    }
    
    if (buf.size() == 2) {
        ans = "Yes";
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

partial class Solver
{
    public void Run()
    {
        var N = ni();
        var K = ni();
        var S = ns();

        var c = S.ToCharArray();
        c[K - 1] = char.ToLowerInvariant(c[K - 1]);
        cout.WriteLine(new string(c));
    }
}


// PREWRITEN CODE BEGINS FROM HERE
partial class Solver : Scanner
{
    public static void Main(string[] args)
    {
        new Solver(Console.In, Console.Out).Run();
    }

    TextReader cin;
    TextWriter cout;

    public Solver(TextReader reader, TextWriter writer)
        : base(reader)
    {
        this.cin = reader;
        this.cout = writer;
    }
    public Solver(string input, TextWriter writer)
        : this(new StringReader(input), writer)
    {
    }

    public int ni() { return NextInt(); }
    public int[] ni(int n) { return NextIntArray(n); }
    public long nl() { return NextLong(); }
    public long[] nl(int n) { return NextLongArray(n); }
    public double nd() { return NextDouble(); }
    public string ns() { return Next(); }
}

public class Scanner
{
    private TextReader Reader;
    private Queue<String> TokenQueue = new Queue<string>();
    private CultureInfo ci = CultureInfo.InvariantCulture;

    public Scanner()
        : this(Console.In)
    {
    }

    public Scanner(TextReader reader)
    {
        this.Reader = reader;
    }

    public int NextInt() { return Int32.Parse(Next(), ci); }
    public long NextLong() { return Int64.Parse(Next(), ci); }
    public double NextDouble() { return double.Parse(Next(), ci); }
    public string[] NextArray(int size)
    {
        var array = new string[size];
        for (int i = 0; i < size; i++) array[i] = Next();
        return array;
    }
    public int[] NextIntArray(int size)
    {
        var array = new int[size];
        for (int i = 0; i < size; i++) array[i] = NextInt();
        return array;
    }

    public long[] NextLongArray(int size)
    {
        var array = new long[size];
        for (int i = 0; i < size; i++) array[i] = NextLong();
        return array;
    }

    public String Next()
    {
        if (TokenQueue.Count == 0)
        {
            if (!StockTokens()) throw new InvalidOperationException();
        }
        return TokenQueue.Dequeue();
    }

    public bool HasNext()
    {
        if (TokenQueue.Count > 0)
            return true;
        return StockTokens();
    }

    private bool StockTokens()
    {
        while (true)
        {
            var line = Reader.ReadLine();
            if (line == null) return false;
            var tokens = line.Trim().Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            if (tokens.Length == 0) continue;
            foreach (var token in tokens)
                TokenQueue.Enqueue(token);
            return true;
        }
    }
}


Measured memory_bytes: 11220
#include<stdio.h>
int main(){
  int a,b,c,d;
  scanf("%d%d",&a,&b); 
 
c=a*b;
d=a+b;
 
if(d==15){
printf("+\n");
}else if(c==15){
printf("*\n");
}else{
printf("x\n");
}
   return 0;
}

Measured memory_bytes: 128
def isop(s):
    if s == "+" or s == "-" or s == "*":
        return True
    return False


def main():
    line = list(input().split())
    stack = []
    while len(line) > 0:
        tmp = line.pop()
        if isop(tmp):
            stack.append(tmp)
        else:
            stack.append(int(tmp))
        while len(stack) > 2 and isop(stack[-1]) == False and isop(stack[-2]) == False:
            num1 = stack.pop(-1)
            num2 = stack.pop(-1)
            op = stack.pop(-1)
            if op == "+":
                stack.append(num1 + num2)
            elif op == "-":
                stack.append(num1 - num2)
            else:
                stack.append(num1 * num2)

    print(*stack)


if __name__ == '__main__':
    main()


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

#define EPS (1e-7)
#define INF (1e9) #define PI(acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

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

typedef long long ll;

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

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

ll anti(ll X, ll C, ll D) { return X - X / C - X / D + X / lcm(C, D); }

void solve(long long A, long long B, long long C, long long D) {
    cout << anti(B, C, D) - anti(A - 1, C, D) << endl;
}

int main() {
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    long long C;
    scanf("%lld", &C);
    long long D;
    scanf("%lld", &D);
    solve(A, B, C, D);
    return 0;
}


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

int main(void){
	int n, m;
	cin >> n >> m;
	vector<int> x(m);
	for(int i = 0; i < m; ++i){
		cin >> x[i];
	}
	sort(x.begin(), x.end());
	vector<int> y(m-1);
	for(int i = 0; i < m-1; ++i){
		y[i] = x[i+1] - x[i];
	}
	sort(y.begin(), y.end());
	long long ans = 0LL;
	for(int i = 0; i < m-n; ++i){
		ans += y[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    string s;cin>>s;
    string t;t=s;
    reverse(all(t));
    if(s==t){
        ll n=(ll)s.size();
        bool f=1;
        rep(i,n/2){
            if(s[i]!=s[i+n/2+1])f=0;
        }
        if(f)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

int dx[] = { -1, 0, 1, 0, -1, -1, 1, 1};
int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};


int main() {

	long long  n; cin >> n;
	vector<long long > x(n, 0); for (long long  i = 0; i <= n - 1; i++) cin >> x[i];

	long long  ans = LLONG_MAX;
	for (long long  i = 1; i <= 100; i++) {
		long long  curr = 0;
		for (auto j : x) curr += ((i - j) * (i - j));
		ans = min(ans, curr);
	}

	cout << ans;

	return 0;
}

Measured memory_bytes: 3196
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N;
	int ans = -1;

	cin >> N;

	rep(i, 500001) {
		if ((int)(i * 1.08) == N) {
			ans = i;
			break;
		}
	}

	if (ans == -1) cout << ":(" << endl;
	else cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    string s, t, u;
    int a, b;
    cin >> s >> t >> a >> b >> u;
    if(u == s)a--;
    else b--;
    cout << a << ' ' << b << endl;
    return 0;
}
 
 


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++) //for文マクロ
#define all(obj) obj.begin(), obj.end()
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);

using namespace std;

typedef unsigned long long ull;
typedef int long long ll;
constexpr ll bigNum = 1000000007;

signed main()
{
    fast;
    //ここから本体
    ll n;
    cin >> n;
    vector<string> a(n);
    for (int i = 0; i < n; i++)
    {
        string x;
        cin >> x;
        sort(all(x));
        a[i] = x;
    }
    sort(all(a));

    ll ans = 0;
    ll c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }
    ans += (c * (c - 1)) / 2;
    cout << ans << endl;
}


Measured memory_bytes: 5760
#include <iostream>
using namespace std;
int main()
{
	char c;
	cin >> c;
	if (c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
	{
		cout << "vowel" << endl;
	}
	else
	{
		cout << "consonant" << endl;
	}
}

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

using namespace std;
int main()
{
    double a, b, h, m;
    cin >> a >> b >> h >> m;

    double theta = 2 * M_PI * ((h / 12 + m / 60 / 12) - m / 60);

    double r = sqrt(a * a + b * b - 2 * b * a * cosl(theta));

    printf("%.20lf\n", r);
}

Measured memory_bytes: 4128
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define INF LLONG_MAX
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    string s; cin >> s;
    cout << 2 * min(count(ALL(s), '0'), count(ALL(s), '1')) << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int pri=998244353;

signed main(){
	int H,W,N; cin>>H>>W>>N;
	if(H>W)swap(H,W);
	int ans=0;
	while(N>0){
		N-=W;
		H--;
		ans++;
	}
	cout<<ans<<endl;
}

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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define Si size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define Em empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define Fi first
#define Se second
#define Pi acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

LL big_mod(LL val,LL pow,LL mod);
LL mod_inverse(LL val,LL mod);









int main()
{
//    FAST();

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    int row,col,h,w;
    S("%d %d %d %d",&row,&col,&h,&w);
    P("%d",row*col-(h*col+w*row-h*w));
    return 0;
}







LL big_mod(LL val,LL pow,LL mod)
{
    LL res = 1;
    val = val % mod;
    while(pow > 0)
    {
        if(pow & 1)
        {
            res = (res*val) % mod;
        }
        pow = pow >> 1;
        val = (val*val) % mod;
    }
    return res;
}

LL mod_inverse(LL val,LL mod)
{
    LL mod1 = mod;
    if(mod == 1)
    {
        return 0;
    }
    LL y = 0;
    LL x = 1;
    LL quotient,temp;
    while(val > 1)
    {
        quotient = val / mod;
        temp = mod;
        mod = val % mod;
        val = temp;
        temp = y;
        y = x - quotient * y;
        x = temp;
    }
    if(x < 0)
    {
        x += mod1;
    }
    return x;
}


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

int LCS(int len[],char S[][1001]){//???????????????2?????§?????????
    int DP[1001][1001] = {};
    for (int i = 1; i <= len[0]; i++) {
        for (int j = 1; j <= len[1]; j++) {
            if(S[0][i-1] == S[1][j-1]){
                DP[i][j] = DP[i-1][j-1]+1;
            }else{
                DP[i][j] = max(DP[i-1][j],DP[i][j-1]);
            }
        }
    }
    
    return DP[len[0]][len[1]];
}

void solve(){
    char S[2][1001];
    int len[2];
    scanf("%s %s",S[0],S[1]);
    len[0] = strlen(S[0]);
    len[1] = strlen(S[1]);
    int ll;
    ll = LCS(len,S);
    printf("%d\n",ll);
}

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

Measured memory_bytes: 5096
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
typedef long double ld;
typedef unsigned long long ull;
#define X first
#define Y second
#define mp make_pair
template<class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T, class X> using indexed_map = tree<T, X, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const long long M = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

long long modpow(long long n, long long k, long long MOD);

/**************** code starts here ****************/

bool yymm(string s) {
	int y = stoi(s.substr(0, 2));
	int m = stoi(s.substr(2, 2));

	if (m >= 1 && m <= 12) return 1;
	return 0;
}

bool mmyy(string s) {
	int m = stoi(s.substr(0, 2));
	int y = stoi(s.substr(2, 2));

	if (m >= 1 && m <= 12) return 1;
	return 0;
}

void poppingfever() {
	string s; cin >> s;

	if (yymm(s) && mmyy(s)) {
		cout << "AMBIGUOUS";
	} else if (yymm(s)) {
		cout << "YYMM";
	} else if (mmyy(s)) {
		cout << "MMYY";
	} else {
		cout << "NA";
	}
}

/**************************************************/

signed main() {
	#ifdef fastfurioustransform
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	#endif

	ios::sync_with_stdio(0); cin.tie(0);
	//cout << fixed << setprecision(12);

	poppingfever();

	return 0;
}

long long modpow(long long n, long long k, long long MOD) {
	long long ans = 1; n %= MOD;
	while (k > 0) {
		if (k & 1) ans = (ans*n) % MOD;
		k >>= 1; n = (n*n) % MOD;
	}
	return ans; 
}

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

int data[101];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<2*n;i++)cin>>data[i];
	sort(data,data+2*n);
	int ans=0;
	for(int i=0;i<n;i++){
		ans+=data[2*i];
	}
	cout<<ans<<endl;
}


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

int main() {
  int A,B;
  cin >> A >> B;
  if ((A-B)%2!=0){
      cout << "IMPOSSIBLE" << endl;
  }
  else if (A > B){
    cout << B+(A-B)/2 << endl;
  }
  else {
    cout << A+(B-A)/2 << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define mp make_pair
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) 
#define rep2(i, n, m) for (ll i = n; i <= (ll)(m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (ll)(m); --i)

template<class T, class U> bool chmax(T &a, U b) { if (a < b) a = b; return true; }
template<class T, class U> bool chmin(T &a, U b) { if (a > b) a = b; return true; }

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

constexpr ll MOD = 1000000007;

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

  int n, k; cin >> n >> k;
  int ans = 0;

  while (n) {
    n /= k;
    ++ans;
  }

  cout << ans << endl;

  return (0);
}


Measured memory_bytes: 3572
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

int sqrti(long long x) {
	int s = (int)sqrt(x * 1.L);
	long long sqs = (long long)s * s;
	if (sqs > x) {
		do -- s; while ((long long)s * s > x);
	} else {
		while (sqs <= x - (2 * s + 1)) {
			sqs += 2 * s + 1;
			++ s;
		}
	}
	return s;
}

int main() {
	int T;
	scanf("%d", &T);
	for (int ii = 0; ii < T; ++ ii) {
		int A; int B;
		scanf("%d%d", &A, &B);
		ll S = (ll)A * B - 1;
		int sqrtS = sqrti(S);
		int t = (int)(S / (sqrtS + 1));
		ll ans = 0;
		ans += sqrtS;
		ans -= A <= sqrtS ? 1 : 0;
		ans += t;
		ans -= B <= sqrtS ? 1 : 0;
		printf("%lld\n", ans);
	}
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
vector<bool> prime;
void make(int num){
    prime.resize(num,true);
    prime[0]=false;
    for(int i=0;i*i<num;i++){
        if(prime[i]){
            for(int j=2;(i+1)*j<=num;j++){
                prime[(i+1)*j-1]=false;
            }
        }
    }
}
int main(){
	make(1000010);
while(1){
ll a,d,n;
cin>>a>>d>>n;
if(a==0)return 0;
  int j=0;
  ll now=0;
  ll val=0;
  while(1){
	  val=a+d*now;
	  if(prime[val-1])j++;
	  if(j==n)break;
	  now++;
  }
  cout<<val<<endl;
 }
}



Measured memory_bytes: 3268
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

m,n,k = map(int,readline().split())

def comb(n, r, mod):
    r = min(r, n-r)
    mol = 1
    deno = 1
    for i in range(1, r+1):
        mol = mol * (n-r+i) % mod
        deno = deno * i % mod
    ret = mol * pow(deno, mod-2, mod) % mod
    return ret

def f1(x,y,a,b):
    return (a+b-x-y)*(a-x+1)*(b-y+1)//2

def f2(x,a):
    return (a-x)*(a-x+1)//2

ans = 0

for x in range(1,n+1):
    for y in range(1,m+1):
        a = n-x+1
        b = m-y+1
        c = m*(a*(a-1)+x*(x-1))
        d = n*(b*(b-1)+y*(y-1))
        ans += (c+d)//2
        ans %= mod

ans = (ans * comb(m*n-2,k-2,mod))%mod
ans = ans*pow(2,mod-2,mod)%mod

print(ans)



Measured memory_bytes: 9412
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
            
        int count = sc.nextInt();
        int max = 0;
        int total = 0;
    
        for(int i=0 ; i<count;i++){
            
            int tmp = sc.nextInt();
            total += tmp;
            
            if(max < tmp){
                max = tmp;
            }
        }
        
        if(max >= total - max){
            System.out.println("No");
        }else{
             System.out.println("Yes");
        }
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int a[n];
    int oddnum = 0;
    bool even=true;

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

    while (true)
    {
        for (int i = 0; i < n; i++)
        {
            if (a[i] % 2 == 0)  a[i] /= 2;
            else{
                even = false;
                }
        }
        if(even) oddnum++;
        else{
            break;
        }
    }

    cout << oddnum << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
string s;
int k;
main(){
	cin>>s;
	scanf("%lld",&k);
	int len1=s.length();
	for(int i=0;i<len1;i++){
		if(s[i]=='1'){
			k--;
			if(k==0){
				cout<<1<<endl;
				return 0;
			}
		}else{
			cout<<s[i]<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	cout << 6 - a - b << endl;
	return 0;
}


Measured memory_bytes: 3608
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a=sc.nextLong();
		long b=sc.nextLong();
		
		System.out.println(calcLcm(a,b));
		
		sc.close();
	}
	
	  // 最大公約数を求める。
    static long calcGcd(long m, long n) {
        if (m <= 0 || n <= 0) {
            throw new IllegalArgumentException("Arguments must be 1 and over.");
        }
        if(m < n) {
            long tmp = m;
            m = n;
            n = tmp;
        }
        long remainder = 0;
        while ((remainder = m % n) != 0) {
            m = n;
            n = remainder;
        }
        return n;
    }

    // 最小公倍数を求める。
    static long calcLcm(long m, long n) {
        return m * n / calcGcd(m, n);
    }
}


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

int main() {
  int n , k;
  string s;
  cin >> n >> k >> s;
  if (s.at(k-1)=='A'){
  s.at(k-1)='a';
  }else if (s.at(k-1)=='B'){
  s.at(k-1)='b';
  }else{
  s.at(k-1)='c';
  } cout << s << endl;
}


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

int main() {
  vector<vector<int>> data(3, vector<int>(3));
  for (int i=0; i<3; i++) {
    for (int j=0; j<3; j++) {
      cin >> data.at(i).at(j);
    }
  }
  int flag = 0;
  for (int i=0;i<2;i++) {
    if (data.at(i).at(0) - data.at(i+1).at(0) != data.at(i).at(1) - data.at(i+1).at(1)
        || data.at(i).at(0) - data.at(i+1).at(0) != data.at(i).at(2) - data.at(i+1).at(2)) {
      flag = 1;
    }
  }
  if (!flag) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 764
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]

dp = [[0]*(n + 1) for _ in range(n + 1)]

for i in range(n + 1):
    dp[i][i] = 0

for width in range(1, n + 1):
    for l in range(n + 1):
        r = width + l
        if r <= l or r > n:
            continue
        if (n - (r - l)) % 2 == 0:
            dp[l][r] = max(dp[l + 1][r] + a[l], dp[l][r - 1] + a[r - 1])
        else:
            dp[l][r] = min(dp[l + 1][r] - a[l], dp[l][r - 1] - a[r - 1])

print(dp[0][n])




Measured memory_bytes: 113628
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;


int main(){
	string S; long long K,co=0;
	cin >> S >> K;
	for(int i=0; i<S.size(); i++){
		if(S[i]=='1') co+=1;
		if(K==co){cout << '1' << endl; return 0;}
		if(S[i]!='1'){
			 cout << S[i] << endl;
			 return 0;
		}
	}
	cout << '1' << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	int ans1=a+b;
	int ans2=a-b;
	int ans3=a*b;
	cout<<max(ans1,max(ans2,ans3));
	return 0;
}

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

int main(){
  int N , M , X ; 
  cin >> N >> M >> X ;
  vector<int> B(N) ; 
  
  for(int i=0; i < M ; i++){
    int A ; 
    cin >> A ;
    B.at(A)++ ;  
  }
  int cnt = 0 ; 
  for(int i = 0 ; i < X ; i++){
    if(B.at(i) == 1){
      cnt++ ; 
    }
  }
  
  cout << min(cnt,M-cnt) << endl;
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
    int a,b;char c;
    cin >> a >> c >> b;
    if(c == '+'){
        cout << a + b << endl;

    }
    else{
        cout << a- b << endl;

    }
    return 0;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define ve vector
#define vei vector<int>
#define vep vector<pair<int,int>>
#define vvi vector<vector<int>>
 
typedef long long ll;
const ll INF = LLONG_MAX - 100;
const ll mod = 1e9 + 7;
const int MAX_N = 2e5 + 5;
int dx[] = {-1,0,1,0}, dy[] = {0,1,0,-1};
vector<ll> prime;
 
int fac[MAX_N], inv[MAX_N];
 
template <class T = ll> T in() {T x; cin >> x; return (x);}
void DEBUG(vector<int> a) {for(int i=0;i<a.size();i++){cout<<a[i]<<" ";cout<<endl;}}
ll GCD(ll a, ll b) {ll c; while (b != 0) {c = a % b; a = b; b = c;}return a;}
ll LCM(ll a, ll b) {return a * b / GCD(a, b);}
ll POW(ll a, ll b) {ll c = 1LL; while (b > 0) {if (b & 1LL) {c = a * c%mod;}a = a * a%mod; b >>= 1LL;}return c;}
void _nCr() {fac[0] = 1LL; for (int i = 1LL; i < MAX_N; i++) {fac[i] = fac[i - 1LL] * i%mod;}for (int i = 0; i < MAX_N; i++) {inv[i] = POW(fac[i], mod - 2);}}
ll nCr(ll n, ll r) {return (fac[n] * inv[r] % mod)*inv[n - r] % mod;}
void PRI(ll n) {bool a[n + 1LL]; for (int i = 0; i < n + 1LL; i++) {a[i] = 1LL;}for (int i = 2; i < n + 1LL; i++) {if (a[i]) {prime.pb(i); ll b = i; while (b <= n) {a[b] = 0; b += i;}}}}
template <typename T> T chmin(T& a, T b) {if(a>b)a=b;return a;}
template <typename T> T chmax(T& a, T b) {if(a<b)a=b;return b;}

int b[2005][2005][4];
//上下左右

bool solve() {
	int h,w; cin >> h >> w;
	string s[h];
	REP (i,h) cin >> s[i];
	REP (i,h) {
		int tmp = 0;
		REP (j,w) {
			if (s[i][j] == '.') {
				b[i][j][2] = tmp;
				tmp++;
			} else {
				tmp = 0;
			}
		}
		tmp = 0;
		for (int j = w-1;j >= 0;j--) {
			if (s[i][j] == '.') {
				b[i][j][3] = tmp;
				tmp++;
			} else {
				tmp = 0;
			}
		}
	}
	REP (j,w) {
		int tmp = 0;
		REP (i,h) {
			if (s[i][j] == '.') {
				b[i][j][0] = tmp;
				tmp++;
			} else {
				tmp = 0;
			}
		}
		tmp = 0;
		for (int i = h-1;i >= 0;i--) {
			if (s[i][j] == '.') {
				b[i][j][1] = tmp;
				tmp++;
			} else {
				tmp = 0;
			}
		}
	}
	int ans = 0;
	REP (i,h) {
		REP (j,w) {
			if (s[i][j] == '#') continue;
			ans = max(ans,b[i][j][0]+b[i][j][1]+b[i][j][2]+b[i][j][3]+1);
		}
	}
	cout << ans << endl;
}

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

	solve();
}

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

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

    if((r-l)>2030){
        cout << 0 << endl;
    }

    else{
        vector <long> mod(r-l+1,0);
        for(int i=0; i<r-l+1; i++){
            mod[i] = (l+i)%2019;
        }

        sort(all(mod));

        int ans=4000;

        for(int i=0; i<r-l+1; i++){
            for(int j=0; j<r-l+1; j++){
                if(i!=j){
                    int tmp = (mod[i]*mod[j])%2019;
                    if(tmp < ans){
                        ans = tmp;
                    }
                }
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void)
{
	char c[101][101];
	int h,w,i,j,li=0;
	cin>>h>>w;
	for(i=0;i<h;i++) cin>>c[i];
	for(i=0;i<h;i++){
		for(li=0;li<2;li++){
			for(j=0;j<w;j++){
				cout<<c[i][j];
			}
			cout<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Arrays
import java.util.ArrayList

const val MOD: Long = (1e9+7).toLong()
fun Double.format(digits: Int) = String.format("%.${digits}f", this)

fun main(args: Array<String>) {
    val (r, g, b, n) = readLine()!!.split(" ").map{it.toInt()}

    var res = 0
    for (i in 0..(n/r)) {
        for (j in 0..((n-r*i)/g)) {
            if (n - i - j < 0) break
            if ((n - i*r - j*g) % b == 0) res += 1
        }
    }

    println(res)
}


Measured memory_bytes: 38036
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;

int main(){
    int r,g,b,rgb;
    cin >> r >> g >> b;

    rgb = r*100+g*10+b;
    if(rgb%4 == 0) cout << "YES" << endl;
    else cout << "NO" << endl;


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    ll hp; cin >> hp;
    vector<ll> a(n), b(n);
    for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
    sort(a.begin(), a.end(), greater<ll>());
    sort(b.begin(), b.end(), greater<ll>());
    ll ans = 0, val = a[0];
    for(int i = 0; i < n; i++)
    {
        if(b[i] < val || hp <= 0) break;
        hp -= b[i];
        ans++;
    }
    if(hp > 0) ans += (hp + val - 1) / val;
    cout << ans << endl;
    return 0;
}


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

using namespace std;


int check[200005];
int ans[200005];
int main() {
    int a, x;
    scanf("%d %d", &a, &x);
    int N = 2 * a - 1;
    int mid = a;
    if (N <= x || x <= 1) {
        puts("No");
        return 0;
    }
    ans[mid] = x;
    ans[mid + 1] = x + 1;
    ans[mid - 1] = x - 1;

    if (x == 2) {
        ans[mid + 2] = x + 2;
    } else {
        ans[mid + 2] = x - 2;
    }
    for (int i = 1; i < N + 1; ++i) check[ans[i]] = 1;

    vector<int> r;
    for (int i = 1; i < N + 1; ++i)
        if (!check[i]) r.push_back(i);


    for (int i = 1; i < N + 1; ++i)
        if (!ans[i]) {
            ans[i] = r.back();
            r.pop_back();
        }
#ifdef test
    funct(x_, N, ans);
#endif

    printf("Yes\n");
    for (int i = 1; i < N + 1; ++i) printf("%d\n", ans[i]);


    return 0;
}


Measured memory_bytes: 3188
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007

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

int main()
{
    int w, b;
    cin >> b >> w;
    string s[100];
    string str_black(100, '#');
    string str_white(100, '.');
    for (int i = 0; i < 50; i++)
    {
        s[i] = str_black;
    }
    for (int i = 50; i < 100; i++)
    {
        s[i] = str_white;
    }

    for (int i = 0; i < b - 1; i++)
    {
        int y = (i / 50) * 2;
        int x = (i % 50) * 2;
        s[y][x] = '.';
    }
    for (int i = 0; i < w - 1; i++)
    {
        int y = (i / 50) * 2 + 51;
        int x = (i % 50) * 2;
        s[y][x] = '#';
    }
    cout << 100 << " " << 100 << endl;
    for (int i = 0; i < 100; i++)
    {
        cout << s[i] << endl;
    }
    return 0;
}

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

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(0);
	int n;
	cin>>n;
	char arr[n];
	int i;
	for( i=0;i<n;i++)
	cin>>arr[i];
	int cnt=0;
	for(i=2;i<n;i++){
		if (arr[i]=='C'&& arr[i-1]=='B'&& arr[i-2]=='A'){
			cnt++;
		}
	}
	cout<<cnt<<endl;
	
}


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

int main() {
	int N;
	cin >> N;
	vector<int> h(N);
	for (int i = 0; i < N; i++) {
		cin >> h[i];
	}
	int cnt;
	for (cnt = 0; cnt < 100001; cnt++) {
		for (int i= 0; i < N; i++) {
			if (i == N-1 && h[i] == 0) goto LOOPOUT;
			if (h[i] == 0) continue;
			for (int j = i; j < N; j++) {
				if (h[j]) {
					h[j]--;
				}
				else {
					break;
				}
			}
			break;
		}
	}
LOOPOUT:
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;
static const ll LOGN=55;


ll dp[20][MAX];

int main(void) {
  ll N;
  cin >> N;
  
  
  if(N<1000) {
    pt("ABC");
  }else {
    pt("ABD");
  }
  
  
}






Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}()

func nextString() string {
	sc.Scan()
	return sc.Text()
}

const (
	bad  = "Bad"
	good = "Good"
)

func isDif(s string) bool {
	rs := []rune(s)
	old := rs[0]
	for _, r := range rs[1:] {
		if old == r {
			return true
		}
		old = r
	}
	return false
}

func main() {
	s := nextString()

	if isDif(s) {
		fmt.Println(bad)
	} else {
		fmt.Println(good)
	}
}


Measured memory_bytes: 640