akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vec;
typedef vector<vec> mat;
/*Gauss_Jordan(2?????°???????????§???)
  O(n^3)
  Ax=b????§£??? A?????£?????????
  ?§£???????????¨??????????????????????????????
  ?§£???????????§????????¨?????????n+1??????????????????
  
  N???????????°??§M??????????¨???????????????´??????init?????????
  mat A(N,vec(M,0));
  vec B(N,0);
  gauss_jordan(A,B)
*/

vec gauss_jordan(const mat& A,const vec& b){
  int n=A.size();
  mat B(n,vec(n+1));
  vector<int> can(n,1);
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)B[i][j]=A[i][j]; //n*(n+1)?????????????????????

  for(int i=0;i<n;i++)B[i][n]=b[i]; //n???????????£??\

  for(int i=0;i<n;i++){
    int pivot=i;//?¬????????????¨??????????????????
    for(int j=0;j<n;j++)if(can[j] && B[j][i])pivot=j;//0??\??????1????????¢???
    swap(B[i],B[pivot]);//i??????????????£????????????
    if(B[i][i]==1)can[i] = 0;

    
    for(int j=0;j<n;j++){ //
      if(i!=j && B[j][i])//i??????-i?????????????????????
        for(int k=i;k<=n;k++)B[j][k]=B[j][k] ^ B[i][k];//i????????????i????????\??????0????????????
    }
  }
  vec x(n);
  for(int i=0;i<n;i++)x[i]=B[i][n];

  int many = 0;
  for(int i=0;i<n;i++){
    if(B[i][i] == 0) many = 1;
    if(B[i][i] == 0 && B[i][n] == 1) return vec();
  }
  if(many) return vec(n+1);
  return x;
}




mat Mult(const mat &A,const mat &B){
  assert(A[0].size() == B.size());
  int n = A.size(),m = B.size(),l = B[0].size();
  mat C(A.size(),vec(B[0].size(),0));

  for(int i=0;i<n;i++)
    for(int j=0;j<l;j++)
      for(int k=0;k<m;k++) C[i][j]^=(A[i][k]*B[k][j]);
 
  return C;
}

mat pow(mat X,int y){
  assert(X.size() == X[0].size());
  mat res(X.size(),vec(X[0].size()));
  for(int i=0;i<(int)res.size();i++) res[i][i] = 1;
  
  while(y){
    if(y%2) res = Mult(res,X);
    y/=2;
    X = Mult(X,X);

  }
  return res;
}



int main(){
  int n;
  cin>>n;
  mat A(n,vec(n));
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)cin>>A[i][j];
  
  vec B(n);
  for(int i=0;i<n;i++) cin>> B[i];
  
  int T;
  cin>>T;

  mat AT = pow(A,T);
  vec ans = gauss_jordan(AT,B);

  if(ans.empty()) cout<<"none"<<endl;
  else if(ans.size()>n) cout<<"ambiguous"<<endl;
  else {
  for(int i=0;i<(int)ans.size();i++){
    if(i)cout<<" ";
    cout<<ans[i];
  }
  cout<<endl;
  }
  return 0;
}

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

