akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int H, W;
    cin >> H >> W;
    vector<vector<char>> data(H, vector<char>(W));
    vector<bool> row(H, false);
    vector<bool> col(W, false);

    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
            cin >> data.at(i).at(j);
    }

    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            if (data.at(i).at(j) == '#')
            {
                row.at(i) = true;
                col.at(j) = true;
            }
        }
    }

    for (int i = 0; i < H; i++)
    {
        if (row.at(i))
        {
            for (int j = 0; j < W; j++)
            {
                if (col.at(j))
                {
                    cout << data.at(i).at(j);
                }
            }
            cout << endl;
        }
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();

		Integer list[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
		System.out.println(list[number-1]);
	}

}


Measured memory_bytes: 23764
#include<stdio.h>
int main()
{
	int a1,a2,b1,b2,a,b,c,d,x=0,y=0;
	scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&b1,&b2,&a,&b,&c,&d);
	x=a1*a+a2*b+(a1/10)*c+(a2/20)*d;
	y=b1*a+b2*b+(b1/10)*c+(b2/20)*d;
	if(x==y){
		printf("even\n");
	}
	else if(x<y){
		printf("kenjiro\n");
	}
	else  printf("hiroshi\n");
	return 0;
}


Measured memory_bytes: 2620
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N, K;
    cin >> N >> K;
    string S;
    cin >> S;
    
    char prev = 'A';
    int g = 0;
    for (char c : S) {
        if (c != prev)
            g++;
        prev = c;
    }
    
    g = max(1, g - 2 * K);
    cout << N - g << endl;
    return 0;
};


Measured memory_bytes: 512
//	ZapZu's code hohoho
//	#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define dfs_black 1
#define dfs_white -1
#define pr pair
#define vt vector
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef double db;
typedef long long li;
typedef long double ld;

typedef pr<int, int> ii;
typedef pr<ld,ld> dd;

typedef vt<int> vi;
typedef vt<li> vli;
typedef vt<ld> vld;
typedef vt<ii> vii;

typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, char> mic;

typedef set<int> s_i;
typedef set<char> s_c;

const int MOD = 1e9+7;
const li INF = 1e18;
const ld PI = 4*atan((ld)1);
int s[2005], t[2005];
li dp[2005][2005];
signed main()
{
//	freopen(".inp", "r", stdin);
//	freopen(".out", "w", stdout);
	int n, m;
	cin>>n>>m;
	for(int i=0; i<=n; i++)
	{
		if(i) cin>>s[i];
		dp[i][0]=1;
	}
	for(int j=0; j<=m; j++)
	{
		if(j) cin>>t[j];
		dp[0][j]=1;
	}
	for(int i=1; i<=n; i++)
	{
		for(int j=1; j<=m; j++)
		{
			if(s[i]==t[j]) dp[i][j]=(dp[i-1][j]+dp[i][j-1])%MOD;
			else dp[i][j]=(dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1])%MOD;
//			cout<<i<<" "<<j<<dp[i][j]<<endl;
		}
	}
	while(dp[n][m]<0) dp[n][m]+=MOD;
	cout<<dp[n][m]<<endl;
}


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


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

template <class Head>
void dbgLog(Head&& head) {
  cerr << head << endl;
}

template <class Head, class... Tail>
void dbgLog(Head&& head, Tail&&... tail)
{
  cerr << head << " ";
  dbgLog(forward<Tail>(tail)...);
}

#if DEBUG
  #define DLOG(...)        dbgLog(__VA_ARGS__)
  #define DFMT(...)        cerr << dbgFormat(__VA_ARGS__) << endl
  #define DCALL(func, ...) func(__VA_ARGS__)
#else
  #define DLOG(...)
  #define DFMT(...)
  #define DCALL(func, ...)
#endif

// operator<< definitions for some classes

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

template <typename T>
ostream& operator<< (ostream& os, const vector<T>& v) {
  os << '[';
  for (auto it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  os << ']';

  return os;
}

template <typename T, typename T2, typename T3>
ostream& operator<< (ostream& os, const priority_queue<T, T2, T3>& orig) {
  priority_queue<T, T2, T3> pq(orig);
  bool first = true;
  os << '[';
  while (!pq.empty()) {
    T x = pq.top(); pq.pop();
    if (!first) os << ", ";
    os << x;
    first = false;
  }
  return os << ']';
}


int main(int argc, char *argv[]) {
  // C-style stdio functions should not be used.
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  string S; cin >> S;
  ll M = S.size();
  
  ll i = 0;
  ll sum = 0;

  if (S.at(0) == '>') {
    while (i < M && S.at(i) == '>') i++;
    sum = i * (i+1) / 2;
    if (i == M) {
      cout << sum << endl;
      return 0;
    }
  }

  auto getTwo = [&](ll i0, ll& len1, ll& len2) -> bool {
    len1 = 0;
    len2 = 0;
    ll j = i0;
    DLOG("j", j, "S", S, "S.at(j)", S.at(j));
    while (j < M && S.at(j) == '<') {
      j++;
      len1++;
    }
    if (j == M) return true;
    while (j < M && S.at(j) == '>') {
      j++;
      len2++;
    }
    if (j == M) return true;
    return false;
  };

  while (1) {
    ll len1 = 0;
    ll len2 = 0;
    bool fin = getTwo(i, len1, len2);
    ll len3 = max(len1, len2);
    ll len4 = min(len1, len2);
    sum += len3 * (len3 + 1) / 2;
    sum += len4 * (len4 - 1) / 2;
    i += len1 + len2;
    if (fin) break;
  }

  cout << sum << endl;

  return 0;
}



Measured memory_bytes: 1172
N = int(input())
temp = [0 for x in range(N+1)]

#+1で増加するような部分列の最長を求める

for i in range(N):
    num = int(input())
    temp[num] = 0
    temp[num] = temp[num-1]+1
    temp[num-1] = 0

print(N-max(temp))


Measured memory_bytes: 4696
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<functional>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#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,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};




signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a!=c) cout<<1<<endl;
    else cout<<0<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = n;i >= m;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define ALL(n) n.begin(),n.end()

