akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n){return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int h=getInt(),w=getInt(),k=getInt();

		for(int i=0;i<=h;++i) {
			for(int j=0;j<=w;++j) {
				if(calc(i,j,h,w)==k) {
					System.out.println("Yes");
					return;
				}
			}
		}
		System.out.println("No");
	}
	private static int calc(int i,int j, int h, int w){
		return i*w+j*h-i*j*2;
	}
}

Measured memory_bytes: 21844
let input = require("fs").readFileSync("/dev/stdin", "utf8")

function main({ input, load, yesno, math_sum, math_max, math_min }) {

    const [N] = load()
    const A = load(N)

    let Ai_max = math_max(A)
    const nums = new Array(Ai_max + 1).fill(0)

    for(const a of A) nums[a]++

    for(let i = 1; i <= Ai_max; i++) {
        if(!nums[i]) continue
        for(let j = i * 2; j <= Ai_max; j += i) {
            nums[j] = 0
        }
    }

    console.log(nums.filter(n => n === 1).length)
}

let inputs = input.split(/[\s\n]/)
main({
    input,
    yesno: value => value ? 'Yes' : 'No',
    math_sum: numbers => numbers.reduce((acc, cur) => acc + cur, 0),
    load(rows = 1, cols = 1, is_number = true) {
        const length = rows * cols
        let result = inputs.splice(0, length)
        if(is_number) result = result.map(Number)
        if(cols > 1) {
            const arrays = new Array(cols)
            for(let col = 0; col < cols; col++) {
                arrays[col] = new Array()
                for(let row = 0; row < rows; row++) {
                    arrays[col].push(result[row * cols + col])
                }
            }
            result = arrays
        }
        return result
    },
    inifinite_loop_preventer() {
        throw new Error("Infinite loop")
    },
    math_max(numbers, initial_value = null) {
        let result = (initial_value === null) ? numbers[0] : initial_value
        for(const n of numbers) if(n > result) result = n
        return result
    },
    math_min(numbers, initial_value = null) {
        let result = (initial_value === null) ? numbers[0] : initial_value
        for(const n of numbers) if(n < result) result = n
        return result
    },
})


Measured memory_bytes: 70324
#include <vector> 
#include <list> 
 #include <map>
 #include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

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

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

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


string yes="Yes",no="No";
int main(){
    
    int a,b;
    string s;
    cin>>s;
    if(s.find("AC")!=string::npos){
        cout<<yes<<endl;
    }
    else{
        cout<<no<<endl;
    }




}


Measured memory_bytes: 256
import java.util.*;

public class Main {

  public static void main(String[] args) {
  
  Scanner saw = new Scanner(System.in);
  int N,A,B,max,min;
  N = saw.nextInt();
  A = saw.nextInt();
  B = saw.nextInt();
  if((A+B)<=N){
    min = 0;
  }else{
    min = A+B-N;
  }
  if(A>=B){
    max = B;
  }else{
    max = A;
  }
  System.out.println(max+" "+min);
   
  }
}


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

using namespace std;

int N, X, K, a[4016];
long long bst;

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d", &N, &X);
for (int i=0; i<N; i++)
    scanf ("%d", &a[i]);
for (int i=N; i<2 * N; i++)
    a[i] = a[i - N];
for (int L = 1; L <= N; L ++)
{
    long long curr = 1LL * X * (L - 1);
    deque < int > dq;
    for (int i=0; i<2 * N; i++)
    {
        while (!dq.empty () && a[dq.back ()] >= a[i]) dq.pop_back ();
        dq.push_back (i);
        while (dq.front () <= i - L) dq.pop_front ();
        if (i >= N) curr += a[dq.front ()];
    }
    if (L == 1) bst = curr;
    else
    if (curr < bst) bst = curr;
}
printf ("%lld\n", bst);

return 0;
}


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

#define LL long long
#define hell 1000000007
#define PI acos(-1.0)



int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout << fixed << showpoint;
cout << setprecision(11);

int n, k;cin>>n>>k;
int ar[n];for(int i=0;i<n;i++) cin>>ar[i];

sort(ar, ar+n);
LL sm = 0;
for(int i=0;i<k;i++)
{
    sm+=ar[i];
}

cout<<sm;

return 0;
} 

