akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        FastReader scan = new FastReader();
        //PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("something.in")));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        Task solver = new Task();
        //int t = scan.nextInt();
        int t = 1;
        for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
        out.close();
    }
    static class Task {
        public void solve(int testNumber, FastReader sc, PrintWriter pw) {
            long n = sc.nextInt();
            pw.println(n*n);
        }
		/*
		public long exp(long base, int power){
			if(power == 0) return 1;
			if(power == 1) return (base + mod) % mod;
			long ans = exp(base,power/2);
			ans = (ans*ans + mod) % mod;
			if(power%2 == 1) ans = (ans*base + mod) % mod;
			return (ans + mod) % mod;
		}*/

    }
    static class tup implements Comparable<tup>{
        int a, b;
        tup(int a, int b){
            this.a=a;
            this.b=b;
        }

        @Override
        public int compareTo(tup o) {
            return Integer.compare(o.a,a);
        }
    }
    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }
    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

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

int dividir(int* num){
    int resto = *num % 10;
    *num = *num / 10;
    return resto;
}

int main(){
    
    int n, a, b;
    int resto1=0, resto2=0;
    int aux;
    int suma=10e5, sum=10e5;
    
    cin >> n;
    
    for(int i=0; i<n; i++){
        a = n - i;
        b = i;
        
        while(a>10){
           aux = dividir(&a);
           resto1 += aux;
        }
        
        while(b>10){
            aux = dividir(&b);
            resto2 += aux;
        }
        
        suma = sum;
        sum = a + b + resto1 + resto2;
        if (sum > suma){
            sum = suma;
        }
        
    }
    
    cout << sum << endl;
    
    
    return 0;
}

Measured memory_bytes: 256
mod = 10 **9 +7
N, K = map(int,input().split())
ans = 0

def ca(n):
    mi = n*(n+1)//2 %mod
    ma = ((N+1+N+1-n+1)*n//2) %mod
    return ma- mi +1
for k in range(K,N+2):
    ans += ca(k)
    ans %mod

print(ans%mod)

Measured memory_bytes: 9196
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d;
int main() {
    scanf("%d%d%d%d",&a,&b,&c,&d);
    if(ceil(c*1.0/b)<=ceil(a*1.0/d))
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


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

class Cube {
public:
    int face[6];
    void roll(int i, int j, int k, int l) {
        int t = face[i]; face[i] = face[j]; face[j] = face[k]; face[k] = face[l]; face[l] = t;
    }
    void roll_S() { roll(1,0,4,5); } // to S
    void roll_E() { roll(2,0,3,5); } // to E
    void move(char c) {
        if (c == 'S') roll_S();
        else if (c == 'E') roll_E();
        else if (c == 'N') rep(i,3) roll_S();
        else if (c == 'W') rep(i,3) roll_E();
    }
};

int main() {
    Cube c;
    string com;

    rep(i,6) cin >> c.face[i];
    cin >> com;

    rep(i, com.size()) c.move(com[i]);

    cout << c.face[0] << endl;
}


Measured memory_bytes: 3200
#include <iostream>
#include <utility>
#include <cstdio>

using namespace std;

int main(void) {


    while (true) {
        int N, X;
        cin >> N >> X;

        if (N == 0 && X == 0) { break; }

        int total = 0;
        for (int i = 1; i <= N - 2; ++i) {
            for (int j = i + 1; j <= N - 1; ++j) {
                for (int k = j + 1; k <= N; ++k) {
                    if (i + j + k == X)
                        ++total;
                }
            }
        }
        printf("%d\n", total);
    }

    return 0;
}

Measured memory_bytes: 1144
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

bool e[200010];
int main() {
	ll n,a,b,c,d;
	cin>>n>>a>>b>>c>>d;
	a--,b--,c--,d--;
	string s;
	cin>>s;
	for(int i=0;i<n-1;i++){
		char now=s[i],next=s[i+1];
		if(now=='#'&&next=='#'){
			e[i]=true;
		}
	}
	bool ans=true;
		for(int i=a;i<c;i++){
			if(e[i]){
				ans=false;
			}
		}
		for(int i=b;i<d;i++){
			if(e[i]){
				ans=false;
			}
		}
	if(d<c&&ans==true){
		ans=false;
		for(int i=b;i<=d;i++){
			if(s[i-1]=='.'&&s[i]=='.'&&s[i+1]=='.'){
				ans=true;
			}
		}
	}
	cout <<(ans?"Yes":"No");
	// your code goes here
	return 0;
}

Measured memory_bytes: 644
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>

using namespace std;

struct Node {
    int key;
    Node* right, *left, *parent;
};

Node *root, *NIL;

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z;

    z = (Node *)malloc(sizeof(Node));
    z -> key = k;
    z -> left = NIL;
    z -> right = NIL;

    while(x != NIL) {
        y = x;
        if (z -> key < x -> key) {
            x = x -> left;
        } else {
            x = x -> right;
        }
    }

    //if x is empty parent is an empty node
    z -> parent = y;

    if (y == NIL) {
        root = z;
    } else {
        if (z -> key < y -> key) {
            y -> left = z;
        } else {
            y -> right = z;
        }
    }
}

void inorder(Node *u) {
    if (u == NIL) return;
    inorder(u -> left);
    printf(" %d", u -> key);
    inorder(u -> right);
}

void preorder(Node *u) {
    if (u == NIL) return;
    printf(" %d", u -> key);
    preorder(u -> left);
    preorder(u -> right);
}

void postorder(Node *u) {
    if (u == NIL) return;
    postorder(u -> left);
    postorder(u -> right);
    printf(" %d", u -> key);
}


int main()
{
    int n, i, x;
    string com;
    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        cin >> com;
        if (com == "insert") {
            scanf("%d", &x);
            insert(x);
        } else if (com == "print") {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }
    return 0;
}



Measured memory_bytes: 26640
#!/usr/bin/env python
#pyrival orz
import os
import sys
from io import BytesIO, IOBase

"""
    for _ in range(int(input())):
    n,m=map(int,input().split())
    n=int(input())
    a = [int(x) for x in input().split()]
"""

def main():
    n,m,K=map(int,input().split())
    a=[[ x=='#' for x in input()] for _ in range(n)]
    ans=0
    # print(a)
    def get(x,y):
        cnt=0
        for i in range(n):
            for j in range(m):
                if x&(1<<i) or y&(1<<j):
                    continue
                cnt+=a[i][j]
        return cnt

    for m1 in range(1<<n):
        for m2 in range(1<<m):
            ans+=get(m1,m2)==K
    print(ans)

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Measured memory_bytes: 74560
MOD = 1_000_000_007
io = STDIN
N=io.gets.to_i
$memo=Array.new(N+1){{}}
def check(last4)
  return false if last4.index("AGC")
  (0..3).each_cons(2) do |i,j|
    s=last4.clone
    s[i],s[j]=s[j],s[i]
    return false if s.index("AGC")
  end
  true
end
def dfs(i,last3)
  return $memo[i][last3] if $memo[i].has_key?(last3)
  return 1 if i==N
  cnt=0
  'ACGT'.each_char do |c|
    cnt += dfs(i+1,last3[1..-1]+c) if check(last3+c)
  end
  $memo[i][last3] = cnt % MOD
end
puts dfs(0,"TTT")


Measured memory_bytes: 2684
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <cstring>
#include <string>
#include <cctype>
#include <cassert>
#include <queue>

using namespace std;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,b,e) for(int i = (b); i <= (e); i++)
#define INF (1001001001)
#define EPS (1e-15)