int main() {
	int a, b;
	cin >> a >> b;
	cout << b + b - a << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
using ll = long long;

ll f(ll N, ll X){
        if(X==0) return 0;
        if(X>pow(2,N+2)-3) return pow(2,N+1)-1;
        if(N==0&&X==1) return 1;
        if(X<pow(2,N+1)-1) return f(N-1, X-1);
        if(X==pow(2,N+1)-1) return pow(2,N);
        if(X>pow(2,N+1)-1) return pow(2,N)+f(N-1,X-pow(2,N+1)+1);
}

int main(){
        ll N,X;
        cin >> N >> X;
        cout << f(N,X) << endl;
        return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

string a, b, c;
signed main()
{
    cin >> a >> b >> c;
    printf("A%cC\n", b[0]);
    return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
l1=[]
l2=[]
for i in range(n):
  a,s=map(int,input().split())
  l1.append(a)
  l2.append(s)
m1=max(l1)
c=0
l2=sorted(l2)
for i in range(1,1+len(l2)):
  if m<=0:
    break
  elif l2[-i]>=m1:
    c+=1
    m-=l2[-i]
  else:
    break
if m<=0:
  print(c)
else:
  if m%m1==0:
    c+=m//m1
  else:
    c+=m//m1+1
  print(c)

Measured memory_bytes: 12064
#a = int(input())
#b,c = map(int,input().split())
#s = input()
#list_s = list(input())
#list_int = list(map(int,input().split()))

#list = [0 for i in range(n)]
#dp = [[0 for i in range(A)] for j in range(B)]

#list_int 並べて出力 print (' '.join(map(str,ans_li)))
#list_str 並べて出力 print (' '.join(list))

# 2進数 format(10, 'b') # '1010'

# aa=[int(input()) for i in range(n)]

#for i,name in enumerate(list)

''' 二次元配列を一列ずつ
for i in ans:
	print(*i)
'''
''' heapq
queue = []
heapq.heapify(queue) #heapqの作成
heapq.heappush(queue,num) #numのpush(値の追加)
pop = heapq.heappop(queue) #numのpop(最小値の出力)
pop = heapq.heappushpop(queue,num) #push -> pop

'''

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7


S1 = input()
S2 = input()

for i in range(len(S2)):
	S2 = S2[-1] + S2[:-1]
	if S2 == S1:
		print('Yes')
		sys.exit()

print('No')


Measured memory_bytes: 3832
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
	class Program
	{
		public static void Main()
		{
			var radius = IO.ReadDouble();
			IO.Write(2 * radius * Math.PI);
		}
	}

	public static class IO
	{
		public static string   Read()								 { return Console.ReadLine(); }
		public static string[] ReadArray(char iSplitter = ' ')		 { return Read().Split(iSplitter); }
		public static int	   ReadInt()							 { return int.Parse(Read()); }
		public static int[]	   ReadIntArray(char iSplitter = ' ')	 { return ReadArray().Select(iText => int.Parse(iText)).ToArray(); }
		public static long	   ReadLong()							 { return int.Parse(Read()); }
		public static long[]   ReadLongArray(char iSplitter = ' ')	 { return ReadArray().Select(iText => long.Parse(iText)).ToArray(); }
		public static double   ReadDouble()							 { return double.Parse(Read()); }
		public static double[] ReadDoubleArray(char iSplitter = ' ') { return ReadArray().Select(iText => double.Parse(iText)).ToArray(); }
		public static char[]   ReadCharArray()						 { return Read().ToCharArray(); }

		public static void Write(string iValue)									   { Console.WriteLine(iValue); }
		public static void Write(int iValue)									   { Console.WriteLine(iValue); }
		public static void Write(IEnumerable<int> iValue , string iJoinWord = " ") { Console.WriteLine(string.Join(iJoinWord , iValue)); }
		public static void Write(long iValue)									   { Console.WriteLine(iValue); }
		public static void Write(double iValue)									   { Console.WriteLine(iValue); }
		public static void Write(decimal iValue)								   { Console.WriteLine(iValue); }
		public static void Write(bool iValue)									   { Console.WriteLine(iValue ? "Yes" : "No"); }
	}

	public static class Util
	{
		public static long Gcd(long i0 , long i1) { return (i0 > i1) ? _Gcd(i0 , i1) : _Gcd(i1 , i0); }
		public static long Lcm(long i0 , long i1) { return (i0 * i1) / Gcd(i0 , i1); }
		public static long ModPow(long iBaseNumber , long iPow , long iModNumber)
		{
			var num = 1L;
			while(iPow != 0)
			{
				if((iPow & 0x1) != 0)
				{
					num = (num * iBaseNumber) % iModNumber;
				}
				iBaseNumber = (iBaseNumber * iBaseNumber) % iModNumber;
				iPow >>= 1;
			}
			return num;
		}

		private static long _Gcd(long i0 , long i1)	{ return (i1 == 0) ? i0 : _Gcd(i1 , i0 % i1); }
	}
}


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

public class Main {
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
		int n1 = br.ni();
		long l1 = 1;
		long l2 = 1;
		for(int i = 0;i<n1;i++) {
			long j1 = br.ni();
			long j2 = br.ni();
			long n = Math.max((l1+j1-1)/j1, (l2+j2-1)/j2);

			l1=j1*n;
			l2=j2*n;
		}
		pw.println(l1+l2);
		pw.close();
	}
}

class FastScanner {
	BufferedReader br;
	StringTokenizer st;

	public FastScanner(String s) {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

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

	ArrayList<Integer>[] ng(int n, int e) {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	}

	Integer[] nIa(int n) {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	int[] nia(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	Long[] nLa(int n) {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	long[] nla(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	String[] nsa(int n) {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	}

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

	int ni() {
		return Integer.parseInt(nt());
	}

	long nl() {
		return Long.parseLong(nt());
	}

	double nd() {
		return Double.parseDouble(nt());
	}

}

Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

const int dx[] = { -1, -1, -1, 0, 0, 1, 1, 1 }, dy[] = { 0, -1, 1, -1, 1, 0, -1, 1 };
bool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }
int place(int x, int y, int w) { return w*x + y; }

void dbg(int fld, int p, int n)
{
	string s(n*n, '.');
	REP(i, n*n) if ((fld >> i) & 1) s[i] = '#';
	s[p] = '@';
	REP(i, n*n)
	{
		if (i % n == 0) cout << endl;
		cout << s[i];
	}
	cout << endl;
}


int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n;
	while (cin >> n, n)
	{
		vs v(n);
		REP(i, n) cin >> v[i];
		int fld = 0;
		int st;
		REP(i, n)REP(j, n)
		{
			if (v[i][j] == '#') fld |= 1 << place(i, j, n);
			if (v[i][j] == '@') st = place(i, j, n);
		}
		queue<pii> que; que.emplace(fld, st);
		map<pii, int> mp; mp[pii(fld, st)] = 0;
		bool f = false;
		while (!que.empty())
		{
			pii tmp = que.front(); que.pop();
			int tfld = tmp.first;
			int tx = tmp.second / n, ty = tmp.second % n;
			//dbg(tfld, place(tx,ty,n), n);
			if (tfld == 0)
			{
				cout << mp[tmp] << endl;
				f = true;
				break;
			}
			REP(i, 8)
			{
				int nx = tx + dx[i], ny = ty + dy[i];
				int np = place(nx, ny, n);
				if (!valid(nx, ny, n, n) || (tfld>>np) & 1) continue;
				int nfld = tfld;
				nfld |= 1 << np;
				int res = 0;
				REP(j, n)REP(k, n)
				{
					if (j == nx && k == ny) continue;
					int p = place(j, k, n);
					int cnt = 0;
					REP(l, 8)
					{
						int x = j + dx[l], y = k + dy[l];
						if (!valid(x, y, n, n)) continue;
						if ((nfld >> place(x, y, n)) & 1) cnt++;
					}
					if ((nfld >> p) & 1)
					{
						if (cnt == 2 || cnt == 3) res |= 1 << p;
					}
					else
					{
						if (cnt == 3) res |= 1 << p;
					}
				}
				pii nex(res, np);
				if (mp.count(nex)) continue;
				mp[nex] = mp[tmp] + 1;
				que.push(nex);
			}
		}
		if (!f) cout << -1 << endl;
	}
	return 0;
}

Measured memory_bytes: 4436
#include <stdio.h>
#include <math.h>
int main(){
    double x[4],y[4];
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        for(int i=0;i<3;i++)scanf("%lf%lf",&x[i],&y[i]);
        x[3]=y[0]*(x[2]*x[2]+y[2]*y[2])+y[1]*(x[0]*x[0]+y[0]*y[0])+y[2]*(x[1]*x[1]+y[1]*y[1])-y[0]*(x[1]*x[1]+y[1]*y[1])-y[1]*(x[2]*x[2]+y[2]*y[2])-y[2]*(x[0]*x[0]+y[0]*y[0]);
        y[3]=x[0]*(x[2]*x[2]+y[2]*y[2])+x[1]*(x[0]*x[0]+y[0]*y[0])+x[2]*(x[1]*x[1]+y[1]*y[1])-x[0]*(x[1]*x[1]+y[1]*y[1])-x[1]*(x[2]*x[2]+y[2]*y[2])-x[2]*(x[0]*x[0]+y[0]*y[0]);
        y[3]=-y[3];
        x[3]/=x[0]*y[1]+x[1]*y[2]+x[2]*y[0]-x[0]*y[2]-x[1]*y[0]-x[2]*y[1];
        y[3]/=x[0]*y[1]+x[1]*y[2]+x[2]*y[0]-x[0]*y[2]-x[1]*y[0]-x[2]*y[1];
        y[3]/=2;
        x[3]/=2;
        printf("%.3f %.3f %.3f\n",x[3],y[3],sqrt((x[3]-x[0])*(x[3]-x[0])+(y[3]-y[0])*(y[3]-y[0])));
    }
}

Measured memory_bytes: 2572
macro_rules! scan_sub {
    ( $itr:ident, $t:ty ) => {
        let mut buf = String::new();
        let $itr = {
            while buf.trim().len() == 0 {
                buf = String::new();
                std::io::stdin().read_line(&mut buf).unwrap();
            }
            buf.split_whitespace().map(|n| n.parse::<$t>().unwrap())
        };
    };
}

macro_rules! scan {
    ( $x:ident; Vec<$t:ty> ) => {
        scan_sub!(itr, $t);
        let $x = itr.collect::<Vec<_>>();
    };
    ( $( $x:ident ),*; $t:ty ) => {
        scan_sub!(itr, $t);
        let mut itr = itr;
        $(
            let $x = itr.next().unwrap();
        )*
    };
}

fn main() {
    scan!(n, m; usize);

    let t = if n > 0 {n * (n - 1) / 2} else { 0 };
    let u = if m > 0 {m * (m - 1) / 2} else { 0 };

    println!("{}", t + u);
}


Measured memory_bytes: 4352
import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    String S = sc.next();
    String T = sc.next();
    int A = sc.nextInt();
    int B = sc.nextInt();
    String U = sc.next();

    if(S.equals(U)){
        System.out.print(A-1);
        System.out.print(" ");
        System.out.println(B);
    }else{
        System.out.print(A);
        System.out.print(" ");
        System.out.println(B-1);
    }

    }    
}


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

int main() {
  char str[4];
  int num = 0;

  cin >> str;

  rep(i, 3) {
    if (str[i] == '1') {
      num++;
    }
  }

  cout << num << endl;

  return 0;
}


Measured memory_bytes: 256
import string

s = input()
alp = string.ascii_lowercase

def search(s, c):
    for i in s:
        if i == c:
            return 1
    return 0

f = 0
for i in alp:
    if not search(s, i):
        print (i)
        f = 1
        break;
if not f:
    print ("None")


Measured memory_bytes: 3832
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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


// ll memo[2020][2020];
// int pascal_triangle(){
//   for(int i = 0; i < 1000; i++){
//     for(int j = 0; j < i+1; j++){
//       if(j == 0 || j == i) memo[i][j] = 1;
//       else{
// 	memo[i][j] = (memo[i-1][j-1]+memo[i-1][j])%mod;
//       }
//     }
//   }
//   return 0;
// }


// int factorial(int n){
//   if(n == 0) return 1;
//   return n*factorial(n-1);
// }

// int divisor(int a){
//   int cnt = 0;
//   for(int i=1; i <= a; i++) if(a%i == 0) cnt++;
//   return cnt;
// }

// int comb(int n, int k){
//   pascal_triangle();
//   return memo[n][k];
// }

int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}







