akhauriyash/Code-Regression huggingface dataset:
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static         Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static long mod =1000000007;
	public static void main(String[] args) {
		int A=sc.nextInt();
		int B=sc.nextInt();
		int K=sc.nextInt();
		ArrayList<Integer> cc = new ArrayList<>(K);
		for(int i=A;i<A+K&&i<=B;i++) {
			p(i);
		}
		for(int i=Math.max(A+K,B-K+1);i<=B;i++) {
			p(i);
		}
		
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 23892
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;

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

int main(){
  ll a,b;cin>>a>>b;
  ll g=gcd(a,b);
  
  cout<<a/g *b<<endl;
}
  


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rg register
#define il inline
using namespace std;
typedef long long ll;
const int mod=1e9+7;
char s[12];
ll ans;
int len;
il void search(int N,ll val,ll c){
	if(N==len){ans+=c+val;return;}
	search(N+1,val*10+s[N]-'0',c);
	search(N+1,s[N]-'0',c+val);
}
int main(){
	scanf("%s",s);len=strlen(s);
	search(1,s[0]-'0',0);
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 256
from itertools import accumulate
from collections import Counter

N, M = map(int, input().split())
A = list(map(int, input().split()))

B = list(accumulate(A))
ctr = Counter([v % M for v in B])
ans = 0
for i, v in ctr.items():
    ans += v * (v - 1) // 2
    if i == 0:
        ans += v
    
print(ans)


Measured memory_bytes: 63768
//minamoto
#include<bits/stdc++.h>
#define R register
#define inline __inline__ __attribute__((always_inline))
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
char buf[1<<21],*p1=buf,*p2=buf;
inline char getc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}
int read(){
    R int res,f=1;R char ch;
    while((ch=getc())>'9'||ch<'0')(ch=='-')&&(f=-1);
    for(res=ch-'0';(ch=getc())>='0'&&ch<='9';res=res*10+ch-'0');
    return res*f;
}
const int N=2e5+5;
struct eg{int v,nx;}e[N<<1];int head[N],tot;
inline void add(R int u,R int v){e[++tot]={v,head[u]},head[u]=tot;}
int mx[N],n,res;
void dfs(int u,int fa){
	mx[u]=1;
	go(u)if(v!=fa)dfs(v,u),cmax(res,mx[v]+mx[u]),cmax(mx[u],mx[v]+1);
	cmax(res,mx[u]);
}
int main(){
//	freopen("testdata.in","r",stdin);
	n=read();
	for(R int i=1,u,v;i<n;++i)u=read(),v=read(),add(u,v),add(v,u);
	dfs(1,0);
	puts(res%3==2?"Second":"First");
	return 0;
}

Measured memory_bytes: 16000
#include<iostream>
using namespace std;
int main(){

	int a,b,c;
	int dummy;

	cin >> a >> b >> c;

	if (a > b ){
		dummy = a;
		a = b;
		b = dummy;

	}

	if (a > c){
		dummy = a;
		a = c;
		c = dummy;
	
	}

	if (b > c){
		dummy = b;
		b = c;
		c = dummy;

	}
	cout << a <<" " << b <<" "<< c<<  endl;
	return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const ll mod = 998244353;

const int N = 4004;
ll dp[N][N];
int f[N];
int main(){
    f[0] = 0;
    for(int i=1; i<N; ++i) f[i] = f[i-1]+i;

    string s;
    cin >>s;

    int n = s.size();

    vector<int> r,b;
    rep(i,n){
        if(s[i]=='0') rep(j,2) r.pb(i);
        else if(s[i]=='1'){
            r.pb(i);
            b.pb(i);
        }
        else rep(j,2) b.pb(i);
    }

    int R = r.size(), B = b.size();

    rep(i,R-1) r[i+1] = max(r[i+1], r[i]+1);
    rep(i,B-1) b[i+1] = max(b[i+1], b[i]+1);

    dp[0][0] = 1;
    rep(i,2*n)rep(rr,R+1)if(dp[i][rr]>0){
        int bb = i-rr;

        if(rr<R && r[rr]<=i){
            (dp[i+1][rr+1] += dp[i][rr]) %= mod;
        }
        if(bb<B && b[bb]<=i){
            (dp[i+1][rr] += dp[i][rr]) %= mod;
        }
    }

    cout << dp[2*n][R] << endl;
    return 0;
}


Measured memory_bytes: 123520
import sys

if sys.subversion[0] == "PyPy":
    import io, atexit

    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())
RN = lambda x=int: x(RS())


def solve():
    grpsizes = [0]
    visited = set()
    for i in range(n):
        if not i in visited:
            stack = [i]
            while stack:
                el = stack.pop()
                if not el in visited:
                    visited.add(el)
                    grpsizes[-1] += 1
                    stack.extend(adj[el])
            grpsizes.append(0)
    print(max(grpsizes))
    return





n, m = RA()
adj = [[] for _ in range(n)]
for i in range(m):
    u, v = RA()
    adj[u-1].append(v-1)
    adj[v-1].append(u-1)
adj = [list(set(a)) for a in adj]
solve()


Measured memory_bytes: 161332
#include<bits/stdc++.h>
using namespace std;
long long int n,k,a,i,dp[1000001],m=1e9+7,j;
int main()
{
    cin>>n>>k;
    dp[k]=1;
    for(i=0; i<n; i++)
    {
        cin>>a;
        for(j=k; j>=0; j--)
            dp[j]+=dp[j+1];
        for(j=0; j<k; j++)
            dp[j]=(dp[j]-dp[j+a+1])%m;
    }
    cout<<dp[0];
}


Measured memory_bytes: 1024
#include <stdio.h>

int main(){
	int sum = 0;
	char ch;

	while(true)
	{
		while((ch = getchar()) != '\n'){
			sum += ch - '0';
		}
		if(sum == 0)
			break;
		else{
			printf("%d\n",sum);
			sum = 0;
		}
	}
}

Measured memory_bytes: 932
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int A, B; cin >> A >> B;
  for(int i=1; i<=3;i++){
    if(A==i || B==i) continue;
    cout << i << endl;
  }
  return 0;
}


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n,u,v,m;
  cin >> n >> u >> v >> m;

  if(n == 1){
    int ub,nb;
    int ucnt = 0, ncnt = 0;
    cin >> ub >> nb;
    rep(i,n){
      int x;
      cin >> x;
      if(x == ub) ucnt++;
      if(x == nb) ncnt++;
      if(ucnt >= u && ncnt >= v){ cout << "DRAW" << "\n"; return 0;}
      if(ucnt >= u){cout << "USAGI" << "\n"; return 0;}
      if(ncnt >= v){cout << "NEKO" << "\n"; return 0;}
    }
    cout << "DRAW" << "\n"; return 0;
  }
  map<int,vector<PII>> umap;
  rep(i,n)rep(j,n){
    int x;
    cin >> x;
    umap[x].push_back({i,j});
  }

  map<int,vector<PII>> nmap;
  rep(i,n)rep(j,n){
    int x;
    cin >> x;
    nmap[x].push_back({i,j});
  }

  VI ui(n,0);
  VI uj(n,0);
  int ucross=0;
  int ucross2=0;

  VI ni(n,0);
  VI nj(n,0);
  int ncross=0;
  int ncross2=0;

  int nline = 0;
  int uline = 0;
  PII p;
  rep(i,m){
    int x;
    cin >> x;
    bool nok=false, uok= false;

    //うさぎ
    if(umap.find(x) != umap.end()){
      rep(i,umap[x].size()){
        p = umap[x][i];
        ui[p.first]++;  if(ui[p.first] == n) uline++;
        uj[p.second]++; if(uj[p.second] == n) uline++;
        if(p.first == p.second) ucross++; if(ucross == n){uline++; ucross = -1e9;}
        if(p.first + p.second == n-1) ucross2++; if(ucross2 == n){uline++; ucross2 = -1e9;}
        if(uline >= u) uok = true;
        //cout << p.first << " "<< p.second << " -> " << uline << endl;
      }

    }


    //猫
    if(nmap.find(x) != nmap.end()){
      rep(i,nmap[x].size()){
        p = nmap[x][i];
        ni[p.first]++;  if(ni[p.first] == n) nline++;
        nj[p.second]++; if(nj[p.second] == n) nline++;
        if(p.first == p.second) ncross++; if(ncross == n) {nline++; ncross = -1e9;}
        if(p.first + p.second == n-1) ncross2++;if(ncross2 == n) {nline++; ncross2 = -1e9;}
        if(nline >= v) nok = true;
      }
    }

  //  cout << i << uline << " "<< nline<< endl;
    if(uok == true && nok == true){ cout << "DRAW" << "\n"; return 0;}
    if(uok){cout << "USAGI" << "\n"; return 0;}
    if(nok){cout << "NEKO" << "\n"; return 0;}
  }
  cout << "DRAW" << "\n";
  return 0;
}



