akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <bitset>
#include <utility>
#include <assert.h>
using namespace std;
#define rank rankk
#define mp make_pair
#define pb push_back
#define xo(a,b) ((b)&1?(a):0)
#define tm tmp
//#pragma comment(linker, "/STACK:1024000000,1024000000") 
//#define LL ll
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
const int INF=0x3f3f3f3f;
const ll INFF=0x3f3f3f3f3f3f3f3fll;
const int MAX=2e5+10;
//const ll MAXN=2e8;
//const int MAX_N=MAX;
const ll MOD=998244353;
//const long double pi=acos(-1.0);
//const double eps=0.00000001;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<typename T>inline T abs(T a) {return a>0?a:-a;}
template<class T> inline
void read(T& num) {
    bool start=false,neg=false;
    char c;
    num=0;
    while((c=getchar())!=EOF) {
        if(c=='-') start=neg=true;
        else if(c>='0' && c<='9') {
            start=true;
            num=num*10+c-'0';
        } else if(start) break;
    }
    if(neg) num=-num;
}
inline ll powMM(ll a,ll b,ll M){
    ll ret=1;
    a%=M;
//    b%=M;
    while (b){
        if (b&1) ret=ret*a%M;
        b>>=1;
        a=a*a%M;
    }
    return ret;
}
void open()
{
//    freopen("1009.in","r",stdin);
    freopen("out.txt","w",stdout);
}
int n,m;
map<int,int> d;
int tem;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
            scanf("%d",&tem);
            d[tem]++;
    }
    scanf("%d",&m);
    for(int i=1;i<=m;i++)
    {
        scanf("%d",&tem);
        if(d[tem])--d[tem];
        else return 0*printf("NO\n");
    }
    printf("YES\n");
    return 0;
}


Measured memory_bytes: 9600
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# 2*5 の数が末尾の0の数
# nが奇数だと素因数2は出現しないので0
# 偶数の場合のみ考える
# （掛け合わせる数は全て偶数なので（これって理由になってる？））素因数は2よりも5の方が少ない
# 素因数5の数をカウントする
# （2*5で割れる個数）+（2*25で割れる個数）＋... が答え（2をかけているのは偶数前提なので）

def main():
  n=I()

  if n%2!=0:
    return 0

  a=2
  ans=0
  while True:
    a*=5
    if a>n:
      return ans
    ans+=n//a

# main()
print(main())


Measured memory_bytes: 6452
#include <iostream>
#define MAX 100000
#define SENTINEL 2000000000

using namespace std;

struct Card{
    char suit;
    int value;
};

struct Card L[MAX / 2 + 2], R[MAX / 2 + 2];

void merge(struct Card A[], int n, int left, int mid, int right) {
    int i,j,k;
    int n1 = mid -left;
    int n2 = right - mid;
    for (i = 0; i < n1; i++) L[i] = A[left + i];
    for (i = 0; i < n2; i++) R[i] = A[mid + i];
    L[n1].value = R[n2].value = SENTINEL;
    i = j = 0;
    for (k = left; k < right; k++) {
        if (L[i].value <= R[j].value) A[k] = L[i++];
        else A[k] = R[j++];
    }
}

void mergeSort(struct Card A[], int n, int left, int right){
    int mid;
    if (left + 1 < right){
        mid = (left+right)/2;
        mergeSort(A, n, left, mid);
        mergeSort(A, n, mid, right);
        merge(A, n, left, mid, right);
    }
}

int partition(struct Card A[], int n, int p, int r){
    int i, j;
    struct Card t, x;
    x = A[r]; //基準
    i = p - 1;
    //  13 19 9 5 12 8 7
    // 5 19 9 13 12 8 7

    // p = 0, r= 6
    //  x = A[6] = 7
    for(j = p; j < r; j++){
        if (A[j].value <= x.value){
            i++;
            t = A[i];
            A[i] = A[j];
            A[j] = t;
        }
    }
    t = A[i + 1];
    A[i + 1] = A[r];
    A[r] = t;

    // 7 を基準
    // 5 7 19 9 13 12 8

    // i = 1
    // A[1] = 7
    return i+1;
}

void quickSort(struct Card A[], int n, int p, int r){
    int q;
    if (p < r){ //分割したサイズが2以上
        q = partition(A, n, p, r); // ピポットが置かれている配列の要素番号
        quickSort(A, n, p, q-1);
        quickSort(A, n, q+1, r);
    }
}

int main(){
    int n, i, v;
    struct Card A[MAX], B[MAX];
    char S[10];
    int stable = 1;

    cin >> n;

    for (i = 0; i < n; i++){
        cin >> S;
        cin >> v;
        A[i].suit = B[i].suit = S[0];
        A[i].value = B[i].value = v;
    }


    mergeSort(A, n, 0, n); // 安定
    quickSort(B, n, 0, n-1); // 不安定

    for(i = 0; i < n; i++){
        if( A[i].suit != B[i].suit) stable = 0;
    }

    if (stable == 1) cout << "Stable\n";
    else cout << "Not stable\n";
    for ( i = 0; i < n; i++ ) cout << B[i].suit << " " << B[i].value << "\n";

    return 0;
}