#define pr(x) do{cerr << (#x) << " = " << (x) << endl;}while(0)
#define pri(x,i) do{cerr << (#x) << "[" << i << "] = " << (x[i]) << endl;}while(0)
#define pra(x,n) rep(__i,n) pri(x,__i);
#define prar(x,b,e) repr(__i,b,e) pri(x,__i);

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;

ll MOD = 1000000007;

int in() {
	int a;
	scanf("%d ", &a);
	return a;
}

int main() {
	int N = in();
	vint a(N+1);
	rep(i,N)a[i] = in()-1;
	a[N] = INF;
	
	int ans = 0;
	rep(i,N) {
		if (a[i] == i) {
			int temp = a[i];
			a[i] = a[i+1];
			a[i+1] = temp;
			ans++;
		}
	}
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll MOD=10000000;
const ll INF=1000000001;
const ll LINF=4000000000000000010;
const double EPS=1e-9;
int main(){
    int r;cin>>r;
    if(r<1200){
        cout<<"ABC"<<endl;
    }else if(r<2800){
        cout<<"ARC"<<endl;
    }else{
        cout<<"AGC"<<endl;
    }
}


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

using namespace std;

//FILE *fi=freopen("1.txt","r",stdin);

const long long MOD=1e9+7;

int n,k;
long long gt[200001],igt[200001];

long long moe(long long a,long long b)
{
    if (b==0) return 1;
    if (b%2==0) return moe((a*a)%MOD,b/2);
    return (a*moe((a*a)%MOD,b/2))%MOD;
}

void init()
{
    gt[0]=1;
    for (int i=1;i<=n;++i)
        gt[i]=(gt[i-1]*i)%MOD;
    igt[n]=moe(gt[n],MOD-2);
    for (int i=n-1;i>=0;--i)
        igt[i]=(igt[i+1]*(i+1))%MOD;
}

long long nCk(int n,int k)
{
    return ((gt[n]*igt[k])%MOD*igt[n-k])%MOD;
}

void process()
{
    long long kq=0;
    for (int i=0;i<=min(n-1,k);++i)
    {
        kq=(kq+(nCk(n,i)*nCk(n-1,i))%MOD)%MOD;
    }
    cout<<kq;
}

int main()
{
    scanf("%d %d",&n,&k);
    init();
    process();
    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <iterator>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <numeric>
#include <iomanip>
#include <limits>
#include <set>
#include <map>
#include <type_traits>
#include <cstdint>
#include <queue>
#define _USE_MATH_DEFINES
#include <math.h>
#include <sstream> // std::stringstream
#include <bitset>  // std::bitset<N>

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;

//素因数分解
void factoring(ll n, map<ll, ll>& mp) {
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			mp[i]++;
			n /= i;
		}
	}
	if (n != 1) mp[n]++;
}