Measured memory_bytes: 3648
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
struct edge{//辺の情報
  int from,to;
  ll cost;
};
int V,E;//頂点の数、辺の数
edge e[2001];
ll d[1001];//d[v]は始点から頂点vまでの最短距離
bool update;
void bellmanford(int s){//始点sからスタート
  for(int i=0;i<V;i++) d[i]=INFLL;//初期化
  d[s]=0;
  rep(j,V){
    update=false;//更新したか否かのフラグ
    rep(i,E){//全エッジについてループ
      int f=e[i].from,t=e[i].to;
      ll c=e[i].cost;
      if(d[f]!=INFLL&&d[t]>d[f]+c){//更新
	d[t]=d[f]+c;
	update=true; 
      }
    }
    if(!update) break;
  }
}
bool nega[1001];
void find_nega(){
  rep(i,V) nega[i]=false;
  rep(i,V){
    rep(i,E){
      int f=e[i].from,t=e[i].to;
      ll c=e[i].cost;      
      if(d[f]!=INFLL&&d[t]>d[f]+c){//更新
	d[t]=d[f]+c;
	nega[t]=true;
      }
    }
  }
  
}
int main(){
  cin>>V>>E;
  rep(i,E){
    int a,b;
    ll c;
    cin>>a>>b>>c;
    e[i].from=a-1;
    e[i].to=b-1;
    e[i].cost=-c;
  }
  bellmanford(0);
  find_nega();
  if(!nega[V-1]) prin(-d[V-1]);
  else prin("inf");
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	ll k;
	cin>>k;
	ll n = 50;
	vector<ll> v(n, n-1+k/n);
	k %= n;
	rep(i, n){
		if(i<k) v[i] += n+1;
		v[i] -= k;
	}
	cout<<n<<endl;
	rep(i, n) cout<<v[i]<<" "; cout<<endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var items = Console.ReadLine().Split().Select(elem => decimal.Parse(elem)).ToArray();

            try
            {
                var answer = (decimal)0;
                if (!items.Contains(0UL))
                {
                    foreach (var item in items.Select((elem, idx) => new { Index = idx, Data = elem }))
                    {
                        if (item.Index == 0)
                        {
                            answer = item.Data;
                        }
                        else
                        {
                            answer *= item.Data;
                        }

                        if (answer > 1000000000000000000)
                        {
                            throw new OverflowException();
                        }
                    }
                }

                Console.WriteLine(answer);
            }
            catch (Exception)
            {
                Console.WriteLine("-1");
            }
        }
    }
}


Measured memory_bytes: 43592
#include<stdio.h>

int main (void){
    int n = 0;
    scanf("%d", &n);

    int chenge = 0;
    if (n % 1000 > 0) {
        chenge = 1000 - (n % 1000);
    }
    else { 
        //void
    }
    printf("%d", chenge);

    return 0;
}

Measured memory_bytes: 1732
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N, A, B = sc.nextInt
  sc.nextLine
  val S = sc.nextLine

  var a = 0
  var b = 0
  S.foreach({
    case 'a' =>
      if (a + b < A + B) {
        a += 1
        println("Yes")
      } else {
        println("No")
      }
    case 'b' =>
      if (a + b < A + B && b + 1 <= B) {
        b += 1
        println("Yes")
      } else {
        println("No")
      }
    case _ => println("No")
  })
}


Measured memory_bytes: 42560
#include<stdio.h>
int main(void)
{
 int x,y;

 for(;;){
scanf("%d %d",&x,&y);

if(x==0&&y==0)
{
break;
}
if(x>y)
{
printf("%d %d\n",y,x);
}
else
{
printf("%d %d\n",x,y);
}
} 
return 0;
}


Measured memory_bytes: 2584
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <functional>
#include <math.h>

using namespace std;
const int mod = 1000000007;
const double pi = 3.141592653589793238462643382795028841971;

int main() {
	string h;
	cin >> h;
	int ans = 99999999;
	for (int i = 2; i < h.length(); ++i) {
		int mon = stoi(h.substr(i - 2, 3));
		ans = min(ans, abs(mon - 753));
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ips = br.readLine().split(" ");
        int n = Integer.parseInt(ips[0]);
        int m = Integer.parseInt(ips[1]);
        int k = Integer.parseInt(ips[2]);
        for(int i = 0; i <= n; ++i){
            int num = (k-m*i);
            int den = (n-2*i);
            if(den==0)
                continue;
            if(num%den == 0 && num/den <= m && num/den >= 0){
                System.out.println("Yes");
                return;
            }
        }
        System.out.println("No");
    }
}

Measured memory_bytes: 23124
#d maze master

from collections import deque

def bfs(sx,sy):
    cnt=0
    INF=100100100
    #mazeのまわりを"#"で囲ったので
    dist=[[INF]*(w+2) for _ in range(h+2)]
    dx=[1,0,-1,0]
    dy=[0,1,0,-1]

    que=deque([])
    que.append((sx,sy))
    dist[sx][sy]=0

    #while内でpopして空になったとき(最後の層)まで調べた
    while que:
        q=que.popleft()

        for i in range(4):
            next_x=q[0]+dx[i]
            next_y=q[1]+dy[i]

            if maze[next_x][next_y]!="#" and dist[next_x][next_y]==INF:
                que.append((next_x,next_y))
                dist[next_x][next_y]=dist[q[0]][q[1]]+1
                cnt=dist[next_x][next_y]
                #一番最後の層の距離に更新される
    return cnt