Measured memory_bytes: 34596
using static System.Math;
using System;

public class hello
{
	public static void Main()
	{
		while (true)
		{
			string[] line = Console.ReadLine().Trim().Split(' ');
			var n = int.Parse(line[0]);
			var m = int.Parse(line[1]);
			if (n == 0 && m == 0) break;
			line = Console.ReadLine().Trim().Split(' ');
			var a = Array.ConvertAll(line, int.Parse);
			var t = m / n;
			var s = 0;
			for (int i = 0; i < n; i++)
				s += Min(a[i], t);
			Console.WriteLine(s);
		}
	}
}



Measured memory_bytes: 15880
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Data.Char (isUpper)

main :: IO ()
main = do
  s <- getLine
  putStrLn $ if solve s then "AC" else "WA"

solve :: String -> Bool
solve s = c1 && c2 && c3 where
  c1 = head s == 'A'
  c2 = (== 1) . length . filter (== 'C') . drop 2 $ take (length s - 1) s
  c3 = (== 2) . length $ filter isUpper s


Measured memory_bytes: 380
import bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()
count = 0
for a in range(N):
    for b in range(a + 1, N):
        c = bisect.bisect_left(L, L[a] + L[b])
        if c > b:
            count += c - b - 1
        else:
            break
print(count)