//二項係数(mod剰余)----------------------------

// const int MAX = 3000010;
// const int M = 1000000007;

// vector<ll> fac(MAX); //n!(mod M)
// //a,bの範囲的にこれだけ配列を用意していけば十分
// vector<ll> ifac(MAX); //k!^{M-2} (mod M)

// ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
//     ll ans = 1;
//     while(n != 0){
//         if(n&1) ans = ans*x % M;
//         x = x*x % M;
//         n = n >> 1;
//     }
//     return ans;
// }

// ll COMinit(){
//   //大した量ではないので，先にfax[i]とifax[i]を全て計算しておく
//   fac[0] = 1;
//   ifac[0] = 1;
//   for(ll i = 0; i<MAX; i++){
//     fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
//     ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
//   }
//   return 0;
// }

// ll COM(ll a, ll b){ //aCbをmod計算
//   if(a == 0 && b == 0)return 1;
//   if(a < b || a < 0)return 0;
//   ll tmp = ifac[a-b]* ifac[b] % M;
//   return tmp * fac[a] % M;
// }

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



int main(){
  int N;
  cin >> N;
  int a[N];
  rep(i,N) cin >> a[i];
  int m = inf;
  int ans = 0;
  rep(i,N){
    if(a[i] < m){
      ans++;
      m = a[i];
    }
  }
  cout << ans << endl;
  return 0;
}