h,w=map(int,input().split())
maze=[]
ans=0
x=""
for i in range(w+2):
    x+="#"
maze.append(x)
for i in range(h):
    s=input()
    s='#'+s+'#'
    maze.append(s)
maze.append(x)
for i in range(1,h+1):
    for j in range(1,w+1):
        if maze[i][j]=="#":
            continue
        ans=max(ans,bfs(i,j))
print(ans)

Measured memory_bytes: 3316
s = list(input())
t = input()
n = len(s)
f = False
for i in range(n):
    tmp = s[n-1]
    for j in range(n-1,-1,-1):
        s[j] = s[j-1]
    s[0] = tmp
    if t == "".join(s):
        print("Yes")
        f = True
        break
if not f:
    print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

#define int ll
void solve()
{
  string s;
	cin>>s;
	vector<int>pos;
	int ans=0;
	if(s[0]=='<')s='>'+s,--ans;
	if(s.back()=='>')s+='<',--ans;
	int n=s.size();
	rep(i,n-1){
		if(s[i]=='>'&&s[i+1]=='<')pos.pb(i);
	}
	int pre=0;
	//cout<<ans<<endl;
	for(auto x:pos){
		int p=x;
		int cnt=0;
		while(p>=0&&s[p]=='>'){
			++cnt;
			--p;
		}
		if(pre>cnt)--cnt;
		else ans-=pre;
		ans+=(cnt*(cnt+1))/2;
		//cout<<cnt<<"\n";
		p=x+1;
		cnt=0;
		while(p<n&&s[p]=='<'){
			++cnt;
			++p;
		}
		//cout<<cnt<<"\n";
		ans+=(cnt*(cnt+1))/2;
		//cout<<ans<<endl;
		pre=cnt;
	}
	cout<<ans<<"\n";
}
#undef int

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

class DisjointSet {
 public:
  DisjointSet(int size) : parent_(size), size_(size, 1) {
    for (int i = 0; i < size; ++i) {
      parent_[i] = i;
    }
  }
  int Find(int x) {
    int& p = parent_[x];
    if (p != x) p = Find(p);
    return p;
  }
  void Union(int x, int y) {
    x = Find(x), y = Find(y);
    if (x == y) return;
    if (Size(x) > Size(y)) std::swap(x, y);
    parent_[x] = parent_[y];
    size_[y] += size_[x];
  }
  int Size(int x) { return size_[Find(x)]; }
  bool Same(int x, int y) { return Find(x) == Find(y); }

 private:
  std::vector<int> parent_, size_;
};

int main() {
  in(int, n, m);
  DisjointSet ds(n);
  rep(i, m) {
    in(int, x, y, z);
    ds.Union(x - 1, y - 1);
  }
  set<int> s;
  rep(i, n) s.insert(ds.Find(i));
  out(s.size());
}


Measured memory_bytes: 8756
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(int i=(s);i<(t);++i)
#define repb(i,s,t) for(int i=(s);i<=(t);++i)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)x.size())
#define mst(a,b) memset(a,b,sizeof(a))
#define dd(x) cout<<#x<<'='<<x<<' '
#define de(x) cout<<#x<<'='<<x<<'\n'
#define fi first
#define se second
#define sq(x) ((x)*(x))
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;

const int inf = 0x3f3f3f3f;
const ll infl = 4557430888798830399ll;
const ll mod = 1e9+7;


int main()
{
	int T;
	ll a,b,c,d,g;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
		if(d<b||a<b)printf("No\n");
		else if(b<=c)printf("Yes\n");
		else 
		{
			a%=b;d%=b;
			g=__gcd(b,d);
			if((b+b-a-1)/g-(b+c-a)/g>0||(b+c-a<0&&b+b-a>0))printf("No\n");
			else printf("Yes\n");
		}
	}
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define IOS cin.tie(0),ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<ll, ll> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
	if (v.empty())return out;
	constexpr bool is_vector_v = is_vector<T>::value;
	if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
	else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
	return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