Measured memory_bytes: 3188
package main

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


func foo(h, x int) string {
  if x < h {
    return "No"
  } else {
    return "Yes"
  }
}

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {
        panic(e)
    }
    return i
}

func main() {
  var h int
  fmt.Scan(&h)
  
  sc.Split(bufio.ScanWords)
  next := nextInt()
  x := 0
  for i := 0; i < next; i++ {
    x += nextInt()
  }
  fmt.Println(foo(h, x))
}


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

int main(){
    int len;
    cin >> len ;
    
    int lis[100];
    
    for (int i = 0; i< len ;i++) cin >>lis[i];
    
    for (int j = len-1; j >=0; j--){
        if(j != len-1){
            cout << " ";
        }
        cout << lis[j];
        
    }
    cout << endl;
    return 0;  
    

}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
#define il inline
#define vd void
typedef long long ll;
il ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
char s[5010],t[5010];
int n,A[5010],B[5010],a,b,SA[5010],SB[5010];
il int S(int*s,int l,int r,int k=0){
	if(l>r)return 0;
	return k?s[r]-s[l-1]:(r-l+1)*n-s[r]+s[l-1];
}
int main(){
#ifdef XZZSB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	n=gi();scanf("%s",s+1);scanf("%s",t+1);
	int ans=INT_MAX;
	A[++a]=0,B[++b]=0;
	if(s[1]=='1')A[++a]=0;if(t[1]=='1')B[++b]=0;
	for(int i=1;i<n;++i)if(s[i]!=s[i+1])A[++a]=i;
	for(int i=1;i<n;++i)if(t[i]!=t[i+1])B[++b]=i;
	A[++a]=n,B[++b]=n;
	if(s[n]=='1')A[++a]=n;if(t[n]=='1')B[++b]=n;
	for(int i=1;i<=a;++i)SA[i]=SA[i-1]+A[i];
	for(int i=1;i<=b;++i)SB[i]=SB[i-1]+B[i];
	for(int i=1;i<=b;i+=2){
		int c=std::min(b,a+i-1),res=S(SB,1,i-1,1)+S(SB,i+a,b)+S(SA,c-i+2,a);
		for(int j=i;j<=c;++j)res+=abs(A[j-i+1]-B[j]);
		ans=std::min(res,ans);
	}
	for(int i=1;i<=a;i+=2){
		int c=std::min(a,b+i-1),res=S(SA,1,i-1,1)+S(SA,i+b,a)+S(SB,c-i+2,b);
		for(int j=i;j<=c;++j)res+=abs(B[j-i+1]-A[j]);
		ans=std::min(res,ans);
	}
	return printf("%d\n",ans),0;
}


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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

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

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

template <class T>
class segtree {
public:
    int n;
    vector<T> dat, sum;  //区間の和,区間に一様に足された値
    segtree(int size, T x) {
        n = 1;
        while (n < size) n *= 2;
        dat.assign(2 * n - 1, 0);
        sum.assign(2 * n - 1, 0);
        add(0, size, x);
    }
    void add(int a, int b, T x) { add(a, b, x, 0, 0, n); }
    T add(int a, int b, T x, int k, int l, int r) {
        if (b <= l or r <= a) return dat[k];
        if (a <= l and r <= b) {
            sum[k] += x;
            return dat[k] += x;
        }
        int m = (l + r) / 2;
        return dat[k] = max(add(a, b, x, 2 * k + 1, l, m), add(a, b, x, 2 * k + 2, m, r)) + sum[k];
    }
    T query(int a, int b) { return query(a, b, 0, 0, n); }
    T query(int a, int b, int k, int l, int r) {
        if (b <= l or r <= a) return -inf64;
        if (a <= l and r <= b) return dat[k];
        int m = (l + r) / 2;
        return max(query(a, b, 2 * k + 1, l, m), query(a, b, 2 * k + 2, m, r)) + sum[k];
    }
};

