akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int a = input[0];
            Console.WriteLine(3 * a * a);

        }
    }
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m,l,r,L=-1,R=1e7;cin>>n>>m;
  rep(i,m) {
    cin>>l>>r;
    L=max(l,L);
    R=min(r,R);
  }
  ll ans=max(0ll,R-L+1);
  print(ans);
  return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <stdio.h>
#include <string.h>
#define MAX_N 2005

using namespace std;

int n,K,ans=0;
int s[MAX_N][MAX_N];

void read()
{
	scanf("%d%d",&n,&K);
	int x,y; char c[4];
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d%s",&x,&y,c);
		if(c[0]=='W') y+=K;
		s[x%(K<<1)][y%(K<<1)]++;
	}
}

void cal_s()
{
	for(int i=0;i<(K<<1);i++)
	{
		for(int j=0;j<(K<<1);j++)
		{
			if(i) s[i][j]+=s[i-1][j];
			if(j) s[i][j]+=s[i][j-1];
			if(i && j) s[i][j]-=s[i-1][j-1];
		}
	}
}

inline bool is_valid(int &l,int &d,int &r,int &u)
{
	l=max(l,0),d=max(d,0),r=min(r,(K<<1)-1),u=min(u,(K<<1)-1);
	return l<=r && d<=u;
}

inline int get_s(int l,int d,int r,int u)
{
	if(!is_valid(l,d,r,u)) return 0;
	int ans=s[r][u];
	if(l>0) ans-=s[l-1][u];
	if(d>0) ans-=s[r][d-1];
	if(l>0 && d>0) ans+=s[l-1][d-1];
	return ans;
}

inline int get_ans(int x,int y)
{
	int ans=0;
	ans+=get_s(x,y,x+K-1,y+K-1);
	ans+=get_s(x-K,y-K,x-1,y-1);
	ans+=get_s(x-K,y+K,x-1,y+(K<<1)-1);
	ans+=get_s(x+K,y-K,x+(K<<1)-1,y-1);
	ans+=get_s(x+K,y+K,x+(K<<1)-1,y+(K<<1)-1);
	return ans;
}

void work()
{
	cal_s();
	for(int i=0;i<K;i++)
	{
		for(int j=0;j<K;j++)
		{
			int now=get_ans(i,j);
			ans=max(ans,max(now,n-now));
		}
	}
	printf("%d\n",ans);
}

int main()
{
	read();
	work();
}


Measured memory_bytes: 15872
n = int(input())
d = [0] * n
for i in range(n):
    d[i] = int(input())
    
class Node:
    def __init__(self, data):
        self.data = data
        self.right = None
        self.left = None

class BST:
    def __init__(self, number_list):
        self.root = None
        for data in number_list:
            self.insert(data)
    
    def insert(self, data):
        n = self.root
        if n == None:
            self.root = Node(data)
            return
        else:
            while True:
                entry = n.data
                if entry > data:
                    if n.left is None:
                        n.left = Node(data)
                        return
                    n = n.left
                elif entry < data:
                    if n.right is None:
                        n.right = Node(data)
                        return
                    n = n.right
                else:
                    n.data = data
                    return

    #中間順探索
    def inorder(self,node,ll):
        if node is not None:
            self.inorder(node.left,ll)
            ll.append(node.data)
            self.inorder(node.right,ll)
        return ll

bst = BST(d)
ll = []
print(len(bst.inorder(bst.root,ll)))


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

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

long long int dp[101][100001], inf = 1e18; 


int main()
{
	fastio;
	int n, w;
	cin >> n >> w;
	vector<pair<int, int> > v(n+1);
	for(int i = 1; i <= n; i++) {
		cin >> v[i].first >> v[i].second;
	}
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= w; j++) {
			if(v[i].first > j) dp[i][j] = dp[i-1][j];
			else dp[i][j] = max(dp[i-1][j], dp[i-1][j-v[i].first] + v[i].second);
		}
	}
	
	long long int ans = -inf;
	for(int i = 1; i <= w; i++) {
		ans = max(ans, dp[n][i]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 81780
N = int(input())
w = list(str(input()) for _ in range(N))
res = 'Yes'
if len(w) != len(set(w)):
    print('No')
    exit()
last = (w[0])[0]
for i, x in enumerate(w):
    if last != x[0]:
        print('No')
        exit()
    last = x[-1]
print('Yes')

Measured memory_bytes: 3064
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int n,ans=0,m=0; cin>>n;
    rep(i,n){
        int h; cin>>h;
        if(h>=m) ans++;
        m=max(m,h);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3596
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))

ans = 0
mini = float('inf')
for i, h in enumerate(H):
	t = T - h*0.006
	d = abs(t-A)
	if mini > d:
		mini = d
		ans = i+1

print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[100005];
    for(int i=0;i<n;i++){
    	cin>>a[i];
	}
	int i;
	for(i=1;i<n;i++){
		if(a[i]-1>=a[i-1]){
			a[i]--;
		}
		else if(a[i]>=a[i-1]){
			;
		}
		else{
			printf("No\n");
			break;
		}
	}
	if(i==n) printf("Yes\n");
    return 0;
}


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

using namespace std;

#define allof(x) (x).begin(), (x).end()

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

int digitsum(int x){
    string str = to_string(x);
    int ans = 0;
    for(char c : str){
        ans += c - '0';
    }
    return ans;
}

int main(){
    cin.tie(0);
    cin.sync_with_stdio(0);

    int N;
    cin >> N;

    int ans = 999999;
    for(int A = 1; A + 1 <= N; A++){
        int B = N - A;
        ans = min(ans, digitsum(A) + digitsum(B));
    }
    cout << ans;
}


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