Measured memory_bytes: 5324
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
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;
    int A[n + 1];
    for(int i = 0; i < n; i++) cin >> A[i];
    int cnt = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = n - 1; j > 0; j--)
        {
            if(A[j - 1] > A[j])
            {
                swap(A[j], A[j - 1]);
                cnt++;
            }
        }
    }
    for(int i = 0; i < n; i++)
    {
        if(i) cout << " ";
        cout << A[i];
    }
    cout << endl;
    cout << cnt << endl;
    return 0;
}




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


int main() {
	ll N;
	cin >> N;
	vector<pair<ll, ll>>res;
	for (ll i = 1; i*i <= N; ++i) {
		if (N%i == 0) {
			res.push_back({ i,N / i });
		}
	}
	ll ans = 1e15;
	REP(i, res.size()) {
		ans = min(ans, res[i].first + res[i].second - 2);
	}
	cout << ans << endl;
	return 0;
}


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

const int MOD = 1e9 + 7;

long long pow_mod(long long x, int n) {
    long long res = 1;
    while (n) {
        if (n & 1) res = res * x % MOD;
        x = (x * x) % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    int N;  cin >> N;
    map<int, int> mp;
    for (int i = 0; i < N; ++i) {
        int a;  cin >> a;
        ++mp[a];
    }
    for (auto e : mp) {
        if (e.second != 2 && !(N % 2 && !e.first)) {
            cout << 0 << endl;
            return 0;
        }
    }
    cout << pow_mod(2, N / 2) << endl;
}


Measured memory_bytes: 3200
#include <cmath>
#include <iostream>
#include <vector>

#define rep(i, n) for (int i = 0; i < static_cast<int>(n); i++)
using std::cin;
using std::cout;
using std::endl;
using std::vector;

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

  vector<int64_t> weight(N + 1);
  vector<int64_t> value(N + 1);
  vector<vector<int64_t>> dp(N + 1, vector<int64_t>(W + 1, 0));

  for (int i = 0; i < N; i++) cin >> weight[i] >> value[i];

  for (int i = 0; i < N; i++) {
    for (int w = 0; w <= W; w++) {
      if (w < weight[i]) {
        dp[i + 1][w] = dp[i][w];
      } else {
        int64_t selected = dp[i][w - weight[i]] + value[i];
        int64_t not_selected = dp[i][w];
        dp[i + 1][w] = std::max(selected, not_selected);
      }
    }
  }

  cout << dp[N][W] << endl;
}


Measured memory_bytes: 80256
s1, s2, s3 = {1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}
c = set(map(int, input().split()))
if c<=s1 or c<=s2 or c<=s3:
  print("Yes")
else:
  print("No")

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

int main(){
	int n;
	cin>>n;
	int flag;
	long long int m=1e+9+7;
	//素数リストを作る
	vector<int> p;
	for (int i = 2; i <=n; i++) {
		flag=0;
		for (int j = 0; j < p.size(); j++) {
			if (i%p[j]==0) {
				flag=1;
				break;
			}
		}
		if (flag==0) {
			p.push_back(i);
		}
	}
	//答えの計算
	long long int ans=1;
	long long int div;
	long long int nump;
	//素数ごとに個数の計算
	for (int i = 0; i < p.size(); i++) {
		div=p[i];
		nump=0;
		while (n/div>0) {
			nump+=n/div;
			div*=p[i];
		}
		ans*=nump+1;
		ans%=m;
	}
	cout<<ans<<endl;
}

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