Measured memory_bytes: 1024
loop do
  n = gets.chomp.to_i
  break if n==0
  ans = 0
  for i in 0...n
    for j in (i+1)...n
      t = (j*(j+1) - i*(i+1))/2
      ans+=1 if t==n
      break if t>=n
    end
  end
  puts ans
end

Measured memory_bytes: 6096
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#define SIZE 200005

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

vector <int> vec[SIZE];
int A[SIZE],deg[SIZE];
int ans[SIZE];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		scanf("%d %d",&a,&b);a--,b--;
		vec[a].push_back(b);
		vec[b].push_back(a);
	}
	queue <int> que;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&A[i]);
		deg[i]=vec[i].size();
		if(vec[i].size()==1) que.push(i);
	}
	sort(A,A+n);
	ll sum=0;
	for(int i=0;i<n;i++)
	{
		int v=que.front();que.pop();
		ans[v]=A[i];
		if(i+1<n) sum+=A[i];
		for(int j=0;j<vec[v].size();j++)
		{
			int to=vec[v][j];
			deg[to]--;
			if(deg[to]==1) que.push(to);
		}
	}
	printf("%lld\n",sum);
	for(int i=0;i<n;i++) printf("%d ",ans[i]);puts("");
	return 0;
}


Measured memory_bytes: 5760
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
import sys
# import numpy as np
# from scipy.special import comb