bool solve(const string &s){
	stack<char> x;
	for(int i = 0; i < s.size(); ++i){
		if(s[i] == '[' || s[i] == '('){
			x.push(s[i]);
		}
		else if(s[i] == ']'){
			if(x.empty() || x.top() != '[')
				return false;
			x.pop();
		}
		else if(s[i] == ')'){
			if(x.empty() || x.top() != '(')
				return false;
			x.pop();
		}
	}
	return x.empty();
}

int main(){
	string s;
	while(getline(cin, s), s != "."){
		puts(solve(s) ? "yes" : "no");
	}
}

Measured memory_bytes: 1172
l=list(input())
n=len(l)
b=True
for i in range(1,1+n):
  if i%2==0:
    if l[i-1]=="R":
      b=False
  else:
    if l[i-1]=="L":
      b=False
if b:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
from math import gcd
from functools import reduce


def lcm(x, y):
    return x * y // gcd(x, y)


N = int(input())
X = list(map(int, input().split()))
total = reduce(lcm, X)
MOD = 10 ** 9 + 7

ans = 0
for v in X:
    ans += total * pow(v, MOD - 2, MOD) % MOD
    ans %= MOD

print(ans)


Measured memory_bytes: 74912
#include<iostream>
#include<queue>
#include<map>
#include<cstring>
using namespace std;
#define fr first
#define sc second
#define INF 100
typedef pair<int,int>Pt;
int main(){
  int d,n,dx[]={-1,0,1,0},dy[]={0,1,0,-1};
  char mas[101][101]; //上右下左
  bool ok = false;
  cin >> d;
  while(d--){
    if(ok) cout << endl;
    memset(mas,' ',sizeof(mas));
    cin >> n;
    for(int i=0,x=n-1,MUKI=0,y=0;i<n;i++,x+=dx[MUKI],y+=dy[MUKI]) mas[x][y] = '#';
    for(int i=0,cnt=n,x=0,y=0,MUKI=1;i<n-1;i++,MUKI=(MUKI+1)%4){
      for(int j=0;j<cnt;j++,x+=dx[MUKI],y+=dy[MUKI]) mas[x][y] = '#';
      x-=dx[MUKI],y-=dy[MUKI];
      if(i%2==1)cnt-=2;
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++) cout << mas[i][j];
      cout << endl;
    }
    ok = true;
  }
}

Measured memory_bytes: 1168
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter
import kotlin.math.max
import kotlin.math.min

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

fun solve() {
    val (n, m) = readIntegerList()
    val uf = UnionFind(n)
    repeat(m) {
        val (a, b) = readIntegerList().map { it - 1 }
        uf.unite(a, b)
    }

    var ans = 0
    for (i in 0 until n) {
        ans = max(ans, uf.getSize(i))
    }

    out.println(ans)
}


/**　Union find 0 ~ (n - 1)　*/
class UnionFind(n: Int) {
    val parent = IntArray(n) { it }
    val rank = IntArray(n)
    val size = IntArray(n) { 1 }

    /** O(α(n)) */
    fun findRoot(x: Int): Int {
        if (parent[x] == x) return x

        parent[x] = findRoot(parent[x])
        return parent[x]
    }

    /** O(α(n)) */
    fun sameRoot(x: Int, y: Int) = findRoot(x) == findRoot(y)

    /** O(α(n)) */
    fun unite(x: Int, y: Int) {
        val x = findRoot(x)
        val y = findRoot(y)
        if (x == y) return

        if (rank[x] < rank[y]) {
            parent[x] = y
            size[y] += size[x]
        } else {
            parent[y] = x
            if (rank[x] == rank[y]) rank[x]++

            size[x] += size[y]
        }
    }

    /** O(α(n)) */
    fun getSize(x: Int) = size[findRoot(x)]
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


Measured memory_bytes: 61032
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    int n;
    cin >> n;

    vs32 a(n), b(n);
    rep (i, n) cin >> a[i];
    rep (i, n) cin >> b[i];
    // sort(b.begin(), b.end());

    int ans = 0;
    rep (i, 29)
    {
        int mask = (1 << (i + 1)) - 1;
        vs32 B(n);
        rep (j, n) B[j] = b[j] & mask;
        sort(B.begin(), B.end());

        s64 num = 0;
        int t = 1 << i;
        rep (j, n)
        {
            int A = a[j] & mask;
            num += lower_bound(B.begin(), B.end(), 2 * t - A) - lower_bound(B.begin(), B.end(), t - A);
            num += lower_bound(B.begin(), B.end(), 4 * t - A) - lower_bound(B.begin(), B.end(), 3 * t - A);
        }
        if (num & 1) ans |= 1 << i;
    }

    cout << ans << "\n";

    return 0;
}



