akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

signed main()
{
    int n;
    cin >> n;
    vector<string> v;
    for (int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        v.push_back(s);
    }
    map<string, int> m;
    for (auto &&x : v)
    {
        m[x]++;
    }
    int sum = 0;
    for (auto &&p : m)
    {
        if (p.second > 1)
            sum += p.second * (p.second - 1) / 2;
    }
    cout << sum << "\n";
}

Measured memory_bytes: 12020
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			List<Integer> inputList = Arrays.asList(sc.nextLine().split(" ")).stream().map(Integer::parseInt).collect(Collectors.toList());
			if(inputList.get(0)%2 != 0 && inputList.get(1)%2 != 0 ) {
				System.out.println("Odd");
			}else {
				System.out.println("Even");
			}
		}

	}
}


Measured memory_bytes: 27860
import java.util.*;

class Main{
    public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
 
        int N = sc.nextInt();
        long[] A = new long[N];
        long mod = 1000000007;

        for(int i=0; i<N; i++){
            A[i] = sc.nextLong();
        }
        long ans = 0;
        for(int i=0; i<60; i++){
            long c = 0;
            for(int j=0; j<N; j++){
                if(((A[j]>>>i) & 1)==1){
                    c += 1;
                }
            }
            long d = (c * (N - c)) % mod;
            for(int j=0; j<i; j++){
                d = (d<<1) % mod;
            }
            ans += d;
            ans = ans % mod;
        }
        System.out.println(ans);
    }
}

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;
const int mod = 1e9 + 7;

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

    for (int i = 0; i < n; ++i) {
        if (i == n-1) cout << (res ^ a[i]) << endl;
        else cout << (res ^ a[i]) << " ";
    }
}

Measured memory_bytes: 4044
#include<stdio.h>
int main(void) {
	int d, l, n = 0;
	scanf("%d %d", &d, &l);
	while (d>0) {
		if (d>= l) {
			d -= l;
			n += 1;
		}
		else {
			d -= 1;
			n += 1;
		}
	
	}
	printf("%d\n", n);

	return 0;
}


Measured memory_bytes: 2056
import java.util.Scanner;
 
class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String S = sc.next();
        long r = 0 ,g = 0, b = 0;
        sc.close();
        
        for(int i = 0; i < N; i++) {
        	if(S.charAt(i) == 'R') {
        		r++;
        	}
        	if(S.charAt(i) == 'G') {
        		    g++;
        	}
        	if(S.charAt(i) == 'B') {
        		b++;
        	}
        }
        
        long ans = r * g * b;
        for(int i = 0; i < N - 2; i++ ) {
            for(int j = i + 1; j < N-1 ; j ++ ) {
            	int k = 2 * j - i;
            	if(k > N-1) break;
            	if(S.charAt(i) != S.charAt(j) && 
            		S.charAt(j) != S.charAt(k) &&
            		S.charAt(k) != S.charAt(i)){
            			ans --;
            		}
            }
        }
        
       
        
        System.out.println(ans);
        
	}
}

 

Measured memory_bytes: 37948
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>
#include <fstream>
#include <cassert>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

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

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

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

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

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	int n; cin >> n;
	int res = 0;
	for (int a = 1; a <= n; ++a)
	{
		for (int b = 1; a*b < n; ++b)
		{
			if (a*b != n)
			{
				++res;
			}
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 3640
#!/usr/bin/env python
# coding: utf-8

from collections import Counter
def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()

    dic = Counter()
    ans = 0
    for i in range(n):
        s = input()
        ss = "".join(sorted(s))
        dic[ss] += 1
        ans += dic[ss]-1
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 18136
import java.util.*;
import java.lang.StringBuilder;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		String[] st = sc.nextLine().split(" ");
		int h = Integer.parseInt(st[0]);
		int w = Integer.parseInt(st[1]);
		int[][] a = new int[h][w];
		int[] b = new int[w];
		int[] c = new int[h];
		for(int i = 0;i < h;i++){
			st = sc.nextLine().split(" ");
			for(int o = 0;o < w;o++){
				a[i][o] = Integer.parseInt(st[o]);
			}
		}
		for(int i = 0;i < w;i++){
			b[i] = sc.nextInt();
		}
		for(int i = 0;i < h;i++){
			for(int o = 0;o < w;o++){
				c[i] += a[i][o] * b[o];
			}
		}
		for(int i:c){
			System.out.println(i);
		}
	}
}