int main() {
	IOS;
	ll k, n;
	cin >> k >> n;
	vector<ll> a(n);
	REP(i, n) {
		cin >> a[i];
	}
	ll m = 0;
	REP(i, n - 1) {
		chmax(m, a[i + 1] - a[i]);
	}
	chmax(m, a[0] + k - a[n - 1]);
	put(k - m);
	return 0;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  int ans;
  ans = N*(N-1)/2 + M*(M-1)/2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3140
#include<bits/stdc++.h>
using namespace std;
 
int main(){
	string s;
	cin >> s;
	int sum = 700;
	for(int i = 0; i < 3; ++i){
		if(s[i] == 'o') sum = sum + 100;
	}	
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

uint32_t nextpint(void){ char c=getchar_unlocked(); while(c<'0'||'9'<c) c=getchar_unlocked(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return x; }
uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c-'0'; len++; c=getchar_unlocked(); } *s='\0'; return len; }
void printint(uint32_t x){ if(x<0){x=-x; putchar_unlocked('-');}else if(x==0){putchar_unlocked('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar_unlocked(s[i]); putchar_unlocked('\n'); }
void rsort_str(void *base, const int count, const int size);

char s[200001];
uint32_t m[2019]={1};

int main(void){
	uint32_t n=read(0, s, sizeof(s))-1;
	uint32_t a=0, b=1;
	for(int32_t i=n-1; i>=0; i--){
		a+=b*(s[i]-'0');
		a%=2019;
		m[a]++;
		b*=10;
		b%=2019;
	}
	uint64_t ans=0;
	for(uint32_t i=0; i<2019; i++){
		ans+=(uint64_t)m[i]*(m[i]-1)/2;
	}
	printf("%"PRIu64"\n", ans);
}


Measured memory_bytes: 1752
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >>N;
  vector<int>h(N);
  for(int i=0;i<N;i++){
  	cin >>h.at(i);
  }
  bool a=true;
  for(int i=N-2;i>0;i--){
    if(h.at(i)<=h.at(i+1)){
      continue;
    }
    else if(h.at(i)-1==h.at(i+1)){
      h.at(i)-=1;
      continue;
    }
    else{
      a=false;
    }
    
  }
  if(a){
    cout <<"Yes"<<endl;
  }
  else{
    cout <<"No"<<endl;
  }
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 200010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 29;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
string str;
int S[MAX_N];

void solve() {
	cin >> str;
	N = sz(str);
	rep(i, 0, N) {
		if(str[i] == '1') S[i + 1]++;
		S[i + 1] += S[i];
	}
	rep(i, 0, N) {
		int v = N - i * 2;
		if(S[N - i] - S[i] == v || S[N - i] - S[i] == 0) {
			cout << N - i << "\n";
			return;
		}
	}
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
#ifdef LOCAL
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



Measured memory_bytes: 848
#include<iostream>
#include<string>
#include<stack>
#include<vector>
#include<algorithm>
#include<cmath>
#include<functional>

using namespace std;

int main() {
	long long int n; cin >> n;
	for (int i = sqrt(n); i > 0; --i) {
		if (n%i == 0) {
			i = n / i;
			int flag = 0;
			while (i) {
				i /= 10; flag++;
			}
			cout << flag << endl;
			return 0;
		}
	}
}

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

int main(){
    int N, K;
    cin >> N >> K;
    vector<double> A(N), S(N+1);
    for(int i=0; i<N; i++){
        double p;
        cin >> p;
        A[i] = (1+p)/2;
        S[i+1] = S[i] + A[i];
    }
    double ans = 0;
    for(int i=0; i<=N-K; i++){
        ans = max(ans, S[i+K] - S[i]);
    }
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}


Measured memory_bytes: 3456
from collections import deque
n=int(input())
G=[[] for i in range(n)]
dist=[-1]*n
for i in range(n-1):
    a,b,c=map(int,input().split())
    G[a-1].append([b-1,c])
    G[b-1].append([a-1,c])

Q,k=map(int,input().split())
k-=1
q=deque()
q.append(k)
dist[k]=0
while q:
    cur=q.popleft()
    for nx,nx_d in G[cur]:
        if dist[nx]!=-1:continue
        dist[nx]=dist[cur]+nx_d
        q.append(nx)

for i in range(Q):
    x,y=map(int,input().split())
    x-=1
    y-=1
    print(dist[x]+dist[y])



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

#if defined(DEBUG)

#include <unistd.h>
#include <sys/fcntl.h>
#define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
#define DCALL(func, ...) func(__VA_ARGS__)

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#else  // defined(DEBUG)

#define DLOG(...)
#define DCALL(func, ...)

#endif // defined(DEBUG)

vector<int> ans;

void pout(int n, int k) {
  for (int i = 0; i < k; i++) {
    ans.push_back(n);
  }
}

int block(string S, int i) {
  int r = 0, l = 0;
  for (; i < S.size() && S.at(i) == 'R'; i++, r++);
  for (; i < S.size() && S.at(i) == 'L'; i++, l++);
  int p1 = r / 2;
  int p2 = r - p1;
  int q1 = l / 2;
  int q2 = l -q1;
  pout(0, r - 1);
  pout(p2 + q1, 1);
  pout(p1 + q2, 1);
  pout(0, l - 1);
  return i;
}

int main(int argc, char *argv[]) {
#if defined(DEBUG)
  // GDB on Cygwin ignores redirection at run command.
  if (argc == 2) dup2(open(argv[1], 0), 0);
#else
  // For performance.  We should not use C-style stdio functions
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  cout << setprecision(20);

  string S; cin >> S;
  for (int i = 0; i < S.size(); i = block(S, i));
  for (int i = 0; i < ans.size(); i++) {
    if (i > 0) cout << " ";
    cout << ans.at(i);
  }
  cout << endl;

  return 0;
}



Measured memory_bytes: 1224
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
#include <iomanip>
#include <climits>
#include <utility>
#include <queue>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

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

struct Fish
{
    ll beauty;
    ll taste;
};

ll fact(ll n)
{
    if (n == 0)
    {
        return 1;
    }
    if (n == 1)
    {
        return 1;
    }
    return n * fact(n - 1) % MOD;
}

int main()
{
    ll N;
    cin >> N;
    vector<ll> goods(N);
    ll sum = 0;
    for (ll i = 0; i < N; i++)
    {
        cin >> goods[i];
        sum += goods[i];
    }
    
    sort(goods.begin(), goods.end());
    cout << (sum - goods[N - 1] / 2) << endl;
}

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

if N == 0:
    print(0)
else:
    s = ""
    while abs(N) > 0:
        m = N % (-2)
        if m != 0:
            s = "1" + s
        else:
            s = "0" + s
        N = (N+m) // (-2)
    print(s)


Measured memory_bytes: 2940
import java.util.*;
public class Main{
  public static void main(String[] args) {
  Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  System.out.println(fib(n));
}
static int fib(int n){
  if(n == 0 || n == 1) return 1;
  int F = 1,Fn1 = 1,Fn2;
  for(int i = 2;i <= n;i++){
    Fn2 = Fn1;
    Fn1 = F;
    F = Fn1 + Fn2;
  }
  return F;
}
} 


Measured memory_bytes: 26052
import java.util.*;

public class Main{
    public static void main(String[] args){
    //入力
        Scanner sc = new Scanner(System.in);
        int L = sc.nextInt();
        int R = sc.nextInt();
        int ans = 0; 
    //処理
        if(R - L >= 2019){
            ans = 0;
        }
        else{
            R = R % 2019;
            L = L % 2019;
            int temp = R*L % 2019;
            for(int i = L;i<=R-1;i++){
                for(int j= i+1;j<=R;j++){
                    temp = Math.min(i*j%2019,temp);
                }
            } 
            ans = temp;
        }
    System.out.println(ans);
        sc.close();

    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define arrprint(v,n) rep(i,0,n-1)cout << v[i] << " ";cout << endl;
#define matprint(v,n,m) rep(i,0,n-1){rep(j,0,m-1){cout << v[i][j] << " ";}cout << endl;}
using namespace std;
const int mod=1000000007;
const int INF=1001001001;
typedef long long ll;
typedef pair<int,int> P;

ll fight(ll h){
    if(h==1)return 1;
    else return 1+2*fight(h/2);
}

int main(){
    ll h;
    cin >> h;

    ll ans = fight(h);


    cout << ans << endl;
//  printf("%.10f\n",ans);

    return 0;
}

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

int main() {
	int a, b;
	cin >> a >> b;
	if (a <= 8 && b <= 8)puts("Yay!");
	else puts(":(");
	return 0;
}


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

int main()
{
	int s[60000];
	int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;
	int n;
	cin >> n;
	s[0] = 2;
	b = 1;
	a = 3;
	while (a <= 55555)
	{
		d = 0;
		for ( c = 0; c < b; c++)
		{
			if (a%s[c]==0)
			{
				d = 1;
			}
		}
		if (d==0)
		{
			s[b] = a;
			b++;
		}
			a++;
	}
	/*for ( a = 0; a < 5000; a++)
	{
		c = 0;
		for ( b = 0; b < 5; b++)
		{
			c += s[b+a];
		}
		cout << c << endl;
		c = 0;
	}*/


	//auto itr = std::find(begin(s), end(s), 5);     //  5 を検索
	//if (itr != end(s)) {
	//	// 発見出来た場合
	//}
	//else {
	//	// 発見出来なかった場合
	//}
	//cout << b << endl;

	/*for ( a = 0; a <= b; a++)
	{
		cout << s[a] << endl;

	}*/
	b = 0;
	a = 0;
	while(b<n)
	{
		if (s[a]%10==1)
		{
			cout << s[a] << " " << endl;
			b++;
		}
		a++;
	}
	cout  << endl;


	return 0;
}

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

int main() {
  int a11, a12, a13, a21, a22, a23, a31, a32, a33;
  cin >>a11>>a12>>a13>>a21>>a22>>a23>>a31>>a32>>a33;
  int N;
  cin >> N;
  string s11="", s12="", s13="", s21="", s22="", s23="", s31="", s32="", s33="";
  int b;
  for (int i=0;i<N;i++){
    cin >> b;
    if (b == a11){
      s11 = "True";
    }
    else if (b == a12){
      s12 = "True";
    }
    else if (b == a13){
      s13 = "True";
    }
    else if (b == a21){
      s21 = "True";
    }
    else if (b == a22){
      s22 = "True";
    }
    else if (b == a23){
      s23 = "True";
    }
    else if (b == a31){
      s31 = "True";
    }
    else if (b == a32){
      s32 = "True";
    }
    else if (b == a33){
      s33 = "True";
    }
    else{

    }
  }
  if ((s11=="True"&&s12=="True"&&s13=="True")||(s21=="True"&&s22=="True"&&s23=="True")||(s31=="True"&&s32=="True"&&s33=="True")||(s11=="True"&&s21=="True"&&s31=="True")||(s12=="True"&&s22=="True"&&s32=="True")||(s13=="True"&&s23=="True"&&s33=="True")||(s11=="True"&&s22=="True"&&s33=="True")||(s13=="True"&&s22=="True"&&s31=="True")){
    cout << "Yes"<<endl;
  }
  else{
    cout << "No"<<endl;
  }
}

Measured memory_bytes: 256
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout.precision(5);
    cout << fixed << hypot(x1-x2, y1-y2) << "\n";
    return 0;
}

Measured memory_bytes: 1300
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=Integer.parseInt(sc.next());
int ans=2147483647,digsumi=0,digsumj=0;
for(int i=1;i<N;i++){
int tempi=i,tempj=N-i;
while(tempi>0){
digsumi+=tempi%10;
tempi/=10;
}
while(tempj>0){
digsumj+=tempj%10;
tempj/=10;
}
ans=Math.min(ans, digsumi+digsumj);
digsumi=0;digsumj=0;
}

System.out.println(ans);

}
}

Measured memory_bytes: 23764
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
using namespace std;
int main() {
	int n;
	cin >> n;
	
	vector<pair<int, int>>a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i].first;
		a[i].second = i + 1;
	}
	sort(a.begin(), a.end());
	
	for (int i = 0; i < n; i++) {
		cout << a[i].second << " ";
	}
	cout << endl;


}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define ll long long int
using namespace std;

map<ll,ll>l2;

int main()
{
    ll n,x=0,y;
    cin>>n;
    ll l1[n+1];map<ll,ll>m;
    vector<ll>v;
    vector<ll>v2;
    for(int i=1;i<=n;i++){
        cin>>l1[i];l2[l1[i]]++;
        if(l2[l1[i]]==2)v.push_back(l1[i]);
        else if(l2[l1[i]]==4)v2.push_back(l1[i]);
    }
    sort(v.begin(),v.end(),greater<int>());
    sort(v2.begin(),v2.end(),greater<int>());
    if(v2.size()>=1)x=max(x,(ll)(v2[0]*v2[0]));
    if(v.size()>=2)x=max(x,(ll)(v[0]*v[1]));
    cout<<x<<endl;

    return 0;
}


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

int main()
{
	int n;
	int suu[20];
	int big;
	bool flg=true;
	int i;
	int x=1;
	
	cin >> n;
	
	for(i=0;i<n;i++)
	{
		cin >> suu[i];
	}
	
	big=suu[0];
	for(i=1;i<n;i++)
	{
		if(big<suu[i])
		{
			big=suu[i];
		}
	}
	
	while(flg)
	{
		flg=false;
		
		for( i=0 ; i<n ; i++ )
		{
			if( big*x % suu[i] != 0 )
			{
				flg=true;
			}
		}
		x++;
	}
	x--;
	cout << big*x << endl;
	return 0;
}

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

#include <cstdlib>  // abs() for integer 絶対値求めやつ

#include <cmath>    // abs() for float, and fabs()

#include <algorithm>
#include <vector>
#define rep(i,n) for(int i = 0; i< (n);i++)

#define sort(a) sort((a).begin(),(a).end());

#define che(a,string) cout<<string<<":"<<(a)<<endl;

#define ch(a,string) cout<<string<<":"<<(a)<<" ";

using namespace std;

typedef pair<int,int> p;

int main(){
	int n;cin>>n;
	cout<<n/3<<endl;
	  
}

Measured memory_bytes: 256
import sys
import collections
INF = 10**18
ans = 0

def dfs2(now,edge,l,cnt):
    global ans
    if len(l) == n:
        ans+=1
        return
    visited[now] = True
    for v in edge[now]:
        if visited[v] == False:
            l.append(v)
            dfs2(v,edge,l,cnt)
            l.pop()
            visited[v] = False

if __name__ == "__main__":
    n,m = map(int,input().split())
    edge =[[] for i in range(n)]
    for i in range(m):
        a,b = map(int,input().split())
        a-=1
        b-=1
        edge[a].append(b)
        edge[b].append(a)
    l = [0]
    visited = [False]*(n)
    dfs2(0,edge,l,0)
    print(ans)

Measured memory_bytes: 9400
//g++  7.4.0

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007 
#define MAXN 1000005
ll fac[MAXN];

ll power(ll x,ll y)  
{  
    ll res = 1;     // Initialize result  
  
    x = x % MOD; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) 
        return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1LL)  
            res = (res * x) % MOD;  
  
        // y must be even now  
        y = y>>1LL; // y = y/2  
        x = (x * x) % MOD;  
    }
    
    return res;
}  