Measured memory_bytes: 2672
#include<bits/stdc++.h>
using namespace std;
/*******  All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#define mem(a, b) memset(a, (b), sizeof(a))
#define rep(i, j, k) for (int i = j ; i < k ; ++i)
#define rrep(i, j, k) for (int i = j; i > k; --i)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define foreach(i, a) for(auto i: a)
#define forEach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define in(A, B, C) assert( B <= A && A <= C)
#define mp make_pair
#define pb push_back
#define end "\n"
#define endl "\n"
#define inf (int) (1e9 + 7)
#define epsi 1e-9
#define PI 3.1415926535897932384626433832795
#define mod 1000000007
#define read(type) readInt<type>()
#define io ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define left tuyiuoi
#define right fgjhk
#define ss second
#define ff first
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) rep(i, l, r) cout << a[i] << " "; cout << endl
#define Flag(n) cout << "here " << n << endl
const double pi=acos(-1.0);
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<ll, ll> pll;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<pll> vpll;
typedef vector<vi> vvi;
typedef map<int,int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
 
 
int main() {
    io;
    cout.precision(20);

    int sum = 6;
    int a,b;
    cin>>a;
    cin>>b;
    cout<<sum-(a+b);
  

 
 
 
    
 
    return 0;
}

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

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define LOOP(i, N) for (int i = 1; i <= (int)N; i++)
#define RREP(i, N) for (int i =(int)N-1; i >= 0; i--)
#define RLOOP(i, N) for (int i =(int)N; i > 0; i--)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

int main(){
  string s,t;
  cin>>s>>t;
  sort(ALL(s));
  sort(ALL(t));
  reverse(ALL(t));
  if(s<t){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2

using namespace std;
int MOD = 1000000007;

#define MAX_V 101 //100を適宜変える
int cost[MAX_V][MAX_V];//cost[u][v] は　u -> v のコスト
int d[MAX_V];//頂点sからの最短距離 
bool used[MAX_V];//すでに使われたかのフラグ
int V;//頂点数

void dijkstra(int s){//頂点は 0 ~ V-1 になっているので注意
    fill(d,d+V,INF);
    fill(used,used+V,false);
    d[s] = 0;

    while(true){
        int v = -1;
        for(int u = 0;u< V;u++){
            if(!used[u] && (v == -1 || d[u] < d[v])) v = u;
        }
        if(v == -1) break;
        used[v]  = true;
        for(int u=0;u<V;u++){
            d[u] = min(d[u],d[v] + cost[v][u]);
        }
    }
}

signed main(){
    int n,m;
    cin >> n >> m;
    V = n;
    vector<pair<int,int>> x[101];

    rep(i,101) rep(j,101) cost[i][j] = INF;
    rep(j,101) cost[j][j] = 0;
    rep(i,m){
        int a,b,c;
        cin >> a >> b >> c;
        cost[a-1][b-1] = c;
        cost[b-1][a-1] = c;
        x[a-1].pb(MP(b-1,c));
        x[b-1].pb(MP(a-1,c));
    }
    int ans = 0;
    rep(i,n){
        dijkstra(i);
        for(auto y:x[i]){
            if(y.se != d[y.fi]) ans++;
        }
    }
    cout << ans/2 << endl;


    return 0;   
}
// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://ddcc2019-final.contest.atcoder.jp/tasks/ddcc2019_final_a
// rm -r -f test;oj dl http://arc060.contest.atcoder.jp/tasks/arc060_a

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int r;
cin >> r;
cout << r*r << endl;
return 0;
}


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

int main(){
    int H, W;
    cin >> H >> W;
    while(1){
        if(H==0&&W==0) break;
        for(int i = 0; i < H; i++){
            for(int j = 0; j < W; j++){
                if(j==0){
                    cout << "#";
                }
                else if(j==W-1){
                    cout << "#";
                }
                else{
                    if(i==0){
                        cout << "#";
                    }
                    else if (i==H-1){
                        cout <<"#";
                    }
                    else{
                        cout <<".";
                    }
                }
                
            }
            
            cout << endl;
        }
    cout << endl;
    cin >> H >> W;
    }
    return 0;
}


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

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

Measured memory_bytes: 256
def main():
    from itertools import groupby as group
    s = input()
    res = [0 for _ in range(len(s))]

    l, r = 0, 0
    for k, g in group(s):
        m = len(list(g))
        r = l + m - 1
        p, q = divmod(m, 2)
        u = r if k == 'R' else l
        v = 1 if k == 'R' else -1

        res[u] += p + q
        res[u + v] += p

        l = r + 1

    ans = ' '.join(map(str, res))
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 10652
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//setprecision(15)有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n, m;
vector<bool> used(100000,false);
    vector<int>ans_pr,ans;
vector<vector<int>> v(100000);
void dfs(int now,int prev){
        used[now]=true;
        /*
        if(now==0){
            if(!used[v[0][0]])
            dfs(v[0][0],0);
        }
        else{
            ans.push_back(now);
            bool check=false;
            for(int i=0;i<v[now].size();i++){
                if(!used[v[now][i]]){
                    dfs(v[now][i],now);
                    break;
                }
            }
        }
        */
       ans.push_back(now);
            for(int i=0;i<v[now].size();i++){
                if(!used[v[now][i]]){
                    dfs(v[now][i],now);
                    break;
                }
            }
    }
    void dfsp(int now,int prev){
        used[now]=true;
        if(now==0){
            dfsp(v[0][0],0);
        }
        else{
            ans_pr.push_back(now);
            for(int i=0;i<v[now].size();i++){
                if(!used[v[now][i]]){
                    dfsp(v[now][i],now);
                    break;
                }
            }
        }
    }
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>m;
    for (int i = 0; i < m; i++)
    {
        int temp,temp1;
        cin >> temp>>temp1;
        temp--;
        temp1--;
        v[temp].push_back(temp1);
        v[temp1].push_back(temp);
    }
    dfsp(0,-1);
    dfs(0,-1);
    if(ans_pr.size()>=1)
    reverse(ALL(ans_pr));
    cout<<ans.size()+ans_pr.size()<<"\n";
    rep(i,ans_pr.size()){
        cout << ans_pr[i]+1 << "\n";
    }
    rep(i,ans.size())
    cout << ans[i]+1 << "\n";
}