int main() {
    int x,t,ans;
    cin >> x >> t;
    ans = x - t;
    if(ans < 0)ans = 0;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define inf 10000000000000007
#define eps 1e-13
#define PI 3.14159265359
#define sp printf(" ")
#define vi vector<int>
#define vl vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pcc pair<char, char>
#define mp make_pair
#define FF first
#define SS second
#define pb(x) push_back(x)
#define sd(x) scanf("%d", &(x))
#define pd(x) printf("%d", (x))
#define pdn(x) printf("%d\n", (x))
#define sld(x) scanf("%ld", &(x))
#define pld(x) printf("%ld", (x))
#define pldn(x) printf("%ld\n", (x))
#define slf(x) scanf("%lf", &(x))
#define plf(x) printf("%.9lf", (x))
#define plfn(x) printf("%.9lf\n", (x))
#define sch(x) scanf("%c", &(x))
#define pch(x) printf("%c", (x))
#define pchn(x) printf("%c\n", (x))
#define gtl(x) getline(cin, (x))
#define flsh fflush(stdout)
#define ios ios::sync_with_stdio(false); cin.tie(0) ; cout.tie(0)
#define endl '\n'
using namespace std;
int tree[1000004];
long long int query(long node, long  start, long  end, long  l, long r){
if(r < start || end < l)return 0;
     if(l <= start and end <= r)
    {return tree[node];}

    int mid = (start + end) / 2;
    if(r<=mid)return query(2*node, start, mid, l, r);
    if(l>=mid+1)return query(2*node+1, mid+1, end, l, r);
    long long int p1 = query(2*node, start, mid, l, r);
    long long int p2 = query(2*node+1, mid+1, end, l, r);

    return (p1+p2);
}
void update(long node,long start,long end,long ind,long val)
{
    if(start==end)
    {
        tree[node]=val;return;
    }
     int mid = (start + end) / 2;
    if(ind<=mid)update(2*node, start, mid, ind, val);
    else  update(2*node+1, mid+1, end, ind, val);
   tree[node] = tree[2*node]+tree[2*node+1];

}
ll a[200004];pll b[200004];
int main()
{
    ll n,k;
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
    {
        cin>>a[i];
        b[i+1].FF=b[i].FF+a[i];
        b[i+1].SS=i+1;
    }
    for(ll i=1;i<=n;i++)b[i+1].FF=b[i+1].FF-(i)*k;
    b[1].FF=0;b[1].SS=1;
    sort(b+1,b+n+2);
    ll ans=0;
    for(int i=1;i<=n+1;i++)
    {
      //  cout<<b[i].FF<<" "<<b[i].SS<<endl;
        ans+=query(1,1,n+1,1,b[i].SS);
        update(1,1,n+1,b[i].SS,1);

    }
    cout<<ans<<endl;









}




Measured memory_bytes: 8448
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.function.BiConsumer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			double n = in.nextDouble();
			double k = in.nextDouble();
			double ans = 0;
			for (int i = 1; i <= n; i++) {
				double tmp = i;
				double count = 0;
				while (tmp < k) {
					tmp = tmp * 2;
					count++;
				}
				ans += (1.0 / n) * Math.pow(0.5, count);
			}
			out.println(String.format("%.9f", ans));
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public char nextChar() {
			return next().charAt(0);
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}
}


Measured memory_bytes: 21460
n = int(input())
d = {}
for i in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
mx = max(d.values())
ans = ['']
for k, v in d.items():
    if v == mx:
        ans.append(k)
ans.sort()
print(*ans, sep='\n')


Measured memory_bytes: 156864
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll ;
typedef double db;
const double pi = 3.141592654;
#define pb         push_back
#define forab(i,a,b)       for(int i=(a);i<=(b);i++)
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)
#define pcase(z,x)     printf("Case %ld: %lld\n",z,x)
#define nw	 "\n"

int main(void)
{
	CIN;
	ll tc,l,k,sum=0,x=0,y,z=0,m=1,n=0,ans=0,cnt=0;
	cin>>n>>m;
	for(ll i=1;i<=1500;i++)
	{
		x=i*.08,y=i*.1;
		if(x==n && y==m)return cout<<i<<nw,0;
	}
	cout<<-1<<nw;
}

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

int main(){
	int a,b;cin>>a>>b;
	cout<<max({a+b,a-b,a*b})<<endl;
}

Measured memory_bytes: 256
n = int(input())
rc, bc = [], []

for i in range(n):
    rc.append(tuple(map(int, input().split())))

for i in range(n):
    bc.append(tuple(map(int, input().split())))

rc.sort(key=lambda tup: tup[0])
bc.sort(key=lambda tup: tup[0])

pairs = 0
for i in bc:
    pair = (200, -1)
    for j in rc:
        if i[0] < j[0]:
            break
        elif i[1] > j[1] > pair[1]:
            pair = j

    if i[0] > pair[0] and i[1] > pair[1]:
        pairs += 1
        rc.remove(pair)

print(pairs)


Measured memory_bytes: 3064
// finish date: 2018/01/20
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define bigmod 1000000007
#define INF 500000000


int main() {
    string S;
    cin >> S;
    if ((S[0] == S[1] && S[1] == S[2]) || (S[1] == S[2] && S[2] == S[3])) cout << "Yes" << endl;
    else cout << "No" << endl;


    return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

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

    ll N;
    cin >> N;
    ll sum = 0;
    vector<ll> A(N), C(N);
    REP(i, N) cin >> A[i];
    REP(i, N){
    	ll tmp;
    	cin >> tmp;
    	sum += tmp;
    }
    REP(i, N-1) cin >> C[i];
    REP(i, N-1) if(A[i+1]==A[i]+1) sum += C[A[i]-1];
    cout << sum << endl;
    return 0;
}

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

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> d;
	for (int i = 1; i*i <= m; i++)
		if (m%i == 0) d.push_back(i);
	int s = d.size();
	while (s--) d.push_back(m / d[s]);
	cout << upper_bound(d.begin(), d.end(), m / n)[-1] << endl;
	return 0;
}


Measured memory_bytes: 256
#import pysnooper
#import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

m,d=map(int,input().split())
ans=0
for month in range(1,m+1):
    for day in range(1,d+1):
        s=str(day)
        if len(s)==1:
            continue
        if int(s[0])>=2 and int(s[1])>=2 and int(s[0])*int(s[1])==month:
            #print(month,day)
            ans+=1
print(ans)

