akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int n,a,i,min=1000000,max=-1000000;
	long long sum=0;
	cin>> n;
	for(i=0;i<n;i++){
	cin>> a;
		if(a < min){
			min = a;
		}
		if(a > max){
			max = a;
		}
		sum = sum + a;
	}
	cout<< min<< " "<< max<< " "<< sum<< endl; 
	return 0;
}

Measured memory_bytes: 1164
# coding: utf-8
import sys
from collections import deque

readline = sys.stdin.readline
sr = lambda: readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

# 左からgreedyに
N, D, A = lr()
monsters = []
for _ in range(N):
    x, h = lr()
    monsters.append((x, h))

monsters.sort()
bomb = deque()
answer = 0
attack = 0
for x, h in monsters:
    while bomb:
        if bomb[0][0] + D < x:
            attack -= bomb[0][1]
            bomb.popleft()
        else:
            break
    h -= attack
    if h > 0:
        t = -(-h//A)
        answer += t
        bomb.append((x + D, A * t))
        attack += A * t

print(answer)


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

int main() {
  ll n; cin >> n;
  ll sum = 0;
  rep(i, n){
    ll div = i + 1;
    sum += (div + div*(n/div))*(n/div)/2;
  }
  cout << sum << endl;  
  return 0;
}


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

int main(int argc, char const *argv[]) {
    string s, t;
    cin >> s >> t;

    int ans = 0;
    for (size_t i = 0; i < s.length(); i++) {
        if (s[i] != t[i]) ++ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3888
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;


int main() {
    int64 s;
    cin >> s;

    int64 x2,y2,x3,y3;
    x2 = 1;
    y2 = 1e9;
    x3 = (s+y2-1) / y2;
    y3 = abs(s - y2*x3);

//    cout << abs(x2*y3 - y2*x3) << endl;

    cout << 0 << " " << 0 << " ";
    cout << x2 << " " << y2 << " ";
    cout << x3 << " " << y3 << endl;
}

Measured memory_bytes: 888
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
    int n;
    cin >> n;
    if(n == 1){
        cout << "Hello World" << endl;
    }else{
        int a,b;
        cin >> a >> b;
        cout << a+b << endl;
    }
    
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

long long mod = 1000000007;

string toStr(int n) {
  string s;
  for (int i = 0; i < 3; i++) {
    if (n % 4 == 0) {
      s = 'A' + s;
    } else if (n % 4 == 1) {
      s = 'C' + s;
    } else if (n % 4 == 2) {
      s = 'G' + s;
    } else {
      s = 'T' + s;
    }
    n /= 4;
  }

  return s;
}

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

  vector<vector<long long> > count(N, vector<long long>(64));
  for (int i = 0; i < 64; i++) {
    string s = toStr(i);
    if (s == "AGC" || s == "ACG" || s == "GAC") {
      count[2][i] = 0;
    } else {
      count[2][i] = 1;
    }
  }

  for (int i = 3; i < N; i++) {
    for (int j = 0; j < 64; j++) {
      string s = toStr(j);
      for (int k = 0; k < 64; k++) {
        string ts = toStr(k);
        if (ts[1] == s[0] && ts[2] == s[1]) {
          string temp = ts + s[2];
          if ((temp[0] == 'A' && temp[1] == 'G' && (temp[2] == 'C' || temp[3] == 'C')) ||
              ((temp[0] == 'A' || temp[1] == 'A') && temp[2] == 'G' && temp[3] == 'C') ||
              (temp[0] == 'A' && temp[1] == 'C' && temp[2] == 'G') ||
              (temp[0] == 'G' && temp[1] == 'A' && temp[2] == 'C') ||
              (temp[1] == 'A' && temp[2] == 'C' && temp[3] == 'G') ||
              (temp[1] == 'G' && temp[2] == 'A' && temp[3] == 'C')
             ) {
            continue;
          } else {
            count[i][j] = (count[i][j] + count[i - 1][k]) % mod;
          }
        }
      }
    }
  }

  long long ans = 0;
  for (int i = 0; i < 64; i++) {
    ans = (ans + count[N - 1][i]) % mod;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
#include<bitset>
#include<cstdlib>
// #include<deque>
// #include<multiset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;

int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int n;
  cin >> n;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  vector<ll> x(n);
  // x[i] + x[i+1] = 2 * a[i]

  // x[0] + x[1] = 2 * a[0]
  // x[1] = 2 * a[0] - x[0]
  // x[1] + x[2] = 2 * a[1]
  // ...
  // x[-1] = ... + x[0]
  // x[-1] + x[0] = 2 * a[-1]
  // 2 x[0] = 2 * a[-1] + ...

  ll t = 0;
  for(int i = 0; i < n; i++) {
    // x[i] = t +- x[0]
    // x[i] + x[i+1] = 2 * a[i]
    t = 2 * a[i] - t;
    // x[i+1] = 2 * a[i] - x[i]
  }
  // x[0] = t - x[0]
  // 2 x[0] = t

  x[0] = t / 2;

  // x[i] + x[i+1] = 2 * a[i]
  for(int i = 0; i + 1 < n; i++) {
    x[i+1] = 2 * a[i] - x[i];
  }
  
  for(int i = 0; i < n; i++) cout << x[i] << " \n"[i == n - 1];

  return 0;
}


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

string h[101];

int main() {
    int N, M, D;
    cin >> N >> M >> D;
    rep(i, N) cin >> h[i];

    int ans = 0;
    rep(r, N) rep(c, M) {

        if (c+D-1 < M) {
            bool ok = true;
            for (int d=c; d<c+D; ++d) {
                if (h[r][d] == '#') {
                    ok = false;
                    break;
                }
            }
            if (ok) ans++;
        }
        if (r+D-1 < N) {
            bool ok = true;
            for (int d=r; d<r+D; ++d) {
                if (h[d][c] == '#') {
                    ok = false;
                    break;
                }
            }
            if (ok) ans++;
        }
    }

    cout << ans << endl;
}



Measured memory_bytes: 3204
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            int R = sc.nextInt();

            int ans = R;
            if (N < 10) {
                ans += 100 * (10 - N);
            }

            System.out.println(ans);
        }
    }

}