Measured memory_bytes: 9592
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string,int>m;
    long long ans=0;
    string s;
    for(int i=0;i<n;i++){
        cin >> s;
        sort(s.begin(),s.end());
        ans+=m[s];
        m[s]++;
    }
    cout << ans;
}

Measured memory_bytes: 11136
#include <stdio.h>
int main(){
char a[99],b[99],c[99];
char t,x;
int g=0,h=0,q=0,end =1;
scanf("%s%s%s",a,b,c);
t = a[g];
while(end){
switch (t){
case('a'):
  g++;
  t = a[g];
  x = 'A';
  break;
case('b'):
  t= b[h];
  h++;
  x = 'B';
  break;
case('c'):
  t= c[q];
  q++;
  x='C';
  break;
default:
  printf("%c",x);
  end =0;
}
}
return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int checkPrime(int num){
    if (num==2) return 1;
    if (num==3) return 1;
    int count = 0;
    for (int i = 2; i < sqrt(num) + 1; i++){
        if(num%i == 0){
            count++;
        }
    }
    if ( count == 0) return 1;
    else return 0;
}



int main(){
    
    int Num;
    scanf("%d",&Num);
    int A[10000+5]; 
    for(int a = 0; a < Num; a++){
        
        scanf("%d",&A[a]);
        
    }
    
  
    int count = 0;
    int total= 0;
    for(int a = 0; a < Num; a++){
        int isPrime = checkPrime(A[a]);
        
        if(isPrime == 1)total++;
    }
       
    
    printf("%d\n",total);
    return 0;
}



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

using namespace std;

int main(){
  string s;
  cin>>s;
  int size=s.size();
  reverse(s.begin(),s.end());

  bool flag=true;
  for(int t=0;;){
    if(t+6<=size){
      if(s.substr(t,6)=="resare"){
      t+=6;
      if(t==size)break;
      continue;
      }
    }
    if(t+7<=size){
      if(s.substr(t,7)=="remaerd"){
      t+=7;
      if(t==size)break;
      continue;
      }
    }
    if(t+5<=size){
      if(s.substr(t,5)=="maerd"||s.substr(t,5)=="esare"){
      t+=5;
      if(t==size)break;
      continue;
      }
    }
    flag=false;
    break;
  }

  if(flag){
    cout<<"YES"<<"\n";
  }else{
    cout<<"NO"<<"\n";
  }
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll L[51], P[51];
ll dfs(ll n, ll x)
{
    if (x == 0)
    {
        return 0;
    }
    if (n == 0)
    {
        return 1;
    }
    ll ans = 0;
    if(x==1){
        return 0;
    }
    else if (x <= L[n - 1] + 1)
    {
        ans += dfs(n - 1, x - 1);
    }
    else if (x == L[n - 1] + 2)
    {
        ans += (P[n - 1] + 1);
    }
    else if (L[n - 1] + 3 <= x && x <= L[n] - 1)
    {
        ans += (P[n - 1] + 1)+dfs(n - 1, x - (L[n - 1] + 2));
    }
    else if (x == L[n])
    {
        ans += P[n];
    }
    return ans;
}
int main()
{
    L[0] = 1, P[0] = 1;
    for (int i = 1; i <= 50; i++)
    {
        L[i] = L[i - 1] * 2 + 3;
        P[i] = P[i - 1] * 2 + 1;
    }
    ll N, X;
    cin >> N >> X;
    cout << dfs(N, X) << endl;
}


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

using namespace std;

int f[305][305], now[305], sum[305];
bool cancel[305];

int main()
{
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      scanf("%d", &f[i][j]);
  int ans = 1000;
  bool out = false;
  while (true) {
    for (int i = 0; i < n; ++i) {
      while (now[i] < m && cancel[f[i][now[i]]])
        ++now[i];
      if (now[i] >= m) {
        out = true;
        break;
      }
    }
    if (out)
      break;
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < n; ++i)
      ++sum[f[i][now[i]]];
    int id = 0;
    for (int i = 1; i <= m; ++i)
      if (sum[i] > sum[id])
        id = i;
    ans = min(ans, sum[id]);
    cancel[id] = true;
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;
template<class T> void mkuni(vector<T>&v)
{
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
}
template<class T>
void print(T x,int suc=1)
{
    cout<<x;
    if(suc==1) cout<<'\n';
    else cout<<' ';
}
template<class T>
void print(const vector<T>&v,int suc=1)
{
    for(int i=0;i<v.size();i++)
    print(v[i],i==(int)(v.size())-1?suc:2);
}

int main()
{
    int n;
    cin>>n;
    vi cnt(3);
    for(int i=0,tmp;i<n;i++)
    {
        cin>>tmp;
        int cc=0;
        while(tmp%2==0)
        {
            cc++;
            tmp/=2;
        }
        cnt[min(cc,2)]++;
    }
    if(cnt[1]) cnt[0]++;
    if(cnt[0]>cnt[2]+1) cout<<"No\n";
    else cout<<"Yes\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6+10;
const int mod = 1000000007;
int n,ans[N],sum;
int main() {
	scanf("%d",&n);
	ans[n] = n;
	ans[n-1] = (long long)n * n % mod;
	for(int i = n - 2; i >= 1; i--) {
		sum = (sum + ans[i + 3]) % mod;
		ans[i] = ans[i + 1];
		ans[i] = (ans[i] + (long long)(n - 1) * (n - 1) % mod) % mod;
		ans[i] = (ans[i] + sum) % mod;
		ans[i] = (ans[i] + i + 1) % mod;
	}
	printf("%d\n",ans[1]);
	return 0;
}

Measured memory_bytes: 4096
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <map>
#include <complex>
#include <vector>
#include <algorithm>

#define INF (1<<30)
#define re(i, n) for(int i=0;i<(n);i++)
#define rep(i, s, n) for(int i=(s);i<(n);i++)
#define pe(x) return cout<<(x)<<endl,0
#define PI 3.1415926535897932
using namespace std;
typedef long long ll;

int n;
int *a;
int X = 0;

int merge(int s, int m, int t) {
    int n1 = m - s;
    int n2 = t - m;
    int l[n1], r[n2];
    re(i, n1) l[i] = a[s + i];
    re(i, n2) r[i] = a[m + i];
    int i = 0, j = 0;
    int k = s;
    while (i < n1 || j < n2) {
        if (i < n1) {
            if (j < n2) {
                if (l[i] > r[j])a[k++] = r[j++], X++;
                else a[k++] = l[i++], X++;
            } else a[k++] = l[i++], X++;
        } else {
            if (j < n2) a[k++] = r[j++], X++;
            else { cout << "ERROR" << endl; }
        }
    }
}

void mergesort(int s, int t) {
    if (t - s > 1) {
        int mid = (s + t) / 2;
        mergesort(s, mid);
        mergesort(mid, t);
        merge(s, mid, t);
    }

}

int main(void) {
    cin >> n;
    a = new int[n];
    re(i, n)cin >> a[i];
    mergesort(0, n);
    re(i, n) {
        if (i != 0)cout << " ";
        cout << a[i];
    }
    cout << endl;
    cout << X << endl;

}



Measured memory_bytes: 6996
using System.Linq;
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var a = int.Parse(line[1]);
        var b = int.Parse(line[2]);
        var ret = 0;
        foreach (var x in Enumerable.Range(1, n))
            if (countAB(x, a, b)) ret += x;
        Console.WriteLine(ret);
    }
    public static bool countAB(int n, int a, int b)
    {
        var c = n.ToString().ToCharArray().Select(x => int.Parse(x.ToString())).Sum();
        return (c >= a && c <= b);
    }
}

Measured memory_bytes: 15444
//minamoto
#include<bits/stdc++.h>
#define R register
#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;
const int N=505;
int a[N*N],st[N*N],x[N],id[N],top,n;
inline bool cmp(const int &a,const int &b){return x[a]<x[b];}
inline void ins(R int x){fp(i,1,n-x)st[++top]=x;}
int main(){
//	freopen("testdata.in","r",stdin);
	scanf("%d",&n);
	fp(i,1,n)scanf("%d",&x[i]),a[x[i]]=i,id[i]=i;
	sort(id+1,id+1+n,cmp);
	R int i=1,j=1;
	for(;i<=n;++i){
		R int c=0;
		while(c<id[i]-1){
			while(j<x[id[i]]&&a[j])ins(a[j++]);
			if(j==x[id[i]])return puts("No"),0;
			a[j]=id[i],++c,++j;
		}
	}
	while(233){
		while(j<=n*n&&a[j])ins(a[j++]);
		if(j>n*n)break;if(!top)return puts("No"),0;
		a[j++]=st[top--];
	}
	puts("Yes");
	fp(i,1,n*n)printf("%d ",a[i]);
	return 0;
}

Measured memory_bytes: 2688
#include <stdio.h>
#include <alloca.h>

int main(void){
	int n, i;
	int *a;

	scanf("%d", &n);
	a = (int*)alloca(sizeof(int)*n);

	for(i = 0; i < n; i++)
		scanf("%d", a+i);

	for(i = n-1; i > 0; i--)
		printf("%d ", a[i]);
	printf("%d\n", a[0]);

	return 0;
}



Measured memory_bytes: 2044
#include <iostream>

using namespace std;

int main() {
    int N;
    cin >> N;
    bool flag = false;

    for (int i = 1; i <= N; ++i) {
        if (N % i == 0) {
            int aux = N / i;
            int aux2 = N / aux;

            if (aux >= 1 && aux <= 9 && aux2 >= 1 && aux2 <= 9) {
                flag = true;
                break;
            }
        }
    }

    string s = flag ? "Yes" : "No";

    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
/* blog: https://misteer.hatenablog.com/entry/ARC100-E-zeta */

#include <iostream>
#include <algorithm>
#include <vector>

using Int = long long int;
template <class T>
using Vector = std::vector<T>;

struct G {
    Vector<Int> idx;
    static Vector<Int> a;

    G& operator+=(const G& opp) {
        std::copy(opp.idx.begin(), opp.idx.end(),
                  std::back_inserter(idx));
        std::sort(idx.begin(), idx.end(), [&](Int i, Int j) {
            return a[i] == a[j] ? i < j : a[i] > a[j];
        });
        idx.erase(std::unique(idx.begin(), idx.end()), idx.end());
        idx.resize(2);
        return *this;
    }
};
Vector<Int> G::a;

int main() {
    Int n;
    std::cin >> n;
    Vector<Int> a(1 << n);
    for (auto& x : a) std::cin >> x;
    G::a = a;

    Vector<G> g(1 << n);
    for (Int s = 0; s < (1 << n); ++s) {
        g[s].idx.push_back(s);
    }

    // 高速ゼータ変換 下位集合版
    for (Int k = 0; k < n; ++k) {
        for (Int b = 0; b < (1 << n); ++b) {
            if ((b >> k) & 1) {
                g[b] += g[b ^ (1 << k)];
            }
        }
    }

    Int max = 0;
    for (Int s = 1; s < (1 << n); ++s) {
        max = std::max(max, a[g[s].idx[0]] + a[g[s].idx[1]]);
        std::cout << max << std::endl;
    }
    return 0;
}


Measured memory_bytes: 26112
import java.util.*;

import static java.lang.System.*;

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

        // |A_i -B_i|が大きい順番に並べる
        // 同じ場合は、A_i, B_i のどちらかが大きい順番に並べる
        PriorityQueue<Entry> pq = new PriorityQueue<Entry>(N, new EntryComparator());
        for (int i = 0; i < N; i++) {
            long a = sc.nextInt();
            long b = sc.nextInt();
            pq.add(new Entry(a, b));
        }

        //PriorityQueue<Entry> pq_tmp = new PriorityQueue<Entry>(pq);
        //while(!pq_tmp.isEmpty()){
        //    Entry entry = pq_tmp.poll();
        //    out.println(entry.A+","+entry.B);
        //}

        long A_count = 0;
        long B_count = 0;

        while(pq.size() > 0){
            Entry entry = pq.poll();
            A_count += entry.A;

            if(pq.size() == 0) break;

            entry = pq.poll();
            B_count += entry.B;
        }

        out.println(A_count - B_count);
    }

    static class EntryComparator implements Comparator<Entry> {
        @Override
        public int compare(Entry t1, Entry t2) {
            if (t1.sum < t2.sum){
                 return 1;
             } else if (t1.sum == t2.sum){
                 return 0;
             }
            return -1;
        }
    }

    static class Entry {
        public long A;
        public long B;
        public long sum;

        public Entry(long A, long B){
            this.A = A;
            this.B = B;
            this.sum = this.A + this.B;
        }
    }
}

Measured memory_bytes: 96276
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)
s = [a[0]]
(n-1).times do |i|
  s.push(s[i] + a[i+1])