//絶対値
template<class T, class U = std::make_unsigned_t<T>>
U SafeAbs( T x ) {
    return x < 0 ? -static_cast<uintmax_t>(x) : x;
}

//最大・最小
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;
}

//xのn乗
ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
//xの逆元
ll mod_inv(ll x, ll mod) {//O(log(mod))
    return mod_pow(x, mod - 2, mod);
}

//nCr
ll ncr(ll n, ll r, ll mod){
	ll res=1;
	ll num=1,den=1;
	for(ll i=n;i>=n-r+1;i--){
		(den*=i)%=mod;
	}
	for(ll i=1;i<=r;i++){
		(num*=i)%=mod;
	}
	
	res=den*mod_inv(num,mod);

	return res%mod;
}


//二分探索
bool isOk(ll index, ll key,vector<ll> &a){
	
	if(a[index]>key){
		return true;
	}
	
	return false;
}

ll bin_search(ll key, vector<ll> &a){
	
	ll l=-1;
	ll r=a.size();

	while(abs(r-l)>1){
		ll mid = (l+r)/2;
		if(isOk(mid, key, a)){
			r=mid;
		}
		else{
			l=mid;
		}
	}
	return r;
}

/*
//深さ優先探索
void dfs(vector<vector<ll>> &gra,vector<bool> &seen, ll v){

	seen[v]=true;

	for(auto next : gra[v]){
		if(seen[next]){
			continue;
		}

		dfs(gra,seen,next);
	}
	
}
*/

const ll MOD=1000000007;

ll min(ll a, ll b){
	if(a>=b){
		return b;
	}
	else{
		return a;
	}
}

bool compare_by_b(pair<ll, ll> a, pair<ll, ll> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}


void solve()
{
	ll n;
	cin >> n;
	vector<ll> a(n, 0);
	ll all = 0;
	ll mi = 0;
	for (ll i = 0; i < n;i++){
		cin >> a[i];
		all += a[i];
		all %= MOD;
	}

	for (ll i = 0; i < n; i++)
	{
		ll aa = a[i] * a[i];
		aa %= MOD;
		mi += aa;
		mi %= MOD;
	}

	ll ans = 0;
	ans = (all * all) % MOD;
	ans -= mi;
	if(ans<0){
		ans += MOD;
	}

	ans *= mod_inv(2, MOD);
	ans %= MOD;

	cout << ans << endl;
}

int main(){
	
	solve();
	
    return 0;
}

Measured memory_bytes: 4840
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>


using std::cout;
using std::cin;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;




ll gcd(ll a, ll b) {
    while (b != 0) {
        auto tmp = a;
        a = b;
        b = tmp % a;
    }
    return a;
}



void oneCase () {
    int a, b;
    cin >> a >> b;
    if (a == b) {
        cout << "Yes" << "\n";
    } else {
        cout << "No" << "\n";
    }


}




int main() {
    int t = 1;
//    cin >> t;
    while (t > 0) {
        oneCase();
        --t;
    }

    return 0;
}

Measured memory_bytes: 256
n = int(input())
lst = list(map(int, input().split()))
evens = [lst[i] for i in range(0, n, 2)]
odds = [lst[i] for i in range(1, n, 2)]

dic1 = {}
for i in evens:
  if i in dic1:
    dic1[i] += 1
  else:
    dic1[i] = 1

dic2 = {}
for i in odds:
  if i in dic2:
    dic2[i] += 1
  else:
    dic2[i] = 1

lst1 = sorted(dic1.items(), key=lambda x:-x[1])
lst2 = sorted(dic2.items(), key=lambda x:-x[1])

if lst1[0][0] == lst2[0][0]:
  if len(lst1) == 1 and len(lst2) == 1:
    ans = n // 2
  elif len(lst1) == 1:
    ans = n - (lst1[0][1] + lst2[1][1])
  elif len(lst2) == 1:
    ans = n - (lst1[1][1] + lst2[0][1])
  else:
    ans = n - max(lst1[0][1] + lst2[1][1], lst2[0][1] + lst1[1][1])
else:
  ans = n - (lst1[0][1] + lst2[0][1])

print(ans)

Measured memory_bytes: 21568
s = int(input())
#最後に切った場所がiであるようなパターンの数をdp[i]とする
dp=[0]*(s+1)
dp[0]=1
if s<3:
  print("0")  