Measured memory_bytes: 29768
#include<bits/stdc++.h>
using namespace std;
long long ans;
string s;
long long a[50];
int rt,rtl;
int l;
int pow(int a,int b){
	if(b==0)return 1;
	long long  sum=1;
	for(int i=1;i<=b;i++ ){
		sum*=a;
	}
	return sum;
}
int main(){
	cin>>s;
	l=s.length();
	a[0]=pow(2,l-1);
	rtl=0;
	while (rtl<l){
		for(int i=0;i<=rtl;i++){
			ans+=pow(10,i)*a[i]*(s[l-rtl-1]-'0');
		}
		a[rtl]/=2;
		rtl++;
		a[rtl]=a[rtl-1];
	}
	printf("%lld",ans);
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;

int main() {
    ll n; cin >> n;
    int N = sqrt(n);
    string ns = to_string(n);
    int ans = ns.size();
    rep1(i,N+1){
        if(n % i == 0){
            int b = n / i;
            string nb = to_string(b);
            int nbsize = nb.size();
            ans = min(ans,nbsize);
        }else{
            continue;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
//close stdin
//https://codeforces.com/problemset?order=BY_RATING_ASC&tags=binary+search%2C1300-
#include <bits/stdc++.h>
using namespace std;


int main(){
	//freopen ("t.txt","r",stdin);
	int n;
	scanf("%d",&n);
	vector<int> arr(n),cost(n,INT_MAX);

	for(int i=0;i<n;i++)
		cin>>arr[i];

	cost[0]=0;
    
	for(int i=0;i<n-1;i++){
		if(i==n-2){
			cost[i+1]=min(cost[i+1],abs(arr[i]-arr[i+1])+cost[i]);
			continue;
		}
		cost[i+1]=min(cost[i+1],abs(arr[i]-arr[i+1])+cost[i]);
		cost[i+2]=min(cost[i+2],abs(arr[i]-arr[i+2])+cost[i]);
	
	}
	cout<<cost[n-1];
	



return 0;
}


Measured memory_bytes: 1024
/*
Problem:Integers on a tree 
Algorithm:DFS
Status:
*/

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <utility>
#include <list>
#include <ctime>
#include <memory.h>
#include <stack>
#include <stdio.h>
#include <string.h>

using namespace std;

const int INF=1e9;

int a[100005];
vector<int> nei[100005];
int n,k;
int l[100005],r[100005];

void shit(){
	cout<<"No"<<endl;
	exit(0);
}

void make(int x,int p){
	for(int i=0;i<nei[x].size();i++){
		if(nei[x][i]==p)continue;
		if(a[nei[x][i]]==-1){
			if(l[nei[x][i]]<=a[x]-1&&a[x]-1<=r[nei[x][i]]){
				a[nei[x][i]]=a[x]-1;
			}
			else{
				a[nei[x][i]]=a[x]+1;
			}
		}
		make(nei[x][i],x);
	}
}

void dfs(int x,int p){
	if(a[x]!=-1){
		l[x]=r[x]=a[x];
	}
	for(int i=0;i<nei[x].size();i++){
		if(nei[x][i]==p)continue;
		dfs(nei[x][i],x);
		
		if(l[nei[x][i]]<-INF/2)continue; 
		if(l[x]<-INF/2){
			l[x]=l[nei[x][i]]-1;
			r[x]=r[nei[x][i]]+1;
			continue; 
		}
		
		if(abs(l[x])%2==abs(l[nei[x][i]])%2){
			shit();
		}
		
		l[x]=max(l[x],l[nei[x][i]]-1);
		r[x]=min(r[x],r[nei[x][i]]+1);
	}
	if(l[x]>r[x]){
		shit();
	}
}

int main()
{
	#ifndef ZZZYT
		//freopen(".in","r",stdin);
		//freopen(".out","w",stdout);
	#endif
	
	for(int i=0;i<100000;i++){
		a[i]=-1;
		l[i]=-INF-1;
		r[i]=INF+1;
	}
	
	scanf("%d",&n);
	for(int i=0;i<n-1;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		x--;y--;
		nei[x].push_back(y);
		nei[y].push_back(x);
	}
	scanf("%d",&k);
	for(int i=0;i<k;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		x--;
		a[x]=y;
	}
	
	dfs(0,-1);
	
	if(a[0]==-1){
		a[0]=l[0];
	}
	make(0,-1);
	
	cout<<"Yes"<<endl;
	for(int i=0;i<n;i++){
		cout<<a[i]<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 15488
from math import sqrt, ceil
K = int(input())
 
if K <= 500:
    print(K)
    for i in range(K):
        Cout = [i+1 for n in range(K)]
        print(" ".join(map(str, Cout)))
else:
    lim = int(sqrt(K))
    for i in range(2, lim+1):
        if K % (i**2) == 0:
            print(K//i)
            for n in range(K//i):
                Cout = [i * n + (mod % i) + 1 for mod in range(K//i)]
                print(" ".join(map(str, Cout)))
            break
    else:
        n = 2 * ceil(K/4)
        print(n)
        for raw in range(n):
            if raw % 2 == 0:
                Cout = [(raw + c) % n + 1 for c in range(n)]
            else:
                Cout = [n + 1 + (raw + c) % n for c in range(n)]
                for i in range(n):
                    if Cout[i] > K: Cout[i] -= n
            print(" ".join(map(str, Cout)))

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

const int MAX = 410;
int64_t dp[MAX][MAX];
int vec[MAX];
int64_t sum[MAX][MAX];
int64_t INF = 1e18;

int64_t calc(int l, int r){
  if(dp[l][r] != -1){
    return dp[l][r];
  }
  else if(l == r){
    dp[l][r] = 0;
    return dp[l][r];
  }
  else if(r - l == 1){
    dp[l][r] = vec[l] + vec[r];
    return dp[l][r];
  }
  else{
    int64_t cost = INF;
    for(int i=0; i<r-l; i++){
      cost = min(cost, calc(l,l+i) + calc(l+i+1,r) + sum[l][l+i] + sum[l+i+1][r]);
    }
    dp[l][r] = cost;
    return dp[l][r];
  }
}

int main(){
  int N;
  cin >> N;
  for(int i=0; i<N; i++){
    cin >> vec[i];
  }
  for(int i=0; i<N; i++){
    sum[0][i] = vec[i];
    if(i != 0){
      sum[0][i] += sum[0][i-1];
    }
  }
  for(int i=1; i<N; i++){
    for(int j=i; j<N; j++){
      sum[i][j] = sum[0][j] - sum[0][i-1];
    }
  }
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      dp[i][j] = -1;
    }
  }
  cout << calc(0,N-1) << endl;
}

Measured memory_bytes: 2816
def main():
    import sys
    from collections import deque
    input = sys.stdin.buffer.readline


    def bfs(v):
        dist = [f_inf for _ in range(n)]
        dist[v] = 0
        q = deque()
        q.append(v)
        while q:
            u = q.popleft()
            for nv in tree[u]:
                if dist[nv] == f_inf:
                    dist[nv] = dist[u] + 1
                    q.append(nv)
        for d in dist:
            res[d] += 1


    n, x, y = map(int, input().split())

    tree = [[] for _ in range(n)]
    for i in range(n - 1):
        tree[i].append(i + 1)
        tree[i + 1].append(i)
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

    f_inf = float("inf")
    res = [0 for _ in range(n)]
    for i in range(n):
        bfs(i)

    for i in range(1, n):
        print(res[i] // 2)

if __name__ == '__main__':
    main()


Measured memory_bytes: 4208
N=int(input())
d={}
for i in range(N):
  tmp = input()
  if tmp in d:
    d[tmp] += 1
  else:
    d[tmp] = 1

max_v=max(d.values())
ans=list(filter(lambda x: x[1] == max_v, d.items()))
[print(i[0]) for i in sorted(ans)]

Measured memory_bytes: 46932
//Wrong answer on test inf.
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define inf 1000000001
#define y1 y1___
using namespace std;
ll read(){
	char ch=getchar();ll x=0;int op=1;
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') op=-1;
	for (;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
void solve(){
	ll a=read(),b=read(),c=read(),d=read();
	if (a<b){puts("No");return;}
	if (d<b){puts("No");return;}
	if (b<c){puts("Yes");return;}
	if (a%b>c){puts("No");return;}
	// if (b-1<c+1){puts("Yes");return;}
	a%=b;c-=a;
	ll x=__gcd(b,d);b--;b-=a;
	// cerr<<b<<' '<<c+1<<'\n';
	if (b/x-c/x>0) puts("No");else puts("Yes");
}
int main(){
	int T=read();while (T--) solve();
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>
#include <string>
#include <bitset>
#include <functional>
#include <iomanip>

using namespace std;
using lint = long long;
using vi = vector<int>;
using vl = vector<int>;
using pii = pair<int, int>;
using pll = pair<lint, lint>;
using pqi = priority_queue<int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rep2(i, s, n) for (int i = (s); i < (n); i++)
#define mp(x, y) make_pair((x), (y))
#define all(x) (x).begin(), (x).end()
#define foreach(it, x) for (auto it = (x).begin(); it != (x).end(); it++)
#define space (char)0x20

constexpr lint MOD = 1e9 + 7;
int A, B, C, D, E, F, G, H, I, J, K, L, M, N;
int O, P, Q, R, S, T, U, V, W, X, Y, Z;
// string s;

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

	cin >> N >> M;
    int ac = 0;
    int wa = 0;
    vector<bool> status(N, false);
    vector<int> penalty(N+1, 0);
    rep(i, M) {
        int f; string s;
        cin >> f >> s;
        if (s == "AC") {
            if (!status[f]) {
                status[f] = true;
                ac += 1;
                wa += penalty[f];
            }
        } else {
            penalty[f]++;
        }
    }

    cout << ac << space << wa << endl;
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<vs> vvs;

typedef vector<pair<int, int>> vpi;
typedef vector<pair<ll, ll>> vpl;
typedef vector<tuple<int, int, int>> vti;

string judge(int s){
    if (s <= 12 && s > 0){
        return "both";
    }else{
        return "year";
    }
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int s;
    cin >> s;
    int l = s / 100;
    int r = s % 100;
    
    string l_res = judge(l);
    string r_res = judge(r);
    
    string ans = "NA";
    if (l_res == "year" && r_res == "both"){
        ans = "YYMM";
    } else if (l_res == "both" && r_res == "year"){
        ans = "MMYY";
    } else if (l_res == "both" && r_res == "both"){
        ans = "AMBIGUOUS";
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
n = int(input())
h = list(map(int,input().split()))

best = 0
tem = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        tem += 1
    else:
        if tem>best:
            best = tem
        tem = 0

if tem > best:
    best = tem

print(best)



Measured memory_bytes: 63984
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
#include<cstring>
#include<iomanip>
#include<set>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define INF 1000000100
#define rep(i,n) for (int i=0;i<n;i++)

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

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


def main():
    N = int(input())
    P = tuple(map(int, input().split()))
    Q = tuple(map(int, input().split()))

    import itertools
    a = list(itertools.permutations(range(1, N+1)))
    print(abs(a.index(P) - a.index(Q)))


if __name__ == '__main__':
    main()


Measured memory_bytes: 8052
#!/usr/bin/env python3
import sys


def solve(N: int):
    print(len([i for i in range(1,N+1) if i%2 == 1])/N)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#ALDS1_2_A:   Bubble Sort

def b_sort(A, n):
    flag = True
    res = 0
    while flag:
        flag = False
        for j in range(n-1, 0, -1):
            if A[j] < A[j-1]:
                A[j], A[j-1] = A[j-1], A[j]
                flag = True
                res += 1
    return A, res

n = int(input())
l = list(map(int, input().split()))
res_l, res = b_sort(l,n)
print(*res_l)
print(res)


Measured memory_bytes: 5608
#include <stdio.h>
int main()
{

    int i,h,a,b,d,c;
    scanf("%d%d",&a,&b);
i=a*b;
h=a+b;
    if(i==15){
        printf("*\n");
    }
    else if(h==15){
        printf("+\n");
    }
    else{
        printf("x\n");
    }
    return 0;
}

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

#ifdef DEBUG
#include "../.inc/debug.hpp"
#else
#define debug(...) 42
#define rdfile(...) 42
#endif

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // rdfile("_input.txt");

    int n;
    string s;
    cin >> n >> s;

    {
        int c = 0, mn = 0;
        for (int i=0; i<(int)s.size(); ++i) {
            if (s[i] == ')') c--;
            else c++;
            mn = min(mn, c);
        }
        while (mn++ < 0) {
            s = "("+s;
        }
    }
    {
        int c = 0;
        for (int i=0; i<(int)s.size(); ++i) {
            if (s[i] == ')') c--;
            else c++;
        }
        while (c-- > 0) {
            s = s+")";
        }
    }
    
    cout << s << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int n;
vector<int> v;

void prime_factor(int n)
{
	for(int i=2;i*i<=n;i++){
		if(n%i == 0){
			v.push_back(i);
			while(n%i == 0){
				n /= i;
			}
		}
	}
	if(n != 1){
		v.push_back(n);
	}
	return;
}
int main()
{
	scanf("%d",&n);
	prime_factor(n);
	int ans = n;
	for(int i=0;i<v.size();i++){
		ans = (ans/v[i])*(v[i]-1);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3280
import java.util.Arrays;
import java.util.Scanner;
 
// 絶対値の和の最小値
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];
        int[] B = new int[N];
        for(int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
            B[i] = A[i] - i;
        }
        Arrays.sort(B);
        int x = B[N/2];
 
        long res = 0;
        for(int j = 0; j < N; j++) {
            res += Math.max(-x+B[j],x-B[j]);
        }
        System.out.println(res);
    }
}

Measured memory_bytes: 65408
#include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a, b) (abs((a) - (b)) < EPS) // 二つのスカラーが等しいかどうか
#define EQV(a, b) (EQ((a).X, (b).X) && EQ((a).Y, (b).Y)) // 二つのベクトルが等しいかどうか
using namespace std;

typedef complex<double> Point; // 点
typedef Point Vector; // ベクトル

struct Segment{ // 線分
  Point p1, p2;
  Segment(){};
  Segment(Point p1, Point p2) : p1(p1), p2(p2) {}; // p1,p2をセット
};

typedef Segment Line; // 直線

typedef vector<Point> Polygon; // 多角形

double dotproduct(Vector a, Vector b) // 内積
{
  return real((conj(a) * b));
}

double crossproduct(Vector a, Vector b) // 外積
{
  return imag(conj(a) * b);
}

double dist(Point p1, Point p2) // 二点間の距離
{
  return abs(p1 - p2);
}

Point project(Line l, Point p) // 射影
{
  double r = dotproduct(p - l.p1, l.p2 - l.p1) / norm(l.p2 - l.p1);
  return l.p1 + (l.p2 - l.p1) * r;
}

Point reflect(Line l, Point p) // 反射
{
  return p + (project(l, p) - p) * 2.0;
}

bool isOrthogonal(Line l1, Line l2)
{
  return EQ(dotproduct(l1.p1 - l1.p2, l2.p1 - l2.p2), 0.0);
}

bool isParallel(Line l1, Line l2)
{
  return EQ(crossproduct(l1.p1 - l1.p2, l2.p1 - l2.p2), 0.0);
}

int main()
{
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    Point a, b, c, d;
    cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y >> d.X >> d.Y;
    Line l1(a, b), l2(c, d);
    if(isOrthogonal(l1, l2))
      cout << "1" << endl;
    else if(isParallel(l1, l2))
      cout << "2" << endl;
    else
      cout << "0" << endl;
  }
}

Measured memory_bytes: 1232
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
dp=[[0]*(K+1) for i in range(N+1)]
sumi=[[0]*(K+2) for i in range(N+1)]
mod=10**9+7
dp[0][K]=1
sumi[0][K+1]=1
sumi
for i in range(1,N+1):
    for k in range(K+1):
        #print(i,k)
        dp[i][k]=sumi[i-1][min(k+A[i-1],K)+1]-sumi[i-1][k]
        dp[i][k]%=mod
        sumi[i][k+1]=sumi[i][k]+dp[i][k]
        sumi[i][k+1]%=mod
print(dp[N][0]%mod)
#print(dp)


Measured memory_bytes: 193048
n,m = map(int,input().split())
a=[0]*n
w=[0]*n
ac=0
wc=0
for _ in range(m):
    p,s=input().split()
    p=int(p)-1
    if a[p]==0:
        if s=="AC":
            a[p]=1
            ac+=1
            wc+=w[p]
        else:
            w[p]+=1
print(ac,wc)

Measured memory_bytes: 4596
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def comb(n, r):
    if n - r < r:
        r = n - r
    res = 1
    for i in range(r):
        res *= (n - i) % mod
        res %= mod
        res *= pow(r - i, mod - 2, mod)
        res %= mod
    return res


n, a, b = inpl()
All = pow(2, n, mod) - 1
ans = All - comb(n, a) - comb(n, b)
print(ans % mod)


Measured memory_bytes: 38640
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

int main(){
  long long int x, y, ans = -1;

  cin>>x>>y;

  if (x % y != 0) {
    for (long long int i = 2 * x; i <= 10e18; i += x) {
      if (i % y != 0) {
        ans = i;
        break;
      }
    }
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
n,x,y = map(int,input().split())
ans = [0] * n
for i in range(1,n):
    for j in range(i+1,n+1):
        a = min(j-i,abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x))
        ans[a] += 1
for i in range(1,n):
    print(ans[i])

Measured memory_bytes: 9148
from itertools import product
d, g = list(map(int, input().split()))
pl = [0] * d
cl = [0] * d
for i in range(d):
    pl[i], cl[i] = map(int, input().split())
INF = float("inf")
ans = INF
for bit in product([0, 1], repeat=d):
    anss = 0
    score = 0
    I = 0
    for i in range(d):
        if bit[i] == 0:
            I = i
        else:
            score += pl[i]*100*(i+1)
            score += cl[i]
            anss += pl[i]

    for _ in range(pl[I]):
        if score >= g:
            ans = min(ans, anss)
            break
        else:
            score += (I+1)*100
            anss += 1
    if score >= g:
        ans = min(ans, anss)

print(ans)


Measured memory_bytes: 40944
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>

using namespace std;

typedef long long ll;

int N;
ll A[200000 + 10];

int main() {
	cin >> N;
	for (int i = 0; i < N; i++)cin >> A[i];

	ll ans = 0;
	ll MH = A[0];
	for (int i = 1; i < N; i++) {
		if (A[i] < MH)
			ans += MH - A[i];
		else MH = A[i];
	}

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

Measured memory_bytes: 5156
#include<stdio.h>
int main(){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if((H<y+r)||(W<x+r)||(0>y-r)||(0>x-r)){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
}


Measured memory_bytes: 2100
n=int(input())
edges=[[] for i in range(n)]
import sys

sys.setrecursionlimit(10**9)
for i in range(n-1):
    a,s,w=map(int,input().split())
    edges[a-1].append([s-1,w]);edges[s-1].append([a-1,w])
colors=[-1]*n
colors[0]=1
def dfs(now):
    for to,cost in edges[now]:
        if colors[to]==-1:
            colors[to]=(cost+colors[now])%2
            dfs(to)

dfs(0)
print(*colors,sep="\n")

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

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

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

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

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

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

  map<ll, ll> mp;
  ll n; cin >> n;
  ll ans = 0;
  REP(i, n) {
    ll a; cin >> a;
    mp[a]++;
    ans += a;
  }
  ll q ;cin >> q;
  REP(_, q) {
    ll b, c; cin >> b >> c;
    ll val = mp[b];
    ans -= b * val;
    ans += c * val;
    cout << ans << endl;
    mp[b] = 0;
    mp[c] += val;
  }



}








Measured memory_bytes: 9524
#include <bits/stdc++.h>
using namespace std;
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 (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define F first
#define S second

typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1000000;
const int minf = -1000000;
const ll lnf = 1e12;
const ll mlnf = -1e12;

int H, W;
int dx[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[8] = { 1, 0, -1, 0, 1, -1, 1, -1 };
void dfs(vector<vector<int>>& field, int x, int y);
int main()
{
    while (1) {
        cin >> W >> H;
        if (H == 0 && W == 0)
            break;
        vector<vector<int>> field(H, vector<int>(W));
        rep(i, H) rep(j, W) cin >> field[i][j];
        int ans = 0;
        for (int h = 0; h < H; h++) {
            for (int w = 0; w < W; w++) {
                if (field[h][w] == 0)
                    continue;
                dfs(field, h, w);
                ans++;
            }
        }
        cout << ans << endl;
    }
}

void dfs(vector<vector<int>>& field, int x, int y)
{
    field[x][y] = 0;
    for (int i = 0; i < 8; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (nx < 0 || H <= nx || ny < 0 || W <= ny)
            continue;
        if (field[nx][ny] == 0)
            continue;
        dfs(field, nx, ny);
    }
}



Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007;
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define debug(x) cout << #x << " : " << x << endl
#define part cout << "----------------------------------\n";
#define mp make_pair
#include <iostream>


#define fastinput                     \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

LL POW(LL x, LL y)
{
    LL ans = 1;
    LL base = x;
    while (y)
    {
        if (y & 1)
        {
            ans *= base;
        }
        base = base * base;
        y = y >> 1;
    }
    return ans;
}

int main()
{
    fastinput;
    LL n,i,j,k,t,temp;
    LL a,b,c;
    cin>>a>>b>>c>>k;
    if(k<=a)
    {
        cout<<k<<endl;
    }
    else if(k<=a+b)
    {
        cout<<a<<endl;
    }
    else
    {
        LL left=k-a-b;
        cout<<a-left<<endl;
    }
    

    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define LLINF (1e18)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    while (true)
    {
        int n, m;
        cin >> n >> m;
        if(n == 0 && m == 0){
            break;
        }
        vector<int> taro(n), hanako(m);
        int sum_taro = 0;
        int sum_hanako = 0;
        for (int i = 0; i < n; i++)
        {
            cin >> taro[i];
            sum_taro += taro[i];
        }
        for (int i = 0; i < m; i++)
        {
            cin >> hanako[i];
            sum_hanako += hanako[i];
        }
        int merge = sum_taro - sum_hanako;
        vector<pair<int, int>> ans;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < m; j++)
            {
                if (2 * (taro[i] - hanako[j]) == merge)
                {
                    ans.push_back(make_pair(taro[i], hanako[j]));
                }
            }
        }
        if (ans.empty())
        {
            cout << -1 << endl;
        }
        else
        {
            int mx = INF;
            pair<int, int> res;
            for (int i = 0; i < (int)ans.size(); i++)
            {
                int tmp = ans[i].first + ans[i].second;
                if (tmp < mx)
                {
                    mx = tmp;
                    res = ans[i];
                }
            }
            cout << res.first << ' ' << res.second << endl;
        }
    }
}


Measured memory_bytes: 3288
/**************************************************************************
Coded by: Saba Karimi(_VINTAGE)
Institution: AIT PUNE
***************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back 
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define ld long double
#define int long long int 
/**************************************************************************/
signed main()
{
    fast;
    int n;
    cin>>n;
    int a[n+1],b[n+1],c[n+1];
    for(int i=1;i<=n;i++)
        cin>>a[i]>>b[i]>>c[i];
    int dp[n+1][3];
    dp[1][0] = a[1];
    dp[1][1] = b[1];
    dp[1][2] = c[1];
    for(int i=2;i<=n;i++)
    {
        dp[i][0] = a[i]+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1] = b[i]+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2] = c[i]+max(dp[i-1][0],dp[i-1][1]);
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b ;
  if( a%2 == 1 && b%2 == 1){
    cout << "Odd" << endl; 
  }
  else{
    cout << "Even" << endl;     
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
/* Coding space */
bool dp1[5001][5001] = {};
bool dp2[5001][5001] = {};
int main(){
  int n,k; cin >> n >> k;
  vi in(n);
  rep(i,n) cin >> in[i];

  rep(i,n+1)  dp1[i][0] = 1,dp2[i][0] = 1;
  rep(i,n)rep(j,k){
    if(dp1[i][j]){
      dp1[i+1][j] = 1;
      if(j + in[i] <= k)
        dp1[i+1][j+in[i]] = 1;
    }
  }
  for(int i = n; i > 0; i--)rep(j,k){
    if(dp2[i][j]){
      dp2[i-1][j] = 1;
      if(j + in[i-1] <= k)
        dp2[i-1][j+in[i-1]] = 1;
    }
  }
  int ans = n;
  rep(i,n){
    [&](){
    set<int> table;
    //rep(j,k+1) cerr << i << " " << j << " " << dp2[i+1][j] << endl;
    rep(j,k+1) if(dp2[i+1][j]) table.insert(j);
    rep(j,k+1){
      if(dp1[i][j]){
        if(table.lower_bound(k - (j + in[i])) != table.end() && *table.lower_bound(k-(j+in[i])) + j < k){
          //cerr << i << " " << j << endl;
          ans--;
          return;
        }
      }
    }
    }();
  }
  cout << ans << endl;
}

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

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
#define repb(i, ed, st) for(int i=ed; i>=st; i--)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 5e5 + 10;
const ll INF = 1LL << 60;

template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}


vector<int> g[N];
bool viss[N];
int vis[N];

// Normal DFS
void dfs(int curr, int par)
{
  for(auto x: g[curr])
    if(x != par)
      dfs(x, curr);
}

// DFS with visiting status
void dfs1(int curr, int par)
{
  viss[curr] = 1;
  for(auto x: g[curr])
    if(!viss[x])
      dfs1(x, curr);
}

// DFS with strongly connected component
void dfs2(int curr, int par, int num)
{
  vis[curr] = num;
  for(auto x: g[curr])
    if(vis[x] == 0 || vis[x] > (num+1))
      dfs2(x, curr, num+1);
}

// XOR from 0 to n
ll fxor(ll n)
{
  if(n < 0) return 0;
  if(n % 4 == 3) return 0;
  else if(n % 4 == 0) return n;
  else if(n % 4 == 1) return n^(n-1);
  else if(n%4 == 2) return n^(n-1)^(n-2);
}

// Power in logn with mod 1000000007
llt ppow(llt x, llt y)
{
  llt res = 1;
  while(y > 0){
    if(y&1)
      res = (res * x)%M;
    y = y >> 1;
    x = (x * x)%M;
  }
  return res;
}

// Factorial with dp
llt factdp[N];
llt fact(llt x)
{
  if(x == 0) return 1;
  if(x == 1) return 1;
  if(factdp[x] != 0) return factdp[x];
  return factdp[x] = (x*fact(x-1))%M;
}
// Combination
ll modcomb(ll n, ll r)
{
  if(n < r) return 0;
  ll res = fact(n);
  (res *= ppow(fact(r), M-2)) %= M;
  (res *= ppow(fact(n-r), M-2)) %= M;
  return res;
}

// String return to base b
string ansConv ="";
void convert10tob(llt N, int b)
{
     if (N == 0)
        return;
     int x = N % b;
     N /= b;
     if (x < 0)
        N += 1;
     convert10tob(N, b);
     ansConv += to_string(x);
     return;
}

// Convert string to num wiht base b
llt convertstrtob(string a, int b)
{
  llt aa = 0;
  llt mul = 1;
  for(int i=a.length()-1; i>=0; i--)
  {
    int curr = a[i] - '0';
    aa += (curr * mul);
    mul *= b;
  }
  return aa;
}

// Union Find
// Find()
int parent[N], ran[N];
int find(int x)
{
    if(parent[x]==x)return x;
    else return parent[x]=find(parent[x]);
}
// Union()
void unite(int x,int y){
    x=find(x);
    y=find(y);
    if(x==y)return;

    if(ran[x]<ran[y])
        parent[x]=y;
    else{
        parent[y]=x;
        if(ran[x]==ran[y])ran[x]++;
    }
}

// Main Code

int main()
{
  int h, w;
  cin>>h>>w;
  int n;
  cin>>n;
  int ans[h][w];
  int hh = 0;
  int ww = 0;
  int ad = 1;
  repn(i, 1, n)
  {
    int x;
    cin>>x;
    rep(j, 0, x)
    {
      if(ww == w)
      {
        ww = w-1;
        hh++;
        ad = -1;
      }
      if(ww == -1)
      {
        ww = 0;
        hh++;
        ad = 1;
      }
      ans[hh][ww] = i;
      ww += ad;
    }
  }
  rep(i, 0, h)
  {
    rep(j, 0, w)
      cout<<ans[i][j]<<" ";
    cout<<endl;
  }
  return 0;
}


Measured memory_bytes: 14080
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define SIZE 4444
#define MOD 1000000007LL
#define MAXV 100
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int, int> pi;
typedef vector<vector<long long> > mat;

ll a,b,h,w;
int main () {
	scanf("%lld%lld",&h,&w);
	if(h % 3 == 0 || w % 3 == 0)	printf("0\n"),exit(0);
	ll ret = INFL;
	for(ll i=0;i<h;i++) {
		ll cand = h * w - i * w;
		ll half = cand / (h-i) / 2LL * (h-i);
		vector<ll> v;
		v.pb(i*w);	v.pb(cand - half);	v.pb(half);
		sort(v.begin(), v.end());
		if(v[0] != 0)
			ret = min(ret, v[2] - v[0]);
		half = cand / w / 2LL * w;
		vector<ll> s;
		s.pb(i*w);	s.pb(cand - half);	s.pb(half);
		sort(s.begin(), s.end());
		if(s[0] != 0)
			ret = min(ret, s[2] - s[0]);
	}

	for(ll i=0;i<w;i++) {
		ll cand = h * w - i * h;
		ll half = cand / (w-i) / 2LL * (w-i);
		vector<ll> v;
		v.pb(i*h);	v.pb(cand - half);	v.pb(half);
		sort(v.begin(), v.end());
		if(v[0] != 0)	
			ret = min(ret, v[2] - v[0]);
		half = cand / h / 2LL * h;
		vector<ll> s;
		s.pb(i*h);	s.pb(cand - half);	s.pb(half);
		sort(s.begin(), s.end());
		if(s[0] != 0)
			ret = min(ret, s[2] - s[0]);
	}
	printf("%lld\n",ret);
}

Measured memory_bytes: 256
#include<iostream>

int digit(int i ,int base)
{
    int count(1);
    int num(base);
    while (num <= i)
    {
        num *= base;
        count ++ ;
    }
    return count;
}

int main()
{
    int N,K;
    std::cin >> N >> K;
    std::cout << digit(N,K) << std::endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {



    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();

        if(a > b){
            System.out.println("a > b");
        }else if(a < b){
            System.out.println("a < b");
        }else{
            System.out.println("a == b");
        }
    }

}



Measured memory_bytes: 26200
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <bitset>
#include <stack>
#include <cstdlib>
#include <complex>
#include <unordered_map>
#define REP(i,n) for(int i = 0; n > i; i++)
#define MODU 33
#define Range(x,a,b) ((a) <= (x) && (x) <= (b))
#define POWT(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef vector<int> Ivec;
typedef pair<int, int> pii;
typedef long long int ll;


class RMQ {
public:
	static const int MAX_N = 300001;
	int n, dat[2 * MAX_N - 1];
	//[a,b)の最小値を返す
	//kは節点の番号l,rはその節点が[l,r)を保持している
	int rec(int a, int b, int k, int l, int r) {
		if (b <= l || r <= a) {
			return INT_MAX;
		}

		if (a <= l && r <= b) {
			return dat[k];
		}
		else {
			int rl = rec(a, b, 2 * k + 1, l, (l + r) / 2);
			int rr = rec(a, b, 2 * k + 2, (l + r) / 2, r);
			return min(rl, rr);
		}
	}

	void init(int n_) {
		n = 1;
		while (n < n_) n *= 2;

		for (int i = 0; i<2 * n - 1; i++) {
			dat[i] = INT_MAX;
		}
	}

	//kをaに変更
	void update(int k, int a) {
		int reaf = k + n - 1;
		dat[reaf] = a;
		while (reaf>0) {
			reaf = (reaf - 1) / 2;
			dat[reaf] = min(dat[reaf * 2 + 1], dat[2 * reaf + 2]);
		}
	}

	//query[a,b]の範囲内の最小値を返す
	int query(int a, int b) {
		return rec(a, b + 1, 0, 0, n);
	}
};

int main() {
	int n;
	scanf("%d", &n);
	vector<int> num(n);
	RMQ rmq;
	rmq.init(n);
	REP(i, n) {
		int a;
		scanf("%d", &num[i]);
		rmq.update(i,num[i]);
	}
	ll sum = 0;
	REP(i, n) {
		int l, r;
		int Max = i;
		int Min = 0;
		while (1) {
			int Mid = (Max + Min) / 2;
			if (rmq.query(Mid, i) == num[i]) {
				Max = Mid;
			}
			else {
				Min = Mid + 1;
			}
			if (Max == Min) {
				l = Max;
				break;
			}
		}
		Max = n - 1;
		Min = i;
		while (1) {
			int Mid = (Max + Min) / 2 + (Max+Min)%2;
			if (rmq.query(i, Mid) == num[i]) {
				Min = Mid;
			}
			else {
				Max = Mid - 1;
			}
			if (Max == Min) {
				r = Max;
				break;
			}
		}
		sum += (ll)(i - l + 1)*(r - i + 1)*num[i];
	}
	printf("%lld\n", sum);
	return 0;
}

Measured memory_bytes: 3072
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
#include <numeric>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265359;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

signed main() {
	int N;
	vector<int>list;
	//int list[2005];
	int cnt = 0;

	//memset(list, 99999999, sizeof(list));
	/*for (int i = 0; i < 2005; i++) {
		list[i] = 99999999;
	}*/

	cin >> N;

	for (int i = 0; i < N; i++) {
		int num;
		cin >> num;
		list.push_back(num);
		//list[i] = num;
	}

	sort(list.begin(), list.end());
	//sort(list , list + SIZE_OF_ARRAY(list));
	//int indexk = 0;

	for (int i = 0; i < N - 2; i++) {
		for (int j = i + 1; j < N - 1; j++) {
			for (int k = j + 1; k < N; k++) {
			//for (int k = indexk; k > j;) {
			//for (int k = indexk; k < N; k++) {
				//if (k <= j)continue;
				//if (list[i] + list[j] <= list[k]) {
				//	//cnt += (k - j);
				//	cnt += (k + 1);
				//	//cnt += (indexk + 2);
				//	cout << "cnt->" << cnt << " k->" << k << endl;
				//	indexk = k - 1;
				//	break;
				//}
				//else {
				//	//indexk = k;
				//}

				//int num = list[i] + list[j] + list[k];
				//int num = min( { list[i] + list[j], list[j] + list[k], list[i] + list[k]});

				//if (list[i] + list[j] < num && list[i] + list[k] < num &&list[j] + list[k] < num) {
				if (list[i] + list[j] > list[k] && list[i] + list[k] > list[j] &&list[j] + list[k] > list[i]) {
					cnt++;
				}
				else {
					break;
				}
			}
			//indexk = j + 2;
			//indexk = 0;
		}
		//indexk = 0;
	}



	cout << cnt << endl;


	
	return 0;
}

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

#define MAXN 300

int main(){
  int n;cin>>n;
  ll og[MAXN][MAXN], g[MAXN][MAXN];
  rep(i, n)rep(j, n){ cin>>og[i][j]; og[j][i]=og[i][j]; }
  rep(i, n)rep(j, n)g[i][j]=og[i][j];

  rep(k, n)rep(i, n)rep(j, n)g[i][j] = min<ll>(g[i][j], g[i][k]+g[k][j]);

  bool f=true;
  rep(i, n)rep(j, n)if(og[i][j]!=g[i][j])f=false;
  if(!f){ cout<<-1<<endl; return 0; }

  vector<pair<ll, pi>> edges;
  rep(i, n)rep(j, n)if(i!=j)edges.push_back({g[i][j], {i, j}});

  rep(k, n)rep(i, n)rep(j, n)if(g[i][k]!=0 && g[k][j]!=0 && g[i][j]==g[i][k]+g[k][j]) g[i][j]=g[j][i]=0;

  ll result = 0;
  rep(i, n)rep(j, n) result += g[i][j];

  cout<<result/2<<endl;

  return 0;
}

Measured memory_bytes: 3828
N = int(input())

def check(N):
    if N//100==7:
        return True
    N = N - ((N//100)*100)
    if N//10==7:
        return True
    N = N - ((N//10)*10)
    if N==7:
        return True
    return False

if check(N):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9180
import java.io.*;
import java.util.*;
public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        int a=Integer.parseInt(st.nextToken());
        int b=Integer.parseInt(st.nextToken());
        int c=Integer.parseInt(st.nextToken());
        int d=Integer.parseInt(st.nextToken());
        System.out.println((int)Math.max(a*b, c*d));
    }
    
}

Measured memory_bytes: 8148
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forna(i,a,n) for(int i =a; i < n; i++)
#define fornd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push
#define fi first
#define se second
#define __ ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long int unsigned lliu;
typedef long long int lli;
typedef pair<lli,lli> pi;
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
#define MOD 1000000007

int main(){__
    int n;
    cin>>n;
    int suma = 1000*(n/500);
    suma+= 5*((n%500)/5);
    cout<<suma<<"\n";
}

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

//オーバーフロー
//コーナーケース

typedef long long ll;

void yes() {
    cout << "Yay!" << endl;
}
void no() {
    cout << ":(" << endl;
}

int main() {
    int x,y;
    cin >> x >> y;
    int ans = 0;
    ans += max(0, 4 - x);
    ans += max(0, 4 - y);
    if (x == y && x == 1) {
        ans += 4;
    }
    cout << ans * 100000 << endl;
    return 0;
}


Measured memory_bytes: 256