end

min = 100000000
(n-1).times do |i|
  tmp = (2 * s[i] - s[-1]).abs
  if tmp < min then
    min = tmp
  end
end
  
puts min

Measured memory_bytes: 1788
# -*- coding: utf-8 -*-


import sys
import math

# 1整数
# n = int(input())

# 空白区切り2整数
n, m, c = list(map(int, input().split()))

# 空白区切りリスト
b=list(map(int, input().split()))

ret = 0
for i in range(n):
    a = list(map(int, input().split()))
    sum = c
    for j in range(m):
        sum += a[j]*b[j]
    if sum>0:
        ret += 1


print(ret)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    
    string s = "";
    
    string r = "No";
    
    
    cin >> s;
    
    if( s != "AAA" && s != "BBB" ) {
        r = "Yes";
    } 
    
    
    cout << r << endl;
    
    
}

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back

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

using namespace std;

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

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<60;
const int MAX_N = 100005;

ll N,L,x[MAX_N];
int r[MAX_N][20];

void prepare(){
  // rep(i,N) rep(k,20) r[i][k] = INF;
  rep(i,N) r[i][0] = int(upper_bound(x,x+N,x[i]+L)-x)-1;
  int lg = 0; while((1<<lg)<N) lg++;
  rep(k,18) rep(i,N) r[i][k+1] = r[r[i][k]][k];
  // rep(i,N){rep(k,lg) cout << r[i][k] << " "; cout << endl;}
}