sys.setrecursionlimit(100000)
INF = float('inf')

N = int(input())
memo = [INF] * (N + 1)
memo[0] = 0


def f(n):

    # 0なら終了
    if n == 0:
        return 0

    # メモされてたら終了
    if not memo[n] == INF:
        return memo[n]

    ans = INF

    # 9
    for i in range(1, n):
        if 9 ** i > n:
            break
        ans = min(ans, f(n - 9**i) + 1)

    # 6
    for i in range(1, n):
        if 6 ** i > n:
            break
        ans = min(ans, f(n - 6**i) + 1)

    # 1
    ans = min(ans, f(n - 1) + 1)

    # メモ
    memo[n] = ans
    return ans


def main():
    print(f(N))


if __name__ == '__main__':
    main()


Measured memory_bytes: 63184
N = int(input())
S = input()

length = 0 

for i in range(N):
    l1 = i
    l2 = i + length
    _word = S[l1:l2]
    _S = S[l2:]
    while _word in _S:
        l2 += 1
        _word = S[l1:l2]
        _S = S[l2:]
    length = max(len(_word)-1, length)

print(length)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define erep(i,a,n) for(int i = a;i<=n;i++)
typedef long long ll;
#define int long long
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 1101010101010101010
#define MOD 1000000007
#define P pair<int,int>
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; }