Measured memory_bytes: 3316
package main
import "fmt"
func main(){
    var A, B, K int

    fmt.Scanf("%d %d %d", &A, &B, &K)
    
    n := gcd(A, B)
    
    c := 0
    ans := 0
    
    for i := n; i >= 1; i-- {
        if n % i == 0 {
            c++
        }
        if c == K && ans == 0{
            ans = i
        }
    }
    fmt.Println(ans)
}

func gcd(a, b int) int {
    if b == 0 {
        return a
    }
    return gcd(b, a%b)
}


Measured memory_bytes: 512
#include<stdio.h>
#include<string.h>

#define max(a,b) (a>b?a:b)

int mv[4][2] = {{1,0},{0,1},{-1,0},{0,-1}};
int ori[10][10];
int map[10][10];
int fa[100];
int color[100];

int x,y,tar;

int find(int now){
  if(fa[now]==-1)return now;
  return fa[now] = find(fa[now]);
}

void chkun()
{
  int i,j,k;
  int dx,dy;
  int ta,tb;
  for(i=0;i<x;i++){
    for(j=0;j<y;j++){
      for(k=0;k<2;k++){
        dx = i + mv[k][0];
        dy = j + mv[k][1];
        if(0<=dx && dx<x && 0<=dy && dy<y){
          ta = find(map[dx][dy]), tb = find(map[i][j]);
          if(ta!=tb && color[ta]==color[tb]){
            fa[ta] = tb;
          }
        }
      }
    }
  }
}

int dfs(int a,int b, int c, int d, int e){

    int i,j;

    memset(fa,-1,sizeof(fa));
    int cn = 0;
    int tem,total;

    for(i=0;i<x;i++){
      for(j=0;j<y;j++){
        map[i][j] = cn;
        color[cn] = ori[i][j];
        cn++;
      }
    }
    chkun();

    color[find(map[0][0])] = a;
    chkun();
    color[find(map[0][0])] = b;
    chkun();
    color[find(map[0][0])] = c;
    chkun();
    color[find(map[0][0])] = d;
    chkun();
    color[find(map[0][0])] = e;
    chkun();

    tem = find(map[0][0]);
    if(color[tem]!=tar)return 0;

    total = 0;
    for(i=0;i<x;i++){
      for(j=0;j<y;j++){
        if(find(map[i][j])==tem)total++;
      }
    }
    return total;

}

int main()
{
  int i,j,k,l;
  int ans;
  while(scanf("%d%d%d",&x,&y,&tar)!=EOF){
    if(!(x+y+tar))break;
    for(i=0;i<x;i++){
      for(j=0;j<y;j++){
        scanf("%d",&ori[i][j]);
      }
    }

    ans = 1;
    for(i=1;i<=6;i++){
      for(j=1;j<=6;j++){
        for(k=1;k<=6;k++){
          for(l=1;l<=6;l++){

              ans = max(ans,dfs(i,j,k,l,tar));
          }
        }
      }
    }
    printf("%d\n",ans);
  }
  return 0;
}

Measured memory_bytes: 600
import java.util.*
 
fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val t = mutableListOf<Int>()
    val sorted = mutableListOf<Int>()
    repeat(n) {
        val x = sc.nextInt()
        t.add(x)
        sorted.add(x)
    }
 
    sorted.sortDescending()
 
    for (x in t) {
        if (x == sorted[0]) {
            println(sorted[1])
        } else {
            println(sorted[0])
        }
    }
}

Measured memory_bytes: 99944
/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class Main {
	public static void main (String[] args) {
	    Scanner s=new Scanner(System.in);
	int n=6;
	n-=s.nextInt();
	n-=s.nextInt();
	System.out.println(n);
		}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
const ll INF=(ll)1e18+10;
const double PI=acos(-1);

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; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};



int main() {
    ll H,N; cin>>H>>N;
    ll sum=0ll;
    for (int i = 0; i < N; ++i) {
        int a;
        cin>>a;
        sum+=a;
    }
    cout<<((H<=sum)?"Yes":"No")<<endl;
    return 0;
}


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

typedef long long ll;

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

  int N = (1 << n);
  vector<int> s(N);
  
  for(int i = 0; i < N; i++) cin >> s[i];

  sort(s.begin(),s.end(),greater<ll> ());
  //for(int i = 0; i < N; i++) cout << s[i] << endl;

  vector<int> ans;
  ans.push_back(s[0]);
  s[0] = -1;

  for(int i = 0; i < n; i++) {
      int pos = 0;
    vector<int> p = ans;
    sort(p.begin(),p.end());
    //  for(int l = 0; l < p.size(); l++) cout << p[l] << endl;
    // cout << endl;
 
    while(p.size() && pos < N) {
    
      if(s[pos] == -1) {
	pos++;
	continue;
      }

      if(s[pos] <  p.back()) {
	ans.push_back(s[pos]);
	s[pos] = -1;
	p.pop_back();
      }
      pos++;
    }
    if(p.size() > 0) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}

  
  

  


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