void query(){
  int a,b; scanf("%d%d",&a,&b);
  if(a>b) swap(a,b);
  a--; b--;
  int ans = 0;
  rrep(k,18){
    if(r[a][k]<b){
      a = r[a][k];
      ans += (1<<k);
    }
  }
  cout << ans+1 << endl;
}

int main(){
  cin >> N;
  rep(i,N) scanf("%lld",x+i);
  cin >> L;
  prepare();
  int Q; cin >> Q;
  rep(i,Q) query();
  return 0;
}

Measured memory_bytes: 9472
#include <iostream>
#include <iomanip>
#include <vector>
#include <bits/stdc++.h>
#include <math.h>
#include <stack>
#define pb push_back
// #define pop pop_back
#define ll long long int
#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep2(i, a, b) for (ll i = a; i <= b; i++)
#define repr(i, a, b) for (ll i = a; i >= b; i--)
#define I long_max
#define pii pair<int, int>
#define pll pair<long, long>
#define vpair vector<pair<int, int>>
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define fir first
#define sec second
#define d (int)1e9 + 7
#define INF (int)2e9 + 1
#define el "\n"
#define fs fastscan

#define vrep(vec) for (const auto &value : vec)
#define arep(arrat) for (const auto &value : array)
using namespace std;

bool sortinrev(const pair<int, int> &a,
               const pair<int, int> &b)
{
    return (a.first > b.first);
}
void swap(int *a, int *b)
{
    int temp;
    temp = *a;
    *a = *b;
    *b = temp;
}

//over

bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n % 2 == 0 || n % 3 == 0)
        return false;

    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;

    return true;
}

int dfs(int n, vector<vector<int>> &adj, vector<bool> &check, vector<vector<ll>> &final1, int last)
{
    // if (n == target)
    // {
    //     check[target] = true;
    //     return final;
    // }
    for (int j = 0; j < adj[last].size(); j++)
    {
        if (adj[last][j] != 0 && !check[j])
        {
            check[j] = true;
            final1[n][j] = final1[n][last] + adj[last][j];
            dfs(n, adj, check, final1, j);
        }
        // if (check[target])
        // {
        //     return a;
        // }
    }
    return 0;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //use auto instead of data types
    // int t;
    // cin >> t;
    // while (t--)
    {
     int n;
     cin>>n;
     vector<int> a(n);
     rep(i,n){
         cin>>a[i];
     }
     vector<int> dp(n,0);
     for(int i = 1;i<n;i++){
        //  dp[i] = dp[0] + abs(a[i] - a[0]);
        if(i>=2){
         dp[i] = min(dp[i-1] + abs(a[i] - a[i-1]),dp[i-2] + abs(a[i] - a[i-2]));
        }
        else{
            dp[i] = dp[i-1] + abs(a[i] - a[i-1]);
        }
     }
     cout<<dp[n-1]<<endl;
    }
    return 0;
}