signed main(){
  int n,k;
  cin >> n >> k;
  vint p(n);
  rep(i,0,n) cin >> p[i];
  sort(p.begin(),p.end());
  int ans = 0;
  rep(i,0,k) ans += p[i];
  cout << ans << endl;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
map<string,int> mp;
int main() {
    long test=1;
    // cin>>test;
    while(test--)
    {
	long t,i,j,n,a,b,c,d,ans,A,B;
	string s,s1,s2,s3;
	cin>>s1>>s2>>s3;
    cout<<char(int(s1[0])-32);
    cout<<char(int(s2[0])-32);
    cout<<char(int(s3[0])-32);
    }
	return 0;
}

Measured memory_bytes: 256
#
# File    : B.rb
# Author  : Kazune Takahashi
# Created : 8/18/2018, 9:02:44 PM
# Powered by Visual Studio Code
#

n = gets.to_i

ans = 0

for i in 1..n
  if i % 2 == 0
    next
  end
  cnt = 0
  for j in 1..i
    if i % j == 0
      cnt += 1
    end
  end
  if cnt == 8
    ans += 1
  end
end

puts ans

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> l(n);
	rep(i,n) cin >> l[i];
	sort(l.begin(), l.end());
	ll ans = 0;
	rep(i,n-2){
		for(int j = i+1; j < n-1; ++j){
			int idx = lower_bound(l.begin(), l.end(), l[i]+l[j]) - l.begin();
			ans += idx - j - 1;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3652
import math
N,M = map(int,input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N !=0 and N != 1:
    a = combinations_count(N, 2)
else:
    a = 0

if M !=0 and M != 1:
    b = combinations_count(M, 2)
else:
    b = 0

print(a+b)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i=j; i<=k; i++)
#define FFOR(i, j, k) for(int i=j; i<k; i++)
#define DFOR(i, j, k) for(int i=j; i>=k; i--)
#define bug(x) cerr<<#x<<" = "<<x<<'\n'
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
template <typename T> inline void read(T &x){
    char c;
    bool nega=0;
    while((!isdigit(c=getchar()))&&(c!='-'));
    if(c=='-'){
        nega=1;
        c=getchar();
    }
    x=c-48;
    while(isdigit(c=getchar())) x=x*10+c-48;
    if(nega) x=-x;
}
template <typename T> inline void writep(T x){
    if(x>9) writep(x/10);
    putchar(x%10+48);
}
template <typename T> inline void write(T x){
    if(x<0){
        putchar('-');
        x=-x;
    }
    writep(x);
}
template <typename T> inline void writeln(T x){
    write(x);
    putchar('\n');
}
#define taskname "C"
ll ans=1LL<<50;
int n;
int a[101];
int main(){
    #ifdef Megumin
        if(fopen(taskname".inp", "r"))
            freopen(taskname".inp", "r", stdin);
    #endif // Megumin
    read(n);
    FOR(i, 1, n) read(a[i]);
    FOR(x, -100, 100){
        ll res=0;
        FOR(i, 1, n) res+=(a[i]-x)*(a[i]-x);
        ans=min(ans, res);
    }
    write(ans);
}

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

int main(){
    int N;
    string s;
    string t;
    cin >> N >> s >> t;
    for (int i=0;i<N;i++){
        if (t[0]==s[i]){
            bool flag = true;
            for (int j=1;i+j<N;j++){
                if(t[j]!=s[i+j]){
                    flag = false;
                    break;
                 }
            }
            if (flag){
                cout << (N+i) << endl;
                return 0;
            }
        }
    }
    cout << (2*N) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<set>    
#include<map>    
#include<stack>    
#include<ctime>    
#include<cstdio>    
#include<queue>    
#include<cmath>    
#include<vector>    
#include<cstring>   
#include<climits>    
#include<iostream>   
#include<algorithm>
using namespace std;
#define LL long long
int read(){
    int f=1,x=0;char c=getchar();
    while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}
    while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}
    return f*x;
}
#define MAXN 1000000
#define INF 0x3f3f3f3f
char S[MAXN+5];
int a[MAXN+5],f2[MAXN+5];
int C(int n,int m){return f2[n]-f2[m]-f2[n-m]?0:1;}
int main(){
	int n=read();
	scanf("%s",S+1);
	for(int i=1;i<n;i++)
		a[i]=abs(S[i]-S[i+1]);
	int bei=2;
	for(int i=1;i<=n;i++)
		if(a[i]==1){
			bei/=2;
			break;
		}
	n--;
	for(int i=1;i<=n;i++)
		f2[i]=f2[i-1]+(int)log2(i&-i);
	if(bei==2)
		for(int i=1;i<=n;i++)
			a[i]>>=1;
	int ans=0;
	for(int i=1;i<=n;i++)
		if(a[i]==1)
			ans^=C(n-1,i-1);
	printf("%d\n",ans*bei);
	return 0;
}


Measured memory_bytes: 9088
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	static HashSet<Integer>[]	nextSets;	// i番目のノードの隣接ノードを記録する
	static long[]				cnt;		// i番目のノードの持ちカウントを記録する

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		// 入力受け取り
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int q = in.nextInt();
		nextSets = new HashSet[n + 1];
		for ( int i = 0; i <= n; i++ ) {
			nextSets[i] = new HashSet<>();
		}
		for ( int i = 1; i < n; i++ ) {
			int a = in.nextInt();
			int b = in.nextInt();
			nextSets[a].add(b);
			nextSets[b].add(a);
		}

		//		for ( int i = 0; i <= n; i++ ) {
		//			System.out.println(i + " : " + nextlists[i] + " size is " + nextlists[i].size());
		//		}

		// ノードごとの基礎カウントを記録
		cnt = new long[n + 1];
		for ( int i = 1; i <= q; i++ ) {
			int p = in.nextInt();
			int x = in.nextInt();
			cnt[p] += x;
		}

		// カウントの伝播
		cntSpread(1, cnt[1], nextSets[1]);

		// 表示 N<=2*10E5 これくらいだとStringBuilderを使わないと間に合わない模様
		StringBuilder result = new StringBuilder();
		for ( int i = 1; i <= n; i++ ) {
			result.append(cnt[i]).append(" ");
		}
		System.out.println(result);
		in.close();
	}

	// 親のカウントを子に加算
	static void cntSpread(int prnt, long prntCnt, HashSet<Integer> chldList) {

		// System.out.println("prnt is " + prnt);
		// 子がいなかったらリターン
		if ( chldList.size() < 1 /*&& nextList.get(0) == prnt*/ ) return;

		// 親が確定していればその隣接は子
		for ( Integer chld : chldList ) {
			cnt[chld] += prntCnt;
			nextSets[chld].remove(prnt); // ただしこの隣接ノードリストから親を削除する必要がある
			cntSpread(chld, cnt[chld], nextSets[chld]);
		}
	}
}

Measured memory_bytes: 274248
n = int(input())
ans = []

if n % 2 == 0:
    temp = n + 1
else:
    temp = n

for i in range(1, n):
    for j in range(i+1, n+1):
        if i + j == temp:
            continue
        else:
            ans.append((i, j))

print(len(ans))
for a in ans:
    print(a[0], a[1])


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