void pre()
{
    fac[0] = 1;
    for(ll i=1;i<MAXN;++i)
        fac[i] = (fac[i - 1] * i) % MOD;
}

ll inv(ll x)
{
    return(power(x,MOD - 2));
}

ll ncr(ll N,ll R)
{
    ll one = fac[N];
    ll two = inv(fac[R]);
    two = (two * (inv(fac[N - R]))) % MOD;
    
    return((one * two) % MOD);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll X; cin>>X;
    if(X)
        cout<<0<<endl;
    else
        cout<<1<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k;
    int a,b;
    cin>>k;
    cin>>a>>b;
    bool flag=false;
    for(int i=a;i<=b;++i)
    {
        if(i%k==0)
            flag=true;
    }
    if(flag)
        cout<<"OK"<<endl;
    else
        cout<<"NG"<<endl;
    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <queue>

using namespace std;

struct ITEM{
	long long x;
	int type;
	long long h;
	ITEM(long long _x, int _type, long long _h){
		x = _x;
		type = _type;
		h = _h;
	}
};


class ITEM_COMP{
	public:
	bool operator () (const ITEM& a, const ITEM& b){
		return a.x == b.x ? a.type > b.type : a.x > b.x;
	}
};

int main(void){
	std::priority_queue<ITEM, vector<ITEM>, ITEM_COMP> queue;
	
	int N;
	cin >> N;
	long long D;
	cin >> D;
	long long A;
	cin >> A;
	
	for(int i = 0; i < N; i ++){
		long long X;
		cin >> X;
		long long H;
		cin >> H;
		queue.push(ITEM(X, 0, H));
	}
	
	long long total = 0;
	long long height = 0;
	while(!queue.empty()){
		ITEM item = queue.top();
		
//		cout << item.x << " " << item.type << " " << item.h << endl;
		if(item.type == 0){
			if(height < item.h){
				long long count = (item.h - height + A - 1) / A;
				total += count;
				height += count * A;
				queue.push(ITEM(item.x + D * 2, 1, count * A));
			}
		}else{
			height -= item.h;
		}
		
		queue.pop();
	}
	cout << total << endl;
	return 0;
}

Measured memory_bytes: 8560
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vp;
typedef set<ll> si;
typedef map<string, ll> msi;
#define REP(i,a,b) \
for(ll i=ll(a);i<=ll(b);i++)
#define DEP(i,a,b) \
for(ll i=ll(a);i>=ll(b);i--)
#define TR(c, it) \
for (auto it = (c).begin(); it != (c).end(); it++)
#define mp make_pair
#define pb push_back
#define F first
#define S second

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  
  int T;
  T=1;
  while(T--)
  {
      ll n,i,j,k,l,m;
      //cin>>n;
      string s,t;
      cin>>s>>t;
      ll cnt=0;
      REP(i,0,s.length()-1){
        if(s[i]!=t[i])cnt++;
      }
      cout<<cnt;
  }
  return 0;
}