Measured memory_bytes: 23892
#include<stdio.h>
int main(){
  int motoC,mokuC,kooriS,tokasuS,atatameS;
  scanf("%d%d%d%d%d",&motoC,&mokuC,&kooriS,&tokasuS,&atatameS);
  if(motoC<0){
    printf("%d\n",(motoC*(-1)*kooriS)+tokasuS+atatameS*mokuC);
  }
  else{
    printf("%d\n",(mokuC-motoC)*atatameS);
  }
  return(0);
}


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

using namespace std;
using ll = long long;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;

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


const int mod = 1e9 + 7;

struct node
{
    ll black;
    ll white;
    int depth;
    int parent;
    vector<int> connect;
};

vector<node> nodes;

void dfs(int s, int d)
{
    nodes[s].depth = d;
    for (auto i : nodes[s].connect)
    {
        if (nodes[i].depth == -1)
        {
            nodes[i].parent = s;
            dfs(i, d + 1);
        }
    }
}

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n, a, b, maxd;
    cin >> n;
    vector<int> v;
    vector<vector<int>> depth_list;
    rep(i, n)
    {
        nodes.push_back((node){1, 1, -1, -1, v});
    }
    rep(i, n - 1)
    {
        cin >> a >> b;
        a--, b--;
        nodes[a].connect.push_back(b);
        nodes[b].connect.push_back(a);
    }

    dfs(0, 0);

    maxd = 0;
    rep(i, n)
        maxd = max(maxd, nodes[i].depth);
    depth_list.resize(n);
    rep(i, n)
    {
        depth_list[nodes[i].depth].push_back(i);
    }

    for (int k = maxd; k >= 0; k--)
    {
        for (auto i : depth_list[k])
        {
            if (nodes[i].connect.size() == 0)
            {
                nodes[i].black = 1;
                nodes[i].white = 1;
            }
            if (nodes[i].connect.size() == 1 && nodes[i].parent != -1)
            {
                nodes[i].black = 1;
                nodes[i].white = 1;
            }
            else
            {
                for (auto j : nodes[i].connect)
                {
                    if (j != nodes[i].parent)
                    {
                        nodes[i].black *= nodes[j].white;
                        nodes[i].black %= mod;
                        nodes[i].white *= ( (nodes[j].black + nodes[j].white) % mod );
                        nodes[i].white %= mod;
                    }
                }
            }
        }
    }

    // rep(i, n)
    // {
    //     cout << i + 1 << " " << nodes[i].black << " " << nodes[i].white << endl;
    // }
    cout <<  (nodes[0].black + nodes[0].white) % mod << endl;
    return 0;
}


Measured memory_bytes: 18156
dic = {}
readlines.map(&:chomp).each{|line|
  word, num = line.split
  dic[word] ||= []
  dic[word] << num.to_i
}

dic.map {|k, v|  k, v = k, v.sort.join(" ")}.sort.each{|k, v|
  puts k
  puts v
}

Measured memory_bytes: 8772
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int A,B;
    R(A,B);
    W(max(A,B)>8?":(":"Yay!");
    return 0;
}


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

int main(){
    int x, y;
    
    while(true){
     
        
         
        
     cin >> x >> y;
     if (x == 0 && y == 0)
            break;
        for (int p=0; p<y-1; p++){
        cout << "#" ;
     } 
        cout << "#" << endl;
     for (int q=0; q<x-2; q++){
        cout << "#";
     for (int r=0; r<y-2; r++){
            cout << "." ;
        }
        cout << "#" << endl;
    }
     for (int p=0; p<y-1; p++){
        cout << "#" ;
    } 
        cout << "#" << endl;
    cout << endl;
}return 0;
}