void solve() {
    //const i64 mod = 1'000'000'007;

    i64 N,M;
    cin >> N >> M;

    vector<vector<pair<i64,i64>>> r_to_la(N);
    rep(i,0,M){
        i64 l,r,a;
        cin >> l >> r >> a;
        --l;
        --r;
        r_to_la[r].emplace_back(make_pair(l,a));
    }

    const i64 maxn=200000;
    segtree<i64> dp(maxn,-inf64);
    rep(r,0,N){
        i64 val=max(i64(0),dp.query(0,r));
        i64 tmp=dp.query(r,r+1);
        dp.add(r,r+1,-tmp);
        dp.add(r,r+1,val);

        for(auto &p:r_to_la[r]){
            i64 l=p.first,a=p.second;
            dp.add(l,r+1,a);
        }
    }

    cout << max(i64(0),dp.query(0,N)) << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 19456
import java.util.Scanner;

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

    //input
    int n = sc.nextInt();
    int d = sc.nextInt();
    int count = 0;
    double[] distArray = new double[n];
    for(int i = 0; i < distArray.length; i++){
      int x = sc.nextInt();
      int y = sc.nextInt();
      distArray[i] = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
      if( distArray[i] <= d ){
        count++;
      }
    }

    //output
    System.out.println(count);

  }
}


Measured memory_bytes: 51460
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
const long long MOD = 1e9+7;
int main(){
    int card[3][3];
    rep(i,3) rep(j,3) cin >> card[i][j];
    bool bingo[3][3];
    rep(i,3) rep(j,3) bingo[i][j] = false;
    int n;
    cin >> n;
    int a;
    rep(i,n){
        cin >> a;
        rep(j,3) rep(k,3) if(card[j][k]==a) bingo[j][k] = true;
    }
    bool Isbingo = false;
    bool tmpfl = true;
    rep(i,3) if(!bingo[i][2-i]) tmpfl = false;
    if(tmpfl) Isbingo = true;
    tmpfl = true;
    rep(i,3) if(!bingo[i][i]) tmpfl = false;
    if(tmpfl) Isbingo = true;   
    rep(i,3){
        tmpfl = true;
        rep(j,3) if(!bingo[i][j]) tmpfl = false;
    if(tmpfl) Isbingo = true;           
    }
    rep(i,3){
        tmpfl = true;
        rep(j,3) if(!bingo[j][i]) tmpfl = false;
    if(tmpfl) Isbingo = true;           
    }
    if(Isbingo) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

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


Measured memory_bytes: 4840
n = int(input())
ar = list(map(int, input().split()))
ans = [0 for i in range(n)]
fond = True
for i in range(n-1,-1,-1):
    mx = -1
    for j in range(i+1):
        if ar[j] == j+1:
            mx = max(mx, j+1)
    if mx == -1:
        fond = False
        break
    else:
        ans[i] = mx
        for j in range(mx-1, i):
            ar[j] = ar[j+1]

if fond:
    for i in range(n):
        print(ans[i])
else:
    print(-1)




Measured memory_bytes: 3188
'use strict'
// inputに入力データ全体が入る
function Main(input) {
  input = input.split(" ");
  // Nはそれぞれの数
  const N = parseInt(input[0], 10);
  // Aはけた合計の最小値
  const A = parseInt(input[1], 10);
  // Bはけた合計の最大値
  const B = parseInt(input[2], 10);
  const div10 = (a) => Math.floor(a / 10);
  let count = 0;
  
  // 足し合わせ用の関数
  function sum(n){
  	let result = 0;
    while(n > 0) {
		result += n%10;
      	n = div10(n);
    }
    return result;
  }
  
  for(let i = 0; i <= N; i++){
  	let res = sum(i);
    if(res >= A && res <= B){
    	count+= i;
    }
  }
  console.log(count);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"
#define fcout cout << fixed << setprecision(18)

#define MOD 1000000007 // 1e9+7
#define PI 3.1415926535
/*
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
*/
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1
#define LINF 1000000000000000001 // 1e18+1

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

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  ll n,k;cin>>n>>k;
  ll ans;
  if(2*n < k){
    ans=0;
  }else if(k%2==1){
    ans=(n/k)*(n/k)*(n/k);
  }else if(k==2){
    if(n%2==0)ans=n*n*n/4;
    if(n%2==1)ans=(n/2 + 1)*(n/2 + 1)*(n/2 + 1) + (n/2)*(n/2)*(n/2);
  }else if(k%2==0){
    ll p=k/2;
    ll s = n/p;
    if(s%2==0)ans=s*s*s/4;
    if(s%2==1)ans=(s/2 + 1)*(s/2 + 1)*(s/2 + 1) + (s/2)*(s/2)*(s/2);
  }
  P(ans);

  return 0;
}


Measured memory_bytes: 256
S=input()
flag=True
if len(S)==1:
    print("No")
    exit()
if len(S)%2==1:
    print("No")
    exit()
for i in range(len(S)):
    if i%2==0:
        if S[i]!="h":
            flag=False
            break
    else:
        if S[i]!="i":
            flag=False
            break
if flag:
    print("Yes")
else:
    print("No")
    

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int mod_) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod_;
		}
		x = x * x % mod_;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}