Measured memory_bytes: 3796
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]
x,y = gets.strip.split.map(&:to_i)
if A.include?(x) && A.include?(y)
  puts "Yes"
elsif B.include?(x) && B.include?(y)
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 14144
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  





void solve(){
	int n; 
	cin >> n;  
	int a = 0 , b= 0  , c=0  , d = 0 ;
	rep(i,0,n){
		string s; 
		cin >> s;  
		if(s[0]=='A') a++;
		if(s[0]=='W') b++;
		if(s[0] == 'R') c++;
		if(s[0]=='T') d++;
	}
	cout << "AC x " <<a << endl;
	cout << "WA x " <<b << endl;
	cout << "TLE x " <<d << endl;
	cout << "RE x " <<c << endl;
}

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3680
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
m = max(a)
sec_a = []
flag = True
for i in range(n):
    if a[i] != m:
        sec_a.append(a[i])
    else:
        if flag:
            index = i
        else:
            sec_a.append(a[i])
        flag = False
sec_m = max(sec_a)
for i in range(n):
    if i == index:
        print(sec_m)
    else:
        print(m)


Measured memory_bytes: 14060
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let x: u64 = read();

    let n_500 = x / 500;
    let left = x % 500;
    let n_5 = left / 5;

    println!("{}", n_500 * 1000 + n_5 * 5);
}