int main(){
	int taro[100], hanako[100];
	int taroTotatl, hanakoTotal;
	int n, m;
	bool isFind;
	int ans;
	int ansTaro, ansHanako;

	while(cin >> n >> m, n || m){
		isFind = false;
		ans = 10000;
		for(int i=0; i < n; i++) cin >> taro[i];
		for(int i=0; i < m; i++) cin >> hanako[i];

		for(int i=0; i < n; i++){
			for(int j=0; j < m; j++){
				taroTotatl = 0;
				hanakoTotal = 0;

				swap(taro[i], hanako[j]);
				for(int k=0; k < n; k++){
					taroTotatl += taro[k];
				}
				for(int k=0; k < m; k++){
					hanakoTotal += hanako[k];
				}
				if(hanakoTotal == taroTotatl){
					ans = min(ans, taro[i]+hanako[j]);
					if(ans == taro[i] + hanako[j]){
						ansTaro = hanako[j];
						ansHanako = taro[i];
					}
					isFind = true;
				}
				swap(taro[i], hanako[j]);
			}
		}
		if(isFind){
			cout << ansTaro << " " << ansHanako << endl;
		}
		else {
			cout << -1 << endl;
		}
	}
}

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

#define F first
#define S second
#define pb push_back
#define ld  double
#define ll long long
#define int long long


using namespace std;

const int MAXN = 301 * 1001;

set < pair < int , int > > s ;

int ans[MAXN] , x[MAXN] , m[MAXN] , w[MAXN] ;

vector<pair<int,int> > v ;

int32_t main()
{
   ios::sync_with_stdio(0);cin.tie(0);
   int n ;
   cin >> n ;
   for(int i = 1 ; i <= n ; i ++ )
   {
       cin >> x[i] ;
       v.push_back({x[i],i});
     //  if(i>1)s.insert({i,i-1}) ;
   }
   sort(v.begin(),v.end()) ;
   for(int i = 0 ; i < n ; i ++ )
   {
      if(v[i].S>1) s.insert({i,v[i].S-1});
       m[v[i].S] = i ;
       w[i] = v[i].S ;
   }
   int pre = 1 ;
   for(auto u : v )
   {
       int ind = u.F , x = u.S ;
       while(1)
       {
           auto it = s.lower_bound(make_pair(m[x],-1)) ;
           if(it==s.end()||it->F!=m[x])
                break ;
           if(pre==ind)
            return cout<<"No",0;
           ans[pre++] = x ;
           int y = it->S ;
           s.erase(it);
           if(y>1)
           s.insert({m[x],y-1}) ;
       }
       while(pre<ind)
       {
           if(!s.size())
            return cout<<"No",0;
           ans[pre++] = w[s.begin()->F] ;
           int y = s.begin()->S ;
           s.erase(s.begin()) ;
           if(y>1)s.insert({m[ans[pre-1]],y-1}) ;
       }
        ans[ind] = x ;
        pre = ind + 1 ;
        m[x] = n + x ;
        w[n+x] = x ;
        if(x<n)s.insert({m[x],n-x});
   }
   while(pre<=n*n)
       {
           if(!s.size())
            return cout<<"No",0;
           ans[pre++] = w[s.begin()->F] ;
           int y = s.begin()->S ;
           s.erase(s.begin()) ;
           if(y>1)s.insert({m[ans[pre-1]],y-1}) ;
       }
   cout<<"Yes\n";
   for(int i = 1 ; i <= n * n ; i ++ )
    cout<<ans[i]<<' ';




}


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

int main(){
     int i, j, k;
     int l, r, d;
     cin >> l >> r >> d;
     int cnt=0;
     for(i=l; i<=r; ++i) if(i%d==0) cnt++;
     cout << cnt << endl;
}


Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <list>
#include <algorithm>
#include <bitset>
#include <string>
#include <cstring>
#include <utility>
#include <stack>
#include <queue>
using namespace std;

#define lli long long int
#define pb push_back
#define M 1000000007

class Comparator
{
public:
    bool operator()(pair<int, int> &p1, pair<int, int> &p2)
    {
        int minVal1 = min(p1.first, p1.second);
        int minVal2 = min(p2.first, p2.second);
        return minVal1 < minVal2;
    }
};

template <typename T>
T maxInThree(T a, T b, T c)
{
    T temp = max(a, b);
    temp = max(temp, c);
    return temp;
}

template <typename T>
T minInThree(T a, T b, T c)
{
    T temp = min(a, b);
    temp = min(temp, c);
    return temp;
}

void solve()
{
    int n;
    cin >> n;
    vector<lli> arr(n);
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    sort(arr.begin(), arr.end(), greater<int>());
    priority_queue<pair<int, int>, vector<pair<int, int>>, Comparator> hique;
    hique.push(make_pair(arr[0], arr[1]));
    hique.push(make_pair(arr[0], arr[1]));
    lli ans = 0;
    ans += arr[0];
    for (int i = 2; i < n; i++)
    {
        pair<int, int> topEl = hique.top();
        hique.pop();
        ans += min(topEl.first, topEl.second);
        hique.push(make_pair(topEl.first, arr[i]));
        hique.push(make_pair(topEl.second, arr[i]));
    }
    cout << ans;
}

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

    solve();

    return 0;
}