else:
  for i in range(3,s+1):
    dp[i]=dp[i-1]+dp[i-3]
    dp.append(dp[i])
    score=dp[s]%(10**9+7)
  print(score)

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

#define f(i,a,b) for( ll  i = a; i < (ll) b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter   ios::sync_with_stdio(false);cin.tie(0)

// policy-based



using namespace std;


typedef long long ll; // int or long long
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;



 
const ll MAX = 3e5+1;
const ll inf = 1e9;
const ll mod = 998244353;


int main(){
	fastio;
	ll n,x,y,c = 0;
	cin >> n;
	f(i,0,n){
		cin >> x >> y;
		if(x == y) c++;
		else c = 0;
		if(c == 3){
			cout << "Yes\n";
			return 0;
		}
	}	
	cout << "No\n";
	return 0;
} 

Measured memory_bytes: 3608
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt();
		if (B%A == 0) System.out.println(A+B);
		else System.out.println(B-A);
	}

}

Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))

// #undef LOCAL
#ifdef LOCAL
#include "../lib/dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  // freopen("temp.1", "r", stdin);

  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1])
      ans = 1;
  }
  if (ans)
    cout << "Bad" << endl;
  else
    cout << "Good" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int n,m;
    bool loop;
    int a,b;

    while(cin >> a >> b, b){
        char map[100][100];
        n = m = 0;
        loop = true;
        rep(i,a){
            rep(j,b){
                cin >> map[i][j];
            }
        }
        for(int k = 0; k < a * b; k++){
            if(map[n][m] == '>')
                m++;
            else if(map[n][m] == '<')
                m--;
            else if(map[n][m] == 'v')
                n++;
            else if(map[n][m] == '^')
                n--;
            else
                loop = false;
        }
        if(loop == false)
            cout << m << " " << n << endl;
        else
            cout << "LOOP" << endl;
    }
}

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

int main() {
  int N;
  cin >> N;
  vector<string> blue(N);
  for (int i=0; i<N; i++) {
  cin >> blue.at(i);
  }
  
  int M;
  cin >> M;
  vector<string> red(M);
  for (int i=0; i<M; i++) {
  cin >> red.at(i);
  }
  
  vector<int> yen(N);
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      if (blue.at(i)==blue.at(j)) {
      yen.at(i)++;
      }
    }
    for (int j=0; j<M; j++) {
      if (blue.at(i)==red.at(j)) {
      yen.at(i)--;
      }
    }
  }
  
  sort(yen.begin(), yen.end());
  cout << max (yen.at(N-1), 0 ) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)


int par[1000000];//親
int ran[200000]; //木の深さ

struct unionfind
{

unionfind(int n) //初期化
{
  rep(i,n)
  {
    par[i]=i;
    ran[i]=0;
  }
}

int root(int x) //木の根を求める
{
  if(par[x]==x) return x;
  else return par[x]=root(par[x]);
}

void unite(int x,int y) //xとyの属する集合を併合
{
  x=root(x);
  y=root(y);
  if(x==y) return;

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

bool same(int x,int y) //xとyが同じ集合に属するのか
{
    return root(x)==root(y);
}

};

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

  unionfind ship(n);

  rep(i,m)
  {
    int a,b;
    cin>>a>>b;
    if(a==1) ship.unite(a-1,b-1);
    else if(b==n) ship.unite(a-1,b-1);
  }

  if(ship.same(0,n-1)) cout<<"POSSIBLE";
  else cout<<"IMPOSSIBLE";
  cout<<endl;
}

Measured memory_bytes: 1792
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    ll X, Y, A, B, C;
    cin >> X >> Y >> A >> B >> C;

    ll p[A];
    ll q[B];
    ll r[C + X + Y];
    rep(i, A){
        cin >> p[i];
    }
    rep(i, B){
        cin >> q[i];
    }
    sort(p, p + A, greater<ll>());
    sort(q, q + B, greater<ll>());
    rep(i, C){
        cin >> r[i];
    }
    for(ll i = C; i < C + X; i++){
        r[i] = p[i - C];
    }
    for(ll i = C + X; i < C + X + Y; i++){
        r[i] = q[i - C - X];
    }
    sort(r, r + C + X + Y, greater<ll>());

    ll ans = 0;
    rep(i, X + Y){
        ans += r[i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 7292
#include<bits/stdc++.h>
#define maxn 100007
#define inf 1000000007
#define ll long long int
using namespace std;

int a,m=inf;

inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x*f;
}

inline void writ(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>9) writ(x/10);
	putchar(x%10+'0');
}
inline void write(int x){writ(x);putchar('\n');}

int main()
{
	int n=read(),c=read();
	for (int i=1;i<=n;++i) a=read(),c=c-a,m=min(m,a);
	write(n+c/m);
	return 0;
}

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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int n,m;

main() {
    cin >> n >> m;
    n--;m--;
    ct(n*m)
}