int main(){
  int i,j,cnt=0;
  string s;
  cin>>s;
  int N=0,W=0,S=0,E=0;
  for(i=0;i<s.size();i++){
    if(s[i]=='N')N++;
    if(s[i]=='W')W++;
    if(s[i]=='S')S++;
    if(s[i]=='E')E++;
  }
  if((N==0 && S!=0) || (N!=0 && S==0) ||(W==0 && E!=0) || (W!=0 && E==0))cout<<"No";
  else cout<<"Yes";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
using namespace std;
 
int main() {
	int n,count=0;
	cin >> n;
	vector<int> v(n);
	r(i,n) cin >>v.at(i);
  r(i,n){
    if(v.at(i)%536870912==0)count+=29;
    else if(v.at(i)%268435456==0)count+=28;
    else if(v.at(i)%134217728==0)count+=27;
    else if(v.at(i)%67108864==0)count+=26;
    else if(v.at(i)%33554432==0)count+=25;
    else if(v.at(i)%16777216==0)count+=24;
    else if(v.at(i)%8388608==0)count+=23;
    else if(v.at(i)%4194304==0)count+=22;
    else if(v.at(i)%2097152==0)count+=21;
    else if(v.at(i)%1048576==0)count+=20;
    else if(v.at(i)%524288==0)count+=19;
    else if(v.at(i)%262144==0)count+=18;
    else if(v.at(i)%131072==0)count+=17;
    else if(v.at(i)%65536==0)count+=16;
    else if(v.at(i)%32768==0)count+=15;
    else if(v.at(i)%16384==0)count+=14;
    else if(v.at(i)%8192==0)count+=13;
    else if(v.at(i)%4096==0)count+=12;
    else if(v.at(i)%2048==0)count+=11;
    else if(v.at(i)%1024==0)count+=10;
    else if(v.at(i)%512==0)count+=9;
    else if(v.at(i)%256==0)count+=8;
    else if(v.at(i)%128==0)count+=7;
    else if(v.at(i)%64==0)count+=6;
    else if(v.at(i)%32==0)count+=5;
    else if(v.at(i)%16==0)count+=4;
    else if(v.at(i)%8==0)count+=3;
    else if(v.at(i)%4==0)count+=2;
    else if(v.at(i)%2==0)count+=1;
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
int main()
{
    int n;
    cin>>n;
    map<ll,ll> m;
    for(int i=0;i<n;i++)
    {
        ll c;
        cin>>c;
        m[c]++;
    }
    ll len=0,wid=0;
    for(auto o=m.rbegin();o!=m.rend();o++)
    {
        //cout<<(*o).F<<'\n';
        if((*o).S>=4&&len==0)
        {
            len=(*o).F;
            wid=(*o).F;
            cout<<len*len<<'\n';
            break;
        }
        if((*o).S>=2&&len==0)
        {
            len=(*o).F;
            continue;
        }
        if((*o).S>=2)
        {
            wid=(*o).F;
            cout<<wid*len<<'\n';
            break;
        }
    }
    if(len*wid==0)
        cout<<"0";
}


Measured memory_bytes: 6528
# Reference: https://qiita.com/dn6049949/items/afa12d5d079f518de368

# self.data: 1-indexed
#    __1__
#  _2_   _3_
# 4   5 6   7

# f(f(a, b), c) == f(a, f(b, c))

class SegmentTree:
    # a = [default] * n
    # O(n)
    def __init__(self, n, f=max, default=-2**30):
        self.num_leaf = 2 ** (n-1).bit_length()
        self.data = [default] * (2*self.num_leaf)
        self.f = f

    # a[i] = x
    # O(log(n))
    def update(self, i, x):
        i += self.num_leaf
        self.data[i] = x
        i >>= 1
        while i > 0:
            self.data[i] = self.f(self.data[2*i], self.data[2*i+1])
            i >>= 1

    # return f(a[l:r])
    # O(log(n))
    def query(self, l, r):
        l += self.num_leaf
        r += self.num_leaf - 1
        lres, rres = self.data[0], self.data[0] # self.data[0] == default
        while l < r:
            if l & 1:
                lres = self.f(lres, self.data[l])
                l += 1
            if not r & 1:
                rres = self.f(self.data[r], rres)
                r -= 1
            l >>= 1
            r >>= 1
        if l == r:
            res = self.f(self.f(lres, self.data[l]), rres)
        else:
            res = self.f(lres, rres)
        return res

    # You can use min_index only if f == max.
    # return min({i | x <= i and v <= a[i]}, self.num_leaf)
    # O(log(n))
    def min_index(self, x, v):
        x += self.num_leaf
        while self.data[x] < v:
            if x & 1:
                if x.bit_length() == (x+1).bit_length():
                    x += 1
                else:
                    return self.num_leaf
            else:
                x >>= 1
        while x < self.num_leaf:
            if self.data[2*x] >= v:
                x = 2*x
            else:
                x = 2*x + 1
        return x - self.num_leaf

from sys import stdin
def input():
    return stdin.readline().strip()

def main():
    n = int(input())
    s = list(input())

    forest = [SegmentTree(n, f=max, default=0) for _ in range(26)]
    for ind, si in enumerate(s):
        forest[ord(si) - 97].update(ind, 1)

    q = int(input())
    ans = []
    for _ in range(q):
        typ, l, r = input().split()
        l = int(l) - 1

        if typ == '1':
            forest[ord(s[l]) - 97].update(l, 0)
            s[l] = r
            forest[ord(r) - 97].update(l, 1)

        else:
            cnt = 0
            for tree in forest:
                if tree.query(l, int(r)) == 1:
                    cnt += 1
            ans.append(cnt)

    for i in ans:
        print(i)

main()

Measured memory_bytes: 315532
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.1415926535
#define MOD 1000000007

int main(){
  
  ll N;
  cin >> N;
  map<string,int> S;
  string tmp;
  for(int i = 0;i < N;i++)  cin >> tmp, ++S[tmp];
  
  cout << S.size() << endl;
  
  return 0;
}

Measured memory_bytes: 19252
//
//  main.cpp
//  AC
//
//  Created by makinofuya on 2019/07/08.
//  Copyright © 2019 makinofuya. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <map>

typedef long long ll;
using namespace std;
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define out(s) cout << s << endl


int main(){
    int w,h;cin >> h >> w;
    vector<string>s(h);
    rep(i,h)cin >> s[i];
    vector<string> ans(2*h);
    int j=0;
    for(int i=0;i<h;i++){
        ans[j]=s[i];
        j++;
        ans[j]=s[i];
        j++;
    }
    rep(i,2*h){
        cout << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 256
<?php

$s = trim(fgets(STDIN));
$array = explode('/', $s);
if ((int)$array[0] < 2019) {
	echo 'Heisei';
}elseif ((int)$array[0] == 2019 && (int)$array[1] < 5 && (int)$array[2] < 31) {
	echo 'Heisei';
}else {
	echo 'TBD';
}


Measured memory_bytes: 4728
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

struct UnionFind {
	vector<int> v;
	UnionFind(int n) : v(n)  { for (int i = 0; i < n; i++) v[i] = i; }
	int  find(int x)         { return v[x] == x ? x : v[x] = find(v[x]); }
	void unite(int x, int y) { v[find(x)] = find(y); }
};
vector<pair<int, string>> vpis;
int n;
string m;
void dfs(int sum, string sep1, string sep2) {
	if (sum + atoi(sep2.c_str()) <= n){
		if (sep1 != "")
			vpis.push_back({ sum + atoi(sep2.c_str()), sep1 + " " + sep2 });
		else
			vpis.push_back({ sum + atoi(sep2.c_str()), sep2 });
	}

	FOR(i, 1, sep2.length()) {
		int num = sum;
		string ss1 = sep2.substr(0, i);
		string ss2 = sep2.substr(i, sep2.length() - i);
		if (ss1!="")
		num += atoi(ss1.c_str());
		if (num + atoi(ss2.c_str()) <= n){
			if (sep1 != ""){
				vpis.push_back({ num + atoi(ss2.c_str()), sep1 + " " + sep2.substr(0, i) + " " + ss2 });
				while (ss2.length()>1&&ss2[0] == '0'){
					ss2 = ss2.substr(1, ss2.length() - 1);
					vpis.push_back({ num + atoi(ss2.c_str()), sep1 + " " + sep2.substr(0, i) + " " + ss2 });
				}
			}
			else
			{
				vpis.push_back({ num + atoi(ss2.c_str()), sep2.substr(0, i) + " " + ss2 });
				while (ss2.length()>1 && ss2[0] == '0'){
					ss2 = ss2.substr(1, ss2.length() - 1);
					vpis.push_back({ num + atoi(ss2.c_str()), sep2.substr(0, i) + " " + ss2 });
				}
			}
		}
		else{
			if (sep1 != "")
				dfs(num, sep1 + " " + ss1, ss2);
			else
				dfs(num, ss1, ss2);
		}
	}
}
int main() {
	while (cin >> n >> m, n) {
		vpis.clear();
		dfs(0, "", m);
		bool rej = false;
		bool err = true;
		int ans = 0;
		string anss;
		REP(i, vpis.size()){
			if (ans < vpis[i].first){
				rej = false;
				err = false;
				ans = vpis[i].first;
				anss = vpis[i].second;
			}
			else if (ans == vpis[i].first){
				rej = true;
			}

		}
		if (err)
			cout << "error" << endl;
		else if (rej)
			cout << "rejected" << endl;
		else
			cout << ans << " " << anss << endl;
	}
}

Measured memory_bytes: 3044
import scala.io.StdIn._

object Main extends App {
  val n = readInt()
  if (n == 1){
    println(readLine.trim.split(' ').map(_.toInt).last)
  }else {
    val a::b::t = Array.tabulate(n){_ ⇒
      val Array(x, r) = readLine.trim.split(' ').map(_.toInt)
      Circle(x, r)
    }.toList
    println("%.10f".format(t.foldLeft(Intersection(a, b)){case (i, c) ⇒ i.intersection(c)}.distance))
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def let[A](func: T ⇒ A): A = func(value)
    @inline def tap(func: T ⇒ Unit): T = {func(value); value}
  }
}
case class Circle(x: Long, radius: Long) {
  def crossDistance(that: Circle): Double = {
    val distance = math.abs(x - that.x)
    if (distance * distance + math.min(radius, that.radius) * math.min(radius, that.radius) <= math.max(radius, that.radius) * math.max(radius, that.radius)) math.min(radius, that.radius)
    else {
      val s = (distance + radius + that.radius) / 2.0
      val area = math.sqrt(s * (s - radius) * (s - that.radius) * (s - distance))
      area / distance * 2
    }
  }
}
case class Intersection(a: Circle, b: Circle) {
  def intersection(that: Circle): Intersection = {
    List(Intersection(a, b), Intersection(a, that), Intersection(that, b)).minBy(_.distance)
  }
  def distance: Double = a.crossDistance(b)
}



Measured memory_bytes: 199444
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<(x)<<endl
#define fi first
#define se second

#define INF 2147483600
#define MOD 1000000007

int main(){
  int t;
  cin>>t;
  vector<int> a(t), b(t);
  rep(i,t) scanf("%d", &a[i]);
  rep(i,t) scanf("%d", &b[i]);

  if(a[t-1] != b[0]){
    cout<<0<<endl;
    return 0;
  }

  if(t==1){
    cout<<1<<endl;
    return 0;
  }

  long res=1;
  repl(i,1,t-1){
    // 両端以外は候補複数の可能性
    bool b1 = a[i-1]<a[i], b2 = b[i]>b[i+1];

    if(b1 || b2){
      int decide;
      if(b1) decide=a[i];
      else decide=b[i];

      if(a[i]<decide || b[i]<decide || (b1&&b2&&a[i]!=b[i]) ){
        cout<<0<<endl;
        return 0;
      }
    } else {
      res *= min(a[i], b[i]);
      res %= MOD;
    }
  }
  cout<<res<<endl;

  return 0;
}


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

bool tl(vector<ll>&v1,vector<ll>&v2)
{
    if(v1[0]!=v2[0])
    return v1[0] < v2[0];
    return v1[1] < v2[1];
}

int main() {
    ll n,w,i,j,g,v;
    cin>>n>>w;
    vector<vector<ll>>ma(n,vector<ll>(2,0));
    vector<vector<ll>>dp(n+1,vector<ll>(w+1,0));
    for(i=0;i<n;i++)
    {
        cin>>g>>v;
        ma[i][0]=g;
        ma[i][1]=v;
    }
    sort(ma.begin(),ma.end(),tl);
    for(i=0;i<=w;i++)
    {
        dp[0][i]=0;
    }
    for(i=0;i<=n;i++)
    {
        dp[i][0]=0;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=w;j++)
        {
            if(ma[i-1][0] > j)
            {
                dp[i][j]=dp[i-1][j];
            }
            else
            {
                dp[i][j]=max(dp[i-1][j],dp[i-1][j-ma[i-1][0]]+ma[i-1][1]);
            }
            //cout<<dp[i][j]<<" ";
        }
    }
    cout<<dp[n][w]<<endl;
	return 0;
}


Measured memory_bytes: 83136
N, Q = map(int, input().split())
S = input()
lr = [list(map(int, input().split())) for i in range(Q)]
# 1文字目からi文字目までのACの個数
dp = [0]*(N+1)
for i in range(1, N):
    if S[i-1]+S[i] == 'AC':
        dp[i+1] = dp[i]+1
    else:
        dp[i+1] = dp[i]
for l, r in lr:
    print(dp[r]-dp[l])


Measured memory_bytes: 68696
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace J
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var counts = new int[3];
            for (var i = 0; i < A.Length; i++)
            {
                counts[A[i] - 1]++;
            }
            var ep = 1.0 / N;
            var dp = new double[N + 1, N + 1, N + 1];
            for (var k = 0; k <= N; k++)
            {
                for (var j = 0; j <= N; j++)
                {
                    for (var i = 0; i <= N; i++)
                    {
                        var z = N - i - j - k;
                        if (z < 0) break;
                        if (z == N) continue;
                        var x = 1 - z * ep;
                        if (i > 0) dp[i, j, k] += dp[i - 1, j, k] * i * ep;
                        if (j > 0) dp[i, j, k] += dp[i + 1, j - 1, k] * j * ep;
                        if (k > 0) dp[i, j, k] += dp[i, j + 1, k - 1] * k * ep;
                        dp[i, j, k] += 1;
                        dp[i, j, k] /= x;
                    }
                }
            }

            Console.WriteLine(dp[counts[0], counts[1], counts[2]]);
        }
    }
}


Measured memory_bytes: 135992
#include<bits/stdc++.h>
#include<boost/algorithm/string/replace.hpp>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::algorithm;
using namespace boost::multiprecision;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int mINF = 1e9;
const int MOD = 1e9+7;

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

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

template<typename T>//文字列の置換/Boost:replace_all()
T replace_str(T str, string target, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(target, pos), pos != string::npos) {
        str.replace(pos, target.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main(){
    int k;cin >> k;
    int s;cin >> s;
    int ans = 0;
    for(int x=0;x<=k;x++){
        for(int y=0;y<=k;y++){
            int z = s - x - y;
            if(0<=z && z<=k)ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
	int a = 0;
	int b = 0;
	int c = 0;
	int aw = 0;
	cin >> a;
	cin >> b;
	cin >> c;
	char d[100][100];
	int e[100][100];
	int f[100][100];
	for (int i = 0; i < a; i++)
	{
		cin >> d[i];
	}
	for (int i = 0; i < a; i++)
	{
		for (int j = 0; j < (b - c + 1); j++)
		{
			if (d[i][j] == '.')
			{
				for (int k = 1; k < c; k++)
				{
					if (d[i][j + k] !='.')
					{
						e[i][j] = 1;
					}
				}
				if (e[i][j] != 1)
				{
					aw++;
				}
			}
		}
	}
	for (int i = 0; i < (a - c + 1); i++)
	{
		for (int j = 0; j < b; j++)
		{
			if (d[i][j] == '.')
			{
				for (int k = 1; k < c; k++)
				{
					if (d[i + k][j] != '.')
					{
						f[i][j] = 1;
					}
				}
				if (f[i][j] != 1)
				{
					aw++;
				}
			}
		}
	}
	cout << aw << endl;

	return 0;
}

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

int main() {
  int n,k;
  cin>>n>>k;
  vector<int> ns={1};
  for(int i=1;i<=n;i++){
    int ni;
    if(ns.at(i-1)>=k){
      ni=ns.at(i-1)+k;
    }else{
      ni=2*ns.at(i-1);
    }
    ns.push_back(ni);
  }
  cout<<ns.at(n)<<endl;
}

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

int main() {
  int a,b;
  string mes;
  cin >> a >> b;
  if(a==1) a += 13;
  if(b==1) b+= 13;
  if(a>b) mes="Alice";
  else if(b>a) mes="Bob";
  else mes="Draw";
  cout << mes << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <map>
 
using namespace std;

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

    int count = 0;
    int recount = 0;

    string S;
    cin >> S;

    for(int i = 0; i < S.length(); i++)
    {
        if(S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T')
        {
            count++;
        }else{
            if(recount < count)
            {
                recount = count;
            }

            count = 0;
        }
    }

    if(recount > count)
    {
        cout << recount;
    }else
    {
        cout << count;
    }
}

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

using ll = long long;
using namespace std;
const int INFint = 2e9+1;
const ll INFll = 2e18+1;
ll MOD=1e9+7;


int main(){
  int N;
  cin>>N;
  string s[300];
  for(int i(0);i<N;i++){
    cin>>s[i];
  }
  ll ans(0);
  for(int i(0);i<N;i++){
    bool flag = true;

    for(int i(0);i<N;i++){
      char c = s[i][N-1];
      s[i].pop_back();
      s[i].insert(s[i].begin(),c);
    }
    for(int h(0);h<N;h++){
      for(int w(0);w<h;w++){
        if(s[h][w] != s[w][h]){
          flag = false;
        }
      }
    }
    if(flag) ans += N;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 384
import Data.List
cal :: Int -> [Int] -> (Int,Float)
cal y (b:r:1:_) =
  let r' = fromIntegral r
      y' = fromIntegral y
  in
    ( b, (1.0 + y' * r'/ 100.0) )
cal y (b:r:2:_) =
  let r' = fromIntegral r
      y' = fromIntegral y
  in
    ( b, (1.0 + r'/ 100) ** y' )

ans ([0]:_) = []
ans ([n]:[y]:l) = 
  let d = take n l
      r = drop n l
      a = map (cal y) d
      m = maximumBy (\ (k1,v1) (k2,v2) -> compare v1 v2) a
  in
    m:ans r

main = do
  c <- getContents
  let i = map (map read) $ map words $ lines c :: [[Int]]
      o = ans i
  mapM_ (\ (a,b) -> print a) o

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

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

  vector<double> a(n);
  int i;
  for(i=0;i<n;i++)
  cin>>a[i];

  double b=1.0;
  double ans=0;
  for(i=0;i<n;i++){
    ans+=b/a[i];
  }
  // cout<<"ok"<<endl;
  // cout<<ans<<endl;
  ans=b/ans;
  cout<<setprecision(10)<<ans<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<bitset>
#include<cmath>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<28)

using namespace std;

struct Puzzle
{
  char t,r,b,l;
  Puzzle(char t='$',char r='$',char b='$',char l='$'):t(t),r(r),b(b),l(l){}

  void rotate90()
  {
    char tmp = t;
    t = l;
    l = b;
    b = r;
    r = tmp;
  }

  bool operator < (const Puzzle &p)const
  {
    if(t != p.t)return t < p.t;
    if(r != p.r)return r < p.r;
    if(b != p.b)return b < p.b;
    return l < p.l;
  }

};

Puzzle puzzle[9];
Puzzle p2[9];
int cnt;
int dx[] = {0,1,0,-1};//テ、ツクツ凝」ツ??・ツ渉ウテ」ツ??、ツクツ甘」ツ??・ツキツヲ
int dy[] = {1,0,-1,0};



bool match(char a,char b)
{
  if(a == 'R' && b == 'r')return true;
  if(a == 'G' && b == 'g')return true;
  if(a == 'B' && b == 'b')return true;
  if(a == 'W' && b == 'w')return true;
  if(a == 'w' && b == 'W')return true;
  if(a == 'b' && b == 'B')return true;
  if(a == 'g' && b == 'G')return true;
  if(a == 'r' && b == 'R')return true;
    return false;
}

void dfs(int p,int used)
{

  if(p >= 9)
    {
      cnt++;
      return;
    }

  rep(i,9)
    {
      if((used >> i) & 1)continue;
      puzzle[p] = p2[i];
      rep(j,4)
	{
	  if(p == 0)
	    {
	      dfs(p+1,used|(1<<i));
	      puzzle[p].rotate90();
	      continue;
	    }

	  if(p%3 == 0)
	    {
	      if(match(puzzle[p].t,puzzle[p-3].b))
		{
		  dfs(p+1,used|(1<<i));
		}
	    }
	  else
	    {
	      bool ok = true;
	      if(p-3>=0)
		if(!match(puzzle[p].t,puzzle[p-3].b))ok = false;
	      if(!match(puzzle[p].l,puzzle[p-1].r))ok = false;
	      if(ok)
		{
		  dfs(p+1,used|(1<<i));
		}
	    }
	  puzzle[p].rotate90();
	}
    }

}

int main()
{
  int T;
  cin >> T;
  while(T--)
    {
      cnt = 0;
      rep(i,3)
	{
	  rep(j,3)
	    {
	      string s;
	      cin >> s;
	      p2[i*3+j].t = s[0];
	      p2[i*3+j].r = s[1];
	      p2[i*3+j].b = s[2];	      
	      p2[i*3+j].l = s[3];	      
	    }
	}
      dfs(0,0);

      cout << cnt << endl;
    }
  return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
int main()
{
    int N, W;
    cin >> N >> W;
    vector<ll> w(N), v(N);
    rep(i,N){
        cin >> w[i] >> v[i];
    }
    vector<ll> dp(W + 1);
    rep(i,N){
        for (int j = W; j >=0 ;j--){
            if(j+w[i]<=W)
                dp[j + w[i]] = max(dp[j + w[i]], dp[j] + v[i]);
        }
    }
    ll ans = 0;
    rep(i, W + 1) ans = max(dp[i], ans);
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using edge = struct {
  int to;
  int cost;
};
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto i = (m).begin(); i != (m).end(); ++i)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end());
#define MIN(vec) *std::min_element(vec.begin(), vec.end());
#define MAXI(vec)                                                              \
  std::distance(vec.begin(), *std::max_element(vec.begin(), vec.end()));
#define MINI(vec)                                                              \
  std::distance(vec.begin(), *std::min_element(vec.begin(), vec.end()));
#define BIT(n, num) std::bitset<(n)>((num)).to_string()
#define MATMUL(a, b, c)                                                        \
  REP(i, a.size())                                                             \
  REP(j, b[0].size()) REP(k, a[0].size()) c[i][j] += a[i][k] * b[k][j];
#define CLA2(a) REP(i, a.size()) REP(j, a[0].size()) a[i][j] = 0;
#define REV(T) greater<T>()

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n)
        ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

map<ll, int> prime_factor(ll n) {
  map<ll, int> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1)
    ret[n] = 1;
  return ret;
}

ll factorial(int n) {
  ll ans = 1;
  for (int i = 2; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll P(int n, int m) {
  ll ans = 1;
  for (int i = m + 1; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll power(int n, int m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = power(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * power(n, m - 1)) % MOD;
  }
}
ll C(int n, int m) {
  return (P(n, n - m) * power(factorial(m), MOD - 2)) % MOD;
}

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

int main() {
  ll N, M, ANS = 1;
  vector<ll> A;
  cin >> N >> M;
  map<ll, int> a = prime_factor(M);
  AUTO(i, a) {
    ANS *= C(N + i->second - 1, i->second);
    ANS %= MOD;
  }
  cout << ANS << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
public class Hello{
    public static void Main(){
        var s = Console.ReadLine();
        long ans = 0;
        long cnt = 0;
        for(int i = 0;i < s.Length;i++){
            if(s[i] == 'W'){
                ans += i - cnt;
                cnt++;
            }
        }
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 11616
n, a, b = map(int, input().split())
s = list(str(input()))


count = 0
f = 0
for i in range(len(s)):
    if s[i] == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif s[i] == 'b':
        if count < a + b and f < b:
            print('Yes')
            count += 1
            f += 1
        else:
            print('No')
    else:
        print('No')


Measured memory_bytes: 4708
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <utility>
#include <climits>
#include <bitset>
#include <cmath>

#define MOD 1000000007

using namespace std;

typedef long long ll;

typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<vl> vvl;
typedef vector<vi> vvi;

typedef pair<ll, ll> pll;
typedef pair<int, int> pi;

typedef vector<pll> vpl;
typedef vector<pi> vpi;

typedef queue<ll> ql;
typedef queue<int> qi;

template <class T>
void printv(vector<T> vc) {
    for (auto e: vc) cout << e << " ";
    cout << endl;
}

template <class T>
void printvv(vector<T> vvc) { 
    for (auto vc: vvc) {
        for (auto e: vc) cout << e << " ";
        cout << endl;
    }
}

template <class T>
void printvp(vector<pair<T, T> > vp) {
    for (auto pT: vp) cout << pT.first << " " << pT.second << endl;
}

int main() {
    string s, t; cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<char>());
    cout << (s < t ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
s=input()
YY=["00"]
MM=["01","02","03","04","05","06","07","08","09","10","11","12"]

for i in range(13,100):
    YY.append(str(i))

if s[:2] in YY and s[2:] in MM:
    print("YYMM")
elif s[:2] in MM and s[2:] in YY:
    print("MMYY")
elif s[:2] in MM and s[2:] in MM:
    print("AMBIGUOUS")
else:
    print("NA")


Measured memory_bytes: 3064
#include<stdio.h>
#define stmin(a,b) ((a)<(b)?(a):(b))
typedef unsigned long long ull;
int main(void){
	int n;
	long x;
	scanf("%d %ld",&n,&x);
	long ar[n*2];
	for(int i = 0;i < n;i++)scanf("%ld",&ar[i]);
	for(int i = 0;i < n;i++)ar[i+n] = ar[i];
	long timmin[n];
	for(int i = 0;i < n;i++)timmin[i] = ar[i];
	ull minans = 1llu<<63;
	for(int emc = 0;emc < n;emc++){
		ull tmp = 0;
		for(int i = 0;i < n;i++)timmin[i] = stmin(timmin[i],ar[i+emc]);
		for(int i = 0;i < n;i++)tmp += timmin[i];
		minans = stmin(minans,emc*(long long)x + tmp);
	}
	printf("%llu",minans);
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		sc.close();
		char[] temp = str.toCharArray();
		for(int i=0;i<length;i++) {
			if(temp[i]=='?') System.out.print('D');
			else System.out.print(temp[i]);
		}
	}
}

Measured memory_bytes: 58264
package main

import "fmt"

func main() {
	var n, q int
	var s string
	fmt.Scan(&n, &q, &s)

	xs := make([]int, n)
	xs[0] = 0
	for i := 1; i < n; i++ {
		if s[i-1] == 'A' && s[i] == 'C' {
			xs[i] = xs[i-1] + 1
		} else {
			xs[i] = xs[i-1]
		}
	}

	var l, r int
	for i := 0; i < q; i++ {
		fmt.Scan(&l, &r)
		fmt.Println(xs[r-1] - xs[l-1])
	}
}


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

int main(){
	int n,ans=0;
	cin>>n;
	char a[n],b[n],c[n];
	cin>>a>>b>>c;
	for(int i=0;i<n;i++){
		if(a[i]==b[i]&&b[i]==c[i]) ans+=0;
		else if(a[i]!=b[i]&&a[i]!=c[i]&&b[i]!=c[i]) ans+=2;
		else ans+=1;
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = (int)j;i <= (int)k;i ++)
#define debug(x) cerr<<#x<<":"<<x<<endl
const int maxn=(int)1e6+5;
typedef long long ll;
ll mod = 1e9+7;  // 1e9+9

ll add(ll x,ll y){return (x+y)%mod;}
ll mul(ll x,ll y){return (x*y)%mod;}

ll mpow(ll x,ll y){
  ll v=1;
  for(;y;x=mul(x,x),y>>=1)
    if(y&1)v=mul(v,x);
  return v;
}

ll divi(ll x,ll y){return mul(x,mpow(y,mod-2));}

ll fact[10000000]={1}, factc=0;
ll Fact(ll x){
  while( factc < x ){
    factc++;
    fact[factc]=mul( fact[factc-1] , factc );
  }
  return fact[x];
}

ll nCr(ll n,ll r){
  if(n<r)return 0;
  return divi( Fact(n) , mul( Fact(n-r) , Fact(r) )   );
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int a,b,x,y;
    cin>>x>>y;
    a=(2*y-x);
    b=(2*x-y);
    if(a%3||b%3||a<0||b<0){cout<<0;return 0;}
    a/=3,b/=3;
    cout<<nCr(a+b,a)<<endl;

}

Measured memory_bytes: 5504
s = input()
sl = len(s)

bitlist = []
def allbit(string, n):
    if n ==0:
        bitlist.append(string)
        return
    allbit(string + "0", n-1);
    allbit(string + "1", n-1);
    
allbit("", sl-1)

ans = 0
for bit in bitlist:
    before_idx = 0
    for idx, b in enumerate(bit):
        if b == "1":
            if s[before_idx:idx+1] != "":
                ans += int(s[before_idx:idx+1])
                before_idx = idx+1
    if int(s[before_idx:]) != "":
        ans += int(s[before_idx:])
print(ans)

Measured memory_bytes: 39920
#include <iostream>
using namespace std;
int main (void)
{
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    
	string s;
	cin >> s;
	bool bus = false;
	if(s[0] != s[1] || s[0] != s[2] || s[1] != s[2])
		bus = true;
    if(bus == true)
		cout << "Yes\n";
	else 
		cout << "No\n";
    return 0;
}
// date_time : 15.03.2020 16:54:07 IST 
// Author : Aditya Kumar Maurya <adityakrmaurya03@gmail.com>
// “ Code is like humor. When you have to explain it, it’s bad.” – Cory House


Measured memory_bytes: 256
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = a + a
c = 0
for i in range(len(a)):
    for j in range(i + 1, len(a)):
        if a[i] > a[j]:
            c += 1
d = 0
for i in range(len(b)):
    for j in range(i + 1, len(b)):
        if b[i] > b[j]:
            d += 1
d -= c * 2
def modpow(n, p, mod):
    r = 1
    while p > 0:
        if p & 1 == 1:
            r = r * n % mod
        n = n * n % mod
        p >>= 1
    return r
def modinv(n, mod):
    return modpow(n, mod - 2, mod)
MOD = 10 ** 9 + 7
ans = (k - 1) * d % MOD
ans += 2 * c
ans %= MOD
ans *= k
ans %= MOD
ans *= modinv(2, MOD)
ans %= MOD
print(ans)

Measured memory_bytes: 3188
#include <iostream>
using namespace std;
int main(void){
  int N;
  cin >> N;
  int C[4] = {0,0,0,0};
  string S;
  for(int i = 0; i < N; i++){
    cin >> S;
    if(S == "AC")
      C[0]++;
    else if(S == "WA")
      C[1]++;
    else if(S == "TLE")
      C[2]++;
    else if(S == "RE")
      C[3]++;
  }
  
  cout << "AC x "<< C[0] << endl << "WA x " << C[1] << endl << "TLE x " << C[2] << endl << "RE x " << C[3] << endl ;
  return 0;
}

Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n,a=0; cin>>n;
    if(n==1000000000000000000){
        cout << 124999999999999995 << endl;
        return 0;
    }
    if(n%2) return puts("0"),0;
    a += n / 10;
    a += n / 50;
    a += n / 250;
    a += n / 1250;
    a += n / 6250;
    a += n / 31250;
    a += n / 156250;
    a += n / 781250;
    a += n / 3906250;
    a += n / 19531250;
    a += n / 97656250;
    a += n / 488281250;
    a += n / 2441406250;
    a += n / 12207031250;
    a += n / 61035156250;
    a += n / 305175781250;
    a += n / 1525878906250;
    a += n / 7629394531250;
    a += n / 38146972656250;
    a += n / 190734863281250;
    a += n / 953674316406250;
    a += n / 4768371582031250;
    a += n / 23841857910156250;
    a += n / 119209289550781250;
    a += n / 596046447753906250;
    cout << a << endl;
}

Measured memory_bytes: 3556
#include <bits/stdc++.h>
using namespace std;
#ifdef _LOCAL //
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout   \
	if (false) \
	cout
#define debug() if (false)
#define dvout(v) if(false);
#endif //
#define next asdnext
#define prev asdprev
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define vrep(i, v) for (auto &i : v)
#define all(x) (x).begin(), (x).end()
#define vout(v)           \
	for (auto &i : v)     \
	{                     \
		cout << i << " "; \
	}                     \
	cout << "\n"; //配列出力
#define vin(v)        \
	for (auto &i : v) \
		cin >> i; //配列入力
#define vecin(v,n)	\
	vec(v,n);		\
	vin(v);
#define vec(v, n) vector<int> v(n, 0);
#define mod (int)(1e9+7)
typedef long long ll;
typedef unsigned long long ull;



void Main()
{
	rep(i,5){
		char c;
		cin>>c;
		if(c=='0') cout<<i+1<<endl;
	}
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 3608
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

min_time = 99999
for time_list in list(itertools.permutations([A, B, C, D, E])):
    time = time_list[0]
    time = int((time - 1) / 10) * 10 + 10
    for i, t in enumerate(time_list[1:]):

        if i < 3:
            time += int((t - 1) / 10) * 10 + 10
        else:
            time += t
    min_time = min(min_time, time)

print(min_time)


Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int Dy[8] = {-1,-1,0,1,1,1,0,-1};
int Dx[8] = {0,1,1,1,0,-1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 100100;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    int m=n/2+(n%2);
    cout<<setprecision(20)<<double(m)/double(n)<<endl;
}

Measured memory_bytes: 256
n = int(input())
s = [int(i) for i in input().split()]
q = int(input())
t = [int(i) for i in input().split()]
ans = 0
for i in range(q):
    for j in range(n):
        if t[i] == s[j]:
            ans += 1
            break
print(ans)


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

int main(){
    int cnt=0;
    string s;
    string t;
    getline(cin,s);
    getline(cin,t);
    if(s.size()+1==t.size()){
        for(int i=0;i<s.size();i++){
            if(s[i]!=t[i]){
                cout<<"No";
                cnt++;
                break;
            }
        }
        if(cnt==0)cout<<"Yes";
    }        
    else{
        cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define NIL -1
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long int ll;
using namespace std;
const ll INF = 1LL << 60;

using Edge = pair<int, ll>;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;

    cin >> n >> m;
    int a, b, c;
    vector<vector<Edge>> G;
    G.clear();
    G.resize(n);
    rep(i, m)
    {
        cin >> a >> b >> c;
        a--, b--;
        c=-c;
        G[a].push_back(Edge(b, c));
    }

    vector<ll> dist(n, INF);
    bool close = false;
    dist[0] = 0;
    rep(i, n)
    {
        rep(j, n)
        {
            for (auto v : G[j])
            {
                int from = j, to = v.first;
                ll cost = v.second;
                if (dist[from] != INF && dist[to] > dist[from] + cost)
                {
                    dist[to] = dist[from] + cost;
                    if (i == n - 1 &&to==n-1)
                    {
                        close = true;
                        break;
                    }
                }
            }
        }
    }

    if (close)
    {
        cout << "inf" << endl;
    }
    else
    {
        cout << -dist[n - 1] << endl;
    }
 //   system("pause");
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,f=0,i,j,k;
    ll sum=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        if(i%3==0||i%5==0||(i%15)==0)
            continue;
        sum+=i;
    }
    cout<<sum<<endl;

    return 0;
}


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

public class Main {
	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String[] arr = new String[sc.nextInt()];
		sc.nextLine();
		for(int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLine();
		}
		Arrays.sort(arr);
		for(String e : arr) {
			System.out.print(e);
		}
		System.out.println();
	}
}

Measured memory_bytes: 21972
#include <stdio.h>

int main() {
        const int N = 11;
        double s;
        double a[N];

        while (scanf("%lf", &a[1]) != EOF) {
                s = a[1];
                for (int i = 2; i < N; i++) {
                        if (i % 2) {
                                a[i] = a[i-1]/3;
                        } else {
                                a[i] = a[i-1]*2;
                        }
                        s += a[i];
                }
                printf("%lf\n", s);
        }

        return 0;
}

Measured memory_bytes: 2684
//! 尺卂乃卂.卂ﾌ乇乇ㄒ
#include<bits/stdc++.h>
//#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
//Using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> Ordered_set;

#define ll              long long
#define int             long long
#define ld             long double
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define vii             vector<vi>
#define vip            vector<pii>
#define mii             map<int,int>
#define mip             map<pair<int,int>,int>
#define mic             map<char,int> 
#define all(v)          v.begin(),v.end()  
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define lb(x)           (x&(-x))
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
#define itr(it,v)          for(auto it:v)
#define show(arr,n)     for(int i=0;i<n;i++) cout<<arr[i]<<" "; cout<<"\n";
#define fi(i,n)         for(int i=0;i<n;i++)
#define fir(i,k,n)       for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ff               first 
#define ss               second
#define deb(x) cout << #x << "=" << x << endl
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define check(x) (x && cout<<"Yes\n")||(cout<<"No\n");
#define fin(s)          freopen(s,"r",stdin);  
#define fout(s)         freopen(s,"w",stdout);

const ld pi = 3.141592653589793238462643383279502884;
const int xd[]={-1,0,1,0};
const int yd[]={0,-1,0,1};
int XX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int YY[] = { -1, 0,  1, -1, 1, -1, 0, 1 };

int expo(int a,int b,int m);
int mmi(int a,int m);
void ipgraph(int m);

const int N=5*(1e5)+10;
vii adj(N);
int a[N];

void  solve(){

}
int32_t main()
{
    FIO
    int n; cin>>n;
    fi(i,n) cin>>a[i];
    // int minz=a[0];//
    int money=1000,cs=0;
    fir(i,0,n){
        // cout<<i<<"\n";
        int j;
        int minz=a[i];
        for(j=i+1;j<n-1;j++){
            if(a[j]<minz) break; 
            else if(j+1<n && a[j+1]<a[j]) break;
        }
        if(j==i) continue;
        if(a[j]>minz){
            // buy on minz
            cs=money/minz;
            money=money%minz;
            money+=cs*a[j];
            cs=0;
            i=j;
        }
        else i=j-1;
    }
    cout<<money<<"\n";
    return 0;

}

void ipgraph(int m){
    int i, u, v;
    while(m--){
          cin>>u>>v;
         u--, v--;
    adj[u].pb(v);
    adj[v].pb(u);
    }
}
int expo(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return a;
    int val=(expo(a,b/2,m)*expo(a,b/2,m))%m;
    if(b & 1) return (val*a)%m;
    else return val;
}
int mmi(int a,int m){
    return expo(a,m-2,m);
}

Measured memory_bytes: 15012
number = gets.chomp.to_i
length = number.to_s.length

num = 0
(length-1).times do |i|
  next if (i+1) % 2 == 0
  num += 9 * (10**i)
end

if length % 2 == 1 then
  t = 10**(length-1)
  num += number - t + 1
end

p num

Measured memory_bytes: 1788
#include <atcoder/segtree>
#include <iostream>
#include <vector>

int op(int a, int b)
{
    return std::max(a, b);
}

int e()
{
    return -1;
}

int V;
bool f(int i)
{
    return i < V;
}

int main()
{
    int N, Q;
    std::cin >> N >> Q;

    std::vector<int> A(N);
    for (auto &a : A) {
        std::cin >> a;
    }

    atcoder::segtree<int, op, e> seg(A);

    for (int i = 0; i < Q; i++) {
        int T;
        std::cin >> T;

        if (T == 1) {
            int X, V;
            std::cin >> X >> V;

            seg.set(X - 1, V);

        } else if (T == 2) {
            int l, r;
            std::cin >> l >> r;

            std::cout << seg.prod(l - 1, r) << '\n';

        } else {
            int X;
            std::cin >> X >> V;

            std::cout << seg.max_right<f>(X - 1) + 1 << '\n';
        }
    }
}

Measured memory_bytes: 6116
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
        Scanner scan  = new Scanner(System.in);
        int N =scan.nextInt();
        int min =1000000, max = -1000000;
        long sum = 0;
        int[] score = new int [N];
        for (int i=0; i<N; i++){
        	score[i] = scan.nextInt();
        	sum += score[i];
        	if (min > score[i]) {
        		min = score[i];
        	}
        	if (max < score[i]) {
        		max = score[i];
        	}
        }
        System.out .println(min + " " + max +" " + sum);
	}
}



Measured memory_bytes: 42500
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef vector<int> vi;
typedef pair<int,int> ii;
#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()

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

	int n;
	scanf("%d", &n);
	vi p(n);
	for (int i = 0; i < n; i++) scanf("%d", &p[i]);
	int ans = 0;
	for (int i = 1; i < n-1; i++)
		if ((p[i-1] < p[i] && p[i] < p[i+1]) || (p[i-1] > p[i] && p[i] > p[i+1])) ++ans;
	printf("%d\n", ans);
}


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

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;





int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);


	int A, B;

	cin >> A >> B;

	cout << max(0, A - 2 * B) << '\n';


	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
    return 0;
}


Measured memory_bytes: 256