Measured memory_bytes: 3908
a,b=map(int,input().split())
c=[]
for i in range(a):
  c+=[list(map(int,input().split()))]
count=0
for i in range(a):
  for j in range(i+1,a):
    k=sum([(c[i][t]-c[j][t])**2 for t in range(b)])
    if int(k**0.5)**2==k:count+=1
print(count)

Measured memory_bytes: 3188
#include <iostream>
#include <string>
using namespace std;
#define REP(i,n)    for(int i = 0; i < (int)n; i++)
#define MAX_N   100000
typedef long long ll;

void solve(){
    int n;
    string s;
    cin >> n;
    cin >> s;
    if(n >= 3200)
        cout << s;
    else
        cout << "red\n" << endl;   

}

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


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

num = [-1]
for _ in range(N - 1):
  num += [-1]

for _ in range(M):
  s, c = list(map(int, input().split()))
  if (s == 1 and c == 0 and N != 1) or (num[s - 1] != -1 and num[s - 1] != c):
    print('-1')
    exit()
  num[s - 1] = c

if num[0] == -1:
  if len(num) == 1:
    print('0')
    exit()
  num[0] = 1

print(''.join(map(str, map(lambda x: 0 if x == -1 else x, num))))


Measured memory_bytes: 3064
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    private static Scanner sc;

    public Main() {
    }

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

    private void solve() {
        int N = sc.nextInt();
        int[] s = new int[N];
        int sum = 0;
        for (int i = 0; i < N; i++) {
            s[i] = sc.nextInt();
            sum += s[i];
        }
        boolean allTen = true;
        if (sum % 10 != 0) {
            System.out.println(sum);
        } else {
            Arrays.sort(s);
            int ans = sum;
            for (int i = 0; i < N; i++) {
                if (s[i] % 10 == 0) {
                    continue;
                }
                allTen = false;
                ans -= s[i];
                if (ans % 10 != 0) {
                    break;
                }
            }
            if (allTen) {
                System.out.println(0);
            } else {
                System.out.println(ans);
            }

        }
    }
}

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