/*--------Library Zone!--------*/

int h, w;
int cnt[30];
void no() {
	cout << "No" << endl;
	exit(0);
}
signed main() {
	cin >> h >> w;
	rep(i, h)rep(j, w) {
		char c; cin >> c;
		cnt[c - 'a']++;
	}
	int four = 0, two = 0;
	rep(i, 26) {
		four += cnt[i] / 4;
		if (cnt[i] % 4 >= 2)two++;
	}
	if (h % 2 && w % 2) {
		int four_ = (h / 2) * (w / 2), two_ = h / 2 + w / 2;
		if (four_ > four)no();
		four -= four_;
		two += four * 2;
		if (two_ > two)no();
	}
	else if (h % 2) {
		int four_ = (h / 2) * (w / 2), two_ = w / 2;
		if (four_ > four)no();
		four -= four_;
		two += four * 2;
		if (two_ > two)no();
	}
	else if (w % 2) {
		int four_ = (h / 2) * (w / 2), two_ = h / 2;
		if (four_ > four)no();
		four -= four_;
		two += four * 2;
		if (two_ > two)no();
	}
	else {
		if ((h / 2) * (w / 2) != four)no();
	}
	cout << "Yes" << endl;
}

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

using namespace std;

int nadjiX(string s,int n)
{
    for(int i=n/2;i<n-1;i++)
        if(s[i]!=s[i+1])return i;
    return -1;
}

int nadjiY(string s,int n)
{
    for(int i=n/2;i>0;i--)
        if(s[i]!=s[i-1])return i;
    return -1;
}
vector<int>res;

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

    string s;
    cin>>s;
    int n=s.size();
    for(int i=1;i<s.size();i++)
    {
        if(s[i]!=s[i-1])res.push_back(max(i,n-i));
    }
    if(res.size()>0)cout<<*min_element(res.begin(),res.end());
    else cout<<n;
    /*int n=s.size();
    int i=s.size()/2;
    int x=i;
    int y=i;
    bool xx=false;
    bool yy=false;
    while(x>=0&&y<=n)
    {
        if(s[x]!=s[x-1]){xx=true;break;}
        if(s[y]!=s[y+1]){yy=true;break;}
        x--;
        y++;
    }
    if(xx=true)
    {
        cout<<max(x,(n-x));
        return 0;
    }
    if(yy=true)cout<<max(y,n-y);*/

    return 0;
}



Measured memory_bytes: 720
#include<iostream>
#include<algorithm>
#include <iostream> 
#include <algorithm> 
#include<string>
#include<queue>
#include<utility>
#include<fstream>
#include<queue>
#include<set>
#include<stack>
#include<map>
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 
 
typedef pair<int,int >P;
//////////////////////////   
/////////////////////////