Measured memory_bytes: 256
using System;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine();
            switch (str)
            {
                case "A":
                    Console.WriteLine("T");
                    break;
                case "T":
                    Console.WriteLine("A");
                    break;
                case "G":
                    Console.WriteLine("C");
                    break;
                case "C":
                    Console.WriteLine("G");
                    break;
                default:
                    break;
            }
        }
    }
}

Measured memory_bytes: 13140
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	n := nextInt()
	k := nextInt()
	xlist := make([]int, n)

	run := 0
	for i := 0; i < n; i++ {
		xlist[i] = nextInt()
		run += 2 * min(xlist[i], k-xlist[i])
	}

	fmt.Println(run)

}
func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

// ---- readfunc
func scanInit() {
	const cap = 64 * 1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1784
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

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; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int a,b;
  cin >> a >> b;
  if(a+b == 15)cout << "+" << endl;
  else if(a*b == 15)cout << "*" << endl;
  else cout << "x" << endl;
}

Measured memory_bytes: 3548
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int a,b,c;
	cin>>a>>b>>c;
	int cnt=0;
	
	for(int i=a;i<=b;i++){
		if(c%i==0)	cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
long long const MOD = 1000000007;

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}

long long mpow(long long a,long long n){
  long long ret=1;
  for(;n>0;n>>=1,a=a*a%MOD){
    if(n%2==1){
      ret=ret*a%MOD;
    }
  }
  return ret;
}

long long inv(long long a){
  return mpow(a,MOD-2);
}

long long int nck(long long n, long long k) {
    long long int ret = 1;
    while(1) {
        if(k == 0)break;
        int N = n%MOD, K = k%MOD;
        if(N < K)return 0;
        for(int i = 0; i < K; i++) {
            ret = ret*(N-i)%MOD;
        }
        long long imul = 1;
        for(int i = 0; i < K; i++) {
            imul = imul*(i+1)%MOD;
        }
        ret = ret*inv(imul)%MOD;
        n /= MOD; k /= MOD;
    }
    return ret;
}

int main() { 
    long long n, a, b, ans = 0;
    cin >> n >> a >> b;
    ans = mpow(2, n) - 1;
    long long nca = nck(n, a), ncb = nck(n, b);
    ans = mod(ans - nca, MOD);
    ans = mod(ans - ncb, MOD);
    cout << ans << '\n';

    return 0;
}


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

int main(){

  int n;
  int v[10][11] = {0};
  string str;

  while(cin >> str){
    for(int i=0; i<10; i++){
      v[9][i] = (int)str[i] - '0';
    }

    for(int i=8; i>=0; i--){
      n = i + 1;
      for(int j=0; j<n; j++){
        v[i][j] = (v[i+1][j] + v[i+1][j+1]) % 10;
      }
    }

    cout << v[0][0] << endl;

  }

  return 0;

}

Measured memory_bytes: 1180
ls1=[int(s) for s in input().split()]
ls2=[int(s) for s in input().split()]
ls3=[int(s) for s in input().split()]

if(ls1[0]-ls2[0]==ls1[1]-ls2[1] and 
   ls1[0]-ls2[0]==ls1[2]-ls2[2] and
   ls1[0]-ls3[0]==ls1[1]-ls3[1] and 
   ls1[0]-ls3[0]==ls1[2]-ls3[2]):
  print("Yes")
else:
  print("No")

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

int main(){
    int x[100], y[100], n, i;
    double sum1 = 0, sum2 = 0, sum3 = 0, max = -1000;
    
    scanf("%d", &n);
    for (i = 0; i < n; i++){
        scanf("%d", &x[i]);
    }
    for (i = 0; i < n; i++){
        scanf("%d", &y[i]);
    }
    for (i = 0; i < n; i++){
        sum1 += fabs(x[i] - y[i]);
        sum2 += (x[i] - y[i]) * (x[i] - y[i]);
        sum3 += pow(fabs(x[i] - y[i]), 3);
        if (max < fabs(x[i] - y[i])) max = fabs(x[i] - y[i]);
    }
    printf("%f\n%f\n%f\n%f\n", sum1, sqrt(sum2), pow(sum3, 1.0/3), max);
    
    return 0;
}

Measured memory_bytes: 696
# include <stdio.h>
# include <ctype.h>

int main(){

	char s1[11], s2[11], s3[11], res[3];

	scanf("%s %s %s", s1, s2, s3);

	res[0] = toupper(s1[0]);
	res[1] = toupper(s2[0]);
	res[2] = toupper(s3[0]);

	for (int i = 0; i<3; ++i)
		printf("%c", res[i]);
	printf("\n");

	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K;
  cin >> N >> K;
  vector<int> h(N);
  int count = 0;
  for (int i = 0; i < N; i++){
    cin >> h.at(i);
    if (h.at(i) >= K) count++;
  }
  
  cout << count << endl;
}