#define F                   first
#define S                   second
#define int                 long long int
#define pb                  push_back
#define mp                  make_pair
#define pii                 pair<int,int>
#define vi                  vector<int>
#define mii                 map<int,int>
#define pqb                 priority_queue<int>
#define pqs                 priority_queue<int,vi,greater<int> >
#define mod                 1000000007
#define endl                '\n'
#define rep(i,a,b)            for(int i=a;i<b;i++)
void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int32_t main()
{
    c_p_c();
    int n;
    cin >> n;
    int ac = 0, wa = 0, tle = 0, re = 0;
    while (n--) {
        string s;
        cin >> s;
        if (s == "AC") {
            ac++;
        }
        if (s == "TLE") {
            tle++;
        } if (s == "WA") {
            wa++;
        } if (s == "RE") {
            re++;
        }
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;


    return 0;
}

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

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

const int MAX_N = 55;

int N; ll Nr[MAX_N];
int main() {
	cin >> N; for(int i=0; i<N; i++) scanf("%lld", &Nr[i]);
	ll ans = 0;
	int cnt = 0;
	do{
		bool isOK = true;
		ll plus = 0;
		for(int i=0; i<N; i++) if(Nr[i] + plus >= N) {
			isOK = false;
			ll val = (Nr[i] + plus) / N;
			Nr[i] -= val * (N+1);
			plus += val;
			ans += val;
		}
		for(int i=0; i<N; i++) Nr[i] += plus;
		if(isOK) break;
	}while(true);
	printf("%lld\n", ans);
	return 0;
}


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

int main(){
long long n,d,k;
  cin>>n>>d;
  vector<long long> x(n);
  vector<long long> y(n);
  for(long long i=0;i<n;i++){
cin>>x.at(i)>>y.at(i);
  }
  k=0;
  for(long long i=0;i<n;i++){
if(x.at(i)*x.at(i)+y.at(i)*y.at(i)<=d*d){
k++;
}
  }
  cout<<k<<endl;
}
  

Measured memory_bytes: 6380
#include <cstdio>
#include <algorithm>
#include <cctype>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ')
{
    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;
    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();
    return f*x;
}
const int N = 1e5+5;
int n, m, w[N], c[N], ans;
int main()
{
    n = read(), m = read(), w[1] = 1;
    for(int i = 1; i <= n; ++i) c[i] = 1;
    for(int i = 1; i <= m; ++i)
    {
        int x = read(), y = read();
        ++c[y], w[y] |= w[x];
        if(--c[x] == 0) w[x] = 0;
    }
    for(int i = 1; i <= n; ++i) ans += w[i];
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e9+7
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}
int main(){
  ll N;
  cin>>N;
  
  vector<ll>X(N);
  
  rep(i,N){
    cin>>X[i];
  }
  ll ans=0;
  ll sub=0;
  rep(i,N){
    if(i>=1){
      if(X[i]<X[i-1]){
        ans+=X[i-1];
        sub+=min(X[i],X[i-1]);
      }
    
      
    }
  }
  ans+=X[N-1];
  cout<<ans-sub<<endl;
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int num1 = scan.nextInt();
		int num2 = scan.nextInt();
		scan.close();
		
		int hp;
		int count;
		
		for(count = 1 ; count <= 10000 ; count++ ) {
			hp = num1 - num2*count;
			if(hp <= 0) break;
		}
				System.out.println(count);
			
		}
	}


Measured memory_bytes: 24148
import java.util.*;
import java.io.*;
 
public class Main {
    static long ans = 0;
    static char[] s;
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        s = sc.next().toCharArray();
        boolean[] plus = new boolean[s.length-1];
        divide(plus,0);
        System.out.println(ans);
    }
    
    public static void divide(boolean[] p, int index){
        if(p.length == index){
            calc(p);
            return;
        }
        divide(p,index+1);
        p[index] = true;
        divide(p,index+1);
        p[index] = false;
        return;
    }
    
    public static void calc(boolean[] p){
        long tmp = 0;
        StringBuilder sb = new StringBuilder();
        sb.append(s[0]);
        for(int i = 0; i < p.length; i++){
            if(p[i]){
                tmp += Long.parseLong(sb.toString());
                sb.setLength(0);
            }
            sb.append(s[i+1]);
        }
        tmp += Long.parseLong(sb.toString());
        //System.out.println(tmp);
        ans += tmp;
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}


Measured memory_bytes: 21972
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>

using namespace std;

#define mp make_pair
#define pb push_back
#define x first
#define y second

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

const int N=100010;

vi e[N];
pii a[N];
bool ok[N];
int col[N];

void dfs(int k,int c)
{
	col[k]=c;
	for (vi::iterator p=e[k].begin();p!=e[k].end();p++)
		if (!col[*p]) dfs(*p,c);
}

int main()
{
	int n,m;scanf("%d%d",&n,&m);
	if (m==n-1) {puts("0");return 0;}
	if (n-1-m>n/2) {puts("Impossible");return 0;}
	for (int i=0;i<n;i++) {int x;scanf("%d",&x);a[i]=mp(x,i);}
	for (int i=0;i<m;i++)
	{
		int x,y;scanf("%d%d",&x,&y);
		e[x].pb(y);e[y].pb(x);
	}
	int l=0;
	for (int i=0;i<n;i++)
		if (!col[i]) dfs(i,++l);
	sort(a,a+n);
	ll ans=0,res=(n-1-m)*2-(n-m);
	for (int i=0;i<n;i++) if (!ok[col[a[i].y]]) {ok[col[a[i].y]]=1;ans+=a[i].x;} else if (res) {res--;ans+=a[i].x;}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
  ll N,K,a=0,answer=0;
  cin>>N>>K;
  vector<ll> vec(N);
  vector<ll> sum(N);
  vector<ll> ans(N-K+1);
  for(ll i=0;i<N;i++){
    cin>>vec.at(i);
    a+=vec.at(i);
    sum.at(i)=a;
  }
  for(ll i=0;i<N-K+1;i++){
    ll m=i+K-1;
    if(i==0){ans.at(i)=sum.at(m);}
    else{ans.at(i)=sum.at(m)-sum.at(i-1);}
    answer=max(answer,ans.at(i));
  }
  ll x=(answer+K)/2;
  if((answer+K)%2!=0)cout<<x<<"."<<5<<endl;
  else{cout<<x<<endl;}
}