int n;
ll DP[22][10][2];
ll dp(int pos, int la, bool fl){

    if(pos == n){
        return 1;
    }
    ll &ret = DP[pos][la][fl];
    if(ret != -1)return ret ;

    int lo = max(0, la-1);
    int hi = min(9, la + 1);
    if(!fl){
        lo = 0, hi = 9;
    }

    ret = 0;
    for(int i = lo;i<=hi;i++){
        ret+=dp(pos + 1, i, i>0 ?1:fl);
    }
    return ret;
}
ll k;
ll res;
void print(int pos, int la, bool fl){
    if(pos == n)return ;
    int lo = max(0, la-1);
    int hi = min(9, la + 1);
    if(fl == 0){
        lo = 0, hi = 9;
    }
    for(int i = lo;i<=hi;i++){
        ll ko = dp(pos + 1, i, i>0 ?1:fl);
        if(ko < k)k-=ko;
        else {
            res = res * 10 + i;
            print(pos + 1, i,i > 0? 1:fl );
            break;
        }
    }

}
int main(){


   
    cin>>k;
    k ++;
    SETR(DP);
    n = 19;

    ll ans = dp(1, 0,0);


   // cout<<ans<<endl;
      

    res = 0;
    print(1, 0, 0);
    cout<<res<<endl;

    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

prev_monster = sum(A)
#勇者は左(i番目)を優先して倒していく方針で
for i in range(N):
  if(A[i] <= B[i]):#左を全滅できるなら
    if(A[i+1] <= B[i]-A[i]):#右も全滅できるなら
      A[i+1] = 0
    else:
      A[i+1] = A[i+1] - (B[i]-A[i])
    A[i] = 0
  else:
    A[i] = A[i]-B[i]

after_monster = sum(A)
ans = prev_monster - after_monster
print(ans)
  

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

int main() {
  int64_t a, b;
  cin >> a >> b;
  if ((max(a, b)-min(a, b))%2 == 0) {
    cout << min(a, b) + (max(a, b)-min(a, b))/2 << endl;
  } else {
    cout << "IMPOSSIBLE" << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <map>
#include <set>
#include <ctype.h>
#include <numeric>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const int INF = 1e9;

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

int selectionSort(vector<int>& a, int n) {
  int count = 0;
  for (int i = 0; i < n; ++i) {
    int minj = i;
    for (int j = i; j < n; ++j) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (i != minj) ++count;
    swap(a[i], a[minj]);
  }
  return count;
}

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

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

  int res = selectionSort(arr, n);
  for (int i = 0; i < n; ++i) {
    cout << arr[i];
    if (i == n - 1) break;
    cout << " ";
  }
  cout << endl << res << endl;
  return 0;
}



Measured memory_bytes: 3092
from sys import stdin
def main():
    readline=stdin.readline
    S=readline().strip()
    N=len(S)
    M=N//2

    if S==S[::-1] and S[:M]==S[:M][::-1] and S[M+1:]==S[M+1:][::-1]:
        print("Yes")
    else:
        print("No")
if __name__=="__main__":
    main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;
typedef pair<ll,ll> pairs;
typedef vector<pairs> p;


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

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

vector<vector<ll>> combination(ll n, ll r){
    vector<vector<ll>> v(n + 1, vector<ll>(n + 1, 0));
    for(ll i=0;i<v.size();++i){
        v[i][0] = 1;
        v[i][i] = 1;
    }
    for(ll i=1;i<v.size();++i){
        for(ll j=0;j<i;++j){
            v[i][j] = (v[i - 1][j - 1] + v[i - 1][j]);
        }
    }
    return v;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll n;
    cin>>n;
    vector<ll> g;
    ll a[n];
    for(ll i=0;i<n;++i){
        cin>>a[i];
        g.push_back(a[i]);
    }
    sort(g.begin(), g.end());
    ll flag = g[0];
    ll sum = 1;
    ll ans = 0;
    for(ll i=1;i<n;++i){
        if(flag == g[i]){
            sum++;
        }else{
            flag = g[i];
            if(sum%2==1){
                ans++;
            }
            sum = 1;
        }
    }
    if(sum%2==1){
        ans++;
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 1912
import java.util.Scanner;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
    static final long MOD = 1000000007;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        if ((n + m) % 2 == 0){
            System.out.println((n+m)/2);
        } else {
            System.out.println("IMPOSSIBLE");
        }

    }
}


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

using namespace std;
using ll = long long;

template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_V(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_M(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}

int main() {
    ll r, d, a;
    cin>>r>>d>>a;

    for (int i = 0; i < 10; ++i) {
        a=r*a-d;
        cout<<a<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
/*  
    Talkin' to myself and feelin' old
    Sometimes I'd like to quit, nothin' ever seems to fit
    Hangin' around, nothin' to do but frown
    Rainy days and Mondays always get me down
    _________________________
    _________________________
    912 Hours of Solitude
    Quarantine_Day : 38
*/

#include<bits/stdc++.h>

using namespace std;

typedef long long int       ll;
typedef vector<int>         vi;
typedef vector<ll>          vl;
typedef pair<int, int>      pii;
typedef pair<ll, ll>		pll;

#define pb(n)           push_back(n)
#define GSORT(v)        sort(v.begin(), v.end(), greater<int>())
#define SORT(v)         sort(v.begin(), v.end());
#define REV(v)          reverse(v.begin(), v.end());
#define db(a)           cout<<#a<<" = "<<a<<endl;
#define FIN             freopen("in.txt","r",stdin);
#define FOUT            freopen("out.txt","w",stdout);
#define REP(i,n)        for(int i = (int)(0); i < (int)(n); i++)
#define FOR(i, a, b)    for(int i = (int)a; i <= (int)b; i++)    

#define MAX 50005

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

    ll x, y, z;
    cin>>x>>y>>z;

    ll rem = x - z;
    cout<<rem / (y + z)<<"\n";

    return 0;
}


Measured memory_bytes: 256
import string
def run():
    letter_list=[] #appendのために宣言が必要
    while True:
        try:
            letter_list.append(input())
    
        except:
            break
        
    letter="".join(letter_list)
    
    d={k:0 for k in string.ascii_lowercase}
    
    for c in letter:
        c=c.lower()
        if c in d:
            d[c]+=1
            
    for c in string.ascii_lowercase:
        print(f"{c} : {d[c]}")


run()


Measured memory_bytes: 6696
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <string>

using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)
static const ll maxLL = (ll)1 << 62;

ll A[200001] = {};
ll B[200001] = {};
ll N;
ll calc(ll b) {
	ll sum = 0;
	repe(i, 1, N) {
		sum += abs(B[i] - b);
	}
	return sum;
}
int main() {
	cin >> N;
	ll maxV = 0;
	ll absV = (ll)1 << 50;
	ll minV = (ll)1 << 50;
	map<ll, ll>mp;
	repe(i, 1, N) {
		ll a; cin >> a;
		A[i] = a;
		B[i] = a - i;
		maxV = max(maxV, B[i]);
		minV = min(minV, B[i]);
	}

	ll minVans = (ll)1 << 50;
	sort(B + 1, B + N + 1);
	ll b = B[N/ 2 + 1];
	ll sum = calc(b);
	minVans = min(sum, minVans);

	//ll b = 0;
	//repe(b, minV, maxV) {
	//	ll sum = 0;
	//	repe(i, 1, N) {
	//		sum += abs(B[i] - b);
	//	}

	//	minVans = min(sum, minVans);
	//}

	cout << minVans << endl;

	return 0;
}

Measured memory_bytes: 3328
n = int(input())
verdicts = ['AC', 'WA', 'TLE', 'RE']
cnt = {verdict : 0 for verdict in verdicts}
for i in range(n):
  verdict = input()
  cnt[verdict] += 1
  
for verdict in verdicts:
	print('{} x {}'.format(verdict, cnt[verdict])) 

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

int main() {
  int a,b,c,X,Y; cin>>a>>b>>c>>X>>Y;
  int res=1e9;
  for (int AB=0; AB<=200000; AB+=2) {
    int tmp=0;
    tmp+=AB*c;
    int aa=X-AB/2;
    int bb=Y-AB/2;
    if (aa>0) tmp+=aa*a;
    if (bb>0) tmp+=bb*b;
    res=min(res, tmp);
  }
  cout<<res<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
const int MOD = 1e9+7,MAX = 1e5;

int main()
{
   int a,b,c,x,y;
   cin >> a >> b >> c >> x >> y;
   int ans = 0;
   if(a+b>c*2)
   {
      int poiu = min(x,y);
      x -= poiu;
      y -= poiu;
      ans += c*poiu*2;
   }
   if(a>c*2)
   {
      int poiu = x;
      ans += x *c * 2;
      x = 0;
   }
   if(b>c*2)
   {
      ans += y*c*2;
      y = 0;
   }
   ans += x*a;
   ans += y*b;

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

Measured memory_bytes: 256
/*
 *  author: chw0501
 *  created: 15.04.2020 11:42:18(UTC)
*/
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

const ll MOD=1000000007ll;
ll n,k;
ll arr[101];
//dp[i][j]: j번째 사람까지 사용한 사탕 개수 i, 그럴 가짓수 %MOD
ll dp[100010][110];
//sum[i][j]: dp[0][j] ~ dp[i-1][j]까지의 합
ll sum[100010][110];
int main(){
	cin>>n>>k;
	for(int i=0;i<n;i++){
		scanf("%lld",arr+i);
	}
	dp[0][0]=1;
	for(int i=0;i<=k;i++){
		sum[i+1][0]=sum[i][0]+dp[i][0];
	}
	for(int j=0;j<n;j++){
		for(int i=0;i<=k;i++){
			ll x=max(i-arr[j],0ll);
			dp[i][j+1]=(sum[i+1][j]-sum[x][j]+MOD)%MOD;
			sum[i+1][j+1]=(sum[i][j+1]+dp[i][j+1])%MOD;
		}
		for(int i=0;i<=k;i++){
			//sum[i+1][j+1]=(sum[i][j+1]+dp[i][j+1])%MOD;
		}
	}
	cout<<dp[k][n];
	return 0;
}

Measured memory_bytes: 172160
#include<iostream>
using namespace std;
long long hgtm;
long long hgt;
long long ans;
int main()
{
	int n;
	cin >> n;
	hgtm = 0;
	for (int i = 1; i <= n; i++)
	{
		cin >> hgt;
		if (hgt < hgtm)
			ans += hgtm - hgt;
		else
			hgtm = hgt;
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
    int n;cin>>n;
    double a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for (int i=1;i<n;i++)
        a[i]=(a[i-1]+a[i])/2;
    cout<<fixed<<a[n-1]<<endl;
}

Measured memory_bytes: 256
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,a[202020];
map<int,int> mp;

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  cin >> n;
  for(int i=1;i<=n;i++){
    cin >> a[i];
  }
  int ans = 0;
  for(int i=1;i<=n;i++){
    ans+=mp[i-a[i]];
    mp[i+a[i]]++;
  }
  cout << ans << endl;
  


return 0;
}
///....


Measured memory_bytes: 27860
a, b, k = map(int, input().split())

cnt = 0
ans_dic = {}
for i in range(max(a, b)):
    n = i+1
    if a%n == 0 and b%n == 0:
        cnt += 1
        ans_dic[cnt] = n

print(ans_dic[cnt - (k-1)])


Measured memory_bytes: 2940
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

template<typename T>
auto makeNdVector(int n) {
  return vector<T>(n);
}

template<typename T, typename N, typename... Tail>
auto makeNdVector(const N& n, const Tail&... tail) {
  auto vec = makeNdVector<T>(tail...);
  vector<decltype(vec)> vecs(n, vec);
  return vecs;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vs){
  for(T& v: vs) is >> v;
  return is;
}

int main() {
  int N; cin >> N;
  auto a = makeNdVector<LL>(N, N);
  for (int i = 0; i < N; ++i) cin >> a[i];

  vector<LL> dp(1 << 16, 0);
  for (int mask = 0; mask < (1 << N); ++mask) {
    bitset<17> b(mask);
    for (int i = 0; i < N; ++i) {
      for (int j = i; j < N; ++j) {
        if (b.test(i) && b.test(j)) dp[mask] += a[i][j];
      }
    }
  }

  for (int mask = 0; mask < (1 << N); ++mask) {
    for (int used = mask; used > 0; used = (used-1) & mask) {
      int unused = mask - used;
      dp[mask] = max(dp[mask], dp[used] + dp[unused]);
    }
  }

  cout << dp[(1 << N) - 1] << endl;
}


Measured memory_bytes: 3796
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>

using namespace std;

template<class T> void gc(T &x)
{
    char c;
    int s = 0;
    x = 0;

    c = getchar_unlocked();

    if (c == '-') s = 1;
    else if ('0' <= c && c <= '9')  x = c - '0';

    while (true)
    {
        c = getchar_unlocked();

        if (c < '0' || c > '9') break;
        x = x * 10 + (c - '0');
    }

    if (s) x = -x;
}

// 素数判定
bool isPrime(int n)
{
    if (n < 2) return false;
    for (int i = 2; i * i <= n; i++)
    {
        if (n % i == 0) return false;
    }
    return true;
}

int main()
{
    int Q;

    gc(Q);

    vector<int> vflg(100001, 0);
    vector<int> vsum(100001, 0);

    for (int i = 1; i <= 100000; i++)
    {
        if (isPrime(i) && isPrime((i + 1) / 2)) vflg[i] = 1;
        vsum[i] += vsum[i - 1] + vflg[i];
    }

    for (int i = 1; i <= Q; i++)
    {
        int l, r;
        gc(l);
        gc(r);

        int ans = vsum[r] - vsum[l - 1];
        printf("%d\n", ans);
    }

    return 0;
}


Measured memory_bytes: 1408
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <string>
#include <math.h>
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>

#include <iomanip> //小数点以下を表示させる(setprecision())

#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

typedef long long ll; //64bit型
using namespace std;
const ll INF = 1LL << 20;

int main()
{
        int N;
        cin >> N;
        vector<int> cost(N + 1), value(N + 1);
        for (int i = 0; i < N; i++)
        {
                cin >> value[i];
        }
        for (int i = 0; i < N; i++)
        {
                cin >> cost[i];
        }

        int ans = 0;
        for (int i = 0; i < N; i++)
        {
                int a;
                a = value[i] - cost[i];
                if (a > 0)
                {
                        ans += a;
                }
        }
        cout << ans << endl;

        return 0;
}

Measured memory_bytes: 256