Measured memory_bytes: 640
#include <cstdlib>
#include <iostream>
#include <queue>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef unsigned long long u64;
typedef signed long long l64;
u64 over = 1000000007;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  u64 k;
  cin >> k;
  if (k == 0) {
    cout << 4 << endl;
    cout << 3 << " " << 3 << " " << 3 << " " << 3 << endl;
    return 0;
  }
  if (k == 1) {
    cout << 3 << endl;
    cout << "1 0 3" << endl;
    return 0;
  }
  if (k < 50) {
    cout << k << endl;
    for (int i = 0; i < k; ++i) {
      cout << k << " ";
    }
    cout << endl;
    return 0;
  }
  cout << 50 << endl;
  for (int i = 0; i < k%50; ++i) {
    cout << k/50 + 100 - k%50 << " ";
  }
  for (int i = k%50; i < 50; ++i) {
    cout << 49 + k/50 - k%50 << " ";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
// https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/8/ITP1_8_A

#include <iostream>
#include <cstring>
#include <vector>

int main()
{
    std::string str;
    //スペースが入っているので行で読み込む
    getline(std::cin, str);

    int len = str.length();
    std::vector<char> cstr(str.begin(),str.end());
    // char cstr[len];

    // strcpy(cstr, str.c_str());

    for (int i = 0; i < len; i++)
    {
        if ((cstr[i] >= 'a') && (cstr[i] <= 'z'))
        {
            cstr[i] = toupper(cstr[i]);
        }
        else if ((cstr[i] >= 'A') && (cstr[i] <= 'Z'))
        {
            cstr[i] = tolower(cstr[i]);
        }
    }

    for (auto &s : cstr)
    {
        std::cout << s;
    }

    std::cout << std::endl;
}



Measured memory_bytes: 3180
N, M = map(int, input().split())
L = 0
R = N


for i in range(M):
    l, r = map(int, input().split())
    if L < l:
        L = l
    if r < R:
        R = r
if L <= R:
    ans = R - L + 1
else:
    ans = 0
# print("---------")
# print(L)
# print(R)
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
   ll n; cin >> n;
   vector<ll> data(n);
   map<ll,ll> mapdata;
    rep(i,n){
        cin >> data[i];
        mapdata[data[i]+(i+1)]++;
    }
    ll ans = 0;
    rep(i,n) ans += mapdata[(i+1)-data[i]];
    cout << ans << endl;
}

Measured memory_bytes: 27440
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int ggcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  int n;
  cin>>n;
  vector<int> a(n),b(n),c(n),d(n),e(n),f(n);
  rep(i,n) cin>>a[i]>>b[i]>>c[i];
  d[0]=a[0];
  e[0]=b[0];
  f[0]=c[0];
  for(int i=1;i<n;i++){
    
    d[i]=max(e[i-1]+a[i],f[i-1]+a[i]);
    e[i]=max(d[i-1]+b[i],f[i-1]+b[i]);
    f[i]=max(d[i-1]+c[i],e[i-1]+c[i]);
    
  }
  cout<<max(d[n-1],max(e[n-1],f[n-1]))<<endl;
  
  
  
  
  
}
///////////////////////////

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <iomanip>
#define M 100000
#define MAX 1000000001
#define MIN -10000000000000000
#define mod 1000000007
#define ss second
#define ff first
#define ll long long int
#define pb push_back
#define ld double
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;

int solve(set<int>adj[],int current,int parent,bool vis[]){
    int ans = 0;
    vis[current] = 1;
    for(int i:adj[current]){
        if(i != parent){
            if(vis[i] == 0){
                ans += solve(adj,i,current,vis);
            }
        }
    }
    ans ++;

    return ans;
}

int main(){
    int n,m;
    cin>>n>>m;
    set<int>adj[n+1];
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        adj[a].insert(b);
        adj[b].insert(a);
    }
    int mx = 0;
    bool vis[n+1] = {0};
    for(int i=1;i<=n;i++){
        if(vis[i] == 0){
            mx = max(mx,solve(adj,i,0,vis));
        }
    }
    // mx--;
    cout<<mx<<"\n";
    return 0;
        
}


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

const ll MOD = 1e9+7;
const int INF = (int)1e9+7;

// vector<tuple<long,long>> items; // (value, weight)
// auto item = items[i];
// long v = get<0>(item);
// long w = get<1>(item);
// long v, w;
//   for( int i = 0; i < N; i++ ){
//     cin >> v >> w;
//     items.push_back( make_tuple(v, w) ); // item : (value, weight)
//   }

int dp[3001][3001];