Measured memory_bytes: 3012
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int now = 0;
		int maxv = 0;
		int count = 0;
		for(int i = 0; i < N; i++) {
			int height = sc.nextInt();
			if(height > now) {
				maxv= Math.max(maxv, count);
				count = 0;
			}else {
				count++;
			}
			now = height;
		}
		System.out.println(Math.max(maxv, count));
	}


}

Measured memory_bytes: 48776
#include <iostream>
#include <string>
#include <cstring>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	bool prm[55556];
	vector<int> prime, ans;
	memset(prm, true, sizeof(prm));
	prm[1] = false;
	for (int i = 2; i <= 55555; i++)
	{
		if (prm[i])
		{
			prime.push_back(i);
			for (int j = i + i; j <= 55555; j+=i) prm[j] = false;
		}
	}
	for (int i = 0; i < prime.size(); i++)
	{
		if (prime[i] % 5 == 1) ans.push_back(prime[i]);
		if (ans.size() == n) break;
	}
	for (int i = 0; i < ans.size(); i++)
	{
		if (i != ans.size() - 1) cout << ans[i] << " ";
		else cout << ans[i] << endl;
	}
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define deb(x)  cout << #x << ' ' << x << endl;
#define mod 1000000007
#define all(n)      (n).begin(), (n).end()
#define ll long long
#define ull unsigned long long 
void solve() {
    ll a,b,c,d; cin >> a >>b>>c>>d;
    ll a1,a2,a3,a4;
    a1 = max(a,b)*max(c,d);
    a2 = max(a,b) * min(c,d);
    a3 = min(a,b)*max(c,d);
    a4 = min(a,b) * min(c,d);
    cout << max(a1,max(a2,max(a3,a4))) << endl;
    
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    //Starts here , 
    // Chaaliya Be! Tamam Dekhun!	
                
    int T = 1; 
    // cin >> T;	
    while(T--){
        solve();
    }
    return 0;
            
}

Measured memory_bytes: 3648
import sys

readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))


n  =readint()

h = [2,4,5,7,9]
p = [0,1,6,8]

if n%10 in h:
    print('hon')
elif n%10 in p:
    print('pon')
else:
    print('bon')

Measured memory_bytes: 61740
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

# define INF 0x3f3f3f3f

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define DEBUG(vec) for (auto v : vec) { cout << v << " "; } cout << endl;

using namespace std;

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

  ll x;
  cin >> x;
  ll ans = (x / 11) * 2;
  x %= 11;
  if (x > 6) {
    ans += 2;
  } else if (x > 0) {
    ans++;
  }

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


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>
#include <cstdlib>

using namespace std;

#define int long long

#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 unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); };

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

const int inf = TEN(18) + 10;
const int mod = TEN(9) + 7;

string s[55];
bool visited[55][55];
int dy[4] = {-1,0,1,0};
int dx[4] = {0,-1,0,1};

int done[100110];