Measured memory_bytes: 6896
#include <iostream>
using namespace std;
int main(){
    int n, a;
    cin >> n;
    int m[n];
    for(int i=0;i<n;i++){
        m[i] = 0;
    }
    for(int i=1;i<n;i++){
        cin >> a;
        m[a-1]++;
    }
    for(int i=0;i<n;i++){
        cout << m[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 4404
#include <iostream>
#include <list>
#include <map>

class Pair {
public:
    std::list<long> L;
    std::list<long> R;
};

int main(void) {
    long n, N, A;
    long X, L, R, counter = 0;
    std::map<int, Pair> LR;
    Pair pair;
    
    std::cin >> N;
    
    for(n = 1; n <= N; n++) {
        std::cin >> A;
        L = n + A;
        LR[L].L.push_back(n);
        
        R = n - A;
        
        if(R > 0) {
            LR[R].R.push_back(n);
        }
        
    }
    
    for(auto itr = LR.begin(); itr != LR.end(); itr++) {
        pair = itr -> second;
        counter += pair.L.size() * pair.R.size();
    }
    
    std::cout << counter << std::endl;
    
    
    return 0;
}


Measured memory_bytes: 34656
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF=20000000000;
//setprecision(2) <<

const int MOD = 1000000007;

long long max(long long a,long long b){
	if(a<b)return b;
	else return a;	
}
long long min(long long a,long long b){
	if(a>b)return b;
	else return a;	
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int h,w,a,b;
	cin>>h>>w>>b>>a;
	int ans[h+1][w+1];
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(i<=a && j<=b){
				ans[i][j]=1;
			}else if(a<i && j<=b){
				ans[i][j]=0;
			}else if(i<=a && b<j){
				ans[i][j]=0;
			}else if(a<i && b<j){
				ans[i][j]=1;
			}
		}
	}
	
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			cout<<ans[i][j];
		}
		cout<<endl;
	}
}
	


Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define all(v) v.begin(), v.end()
#define SENTINEL 2000000000
#define NIL -1
using namespace std;
typedef long long ll;

const ll MAX = 510000;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>inline bool chmin(T &a, T b){if(a > b){a = b;return true;}return false;}
template <class T>inline bool chmax(T &a, T b){if(a < b){a = b;return true;}return false;}

int main()
{
    string s,t;
    cin >> s >> t;
    int ans=10000000;
    REP(i,s.size()-t.size()+1){
        int tmp=0;
        REP(j,t.size()){
            if(i+j>=s.size()){
                break;
            }
            if(t[j]!=s[i+j]){
                tmp++;
            }
        }
        chmin(ans,tmp);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3628
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int sx = Integer.parseInt(sc.next());
		int sy = Integer.parseInt(sc.next());
		int tx = Integer.parseInt(sc.next());
		int ty = Integer.parseInt(sc.next());
		
		String route = "";
		
		for(int i = 0; i < ty - sy; i++) route += "U";
		for(int i = 0; i < tx - sx; i++) route += "R";
		
		for(int i = 0; i < ty - sy; i++) route += "D";
		for(int i = 0; i < tx - sx; i++) route += "L";
		
		route += "L";
		for(int i = 0; i <= ty - sy; i++) route += "U";
		for(int i = 0; i <= tx - sx; i++) route += "R";
		route += "D";
		
		route += "R";
		for(int i = 0; i <= ty - sy; i++) route += "D";
		for(int i = 0; i <= tx - sx; i++) route += "L";
		route += "U";
		
		System.out.println(route);
	}
}

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

using namespace std;

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

    long long n;
    cin >> n;
    int ans = 0;
    int div = 2;
    while(n > 1 && div * 1LL * div <= n)
    {
        int cur = 0;
        int next = 1;
        while(n % div == 0)
        {
            cur++;
            if(cur == next)
            {
                cur = 0;
                next++;
            }
            n /= div;
        }
        div++;
        ans += next - 1;
    }
    if(n > 1)
        ans++;
    cout << ans;

    return 0;
}


Measured memory_bytes: 3644
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int N,M,i,j=0,x;
    int a[200];
    float y;
    cin>>N>>M;
    for(i=0;i<N;i++)
    {
        cin>>a[i];
        j=j+a[i];
    }
    sort(a, a+N);
    x=a[N-M];
    y=((1*1.0)/(4*1.0*M))*j;
    if(y>x)
    {
        cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
    }
    return 0;
}


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

using Graph = vector<vector<int>>;

int ci[200001];
long long ans[200001];
long long cnt;

void dfs(const Graph &G, int v, int p) {
    cnt += ci[v];
    for (auto nv : G[v]) {
        if (nv == p) continue;
        dfs(G, nv, v);
    }
    ans[v] += cnt;
    cnt -= ci[v];
}