int main(){
    int ans=0,sum=0;
    int n,m;
    string s;
    cin >>n>>s;


    //cout <<fixed<<setprecision(16)<< << endl;
    //cout << ans << endl;

    if(n >= 3200)cout << s <<endl;
    else cout << "red" <<endl;
    
    return 0;
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
res = 0

def resolve():
    def dfs(v, p):
        global res
        c = C.pop(0)
        T[v] = c
        for u in edge[v]:
            if u == p:
                continue
            else:
                res += min(T[v], C[0])
                dfs(u, v)

    n = int(input())
    edge = [[] for _ in range(n)]
    for _ in range(n - 1):
        a, b = map(int, input().split())
        edge[a - 1].append(b - 1)
        edge[b - 1].append(a - 1)
    C = list(map(int, input().split()))
    C.sort(reverse=True)

    T = [0] * n
    dfs(0, -1)
    print(res)
    print(*T)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 22304
<?php
	while(fscanf(STDIN, "%lf %lf %lf %lf %lf %lf", $a, $b, $c, $d, $e, $f)) {
		$x = ($c * $e - $b * $f) / ($a * $e - $b * $d);
		$y = ($c * $d - $a * $f) / ($b * $d - $a * $e);
		printf("%.3f %.3f\n", $x, $y);
	}
?>

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

int main() {
  int m, f, r;

  cin >> m >> f >> r;
  while (m != -1 || f != -1 || r != -1) {
    char ret;
    if (m == -1 || f == -1) ret = 'F';
    else if (m+f >= 80) ret = 'A';
    else if (m+f >= 65) ret = 'B';
    else if (m+f >= 50) ret = 'C';
    else if (m+f >= 30) {
      if (r >= 50) ret = 'C';
      else ret = 'D';
    } else ret = 'F';
    cout << ret << endl;

    cin >> m >> f >> r;
  }

  return 0;
}


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

int main(void){
    // 自分の得意な言語で
    // Let's チャレンジ！！
    int N,M;
    cin >> N >> M;
    int acc[N+1];
  	for(int i=0;i<N+1;i++){
    	acc[i]=0;  
	}
    for(int i=0;i<M;i++){
        int x;
        cin >> x;
        acc[x] = -1;
    }
    acc[0]=1;

    for(int i=1;i<N+1;i++){
        if(acc[i]==-1){
            acc[i]=0;
            continue;
        }

        if(i>1)acc[i] += acc[i-2];
        acc[i]+=acc[i-1];
        acc[i] = acc[i]%1000000007;
    }
    cout << acc[N] << endl;
    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<string.h>
#include<vector>
#include<math.h>
#include<algorithm>

using namespace std;

int main() {
    long long N, A, B;
    cin >> N >> A >> B;
    if((abs(A-B))%2==0) {
        cout << (abs(A-B))/2 << endl;
    } else {
        if((B-1)<(N-A)) {
           cout << (A-1) + (B-A-1)/2 + 1 << endl;
        } else {
            cout << N-B + (B-A-1)/2 + 1 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
package main

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

func generated_monkukui_swap(a int, b int) (int, int) {
	return b, a
}
func (u generated_monkukui_UnionFind) Size(x int) int {
	return -u.par[u.Find(x)]
}
func (u generated_monkukui_UnionFind) Union(x, y int) {
	xr := u.Find(x)
	yr := u.Find(y)
	if xr == yr {
		return
	}
	if u.Size(yr) < u.Size(xr) {
		yr, xr = generated_monkukui_swap(yr, xr)
	}
	u.par[yr] += u.par[xr]
	u.par[xr] = yr
}
func (u generated_monkukui_UnionFind) Find(x int) int {
	if u.par[x] < 0 {
		return x
	}
	u.par[x] = u.Find(u.par[x])
	return u.par[x]
}
func generated_monkukui_NewUnionFind(N int) *generated_monkukui_UnionFind {
	u := new(generated_monkukui_UnionFind)
	u.par = make([]int, N)
	for i := range u.par {
		u.par[i] = -1
	}
	return u
}

type generated_monkukui_UnionFind struct{ par []int }

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var n, m int
	fmt.Fscan(r, &n, &m)
	uf := generated_monkukui_NewUnionFind(n)
	for i := 0; i < m; i++ {
		var a, b int
		fmt.Fscan(r, &a, &b)
		a--
		b--
		uf.Union(a, b)
	}
	ans := 0
	for i := 0; i < n; i++ {
		if ans < uf.Size(i) {
			ans = uf.Size(i)
		}
	}
	fmt.Fprintln(w, ans)
}


Measured memory_bytes: 6320
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
void fast_IO() { ios_base::sync_with_stdio(false);cin.tie(NULL);}

int main()
{
	ll n,k; cin>>n>>k;
	ll h[n]; for(ll i=0;i<n;i++) cin>>h[i];

	ll dp[n];
	dp[0]=0;

	for(ll i=1;i<n;i++)
	{
		ll ans= INT_MAX;
		for(ll j=1;j<=k;j++)
		{
			if(i>=j) ans= min(ans, dp[i-j] + abs(h[i]-h[i-j]));
		}
		dp[i]= ans;
	}
	cout<<dp[n-1];
}

Measured memory_bytes: 5064
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	string s;
	cin >> s;
	cout << s[0] << s[1] << s[2] << endl;
	
	return 0;
}


Measured memory_bytes: 3636
d, g = map(int, input().split())
pc = [tuple(map(int, input().split())) for _ in range(d)]

ans = 10 ** 18
import itertools
for i in itertools.product([0, 1], repeat=d):
    point = 0
    num = 0
    # ボーナス加算
    for j in range(d):
        if i[j] == 1:
            num += pc[j][0]
            point += pc[j][1] + 100 * (j+1) * pc[j][0]
    #print('-b-', i, g, point, num)
    # 足りない分を後ろから全問-1問まで加算
    for j in reversed(range(d)):
        if g <= point:
            break
        if i[j] == 0:
            c = (g - point) // (100 * (j+1))
            if c < pc[j][0]:
                num += c
                point += 100 * (j+1) * c
            else:
                num += pc[j][0] - 1
                point += 100 * (j+1) * (pc[j][0] - 1)
        #print(i,j, g, point, num)
    #print('---', ans, num, point)
    if g <= point:
        ans = min(ans, num)
print(ans)





Measured memory_bytes: 3064
#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        line.trim_right();
        line
    }};
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        let iter = line.split_whitespace();
        iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
    }};
}

const FACT_MAX: usize = 300000;
const MOD: i64 = 10000000033;

#[allow(dead_code)]
fn pow_mod(base: i64, power: i64, modulo: i64) -> i64 {
    let mut base = base;
    let mut power = power;
    let mut ans = 1;
    while power > 0 {
        if power & 1 == 1 {
            ans = ans * base % modulo;
        }
        power >>= 1;
        base = base * base % modulo;
    }
    ans
}

thread_local! {
    #[allow(unused)]
    pub static FACT: Vec<i64> = {
        let mut fac: Vec<i64> = vec![1; FACT_MAX+1];

        for i in 1..FACT_MAX+1 {
            fac[i] = (fac[i-1] * i as i64) as i64 % MOD;
        }
        fac
    };

    #[allow(unused)]
    pub static RFACT: Vec<i64> = {
        let mut rfac = vec![1; FACT_MAX+1];
        rfac[FACT_MAX] = FACT.with(|fact| {
            pow_mod(fact[FACT_MAX], MOD-2, MOD)
        });

        for i in (1..FACT_MAX).rev() {
            rfac[i] = (rfac[i+1] * (i+1) as i64) % MOD;
        }
        rfac
    }
}

#[allow(dead_code)]
fn combi(n: usize, m: usize) -> i64 {
    if n < m {
        return 0;
    }

    let n: i64 = n as i64;

    n * (n - 1) / 2
}

fn main() {
    let n = parse_line!(usize);
    let aa = parse_vec!(usize);

    let mut v = vec![0; 200001];

    for &a in aa.iter() {
        v[a] += 1;
    }

    let mut sum = 0;

    for &i in v.iter() {
        sum += combi(i, 2);
    }

    for i in 0..n {
        println!("{}", sum - combi(v[aa[i]], 2) + combi(v[aa[i]] - 1, 2));
    }
}


Measured memory_bytes: 11248
#include<iostream>
using namespace std;
int main() {
	int a = 0;
	int b = 0;
	cin >> a;
	cin >> b;
	if (a>b)
	{
		cout << "a > b" << endl;
	}
	else if (a<b)
	{
		cout << "a < b" << endl;
	}
	else
	{
		cout << "a == b" << endl;
	}
	return 0;
}


Measured memory_bytes: 3092