Measured memory_bytes: 4352
/****************************
/////  Shubham Singhal
/////  LNMIIT
*****************************/
#include <bits/stdc++.h>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define eb emplace_back
#define lwr lower_bound
#define upr upper_bound
#define pq priority_queue
#define umap unordered_map
#define rep(i,n) for(i=0; i<n;i++)
#define repp(i,a,n) for(i=a; i<n;i++)
#define precise(x) cout<<fixed<<setprecision(x)
#define all(x) x.begin(),x.end()
#define lcm(a,b) (a*b)/__gcd(a,b)
#define prn(x) cout<<x<<"\n"
#define prn2(x, y) cout<<x<<" "<<y<<"\n"
#define prn3(x, y, z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define prn4(x, y, z, a) cout<<x<<" "<<y<<" "<<z<<" "<<a<<"\n"
#define prnv(x) for(auto i:x) cout<<i<<" "; cout<<"\n"
#define MOD 1000000007

using namespace std;
 
typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd; 
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pil> vpil;
typedef vector<pli> vpli;
typedef vector<pll> vpll;
const long long INF64 = 1'000'000'000'000'000'000ll;
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
void doc()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
}
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
}
int main()
{
    fast();
    string s,t;
    cin>>s>>t;
    cout<<t+s;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
  val N = readLine()!!.toInt()
  val S = readLine()!!
  val alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  for (s in S) {
    var a = alp.indexOf(s) + N;
    if (a >= alp.length) a %= alp.length
    print(alp.get(a))
  }
  println()
}