int main() {
    int N, Q; cin >> N >> Q;
    Graph G(N);
    for (int i = 0; i < N-1; ++i) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 0; i < Q; i++){
        int p, x;
        cin >> p >> x;
        p--;
        ci[p] += x;
    }
    cnt = 0;
    dfs(G, 0, -1);
    for (int v = 0; v < N; ++v) {
        cout << ans[v] << " ";
    }
    cout << endl;
    return 0;
}

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

const int N = 10005;
const int D = 105;
const int mod = 1e9 + 7;

void add(int &x,int y) {
	x += y; if (x >= mod) x -= mod;
}

int n, d;
char s[N];
int f[N][D][2][2];

#define go(i, l, r) for (int i = l; i <= r; ++i)

int main() {
	scanf("%s %d", s + 1, &d);
	int n = strlen(s + 1);
	f[0][0][0][1] = 1;
	go(i, 1, n) go(sm, 0, d) go(sml, 0, 1) go(z, 0, 1) {
		int ft = f[i - 1][sm][sml][z];
		if (ft == 0) {
			continue;
		}
		int mx = 9;
		if (!sml) mx = s[i] - '0';
		go(nxt, 0, mx) {
			int nsm = (sm + nxt) % d;
			int nsml = (sml || (nxt < (s[i] - '0')));
			int nz = (z && (nxt == 0));
			add(f[i][nsm][nsml][nz], ft);
		}
	} 
	printf("%d\n", (f[n][0][0][0] + f[n][0][1][0]) % mod);
}

Measured memory_bytes: 16640
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef pair<int,int> P;