Measured memory_bytes: 4992
function main(arg) {
    let p = Number(arg)
    let ans = 0
    if(p < 600)ans = 8
    else if(p < 800)ans = 7
    else if(p < 1000)ans = 6
    else if(p < 1200)ans = 5
    else if(p < 1400)ans = 4
    else if(p < 1600)ans = 3
    else if(p < 1800)ans = 2
    else if(p < 2000)ans = 1
    console.log(ans)
}

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

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

#入力
s = raw_input()

l = list(s)

count = 0
cl = []

for x in l:
    if x == "A" or x == "C" or x =="G" or x == "T":
        count += 1
    else:
        cl.append(count)
        count = 0
cl.append(count)

#print(cl)
print(max(cl))


Measured memory_bytes: 2568
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  using in = int64_t;
 in ans=0;
 in n,m;
  cin>>n>>m;
  priority_queue<in, vector<in>, greater<in>> a;
  
  for(in i =0;i<n;i++){//NlogN
    in x;
  cin >>x;
    a.push(x);
  }
  
  vector<pair<in,in>> bc(m);
  for(in i =0;i<m;i++){//m
    in x,y;
  cin >>x>>y;
    bc.at(i) = make_pair(y,x);
  }
  
  sort(bc.begin(),bc.end());//MlogM
  reverse(bc.begin(),bc.end());//
  
  for(in i =0;i<m;i++){
   for(in j =0;j<bc.at(i).second;j++){
   if(a.empty())
     break;
   else if(a.top() <bc.at(i).first){
     a.pop();
     ans +=bc.at(i).first;
       }
   else
     break;
   }
    if(a.empty())
      break;
  }
  
  while(!a.empty()){
    ans += a.top();
    a.pop();
  }
    
   cout <<ans<<endl;
  }


Measured memory_bytes: 2676
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    string u;
    unordered_map<std::string, int> mp;
    for (int i = 0; i < n; i++) {
        cin >> u;
        mp[u] = -1;
    }
    int m;
    cin >> m;
    string t[m];
    for (int i = 0; i < m; i++) {
        cin >> t[i];
    }
    int key = -1;
    for (int i = 0; i < m; i++) {
        if (mp[t[i]]) {
            if (key == -1) {
                cout << "Opened by " << t[i];
                key = 1;
            } else {
                cout << "Closed by " << t[i];
                key = -1;
            }
        } else {
            cout << "Unknown " << t[i];
        }
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 3252
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 1e18+7;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

int main(){
  string s;
  int q;
  cin>>s>>q;
  int t,f;
  int flag=1;
  char c;
  deque<char> ans;
  rep(i,s.size()){
    ans.push_back(s[i]);
  }
  rep(i,q){
    cin>>t;
    if(t==1){
      flag^=1;
    }else{
      cin>>f>>c;
      f--;
      if(flag^f){
        ans.push_front(c);
      }else{
        ans.push_back(c);
      }
    }
  }
  int n=ans.size();
  if(flag){
    rep(i,n){
      cout<<ans[i];
    }
  }else{
    repr(i,n){
      cout<<ans[i];
    }
  }
  cout<<endl;
  return 0;
}


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

#define SIZE 200010

int arr[2][SIZE][4];
int lim[4];
string str[2];

int id(char ch) {
    if (ch == 'L')
        return 0;
    if (ch == 'R')
        return 1;
    if (ch == 'U')
        return 2;
    return 3;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int row, column, len, x, y;
    cin >> row >> column >> len >> x >> y;
    for (int t = 0; t < 2; t++)
        cin >> str[t];

    lim[0] = y;  // Left
    lim[1] = column + 1 - y;  // Right
    lim[2] = x;  // Up
    lim[3] = row + 1 - x;  // Down

    for (int t = 0; t < 2; t++)
        for (int j = 0; j < 4; j++)
            arr[t][0][j] = 0;

    bool ans = true;
    for (int i = 1; i <= len && ans; i++) {
        for (int t = 0; t < 2; t++)
            for (int j = 0; j < 4; j++)
                arr[t][i][j] = arr[t][i - 1][j];
        int op;
        op = id(str[0][i - 1]);
        arr[0][i][op]++;

        if (arr[0][i][op] - arr[1][i - 1][op ^ 1] >= lim[op]) {
            ans = false; break;
        }

        op = id(str[1][i - 1]);
        arr[1][i][op] = min(lim[op] + arr[1][i][op ^ 1] - 1, arr[1][i][op] + 1);
    }

    if (ans)
        cout << "YES\n";
    else
        cout << "NO\n";

    return 0;
}


Measured memory_bytes: 7192
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
//setprecision(12)
#include <cassert>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define Cout(x) cout << x << endl;
#define check(v) rep(i,v.size()) cout << v[i] << endl;
#define vint(x) vector<int> x
#define vll(x) vector<long long> x
#define vstr(x) vector<string> x
const long long LLINF = 1LL<<60;
const int INF = 1e9;
const long long MOD = 1000000007;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
#define pint pair<int,int>
#define pll pair<ll,ll>
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, b, c; cin >> a >> b >> c;
    cout << c << " " << a << " " << b << endl;

    return 0;
}

Measured memory_bytes: 256