int main(){
    string s,t;
    cin >> s >> t;
    
    for(int i=1; i<s.length()+1; i++){
        for(int j=1; j<t.length()+1; j++){
            if(s[i-1]==t[j-1]) dp[i][j] = dp[i-1][j-1] + 1;
            else dp[i][j] = max(dp[i][j-1], dp[i-1][j]);
        }
    }

    // rep(i,s.length()+1){
    //     rep(j,t.length()+1){
    //         cout << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }

    int i = s.length();
    int j = t.length();
    deque<char> a;
    while(i>=0 && j>=0){
        if(dp[i][j]==dp[i][j-1]) j--;
        else if(dp[i][j]==dp[i-1][j]) i--;
        else{
            a.push_front(s[i-1]);
            i--;
            j--;
        }
    }
    rep(i,a.size()) cout << a[i];
}


Measured memory_bytes: 35456
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll a,b,c;
  cin >> a >> b >> c;
  ll all = a + b + c;
  cout << min({all - a,all - b,all - c}) << endl;
}

Measured memory_bytes: 256
/*
PROG: abc079b
LANG: C++
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
*/
#include <bits/stdc++.h>
 
using namespace std;
 
long long readi()
{
	long long input = 0;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	bool negative = false;
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = 10 * input + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	return input;
}
void printi(long long output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
string reads()
{
	string input = "";
	char c = ' ';
	while (c <= ' ')
	{
		c = getchar();
	}
	while (c > ' ')
	{
		input += c;
		c = getchar();
	}
	return input;
}
void prints(string output)
{
	for (int i = 0; i < output.length(); i++)
	{		
		putchar(output[i]);
	}
	return;
}
int sgn(long long x)
{
	if (x < 0) 
	{
		return -1;
	}
	if (x > 0) 
	{
		return 1;
	}
	return 0;
}
long long randomize(long long x)
{
	return (((1ll << 31) * rand()) + rand()) % x;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define MT make_tuple
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

#define SINF 10007
#define MOD 1000000007
#define INF 1000000861
#define LLINF 1000000000000000861ll
#define CO 1000861
#define EPS 0.000000000000001
#define PI 3.141592653589793
#define MAXN 1000

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int N;
ll dp[MAXN];

int32_t main()
{
	ios_base::sync_with_stdio(false);
	srand(time(NULL));
	//	cout << fixed << setprecision(10);	
	//	cerr << fixed << setprecision(10);
	//	if (fopen("abc079b.in", "r"))
	//	{	
	//		freopen ("abc079b.in", "r", stdin);
	//		freopen ("abc079b.out", "w", stdout);
	//	}
	cin >> N;
	dp[0] = 2;
	dp[1] = 1;
	for (int i = 2; i <= N; i++)
	{
		dp[i] = dp[i - 1] + dp[i - 2];
	}
	cout << dp[N] << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int bubble_sort(int x[],int n)
 //配列ｘがソートしたい配列、ｎはソートする配列の数
{
 int i,j,temp;
 for(i=0; i<n-1; i++){
     for(j=n-1; j>i; j--){
         if(x[j-1]>x[j]){     //前の要素のほうが大きかったら
            temp = x[j-1];
            x[j-1]=x[j];
            x[j]=temp;           //値を入れ替える。
            }
        }
 }
}

int main()
{
 int h_m[10];
 int i;
 for(i=0; i<10; i++)
      scanf("%d",&h_m[i]);

bubble_sort(h_m,10);

for(i=9; i>6; i--)
printf("%d\n",h_m[i]);

return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
//#include<ext/pb_ds/tree_policy.hpp>
#define ll long long
#define int long long int
#define mkp make_pair
#define maxN 1005
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,a,b) for(int i=a;i<b;i++)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp map<int,int>
#define ump unordered_map<int,int>
#define  vi vector<int>
#define st set<int>
#define mst multiset<int>
#define pq priority_queue
#define mpq priority_queue<int,vector<int>,greater<int> >
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define in cin>>
#define out cout<<
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> orderedSet;
//typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> orderedMSet;
//*p.find_by_order(index) return value at index
//p.order_of_key(key) return index
void printArray(int arr[],int n)
{
   for(int i=0;i<n;i++)cout<<arr[i]<<' ';
}
void printMp(mp m)
{
  mp ::iterator it;
  for(it=m.begin();it!=m.end();it++)cout<<it->first<<' '<<it->second<<endl;
}
void printUmp(ump m)
{
  ump ::iterator it;
  for(it=m.begin();it!=m.end();it++)cout<<it->first<<' '<<it->second<<endl;
}
void printSt(st s)
{
  st ::iterator it;
  for(it=s.begin();it!=s.end();it++)cout<<*it<<' ';
}
void printMst(mst s)
{
  mst ::iterator it;
  for(it=s.begin();it!=s.end();it++)cout<<*it<<' ';
}
void printVec(vector<int>v)
{
for(int i=0;i<v.size();i++)cout<<v[i]<<' ';
}
void printVec2(vector<int>v[],int n)
{
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<v[i].size();j++)
            cout<<v[i][j]<<' ';
        cout<<endl;
    }
}
 set<pair<int,int>> primeset;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
        for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          primeset.insert(mkp(p,1));
}
pi g1[1000006],g2[1000006];
int arr[maxN][maxN];