Measured memory_bytes: 33816
#include<bits/stdc++.h>
typedef long long ll;
#define INF 100000000
#define MOD 100000007
int dx[4]={1,0,-1,0},dy[4]={0,-1,0,1};
using namespace std;
int main(void){
    string s;
    cin>>s;
    int len=s.size();
    int rem=len-7;
    bool ans=false;
       for(int i=0;i<len-rem;i++){
        if(s.substr(0,i)+s.substr(i+rem)=="keyence"){
            ans=true;
            break;
        }
    }
    if(ans){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
   return 0;
}

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

aa = [0]+a+[0]

b=[]

for i in range(n+1):
    b.append(abs(aa[i+1]-aa[i]))

c = sum(b)

for i in range(n):
    ans = c-b[i]-b[i+1]+abs(aa[i+2]-aa[i])
    print(ans)


Measured memory_bytes: 14048
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9+7;
const int maxn = 100005;
int dp[maxn];
vector<int>v;
int solve(int x) {
	if (~dp[x]) {
		return dp[x];
	}
	int mi = 1;
	for (auto &i : v) {
		if (i > x) {
			break;
		}
		mi = min(mi, solve(x - i));
	}
	return dp[x] = mi ^ 1;
}
void go() {
	int n, k;
	cin >> n >> k;
	f(n) {
		int x;
		cin >> x;
		v.pb(x);
	}
	memset(dp, -1, sizeof(dp));
	cout << (solve(k) ? "First" : "Second") << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        go();
    }
    
}

Measured memory_bytes: 8700
#include <bits/stdc++.h>
#include<utility>
#include<algorithm>

#define pan(i,n) for(int i=0;i<n;i++)
#define pans(i,n,a) for(int i=a;i<n;i++)
#define ll long long int
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define INF 1e9+7
#define PI 3.141592653
#define inf 200007
#define P pair<ll,ll>

using namespace std;

int main(){
    int n;
    cin>>n;
    ll ans=0;
    for(int i=1;i<=n;i++){
        if(i%3!=0 && i%5!=0) ans+=i;
        
    }
    // int a=n/3,b=n/5,c=n/15;
    // ll ts=(a)*(6+(a-1)*3)/2,fs=(b)*(10+(b-1)*5)/2,ff=(c)*(30+(c-1)*15)/2;
    // if(a>0) ans-=ts;
    // if(b>0) ans-=fs;
    // if(c>0) ans+=ff;
    cout<<ans;
}   


Measured memory_bytes: 3588
from bisect import bisect_right
from itertools import accumulate

def main():
    n = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))

    B_counts = []
    for b in B:
        i = bisect_right(C, b)
        B_counts.append(len(C) - i)
    B_counts_cumsum = list(accumulate(B_counts))
    B_counts_cumsum.insert(0, 0)

    count = 0
    for a in A:
        i = bisect_right(B, a)
        if i == len(B):
            continue
        count += B_counts_cumsum[-1] - B_counts_cumsum[i]

    print(count)


if __name__ == "__main__":
    main()


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

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

  if ( max( { A, B, C } ) == min( { A, B, C } ) )
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return ( 0 );
}

Measured memory_bytes: 888