int main() {
  int h,w,n;
  cin >> h >> w >> n;
  P a[n];
  for(int i=0; i<n; i++) cin >> a[i].F >> a[i].S;
  int ans=1<<30;
  for(int k=0; k<2; k++) {
    sort(a,a+n);
    int d[n+1];
    for(int i=0; i<n; i++) d[i]=a[i].S;
    d[n]=0;
    for(int i=n-1; i>=0; i--) d[i]=max(d[i],d[i+1]);
    for(int i=0; i<n; i++) ans=min(ans,a[i].F+d[i+1]);
    for(int i=0; i<n; i++) swap(a[i].F,a[i].S);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4256
def Z_algorithm(s):
    n = len(s)
    Z = [0] * n  # z[i] = sum(s[0::n - i], s[i::n])
    Z[0] = n
    i, j = 1, 0
    while i < n:
        # 共通部分を見つけるパート
        while i + j < n and s[j] == s[i + j]:
            j += 1
        Z[i] = j

        if j == 0:
            i += 1
            continue
        # 計算の再利用パート
        # k + Z[k] < j なら再利用できる
        k = 1
        while k < j and k + Z[k] < j:
            Z[i + k] = Z[k]
            k += 1
        # k個先まで見たのでk個先にバトンを渡す
        i += k
        j -= k
    return Z


def solve(k):
    a = Z_algorithm(s[k:])
    ans = 0
    for i in range(n - k):
        ans = max(ans, min(i, a[i]))
    return ans


n, s = int(input()), input()
print(max(solve(i) for i in range(n)))


Measured memory_bytes: 77704
#include    <iostream>
#include    <string>

using namespace std;

int main() {
    while(1) {
        int H, W;

        cin >> H >> W;
        if(H == 0 && W == 0) break;
        
        const string base(W,'#');
        for(int i = 0; i < H; i++)
            cout << base << endl;
        cout << endl;
    }
    return 0;
}


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

using namespace std;

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

using ll = long long;
using ld = long double;

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

int n, m, q;
int res = 0;
vector<int> a, b, c, d;
void dfs(vector<int> v) {
    if (v.size() == n) {
        int tmp = 0;
        rep (i, q) {
            if (v[b[i]] - v[a[i]] == c[i]) tmp += d[i];
        }
        res = max(res, tmp);
        return;
    }
    FOR (i, 1, m + 1) {
        if (v.size() != 0 && v.back() > i) continue;
        v.push_back(i);
        dfs(v);
        v.pop_back();
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    cin >> n >> m >> q;
    a.resize(q), b.resize(q), c.resize(q), d.resize(q);
    rep (i, q) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--, b[i]--;
    }
    vector<int> x;
    dfs(x);
    cout << res << endl;
    
    return 0;
}



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

#define MAXN 105
#define int long long
#define LL long long
#define pii pair<int, int>
#define fi first
#define se second
#define fastio ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

using namespace std;

int N, K;
int a[105];
int dp[MAXN][100005];
int sum[MAXN][100005];
int mod = 1e9+7;

signed main() {
    cin >> N >> K;
    dp[0][0] = 1;
    for (int j = 0; j <= K; j++) sum[0][j] = 1;
    for (int i = 1; i <= N; i++) cin >> a[i];
    for (int i = 1; i <= N; i++) {
        for (int j = 0; j <= K; j++) {
            dp[i][j] = (dp[i][j] + sum[i-1][j] - (j-a[i]-1 >= 0 ? sum[i-1][j-a[i]-1] : 0) + mod) % mod;
            sum[i][j] = ((j-1 >= 0 ? sum[i][j-1] : 0) + dp[i][j]) % mod;
        }
    }
    cout << dp[N][K] << endl;
    return 0;
}

Measured memory_bytes: 160000
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>

using namespace std;

int main(){
  string s, t;
  cin >> s >> t;
  int len = s.length();
  char stmp, ttmp;
  vector<int> scount(26, 0);
  vector<int> tcount(26, 0);
  bool ans = true;

  for(int i = 0; i < len; ++i){
    scount.at(s.at(i) - 'a')+= 1;
  }

  for(int i = 0; i < len; ++i){
    tcount.at(t.at(i) - 'a')+= 1;
  }
  sort(scount.begin(), scount.end());
  sort(tcount.begin(), tcount.end());

  for(int i = 0; i < 26; ++i){
    if(scount.at(i) != tcount.at(i)){
      ans = false;
    }
  }

  if(ans){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }




}


Measured memory_bytes: 776
n=int(input())
m=int(input())
ans=[0]*n
a=list(map(int,input().split()))
for i in range(m):
	cnt=0
	b=list(map(int,input().split()))
	for j in range(n):
		if b[j]==a[i]:
			ans[j]+=1
		else:
			cnt+=1
	ans[a[i]-1]+=cnt
for i in range(n):
	print(ans[i])




Measured memory_bytes: 5624
#include <iostream>

using namespace std;

int main()
{
    int a,b,c,d,sum1,sum2;
    cin>>a>>b>>c>>d;
    sum1=a+b;
    sum2=c+d;
    if(sum1==sum2)
    {
        cout<<"Balanced";
    }
    else if(sum1>sum2)
    {
        cout<<"Left";
    }
    else if(sum1<sum2)
    {
        cout<<"Right";
    }
}

Measured memory_bytes: 3600
function Main(input){
	input=input.split(/\n|\s/);
	input.pop();
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	function ArraySortNumeric(prev,next){return prev-next;}
	var a=0;
	input.sort(ArraySortNumeric);
	
	while(input[0]+2<=input[2]){input[0]+=2;a++;}
	while(input[1]+2<=input[2]){input[1]+=2;a++;}
	input.sort(ArraySortNumeric);
	if(input[0]==input[2]){}
	else if(input[0]==input[1]){a++;}
	else{a+=2;}
	
	console.log(a);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
#include <stdio.h>
int main (void)
{
  char S[11];
  int cnt=0,i,max=0;
  
  scanf("%s",S);
  for(i=0;i<=10;i++){
 	 if(S[i]=='A'||S[i]=='T'||S[i]=='C'||S[i]=='G')
       cnt++;
     else{
       if(max<cnt)
         max=cnt;
       cnt=0;
     }
  }
  
  printf("%d",max);
  
  return 0;
}

Measured memory_bytes: 128
#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 mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,pair<ll,ll> >
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 100009;
ll a,b;
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>a>>b;
    cout<<((a&1 and b&1) ? "Odd" : "Even"); 
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 200000
 
int main()
{
  int FX[N],i,num,mim,max;
 
  scanf("%d",&num);
  for(i=0;i<num;i++){
    scanf("%d",&FX[i]);
  }
 
  max=FX[1]-FX[0];
  mim=FX[0];
 
  for(i=1;i<num;i++){
    max=(max>FX[i]-mim)? max :FX[i]-mim;
    mim=(mim<FX[i])? mim :FX[i];
  }
 
  printf("%d\n",max);
  return 0;
}

Measured memory_bytes: 1376
#include<algorithm>
#include<cassert>
#include<climits>
#include<cmath>
#include<cstring>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;

#define REP(i, x, n) for(int i = (x), i##_len = int(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = int(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = int(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = int(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = int(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << endl

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-8;

const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

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

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

void dfs(int v, int& t, vector<int>& d, vector<int>& f, const vector< vector<int> >& g){
    d[v] = t++;

    for(auto to : g[v]){
        if(d[to] < 0){
            dfs(to, t, d, f, g);
        }
    }

    f[v] = t++;

    return;
}

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

    int n;
    cin >> n;

    vector< vector<int> > g(n);
    rep(i, n){
        int u, k;
        cin >> u >> k;
        --u;
        rep(j, k){
            int v;
            cin >> v;
            g[u].emplace_back(--v);
        }
    }

    int t = 1;
    vector<int> d(n, -1), f(n, -1);
    rep(i, n){
        if(d[i] < 0){
            dfs(i, t, d, f, g);
        }
    }

    rep(i, n){
        cout << i + 1 << " " << d[i] << " " << f[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 3176
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		long n = saori.saori_hayami();
		long ans =  n*(n+1)/2 - n;
		System.out.println(ans);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 24532
#include<iostream>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,d;
    cin>>n>>d;
    ll cnt=0;
    while(n--)
    {
        ll x,y;
        cin>>x>>y;
        ll f=x*x+y*y;
        ll g=d*d;
        if(f<=g)
        {
            cnt++;
        }

    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 3644