int32_t main(){
    fastio;
int n;in n;
int arr[n];
rep(i,n)
in arr[i];
int c=0;
int ans=0;
for(int i=0;i<n-1;i++){
    if(arr[i]-arr[i+1]>=0)
        c++;
    else{
        ans=max(c,ans);
    //    out i<<" "<<c<<endl;
        c=0;
    }
}
ans=max(c,ans);
out ans;

}


Measured memory_bytes: 1024
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <cmath>
#include <climits>

using namespace std;
typedef long long ll;

int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);

  int n, K;
  cin >> n >> K;
  vector<int> h(n);
  for (int i = 0; i < n; ++i) cin >> h[i];

  vector<int> dp(n);
  for (int i = 1; i < n; ++i) {
    dp[i] = INT_MAX;
    for (int k = 1; k <= K && i - k >= 0; ++k) {
      dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]));
    }
  }

  cout << dp[n - 1] << endl;
  return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string> 
using namespace std;
int main(){
	string s;
	int c[26] =  {0};
	cin>>s;
	for(int i = 0; i < s.length();i++){
		c[s[i]-'A']++;
	}
	int f = 0;
	for(int i = 0; i < 26;i++){
		if(c[i] == 2)
			f++;
	}
	if(f == 2)
		cout<<"Yes\n";
	else
		cout<<"No\n"; 
	return 0;
} 

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




int main()
{
   string s,t;
  
   long  i,n,j,k;
    double ans=0,sum=0,temp=0;
   cin>>n>>k;
    long double arr[n];
   for(i=0;i<n;i++)
   {
    cin>>arr[i];
    arr[i]=(arr[i]+1)/2;
   }
  
  for(i=0;i<k;i++)
  {
   temp+=arr[i];
  }
  ans=max(ans,temp);

  for(i=0;i<n-k;i++)
  {
    temp=temp-arr[i]+arr[i+k];
    ans=max(ans,temp);
  }
  temp=k;
  //ans=(ans+temp)/(double)2;

   cout<<fixed<<setprecision(18)<<ans<<endl;
   
   
  

return 0;

}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for(int i=m; i<n; i++)
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
template <typename T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0; }
template <typename T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1;} return 0; }

int d[101];
int main() {
    int n,k; cin>>n>>k;
    rep(i,0,k){
        int a; cin>>a;
        rep(j,0,a){
            int b; cin>>b;
            d[b-1]++;
        }
    }
    int ans=0;
    rep(i,0,n){
        if(d[i]==0) ans++;
    }
    cout<<ans<<endl;

}

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

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

  int N; cin >> N;
  vector<int> A(N, 0);
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    cnt += (A[i] % 2);
  }
  if (cnt % 2 == 0) cout << "YES\n";
  else cout << "NO\n";
  return 0;
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

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



int main(){
    int n; cin >> n;
    VI a(n);
    REP(i, n) cin >> a[i];
    int q; cin >> q;
    REP(i, q){
        int com; cin >> com;
        int b, e, ret;
        cin >> b >> e;
        ret = a[b];
        switch(com){
            case 0:
                FOR(j, b+1, e)
                    chmin(ret, a[j]);
                break;
            case 1:
                FOR(j, b+1, e)
                    chmax(ret, a[j]);
        }
        cout << ret << "\n";
    }
    return 0;
}



Measured memory_bytes: 3112
n = int(input())
if n == 0:
    print(0)
else:
    d = 0
    pows = [(0, 1)]
    for i in range(1, 50):
        a, b = pows[i-1]
        if i%2 == 1:
            min_ = b-2**(i+1)+1
            pows.append((min_, min_+2**i-1))
        else:
            max_ = a+2**(i+1)-1
            pows.append((max_-2**i+1, max_))
    pows[0] = (1, 1)
    # for p in pows: print(p)

    ans = ''
    d = len(pows)-1
    for p in pows[::-1]:
        pmin, pmax = p
        if n >= pmin and n <= pmax:
            ans += '1'
            n -= (-2)**d
            # print((-2)**d)
        else:
            ans += '0'

        d -= 1
    print(ans.lstrip('0'))

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

int main() {
	int k,a,b;
	cin >> k >> a >> b;
	int x = b/k;
	int y = x*k;
	if(y >= a){
	    cout << "OK";
	} 
	else cout << "NG";
}


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

#define PI 3.14159265359
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define descSort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
ll gcd(ll x,ll y){
    if(y==0)return x;
    return gcd(y,x%y);
}
ll LCM(ll a, ll b){
    return a/gcd(a,b)*b;
}

int main(void)
{
    int n;
    cin>>n;
    vector<ll> a(n);
    ll lcm=1LL;
    rep(i,0,n){
        cin>>a[i];
        lcm=LCM(lcm,a[i]);
    }
    cout<<lcm<<endl;
    
    return 0;
}

Measured memory_bytes: 384