signed main()
{
	int n,k;cin>>n>>k;
	vi a(n);
	rep(i, n) cin>>a[i];

	if (k == 1) {
		int ans = inf;

		rep(i, n) chmin(ans, abs(a[i]));

		cout << ans << endl;
		return 0;
	}
	// k >= 2
	int ans = inf;
	rep(i, n - k + 1) {
		// a[i], a[i + k - 1];
		if (a[i] <= 0 and 0 <= a[i + k - 1]) {
			chmin(ans, a[i + k - 1] * 2  + -a[i]);
			chmin(ans, (-a[i]) * 2 + a[i + k - 1]);
		} else if (a[i] >= 0) {
			chmin(ans, a[i + k - 1]);
		} else if (a[i + k - 1] <= 0) {
			chmin(ans, -a[i]);
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 1024
unittest
{
	assert( [ "1" ].parse.expand.solve == "a" );
	assert( [ "2" ].parse.expand.solve == "aa\nab" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	return solve2( n, 0, 0 ).join( "\n" );
}

dchar[][] solve2( long n, long i, long m )
{
	if( n == i ) return [ "".to!( dchar[] ) ];
	
	dchar[][] ss;
	foreach( d; 0L .. m + 1 )
	{
		foreach( t; solve2( n, i + 1, ( d == m ) ? m + 1 : m ) )
		{
			ss ~= cast( dchar )( 'a' + d ) ~ t;
		}
	}
	return ss;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  double ta = 1.0/0.08;
  double tb = 1.0/0.10;
  
  int minA_ans = (int) A*ta+0.999999;
  int maxA_ans = (int) (A+1)*ta - 0.00001;
  int minB_ans = (int) B*tb+0.999999;
  int maxB_ans = (int) (B+1)*tb - 0.00001;

  int min_ans = max(minA_ans, minB_ans);
  int max_ans = min(maxA_ans, maxB_ans);
  int ans = -1;
  if(min_ans <= max_ans) {
    ans = min_ans;
  }
  
  cout << ans << endl;
}

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

int main()
{
    int N;
    cin >> N;
    for(int i = 1; i < 10; i++)
    {
        for(int j = 1; j < 10; j++)
        {
            if(i*j == N)
            {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int a, b, c;

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

	if(a == b && b ==c && c==a){
		printf("Yes\n");
	}else{
		printf("No\n");
	}

	return 0;
}

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

int N, M, D;
vector<string> mat;

bool solve1(int i, int j) {
  for (int k = 0; k < D; ++k) {
    if (mat[i][j + k] == '#') return false;
  }
  return true;
}

bool solve2(int i, int j) {
  for (int k = 0; k < D; ++k) {
    if (mat[i + k][j] == '#') return false;
  }
  return true;
}

int main() {
  cin >> N >> M >> D;
  mat = vector<string>(N);
  for (int i = 0; i < N; ++i) cin >> mat[i];
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < M - D + 1; ++j) {
      if (solve1(i, j)) ++ans;
    }
  }
  for (int i = 0; i < M; ++i) {
    for (int j = 0; j < N - D + 1; ++j) {
      if (solve2(j, i)) ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}



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

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


int main()
{
    int N;
    cin >> N;
    vector<int> t(N+1);
    vector<int> x(N+1);
    vector<int> y(N+1);
    t.at(0) = x.at(0) = y.at(0) = 0;
    rep(i, N)
    {
        cin >> t.at(i + 1) >> x.at(i + 1) >> y.at(i + 1);
    }

    rep(i, N)
    {
        int dist = abs(x.at(i + 1) - x.at(i)) + abs(y.at(i + 1) - y.at(i));
        int dt = t.at(i + 1) - t.at(i);
        if(dt < dist)
        {
            cout << "No" << endl;
            return 0;
        }
        if(dt%2 != dist%2)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
 
#define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0) (__VA_ARGS__)
#define rep_0(i, end) for (int i = 0; i < (end); ++i)
#define rep_1(i, fr, ba) for (int i = (fr); i <= (ba); ++i)
#define overload_rep(arg_0, arg_1, arg_2, name, ...) name
#define all(box) box.begin(), box.end()
 
template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if (lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if (lhs > rhs) { lhs = rhs; return 1; } return 0; }

template <int MODULUS = 1000000007>
struct modulo_int {
private:

  long long value;
  constexpr void normalize() {
    value %= MODULUS;
    if (value < 0) value += MODULUS;
  }

public:

  constexpr modulo_int(const long long& value_ = 0) : value(value_) { normalize(); }
  constexpr modulo_int operator - () const { return modulo_int(MODULUS - value); }
  constexpr modulo_int operator ~ () const { return modulo_int(*this) << (MODULUS - 2); }
  constexpr const long long& operator () () const { return value; }

  constexpr modulo_int operator + (const modulo_int& rhs) const { return modulo_int(*this) += rhs; }
  constexpr modulo_int& operator += (const modulo_int& rhs) {
    if ((value += rhs.value) >= MODULUS) value -= MODULUS;
    return (*this);
  }

  constexpr modulo_int operator - (const modulo_int& rhs) const { return modulo_int(*this) -= rhs; }
  constexpr modulo_int& operator -= (const modulo_int& rhs) {
    if ((value += MODULUS - rhs.value) >= MODULUS) value -= MODULUS;
    return (*this);
  }

  constexpr modulo_int operator * (const modulo_int& rhs) const { return modulo_int(*this) *= rhs; }
  constexpr modulo_int& operator *= (const modulo_int& rhs) {
    (value *= rhs.value) %= MODULUS;
    return (*this);
  }

  constexpr modulo_int operator / (const modulo_int& rhs) const { return modulo_int(*this) /= rhs; }
  constexpr modulo_int& operator /= (const modulo_int& rhs) {
    return (*this) *= ~rhs;
  }

  constexpr modulo_int operator << (const long long& shift) const {
    modulo_int result(1), mult(*this);
    for (long long t = shift; t > 0; t >>= 1) {
      if (t & 1) result *= mult;
      mult *= mult;
    }
    return result;
  }

  friend std::istream& operator >> (std::istream& stream, modulo_int& lhs) {
    stream >> lhs.value;
    lhs.normalize();
    return stream;
  }

  friend std::ostream& operator << (std::ostream& stream, const modulo_int& rhs) {
    return stream << rhs.value;
  }

};

using modint = modulo_int<>;

int main() {

  int N;
  std::cin >> N;
  std::vector<int> C(N);
  rep (i, N) std::cin >> C[i];
  std::sort(all(C));

  modint ans;
  rep (i, N) {
    int x = i, y = N - i - 1;
    modint coeff = (modint(2) << x) * modint(C[i]);
    if (y > 0) ans += coeff * (modint(2) << (y - 1)) * modint(y);
    ans += coeff * (modint(2) << y);
  }

  std::cout << ans * (modint(2) << N) << '\n';
  return 0;

}


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

int main()
{
    long long n, k,sum=0,  arr[2*100005];
    cin >> n>> k;
    for (int i=0; i<n; i++){
        cin >> arr[i];
    }
    sort ( arr, arr+n);
    long long rem = n-k;
    for (int i=0; i<rem; i++){
        sum+=arr[i];
    }
    cout << sum;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  int sum = 1000000000;
    for (int i = 0 ; i < N ; i++){
    int A;
    cin >> A;
    int temp = 0;
    while ( A%2 == 0 ){
      A /= 2;
      temp ++;
    }
    if ( temp < sum ) sum = temp; 
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
import java.util.*;

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

		while(true){
			int N=sc.nextInt(), M=sc.nextInt();
			if(N==0 && M==0) break;

			int[][] tl = new int[N+1][N+1];
			int[][] ts = new int[N+1][N+1];
			for(int i=0;i<M;i++){
				int x = sc.nextInt();
				int y = sc.nextInt();
				int t = sc.nextInt();
				String s = sc.next();

				if(s.equals("S")){
					if(ts[x][y] == 0) ts[x][y] = ts[y][x] = t;
					else ts[x][y] = ts[y][x] = Math.min(ts[x][y],t);
				}
				else{
					if(tl[x][y] == 0) tl[x][y] = tl[y][x] = t;
					else tl[x][y] = tl[y][x] = Math.min(tl[x][y],t);
				}
			}

			int R = sc.nextInt();
			int[] z = new int[R];
			for(int i=0;i<R;i++) z[i] = sc.nextInt();

			int[][] land = floyd(tl);
			int[][] sea = floyd(ts);
			int[][] dp = new int[R+1][N+1];

			for(int[] tmp : dp){
				Arrays.fill(tmp,Integer.MAX_VALUE);
			}

			dp[0][z[0]] = 0;

			for(int i=1;i<R;i++){
				for(int j=1;j<=N;j++){
					if(dp[i-1][j] == Integer.MAX_VALUE) continue;
					if(land[z[i-1]][z[i]] != 0){
						dp[i][j] = Math.min(dp[i][j],dp[i-1][j] + land[z[i-1]][z[i]]);
					}

					for(int k=1;k<=N;k++){
						if(j != k && sea[j][k] != 0 &&
							 (z[i-1] == j || land[z[i-1]][j] != 0) &&
							 (k == z[i] || land[k][z[i]] != 0) ){
							dp[i][k] = Math.min(dp[i][k], dp[i-1][j] + land[z[i-1]][j] + sea[j][k] + land[k][z[i]]);
						}
					}
				}
			}

			int min = Integer.MAX_VALUE;
			for(int x : dp[R-1])
				min = Math.min(min, x);
			System.out.println(min);
		}
	}

	private static int[][] floyd(int[][] map){
		int n = map.length;
		int[][] c = new int[n][n];

		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				c[i][j] = map[i][j];
			}
		}

		for(int k=0;k<n;k++){
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					if(i == j || c[i][k] == 0 || c[k][j] == 0) continue;
					else if(c[i][j] == 0 || c[i][j] > c[i][k] + c[k][j]){
						c[i][j] = c[i][k] + c[k][j];
					}
				}
			}
		}

		return c;
	}
}

Measured memory_bytes: 15000
n=int(input())
A=list(map(int,input().split()))
c=0
loop=True
while(loop):
    for a in A:
        if a%2!=0:
            loop=False
            break
    if loop:
        A = list(map(lambda i:i//2, A))
        c+=1
    else:
        break
print(c)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
#define ll long long
#define vll vector<ll>
#define llin(a) ll a;cin>>a;
#define llin2(a,b) ll a,b;cin>>a>>b; 
#define llin3(a,b,c) ll a,b,c;cin>>a>>b>>c;
// #define vecin(n,v) for(ll i=0;i<n;i++) cin>>v[i];
#define vecout(n,v) for(ll i=0;i<n;i++) cout<<v[i]<<" "; cout<<endl;
#define fr(i,s,n) for(ll i=s;i<n;i++ )
// #define endl "\n "
#define test cout<<"test line"<<endl;
#define pll pair<ll,ll>
#define vpll vector<pll>
#define mod 1000000007
#define endl "\n"
using namespace std;
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
void swapper(ll* a,ll* b) {ll temp=*a;*a=*b;*b=temp;}
using namespace std;
int main(){
	llin(k);
	string str;
	// cin>>k;
	cin>>str;
	ll n=str.length();
	ll i=k;
	if(n<=k){
		cout<<str<<endl;
	}
	else{
		cout<<str.substr(0,k)<<"..."<<endl;
		// while(i<n){
		// 	cout<<".";
		// 	i++;
		// }
		// cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 10005;

int dp[MAX_N][105][2];

inline int add(int x,int y)
{
    return (x + y)%MOD;
}

inline int sub(int x,int y)
{
    return (x+MOD-y)%MOD;
}

inline int mul(int x,int y)
{
    return (ll)x*y%MOD;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n;
    cin >> n;
    dp[0][0][0] = 1;
    int d = len(s);
    rep(i,d){
        int num = (int)(s[i]-'0');
        rep(j,n){
            rep(k,num){
                dp[i+1][(j+k)%n][1] = add(dp[i+1][(j+k)%n][1], add(dp[i][j][0], dp[i][j][1]));
            }
            dp[i+1][(j+num)%n][0] = add(dp[i+1][(j+num)%n][0], dp[i][j][0]);
            dp[i+1][(j+num)%n][1] = add(dp[i+1][(j+num)%n][1], dp[i][j][1]);
            srep(k,num+1,10){
                dp[i+1][(j+k)%n][1] = add(dp[i+1][(j+k)%n][1], dp[i][j][1]);
            }
        }
    }
    cout << sub(add(dp[d][0][0], dp[d][0][1]), 1) << "\n";
    return 0;
}

Measured memory_bytes: 8448
#include <iostream>
#include <vector>
#include <algorithm>

#define MAX_VALUE 10000

using namespace std;

int main()
{
    int ans = MAX_VALUE;
    vector<int> v(5);
    vector<int> num;
    for (int i = 0; i < 5; ++i) num.push_back(i);
    for (auto & elem:v) cin >> elem;

    do {
        int tmp = 0;
        for (int i = 0; i < 5; ++i) {
            while (tmp % 10 != 0) tmp += 1;
            tmp += v[num[i]];
        }
        ans = min(ans, tmp);
    } while(next_permutation(num.begin(), num.end()));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
typedef pair<long long , long long> P;
typedef long long ll;
typedef long long lint;
#define REP(i, n) for(long long (i)=0; (i)<(n); ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
signed main(){
    int A, B; cin>>A>>B;
    if((A+B)%2) cout << "IMPOSSIBLE" <<endl;
    else cout << (A+B)/2 << endl; 
    return 0;
}

Measured memory_bytes: 256
//カタラン数を語らん!w

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144*2
#define REP(a,b) for(long long a = 0;a < b;++a)
vector<int> inputs;
long long ruiseki[400000];
long long ans[400000];
long long cnt[400000];
int main(){
	int n;
	cin >> n;
	REP(i, n) {
		int a;
		cin >> a;
		cnt[a]++;
	}
	REP(i, n) {
		if (cnt[i + 1] != 0) {
			inputs.push_back(cnt[i + 1]);
		}
		cnt[i + 1] = 0;
	}
	REP(i, inputs.size()) {
		cnt[inputs[i]]++;
		ruiseki[inputs[i]] += inputs[i];
	}
	for (int i = 1; i <= n; ++i) {
		ruiseki[i] += ruiseki[i - 1];
		cnt[i] += cnt[i - 1];
	}
	cout << n << endl;
	for (long long i = 2; i <= n; ++i) {
		if (inputs.size() < i) {
			cout << 0 << endl;
		}
		else {
			long long bot = 0;
			long long top = n;
			while (top - bot > 1) {
				long long mid = (top + bot) / 2;
				long long bo = ruiseki[mid] + (cnt[n] - cnt[mid]) * mid;
				if (bo / i >= mid) {
					bot = mid;
				}
				else {
					top = mid;
				}
			}
			cout << bot << endl;
		}
	}
}

Measured memory_bytes: 8560
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        for (int i = 0; i != n; i++) {

            int a = scan.nextInt();
            int b = scan.nextInt();
            int c = scan.nextInt();
            int d;

            if (a < b) {
                d = a;
                a = b;
                b = d;
            }
            if (b < c) {
                d = b;
                b = c;
                c = d;
            }
            if (a < b) {
                d = a;
                a = b;
                b = d;
            }
            if (a * a == b * b + c * c) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }

    }
}



Measured memory_bytes: 33104
#include <algorithm>
#include <climits>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

ll N, K;
ll XS[100010];

int main(int argc, char const *argv[]) {
  cin >> N >> K;
  for (ll i = 0; i < N; ++i)
    cin >> XS[i];

  ll min_l = INT_FAST64_MAX;
  for (int i = 0; i < N - K + 1; ++i) {
    if (XS[K - 1 + i] < 0)
      min_l = min(-XS[i], min_l);
    else if (XS[i] >= 0)
      min_l = min(XS[K - 1 + i], min_l);
    else {
      auto mov = min(-XS[i], XS[K - 1 + i]);
      min_l = min(XS[K - 1 + i] - XS[i] + mov, min_l);
    }
  }
  cout << min_l << endl;
  return 0;
}


Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

namespace AtCorder
{
    class Program
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Enumerable
                .Range(0, n)
                .Select(x => Console.ReadLine())
                .ToArray();

            var regex = new Regex("AB");
            var numOfBegin = 0;
            var numOfEnd = 0;
            var numOfBoth = 0;
            var count = 0;
            foreach (var l in a)
            {
                count += regex.Matches(l).Count;
                var begin = l.StartsWith("B");
                var end = l.EndsWith("A");

                if (begin && end)
                {
                    numOfBoth++;
                }
                else if (begin)
                {
                    numOfBegin++;
                }
                else if (end)
                {
                    numOfEnd++;
                }
            }

            bool hasA = false;
            bool hasB = false;
            if (numOfBoth > 0)
            {
                count += numOfBoth - 1;
                hasA = true;
                hasB = true;
            }

            if (hasA && numOfEnd > 0)
            {
                count++;
                numOfEnd--;
            }

            if (hasB && numOfBegin > 0)
            {
                count++;
                numOfBegin--;
            }

            count += Min(numOfBegin, numOfEnd);

            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 18636
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    char[] s = scanner.next().toCharArray();

    if(s[2] == s[3] && s[4] == s[5]) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 22996
#include<iostream>
using namespace std;
int gcd(int a,int b){
	if(a % b == 0){
		return b;
	}
	return gcd(b,a%b);
}
int main(){
	int a,b;
	cin>>a>>b;
	if(b > a){
		swap(a,b);
	}
	cout<<(long long)a*(long long)b/gcd(a,b);
	return 0;
}

Measured memory_bytes: 256
fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let n: u64 = it.next().unwrap().parse().unwrap();
    let a: u64 = it.next().unwrap().parse().unwrap();
    let b: u64 = it.next().unwrap().parse().unwrap();
    let mut ans = (n / (a + b)) * a;
    ans += std::cmp::min(n % (a + b), a);
    println!("{}", ans);
}

fn main() {
    run();
}

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

using namespace std;

int main() {
  int n,k,v,ans=0;
  cin >> n >> k;
  for(int i=0;i<n;++i) {
	cin >> v;
    if( v >= k ) ++ans;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
int chk(string a, string b)
{
    int c=0,i;
    for(i=0; i<a.size(); i++)
    {
        if(a[i]!=b[i])
            c++;
    }
    return c;
}
int main()
{
    int i, k, j, m ;
    string s, t,temp,x ;
    cin >> s ;
    cin >> t ;
    k=2000;
    m=t.size();
    for(i=0; i<s.size(); i++)
    {
        x=s.substr(i,m);
        if(x.size()==m)
            k=min(k,chk(x,t));
    }
    cout << k ;
    return 0;
}

Measured memory_bytes: 3648
from collections import deque

n, q = map(int, input().split())
ps = [input().split() for _ in range(n)]

que = deque(ps)
time = 0

while que:

    p, rest = que.popleft()

    elapsed = min(q, int(rest))
    time += elapsed
    rest = str(int(rest) - elapsed)

    if int(rest) > 0:
        que.append([p, rest])
    else:
        print(p, time)


Measured memory_bytes: 19888
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    int p,l=0,r=n-1,t=0;
    cin>>p;
    while(l<=r){
      t++;
      int mid=(l+r)/2;
      if(a[mid]==p)break;
      if(a[mid]>p)r=mid-1;
      else l=mid+1;
    }
    cout<<t<<endl;
  }
}

Measured memory_bytes: 2996
#include <bits/stdc++.h>
using namespace std;
int main()
{
 int N, G = 0, P = 0, W = 0, Y = 0;
 string S;

 cin >> N;

for (int i = 0; i< N;i++)
{
    cin >> S;
    
    if (S == "G")
        G = 1;
    if (S == "P")
        P = 1;
    if (S == "W")
        W = 1;
    if (S == "Y")
        Y = 1;
}
    if (G + P + W + Y == 3)
        cout << "Three" << endl;
    else
        cout << "Four" << endl;

    return 0;
}

Measured memory_bytes: 3528
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define fi first
#define se second
#define reset(n,k) memset((n),k,sizeof(n))
#define all(n) n.begin(),n.end()
#define pb push_back
using namespace std;
using ll=long long;
using pii=pair<int,int>;
int main(){
	IOS;
	ll n,a,b;
	cin>>n>>a>>b;
	ll ans = 0;
	ans += (n/(a+b) ) * a;
	n %=(a+b);
	ans += min(a,n);
	cout<<ans<<'\n';


}


Measured memory_bytes: 256
// head{{{
/* vim: set foldmethod=marker ft=cpp: */
#include <iostream>
#include <list>
#pragma GCC optimize("O3")
using namespace std;
// }}}
 
int main() {
    //optimize{{{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //---------}}}

    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: 3568
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] S = new int[n];
		for(int i = 0; i < n; i++) {
			S[i] = scan.nextInt();
		}
		int q = scan.nextInt();
		int[] T = new int[n + q];
		for(int i = 0; i < q; i++) {
			T[i] = scan.nextInt();
		}
		for(int i = 0; i < n; i++) {
			T[q + i] = S[i];
		}

		Set<Integer> C = new HashSet<Integer>();

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < q; j++) {
				if(T[j] == T[q + i]) {
					C.add(j);
				}
			}
		}
		Integer[] afterC = C.toArray(new Integer[0]);
		System.out.println(afterC.length);



	}

}


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

int main(){
  int N; cin >> N;
  int d[110];
  for(int i = 0; i < N; i++) cin >> d[i];
  
  set<int> values; //insert時に重複を取り除く
  for(int i = 0; i < N; i++){
    values.insert(d[i]);
  }
  cout << values.size() << endl;
}

Measured memory_bytes: 256
//ABC - 143
//19 - 10 - 2019
#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define MOD 1000000007

int main() {
	int n;
	cin >> n;
	ll ans = 1;
	string s;
	cin >> s;
	for(int i = 1;i < n;i++){
		if(s[i] == s[i - 1]);
		else
		ans++;
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 512
import copy
H, W, K = map(int, input().split())
C = [[0] * W for i in range(H)]
for i in range(H):
  s = str(input())
  for j in range(W):
    C[i][j] = int(s[j])
  
def delete(mass, s, t):
  #ここでは、mass[s][t]を試す
  mass[s][t] = 0
  #print(mass)
  score = 0#score
  p = -1
  time = -1#何回目の消滅か
  while p < 1:#消せるものがある間
    this = 0
    for i in range(H):
      now = 1
      for j in range(1, W):
        if (mass[i][j] == mass[i][j - 1]) and (mass[i][j] != 0):
          now += 1
        else:
          if now >= K:
            this += 1
            score += (2 ** time) * now * mass[i][j - 1]
            for k in range(j - now, j):
              mass[i][k] = 0
          now = 1
       # print(mass)
      if now >= K:
        this += 1
        score += (2 ** time) * now * mass[i][j - 1]
        for k in range(j - now + 1, j + 1):
          mass[i][k] = 0
    #print(mass)
    if this == 0:
      p += 1
    #落とすところ
    for i in range(1, H + 1):
      for j in range(W):
        if (mass[H - i][j] == 0) and (i != H):
          k = 1
          while (mass[H - i - k][j] == 0) and (k + i < H):
            k += 1
          mass[H - i][j] = mass[H - i - k][j]
          mass[H - i - k][j] = 0
    time += 1
  return score

ans = 0
for i in range(H):
  for j in range(W):
    D = copy.deepcopy(C)
    ans = max(ans, delete(D, i, j))
  
print(ans)
  






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

#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a))

#define SZ(a) (int) a.size()
#define ALL(a) a.begin(),a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const LL INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const int MAX = 1000 * 100 + 47;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios::sync_with_stdio(false); cin.tie(0);
    LL q, h, s, d, n;
    cin >>q >> h >> s >> d >> n;
    s = min(s, 4 * q);
    s = min(s, 2 * h);
    d = min(d, 8 * q);
    d = min(d, 4 * h);
    d = min(d, 2 * s);
    
    LL ans = n * s;
    ans = min(ans, (n / 2) * d + (n % 2) * s);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>

#define x first
#define y second
#define mp make_pair
#define up_b upper_bound
#define low_b lower_bound
#define pii pair<int,int>
#define bit __builtin_popcount
#define all(x) x.begin(),x.end()

typedef long long ll;
typedef long double ld;

using namespace std;

const ll INF=1e18;
const ld EPS=1e-9;
const int inf=1e9;
const int MOD=1e9+7;
const int N=1e6+1;
const int dx[]={0,0,1,-1};
const int dy[]={1,-1,0,0};

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	char a,b;
	cin>>a>>b;
	if(a>b){
		cout<<">";
		return 0;
	}
	if(a<b){
		cout<<"<";
		return 0;
	}
	cout<<"=";
	return 0;
}

Measured memory_bytes: 764
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        int[] a = Read.ints();
        Console.WriteLine((a[0]-1)*(a[1]-1));
    }
    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b)
    {
        return a * b / gcd(a, b);
    }
    public static bool IsPrime(long n)
    {
        if (n < 2) return false;
        if (n == 2) return true;

        for (long i = 2; i < n; i++)
        {
            if (n % i == 0) return false;
        }
        return true;
    }

}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] longs()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }
    public static int Int()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] ints()
    {
        return Console.ReadLine().Split().Select(int.Parse).ToArray();
    }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

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

int main(){
  int n;
  cin >> n;
  map<string, int> mp;
  int cnt = 0;
  set<string> S;
  rep(i,n){
    string s;
    cin >> s;
    S.insert(s);
    mp[s] ++;
    cnt = max(cnt, mp[s]);
  }
  for(auto v : S){
    if(mp[v] == cnt) cout << v << endl;
  }
}


Measured memory_bytes: 34816