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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

using namespace std;
using ll = long long;

const ll MOD = 1000000007LL; // = 10^9 + 7
const double PI = 3.14159265358979;

void solve()
{
  int n;
  cin >> n;
  vector<int> a(n);
  int min_abs = 1000000007;
  int min_abs_i;
  for(int i = 0; i < n; ++i)
  {
    cin >> a[i];
    if(abs(a[i]) < min_abs)
    {
      min_abs = abs(a[i]);
      min_abs_i = i;
    }
  }

  ll ans = 0;
  for(int i = 0; i < min_abs_i; ++i)
  {
    if (a[i] < 0)
    {
      a[i] = -a[i];
      a[i + 1] = -a[i + 1];
    }
    ans += a[i];
    // cout << "add index i: " << i << " = " << a[i] << endl; 
  }
  // cout << " --- " << endl;
  for(int i = n - 1; i > min_abs_i; --i)
  {
    if (a[i] < 0)
    {
      a[i] = -a[i];
      a[i - 1] = -a[i - 1];
    }
    ans += a[i];
    // cout << "add index i: " << i << " = " << a[i] << endl; 
  }
  ans += a[min_abs_i];
  cout << ans;

}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    ll H, W;
    cin >> H >> W;
    if(H == 1 || W == 1) {
        output(1);
        return 0;
    }
    output((H * W + 1) / 2);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
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; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    ll N, V;
    cin >> N >> V;
    vector<ll> a(N),b(N),c(N),d(N);
    rep(i,N)cin >> a[i];
    rep(i,N)cin >> b[i];
    rep(i,N)cin >> c[i];
    rep(i,N)cin >> d[i];

    vector<ll> v;
    map<ll,int> mp;
    rep(i,N)rep(j,N)v.emplace_back(a[i]+b[j]);
    rep(i,N)rep(j,N)mp[c[i]+d[j]]++;

    int sz = v.size();
    ll ans = 0;
    rep(i,sz)ans += mp[V - v[i]];
    cout << ans << endl;
}




Measured memory_bytes: 135612
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;

namespace question3
{
    class Program
    {
        static void Main(string[] args)
        {
            var p = new Program();
            p.Run();
        }

        void Run()
        {
            var n = Console.ReadLine();
            var p3 = new Regex("3", RegexOptions.Compiled);
            var p5 = new Regex("5", RegexOptions.Compiled);
            var p7 = new Regex("7", RegexOptions.Compiled);
            var p753 = new Regex("^[357]*$", RegexOptions.Compiled);

            var count = 0;
            var combinations = GetCombinations(new int[] { 3, 5, 7 }, n.Length);

            foreach (var c in combinations)
            {
                if (int.Parse(c) <= int.Parse(n) && p3.IsMatch(c) && p5.IsMatch(c) && p7.IsMatch(c) && p753.IsMatch(c))
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }

        IEnumerable<string> GetCombinations(int[] values, int n)
        {
            var c = values.Length;
            for (int i = 3; i <= n; i++)
            {
                for (int j = 0; j < Math.Pow(c, i); j++)
                {
                    var x = "";
                    var result = "";
                    var q = j;

                    while (q > 0)
                    {
                        x += q % c;
                        result += values[q % c];
                        q = q / c;
                    }

                    result = new String(result.Reverse().ToArray());
                    result = result.PadLeft(i, '3');

                    yield return result;
                }
            }
        }
    }
}

Measured memory_bytes: 20244
#include<iostream>
#include<string>
 
using namespace std;
int main(){
	string s;
	char big;
	int n=3;
	for(int i=0;i<n;i++){
		cin>>s;
		for(int i2=0;i2<1;i2++){
			big=s[i2]-32;
			cout<<big;
		}
	}
 cout<<endl;
}

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


void solve(long long A, long long B){

    long long C = A + B;
 
    long long D = A - B;
 
    long long E = A * B;
 
    if(C>=D && C>=E){
        printf("%lld\n",C);
    }
    else if(D>=C && D>=E){
        printf("%lld\n",D);
    }
    else if(E>=C && E>=D){
        printf("%lld\n",E);
    }
    return (void)0;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


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

int main(){
  char b;
  cin >> b;
  map<char, char> m = {{'A', 'T'}, {'T','A'}, {'C', 'G'}, {'G', 'C'}};
  cout << m[b] << endl;
  return 0;
}

Measured memory_bytes: 256
if __name__ == "__main__":
	n = input()
	a = [0.0] * int(n)
	b = [0.0] * int(n)
	count = {"6.909":0} 
	for i in range(int(n)):
		a[i] = input()
		b[i] = a[i]

	b.sort()
	for i in range(int(n)-1):
		if float(b[i]) == float(b[i+1]):
			if b[i] in count:
				x = count[b[i]]
				count[b[i]] = (x + 1)
			else:
				count[b[i]] = 2

	i = 0
	while i < int(n):
		if b[i] in count:
			x = count[b[i]]
			count[b[i]] = (3 * i + x - 1)
			i = i + x - 1
		else:
			count[b[i]] = (3 * i)
		i = i + 1

	for i in range(int(n)):
		print (count[a[i]])




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

int main(){

    int n,q;
    cin>>n>>q;
    string s;
    cin>>s;
    int pre[n+1];
    pre[0]=pre[1]=0;
    
    for(int i=1;i<n;i++){
        if(s[i-1]=='A'&&s[i]=='C'){
            pre[i+1]=pre[i]+1;
        }
        else{
            pre[i+1]=pre[i];
        }
    }
    while(q--){
        int l,r;
        cin>>l>>r;
        cout<<pre[r]-pre[l]<<endl;
    }
    return 0;
}

Measured memory_bytes: 1408
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = getInt(sc);
		int t = getInt(sc);
		int a = getInt(sc);
		int[] h = getIntArray(sc);
		double[] dif = new double[n];

		for (int i = 0; i < n; i++) {
			dif[i] = Math.abs(a - (t - h[i] * 0.006));
		}
		int number = 0;
		double minDif = Double.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			if (dif[i] < minDif) {
				minDif = dif[i];
				number = i + 1;
			}
		}
		System.out.println(number);
	}

	/**
	 * *汎用メソッド<br>
	 * 入力した配列に対する順列を取得
	 *
	 * @param numArray
	 * @return
	 */
	private static List<Integer[]> getPermutation(int[] numArray) {
		List<Integer[]> permutation = new ArrayList<>();
		Integer[] ans = new Integer[numArray.length];
		boolean[] used = new boolean[numArray.length];

		return buildPermutaion(permutation, numArray, ans, used, 0);
	}

	/**
	 * *汎用メソッド(内部)<br>
	 * 入力した配列に対する順列を作成
	 *
	 * @param list
	 * @param numArray
	 * @param ans
	 * @param used
	 * @param depth
	 * @return
	 */
	private static List<Integer[]> buildPermutaion(List<Integer[]> list, int[] numArray, Integer[] ans, boolean[] used,
			int depth) {

		// 全部使い切った時=>できた順列を返す
		if (depth == numArray.length) {
			list.add(ans.clone());
			return list;
		}
		// 使い切っていない場合

		for (int i = 0; i < numArray.length; i++) {
			if (used[i]) {
				continue;
			}
			ans[depth] = numArray[i];
			used[i] = true;
			list = buildPermutaion(list, numArray, ans, used, depth + 1);

			used[i] = false;
		}

		return list;
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をintで返却
	 *
	 * @return
	 */
	public static int getInt(Scanner sc) {

		return Integer.parseInt(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をStringで返却
	 *
	 * @return
	 */
	public static String getString(Scanner sc) {

		return sc.next();
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をint配列で返却
	 *
	 * @return
	 */
	public static int[] getIntArray(Scanner sc) {
		String line = "";
		// 直前にnext()を実行していると改行コードだけ取ってしまうのでその対策
		while (line.equals("")) {
			line = sc.nextLine();
		}

		String[] strArray = line.split(" ");
		int[] intArray = new int[strArray.length];
		for (int i = 0; i < strArray.length; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}

}


Measured memory_bytes: 36880
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a), end(a)
#define TPL template
#define TNM typename

using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vvll = vector<vll>;
TPL<TNM K, TNM V> using umap = unordered_map<K, V>;
TPL<TNM K, TNM V> using uset = unordered_set<K, V>;

TPL <class T = int> inline T IN() { T x; cin >> x; return x; }
TPL<class T> inline void OUT(const T &x) { cout << x << "\n"; }
void YESNO(bool c) { OUT(c ? "YES" : "NO"); };
void YesNo(bool c) { OUT(c ? "Yes" : "No"); };
void bOUT(bool c, string s, string t) { OUT(c ? s : t); }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); /*cout << fixed << setprecision(6);*/ } } pre__;

TPL<TNM V, TNM H> void resize(vector<V>& v, const H h) { v.resize(h); }
TPL<TNM V, TNM H, TNM ... T> void resize(vector<V>& v, const H& h, const T ... t) { v.resize(h); for (auto& _v : v) resize(_v, t ...); }
TPL<TNM V, TNM T> void fill(V& x, const T& val) { x = val; }
TPL<TNM V, TNM T> void fill(vector<V>& vec, const T& val) { for (auto& v : vec) fill(v, val); }
const int inf = INT_MAX / 2; const ll infl = 1LL << 60;

struct BipartiteMatching {
	vector<vector<int>> E; int n, m; vector<int> match, dist;
	void init(int _n, int _m) { n = _n, m = _m; E.resize(n + m + 2); match.resize(n + m + 2); dist.resize(n + m + 2); }
	bool bfs() {
		queue<int> que;
		FOR(i, 1, n + 1) {
			if (!match[i]) dist[i] = 0, que.push(i);
			else dist[i] = inf;
		}
		dist[0] = inf;
		while (!que.empty()) {
			int u = que.front(); que.pop();
			if (u) for (auto v : E[u]) if (dist[match[v]] == inf) {
				dist[match[v]] = dist[u] + 1;
				que.push(match[v]);
			}
		}
		return (dist[0] != inf);
	}
	bool dfs(int u) {
		if (u) {
			for (auto &v : E[u]) if (dist[match[v]] == dist[u] + 1) if (dfs(match[v])) {
				match[v] = u; match[u] = v;
				return true;
			}
			dist[u] = inf;
			return false;
		}
		return true;
	}
	void add(int a, int b) { b += n; E[a + 1].push_back(b + 1); E[b + 1].push_back(a + 1); }
	int whois(int x) { return match[x + 1] - 1; }
	int solve() {
		FOR(i, 0, n + m + 1) match[i] = 0;
		int res = 0;
		while (bfs()) FOR(i, 1, n + 1) if (!match[i] && dfs(i)) res++;
		return res;
	}
};

int main(void) {
	int N = IN();
	vi A(N), B(N), C(N), D(N);
	REP(i, N)cin >> A[i] >> B[i];
	REP(i, N)cin >> C[i] >> D[i];

	BipartiteMatching bm;
	bm.init(N, N);
	REP(i, N) {
		REP(j, N) {
			if (A[i] < C[j] and B[i] < D[j]) {
				bm.add(i, j);
			}
		}
	}

	OUT(bm.solve());

	return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<int> v;
    for(int i = 0; i < N-1; i++){
        int b;
        cin >> b;
        v.push_back(b);
    }
    int sum = v[0]+v[N-2];
    for(int t = 0; t < N-2; t++){
        sum += min(v[t],v[t+1]);
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#include<cmath>
#define int long long int
int answer=0;
int32_t main()
{
    string str;
    cin>>str;
    int k;
    cin>>k;
    int l=str.size();
    int j;
    for(j=0;str[j]!='\0';j++)
    {
		if(k==0)
		    break;
		if(str[j]=='a')
		   continue;
		else  if(str[j]=='z')
		{
			str[j]='a';
			k--;
		}
		else
		{
			int diff='z'-str[j];
			if(k>=diff+1)
			{
				str[j]='a';
				k-=(diff+1);
			}
			else
			{
				continue;
			}
		}
	}
	if(k==0)
	{
		cout<<str<<endl;
	}
	else
	{
		k=k%26;
		while(k!=0)
		{
			if(str[l-1]=='z')
			{
				str[l-1]='a';
				k--;
			}
			else
			{
				str[l-1]=(char)(str[l-1]+1);
				k--;
			}
		}
		cout<<str<<endl;
	}
}


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

int main(){
    string s;
    cin >> s;
    int win = 0;
    for(int i = 0; i < s.size(); i++){
        if(s.at(i) == 'o'){
            win++;
        }
    }
    if(win + (15-s.size()) >= 8){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}

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

int main() {
	// your code goes here
	int a, b, c, t;
	
	cin >> a >> b >> c;
	
	if (a > b) {t = a; a = b; b = t; }
	if (b > c) {t = b; b = c; c = t; }
	if (a > b) {t = a; a= b; b = t; }
	
	cout << a << " " << b <<" " <<  c << endl;
	
	return 0;
}

Measured memory_bytes: 3068
#include <bits/stdc++.h>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
const int MOD = 1000000007;

// vector<p> cut(M);
// cut[i].second
// cut[i].first;
// REP(i,M){
//     int a,b;cin>>a>>b;
//     cut[i] = make_pair(b,a);//last first の順番
// }
//     for(int i=0; i<N;i++){
//     }
// sort(cut.begin(),cut.end()); //sort
// char '' str ""
int main(void)
{
    int K,S;cin>>K>>S;
    int cnt = 0;
    for(int i=0; i<=K;i++){
      for(int j=0; j<=K;j++){
        int s = S - i - j;
        if(s <= K && s>=0) cnt++;

      }
    }



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


Measured memory_bytes: 764
#include <bits/stdc++.h>
#define INF 1000000005
#define MOD 1000000007
#define FF first
#define SS second
#define int long long int

using namespace std;
typedef long long ll;

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

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll modx(ll Base, ll exponent)
{
  ll ans = 1;
  if(Base == 1)
    return Base;
  while(exponent)
  {
    if(exponent & 1)
      ans = (ans * Base)%MOD;
    Base = (Base * Base)%MOD;
    exponent = exponent >> 1;
  }
  return ans;
}

ll inmodx(ll num)
{
  return (modx(num, MOD-2LL));
}

bool cmp(pii loc, pii b)//true for loc before b
{
  if(loc.SS < b.SS)
    return 1;
  if(loc.SS > b.SS)
    return 0;
  if(loc.FF <= b.FF)
    return 1;
  return 0;
}
int dp[3005][3005];
    string s1,s2;
void rec(int n,int m)
{
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=m;j++)
        {
            if(i==0||j==0)
            {
                dp[i][j]=0;
            }
            else if(s1[i-1]==s2[j-1])
            {
                dp[i][j]=dp[i-1][j-1]+1;
            }
            else
            {
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
        }
    }
    int len=dp[n][m];
   // cout<<len<<endl;
    char lcs[len+1];
    lcs[len]='\0';
    int i=n,j=m;
    while(i>0 && j>0)
    {
        if(s1[i-1]==s2[j-1])
        {
            lcs[len-1]=s1[i-1];
            i--,j--,len--;
                    
        }
        else if(dp[i-1][j]>dp[i][j-1])
        {
            i--;
        }
        else
        {
            j--;
        }
    }
    printf("%s",lcs);
}
signed main()
{   
    
  
   // freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(0); 
    cin.tie(0);
    cout.tie(0);
    cin>>s1>>s2;
    int n=s1.length();
    int m=s2.length();
    rec(n,m);
    return 0;
}

    


Measured memory_bytes: 70784
#include<iostream>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<algorithm>
    #include<string>
    #include<math.h>
    #include<sstream>
    #include<set>
    #include<map>
    using namespace std;
    #define INF 10000000;
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
    #define vec(n) vector<int>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

  
  
    int main(){
      int a,b,c,d;
      cin >> a >> b >> c >> d;
      auto v = vec(100);
      REP(i,a,b)v[i]++;
      REP(i,c,d)v[i]++;

      int cnt = 0;
      rep(i,100){
        if(v[i] == 2)cnt++;
      }

      cout << cnt <<endl;

    }

    


Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

mod = 10**9+7
n = int(readline())
a = 10 ** n % mod
b = 9 ** n % mod
c = 8 ** n % mod

ans = a - (c + (b - c) * 2)
print(ans % mod)

Measured memory_bytes: 10880
#include<bits/stdc++.h>
using namespace std;
const int md=1e9+7;
int a[222222];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	long long cnt=0;
	for(int i=0;i<n;i++){
		cnt+=a[i];
	}
	long long ans=0;
	for(int i=0;i<n;i++){
		ans+=((cnt-a[i])%md)*a[i]%md;
	}
	if(ans>=md)
		ans%=md;
	if(ans%2==1)
		ans+=md;
	ans/=2;
	cout<<ans<<endl;
	return 0;
}

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

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

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

    sort(l.begin(), l.end());
    for(int i=0; i<n; i++)
        for(int j=i+1; j<n; j++)
            for(int k=j+1; k<n; k++)
                if(l[i] != l[j] && l[i] != l[k] && l[k] != l[j] && l[i] + l[j] > l[k] && l[i] + l[k] > l[j] && l[k] + l[j] > l[i])
                    sol++;

    

    cout << sol << '\n';
    
    
}

Measured memory_bytes: 3656
// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
#define rep( i, s, t ) for( register int i = s; i <= t; ++ i )
#define re register
int read() {
	char cc = getchar(); int cn = 0, flus = 1;
	while(cc < '0' || cc > '9') {  if( cc == '-' ) flus = -flus;  cc = getchar();  }
	while(cc >= '0' && cc <= '9')  cn = cn * 10 + cc - '0', cc = getchar();
	return cn * flus;
}
const int N = 1e5 + 5 ;
int a[N], n ;
bool cmp( int x, int y ) {
	return x > y ; 
}
signed main()
{
	n = read(); rep( i, 1, n ) a[i] = read() ; 
	sort( a + 1, a + n + 1, cmp ) ; 
	int ans ; 
	rep( i, 1, n ) {
		if( a[i + 1] < ( i + 1 ) ) {
			ans = ( a[i] - i ) % 2 ;
			int flag = 0 ; 
			for( re int j = i + 1; j <= n; ++ j ) {
				if( a[j] == ( i ) ) ++ flag ; 
			}
			ans = max( ans, flag % 2 ) ;
			break ;
		}
	}
	if( ans ) puts("First");
	else puts("Second");
	return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int A=sc.nextInt();
		int B=sc.nextInt();
		int sum_digit;
		int digit;
		int sum=0;
		int n;
		for(int i=1;i<=N;i++){
			sum_digit=0;
			digit=10000;
			n=i;
			while(digit>=1){
				sum_digit+=n/digit;
				n=n%digit;
				digit=digit/10;
				// System.out.println(n);
			}
			if(A<=sum_digit&&B>=sum_digit){
				sum+=i;
			}
		}
		System.out.println(sum);
	}
}


Measured memory_bytes: 22996
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include<set>
#include<tuple>
using namespace std;
#define INF 11000000000
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
typedef pair< pair<int,int>, int> p; 
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)


int main(){
    string s,ans="CF";
    cin>>s;

    int now=0;
    for(int i=0;i<(int)s.size();i++){
        if(now==0){
            if(ans[now]==s[i]) now++;

        }else if(now==1){
            if(ans[now]==s[i]) now++;
        }
    }
    if(now==2) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}



Measured memory_bytes: 256
unittest
{
	assert( [ "5" ].parse.expand.solve == 11 );
	assert( [ "86" ].parse.expand.solve == 939587134549734843 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	auto rs = recurrence!( ( a, n ) => a[ n - 1 ] + a[ n - 2 ] )( 2L, 1L );
	rs.popFrontN( n );
	return rs.front;
}


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

int main () {
    int A, N;

    cin >> N >> A;

    if(N%500 == 0)
        cout << "Yes" << endl;
    else if(N%500 <= A)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    
}

Measured memory_bytes: 256
#include<cstdio>
#define rep(i,a) for(i=0;i<a;i++)
int MOD=100000,i,j,k,n,m;
int main(){
    while(scanf("%d%d",&n,&m),n){
        int dp[110][110][2]={0};
        dp[1][0][0]=dp[0][1][1]=1;
        rep(i,n)rep(j,m)rep(k,2){
			(dp[i+1+k][j][0]+=dp[i][j][k])%=MOD;
			(dp[i][j+1+(1^k)][1]+=dp[i][j][k])%=MOD;
        }
		printf("%d\n",(dp[n][m-1][0]+dp[n-1][m][1])%MOD);
    }
}

Measured memory_bytes: 1132
#include<stdio.h>
#define N 100

int main(){
  int M[N][N];
  int i,j,n,u,k,v;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      M[i][j]=0;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    u--;
    for(j=0;j<k;j++){
      scanf("%d",&v);
      v--;
      M[u][v]=1;
    }
  }
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      if(j)printf(" ");
      printf("%d",M[i][j]);
    }
    printf("\n");
  }

  return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
int main(void){
    int a;
    scanf("%d",&a);
    for(;a>0;a--){
        int b=0,c=0,ball,i,x=1;
        for(i=0;i<10;i++){
            scanf("%d",&ball);
            if(ball<c){
                x=0;
                }
            if(b<ball)b=ball;
            else c=ball;
        }
        if(x==1)puts("YES");
        else puts("NO");

    }
    return 0;
}

Measured memory_bytes: 580
import itertools

S = input()

ans = 0
for T in itertools.product(['', '+'], repeat=len(S) - 1):
    e = ''
    i = 0
    for s in S:
        e += s
        if i < len(T):
            e+=T[i]
            i+=1
    ans += eval(e)

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
vector<vector<int> >dp(100000,vector<int>(20,-1));
vector<int>dep(100000);
int lca(int u,int v){
	if(dep[u]>dep[v])swap(u,v);
	for(int i=19;i>=0;i--){
		if(dp[v][i]!=-1&&dep[dp[v][i]]>=dep[u]){
			v=dp[v][i];
		}
	}
	if(u==v)return u;
	for(int i=19;i>=0;i--){
		if(dp[u][i]!=dp[v][i]){
			u=dp[u][i];
			v=dp[v][i];
		}
	}
	return dp[u][0];
}
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int k;
		cin>>k;
		for(int j=0;j<k;j++){
			int c;
			cin>>c;
			dp[c][0]=i;
			dep[c]=dep[i]+1;
		}
	}
	for(int j=1;j<20;j++){
		for(int i=0;i<n;i++){
			dp[i][j]=(dp[i][j-1]<0?-1:dp[dp[i][j-1]][j-1]);
		}
	}
	int q;
	cin>>q;
	while(q--){
		int u,v;
		cin>>u>>v;
		cout<<lca(u,v)<<"\n";
	}
}


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

elem = [0 for _ in range(N+1)]

for i in range(1, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            elem[j] += 1
            cur //= j

def num(m):
    return len(list(filter(lambda x: x >= m-1, elem)))

print(num(75)  + num(25)*(num(3)-1) + num(15)*(num(5)-1) + num(5)*(num(5)-1)*(num(3)-2) // 2)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int par[100000];
int ran[100000];
int num[100000];

void init(int n){
  rep(i,0,n){
    par[i]=i;
    ran[i]=0;
    num[i]=1;
  }
}

int find(int x){
  if(par[x]==x) return x;
  return par[x]=find(par[x]);
}

void unite(int x,int y){
  x=find(x);
  y=find(y);
  if(x==y) return;
  if(ran[x]<ran[y]){
    par[x]=y;
    num[y]+=num[x];
  }
  else{
    par[y]=x;
    num[x]+=num[y];
    if(ran[x]==ran[y]) ran[x]++;
  }
}

int siz(int x){
  return num[find(x)];
}

bool same(int x,int y){
  return find(x)==find(y);
}

int main(){
  int n,m,k;
  cin>>n>>m>>k;
  init(n);
  int a[n];
  rep(i,0,n) a[i]=0;
  rep(i,0,m){
    int c,d;
    cin>>c>>d;
    c--;
    d--;
    unite(c,d);
    a[c]++;
    a[d]++;
  }
  vector<int> b[n];
  rep(i,0,k){
    int c,d;
    cin>>c>>d;
    c--;
    d--;
    b[c].push_back(d);
    b[d].push_back(c);
  }
  rep(i,0,n){
    int cur=0;
    rep(j,0,b[i].size()){
      if(same(i,b[i][j])) cur++;
    }
    cout<<siz(i)-a[i]-cur-1<<" ";
  }
}


Measured memory_bytes: 7552
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
#define int long long

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

int cnt(int x) {
    int res = 0;
    while(x > 0 && x % 2 == 0) {
        x /= 2;
        res ++;
    }
    return res;
}

void solve() {
	int n, m; cin >> n >> m;
    vector<int> a(n);
    cin >> a[0];
    a[0] /= 2;
    int lcm = a[0];
    int co = cnt(a[0]);
    rep(i, n - 1) {
        cin >> a[i];
        a[i] /= 2;
        if(cnt(a[i]) != co) {
            cout << 0 << endl;
            return;
        }
        int g = gcd(a[i], lcm);
        lcm = (lcm / g) * a[i];
        if(lcm > m) {
            cout << 0 << endl;
            return;
        }
    }
    int x = m / lcm;
    cout << (x + 1) / 2 << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	//int t; cin >> t; rep(i, t)solve();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
typedef long long ll;
typedef unsigned long long ull;
typedef long double LD;
using namespace std;
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const ll INF64 = 1e18;
const double INFD = 1e30;
const double EPS = 1e-6;
const double PI = 3.14159265;
const ll MOD = 1e9 + 7;
template <typename T>
inline T read() {
    T X = 0, w = 0;
    char ch = 0;
    while (!isdigit(ch)) {
        w |= ch == '-';
        ch = getchar();
    }
    while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
    return w ? -X : X;
}
const int MAXN = 200005;
int n, m, k;
int dr[4] = {1, 0, -1, 0};
int dc[4] = {0, 1, 0, -1};
int dr2[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int dc2[8] = {1, 0, -1, 1, 0, -1, 1, -1};

int arr[MAXN];

int main() {
#ifdef LOCALLL
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif
    ll n;
    scanf("%lld", &n);
    if (n & 1)
        printf("0");
    else {
        ll ans = 0;
        for (ll i = 5; i <= n / 2; i *= 5) {
            ans += n / 2 / i;
        }
        printf("%lld", ans);
    }
    return 0;
}

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



int32_t main()
{
	lli N,s=1;
	cin>>N;
	for(lli i = 2; i<=(lli)sqrt(N); i++)
	{
		if(N%i==0)
			s = i;
	}
			cout<<N/s+s-2<<"\n";


	return 0;	
}

Measured memory_bytes: 256
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)

def fac2(n):
    if n < 2:
        return 0
    ans = n * (n-1) // 2
    return ans

d = {key:fac2(val) for key, val in c.items()}
sum_val = sum(d.values())
for a in A:
    ans = sum_val - d[a] + fac2(c[a]-1)
    print(ans)

Measured memory_bytes: 32028
plus = lambda a,b:a+b
minus = lambda a,b:a-b

bit = 0

nums = [int(c) for c in input()]

for bit in range(8):
  op_lst = [(plus if bit >> i & 1 else minus) for i in [2,1,0]]
  temp = nums[0]
  for i in range(len(op_lst)):
    temp = op_lst[i](temp,nums[i+1])
  if temp == 7:
    break

op_strings = {plus:"+",minus:"-"}

s = str(nums[0]) + op_strings[op_lst[0]] + str(nums[1]) + op_strings[op_lst[1]] + str(nums[2]) + op_strings[op_lst[2]] + str(nums[3])

print(s+"=7")

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a,b,c,d;cin>>a>>b>>c>>d;
  ll e=c*d/__gcd(c,d);
  ll ans=b-a+1-b/c+(a-1)/c-b/d+(a-1)/d+b/e-(a-1)/e;
  print(ans);
  return 0;
}

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

int main(void){
	ios::sync_with_stdio(false); cin.tie(0);
	
	int i,n,k,ans=1000000000;
	cin>>n>>k;
	int h[n];
	for(i=0;i<n;i++)cin>>h[i];
	sort(h,h+n);
	for(i=0;i<n-k+1;i++){
		if(h[i-1+k]-h[i]<ans)ans=h[i-1+k]-h[i];
	}
	cout<<ans<<endl;
	
	return 0;
}

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

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) 
    cin >> a[i];
  int res = 0;
  for (int i = 0; i < n; i++) {
    int cur = 1, exp = 0;
    while (a[i] % cur == 0) {
      cur <<= 1;
      ++exp;
    }
    res += exp - 1;
  }
  cout << res << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int n,m;
	int a[1010];
	vector<int> vec;
	while(1)
	{
		vec.clear();
		memset(a,0,sizeof(a));
		cin >> n >> m;
		if(n==0&&m==0)break;
		int now=1;
		for(int i=1;i<=n;i++)
		{
			cin >> a[i];
		}
		for(int i=0;i<m;i++)
		{
			int k;
			cin >> k;
			vec.pb(k);
		}
		int ans=0;
		while(1)
		{
			now+=vec[ans];
			now+=a[now];
			ans++;
			if(now>=n)break;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define SORT(c) sort((c).begin(),(c).end())

using namespace std;

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

//sort(v.rbegin(), v.rend(), [](auto& x, auto& y){return x[1] < y[1];});
//cout << fixed << setprecision(10) << ans << defaultfloat << endl;
typedef long long ll;
typedef vector<int> Vi;
typedef vector<ll> Vl;
typedef vector<double> Vd;
typedef vector<string> Vs;

int main() {
    int P,Q,R;
    cin >> P >> Q >> R;
    cout << P+Q+R-max({P,Q,R}) << endl;
}

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

def uclid(x, y):
    if(y == 0):
        return x
    tmp = y
    y =  x % y
    x = tmp
    return uclid(x, y)

ans = A[0] 
for i in range(1, N):
    ans = uclid(ans, A[i])
print(ans)

Measured memory_bytes: 14224
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

int main()
{
	int n;
	int d, min, max;
	long long sum;

	scanf("%d%d", &n, &d);
	sum = min = max = d;
	while (--n > 0) {
		scanf("%d", &d);
		if (d < min) min = d;
		if (d > max) max = d;
		sum += d;
	}
	printf("%d %d %lld\n", min, max, sum);
	return 0;
}



Measured memory_bytes: 2064
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
  ll n,k;
  cin >>n>>k;
  ll x[n];
  for(ll i=0;i<n;i++) cin >>x[i];
  ll ans=100000000000,sum,l,p;
  for(ll i=0;i<=n-k;i++){
    if(x[i]>0&&x[i+k-1]>0) ans=min(ans,x[i+k-1]);
    else if(x[i]<0&&x[i+k-1]<0) ans=min(ans,abs(x[i]));
    else{
    l=min(abs(x[i]),abs(x[i+k-1]));
    p=max(abs(x[i]),abs(x[i+k-1]));
    ans=min(ans,l*2+p);
    }
  }
  cout <<ans<<endl;
  }


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int A;
  cin >> A;
  if(A >= 30) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

struct Pos {
	double x, y;
}a, b, c, d;

int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++ ) {
		cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y;
		Pos e;
		e.x = b.x - a.x;
		e.y = b.y - a.y;
		Pos f;
		f.x = d.x - c.x;
		f.y = d.y - c.y;
		
		double men = e.x * f.y - e.y * f.x;
		double eps = 1e-10;
		if(-eps <= men && men <= eps)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 1220
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>	tree_set;
typedef long long ll;
typedef long double ld;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

ll mod=1e9 + 7;

int main()
{
    fast();
    int n,ans=0;
    cin>>n;
    ll arr[n];
    for(ll i=0;i<n;i++)
        cin>>arr[i];
    for(ll i=1;i<n-1;i++)
    {
        ll mn = min(arr[i], min(arr[i-1],arr[i+1]) );
        ll mx = max(arr[i], max(arr[i-1],arr[i+1]) );
        if(arr[i]!=mn && arr[i]!=mx)
            ans++;
    }
    cout<<ans;
}



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

int main() {
  string s;
  cin >> s;
  string ans;

  for(char c:s) {
    if(c == 'B' && ans.size() >= 1) {
    ans.pop_back();
    } else if(c == '0' || c == '1'){
      ans.push_back(c);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000000000000



int main(){
	
	string S;
	cin>>S;
	
	cout<<S.substr(0,4)<<' '<<S.substr(4)<<endl;


	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int i;
	char S[4];
	scanf("%s",S);
	for(i=0;i<3;i++){
		if(S[i]==S[i+1]&&S[i+1]==S[i+2]){
			printf("Yes\n");
			return 0;
		}
	}
	printf("No\n");
	return 0;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> a(H, vector<char>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> a.at(i).at(j);
    }
  }
  
  //横
  for (int i = 0; i < H; i++) {
    int yoko = 0;
    for (int j = 0; j < W; j++) {
      if (a.at(i).at(j) == '.'|| a.at(i).at(j) == '*') yoko++;
    }
    for (int j = 0; j < W; j++) {
      if (yoko == W) a.at(i).at(j) = '*';
    }
  }
  
  //縦
  for (int i = 0; i < W; i++) {
    int tate = 0;
    for (int j = 0; j < H; j++) {
      if (a.at(j).at(i) == '.' || a.at(j).at(i) == '*') tate++;
    }
    for (int j = 0; j < H; j++) {
      if (tate == H) a.at(j).at(i) = '*';
    }
  }
  
  //出力
  for (int i = 0; i < H; i++) {
    int count = 0;
    for (int j = 0; j < W; j++) {
      if (a.at(i).at(j) == '*') {
        count++;
        continue;
      }
      cout << a.at(i).at(j);
    }
    if (count != W) cout << endl;
  }
}


Measured memory_bytes: 256
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  double a, b, h, m, x[2], y[2], d;
  cin >> a >> b >> h >> m;
  x[0] = a;
  y[0] = 0.0;
  d = m / 60.0 - (h + m / 60.0) / 12.0;
  d *= 2.0 * acos(-1);
  x[1] = b * cos(d);
  y[1] = b * sin(d);
  cout << fixed << setprecision(10)
       << sqrt((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]))
       << endl;
}

Measured memory_bytes: 4156
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	pp1 := make([]int, n)
	pp2 := make([]int, n)
	for i := 0; i < n; i++ {
		pp1[i] = getNextInt(scanner)
		pp2[i] = pp1[i]
	}
	sort.Ints(pp2)
	d := 0
	for i := 0; i < n; i++ {
		if pp1[i] != pp2[i] {
			d++
		}
	}
	ans := "NO"
	if d <= 2 {
		ans = "YES"
	}
	fmt.Fprintln(writer, ans)
	writer.Flush()
}


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

int a, b, c;

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

    cin >> a >> b >> c;

    if (b - a == c - b) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }

    return 0;
}

Measured memory_bytes: 3676
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef long long lli;


const lli dx[2][7] = {{0,1,1,0,-1,-1,0},
                      {0,1,1,0,-1,-1,0}};
const lli dy[2][7] = {{1,0,-1,-1,-1,0,0},
                      {1,1,0,-1,0,1,0}};

struct State {
  lli x, y, t, cost;
  State() {}
  State(lli x, lli y, lli t, lli cost) : x(x), y(y), t(t), cost(cost) {}
  bool operator < (const State &s) const {
    if(cost != s.cost) return cost > s.cost;
    if(t != s.t) return t < s.t;
    if(x != s.x) return x < s.x;
    return y < s.y;
  }
};

struct State2 {
  lli x, y, t;
  State2() {}
  State2(lli x, lli y, lli t) : x(x), y(y), t(t) {}
  bool operator < (const State2 &s) const {
    if(t != s.t) return t < s.t;
    if(x != s.x) return x < s.x;
    return y < s.y;
  }
};

int main() {
/*
  for(int i = 0; i < 7; ++i) {
    cout << dx[0][i] << ", " << dy[0][i] << endl;
  }
  cout << endl;
  for(int i = 0; i < 7; ++i) {
    cout << -1+dx[1][i] << ", " << dy[1][i] << endl;
  }
*/
  while(1) {
    lli sx, sy, gx, gy, lx, ly, n;
    set<pair<lli,lli> > G;

    if(cin >> sx >> sy >> gx >> gy) ; else break;
    cin >> n;
    for(int i = 0; i < n; ++i) {
      lli x, y;
      cin >> x >> y;
      G.insert(make_pair(x,y));
    }
    cin >> lx >> ly;

    priority_queue<State> que;
    set<State2> vis;
    lli res = -1;
    que.push(State(sx,sy,0,0));
    while(!que.empty()) {
      State s = que.top(); que.pop();
      if(vis.count(State2(s.x, s.y, s.t))) continue;
      vis.insert(State2(s.x, s.y, s.t));
      if(s.x == gx && s.y == gy) {
        res = s.cost;
        break;
      }
      for(int i = 0; i < 7; ++i) {
        State n;
        n.x = s.x + dx[labs(s.x)%2][i];
        n.y = s.y + dy[labs(s.x)%2][i];
        n.t = (s.t+1)%6;
        n.cost = s.cost + (( (labs(s.x)%6) * (labs(s.y)%6) * s.t )%6 != i);
        if(labs(n.x) > lx) continue;
        if(labs(n.y) > ly) continue;
        if(G.count(make_pair(n.x, n.y))) continue;
        if(vis.count(State2(n.x, n.y, n.t))) continue;
        que.push(n);
      }
    }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 16424
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(){
    int n; cin >> n;
    vector<int> p(n);rep(i,n) cin >> p[i];
    vector<int> q(n);rep(i,n) cin >> q[i];
    vector<int> r(n);rep(i,n) r[i]=i+1;
    int pnum=0,qnum=0;
    bool okp=true,okq=true;
    do{
        // rep(i,n) cout<<r[i]<<" ";
        // cout << endl;
        if(okp){
             rep(i,n){
                if(p[i]!=r[i]) break;
                if(i==n-1) okp=false;
            }
            pnum++;
            // cout << "p " << pnum << endl;
        }
        if(okq){
            rep(i,n){
                if(q[i]!=r[i]) break;
                if(i==n-1) okq=false;
            }
            qnum++;
            // cout << "q " << qnum <<okq<< endl;
        }
        if(!okp && !okq) break;
    }while(next_permutation(r.begin(),r.end()));
    cout << abs(pnum-qnum) << endl;
}

Measured memory_bytes: 3588
N = int(input())
s = [list(input().split( )) for i in range(N)]
#print(s[1][0])
t = sorted(s, key=lambda x:int(x[1]), reverse = True)
#print(t)
count = 0
sum1 = sum([int(t[j][0]) for j in range(len(t))])
for i in range(len(t)):
  if int(t[i][1]) >= sum1 :
    sum1 = sum1 - int(t[i][0])
  else:
    count += 1
    sum1 = sum1 - int(t[i][0])
if count == 0:
  print("Yes")
else:
  print("No")

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n;
  cin >> n;

  vector<pll> x(n);
  REP(i, n){
    cin >> x[i].FI >> x[i].SE;
    ll a = x[i].FI-x[i].SE;
    ll b = x[i].FI+x[i].SE;
    x[i].FI = a;
    x[i].SE = b;
  }


  sort(x.begin(), x.end());
  ll cur = 0;
  ll en;

  ll ans = 1;
  REP(i, n){
    if(x[cur].SE > x[i].SE)
      cur = i;

    if(x[cur].SE<=x[i].FI){
      cur = i;
      ans++;
    }
  }

  cout << ans << endl;

}


Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#define NIL NULL

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;

Node root;

void insert(int);
void inorder(Node);
void preorder(Node);
Node treesearch(Node,int);
void treedelete(Node);
Node treesuccessor(Node);
Node treeminimum(Node);

int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
  
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treesearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if( com[0] == 'd' ){
      scanf("%d", &x);
      treedelete(treesearch(root, x));
  }
  
  
  

  }
  return 0;
}

void insert(int k){
  Node y=NIL;
  Node x=root;
  Node z;
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x!=NIL){
    y=x;
    if (z->key < x->key)
      x=x->left;
    else
      x=x->right;
  }
  z->parent=y;
  if(y==NIL)
    root=z;
  else {
    if(z->key < y->key)
    y->left=z;
  else
    y->right=z;
  }
}

void inorder(Node u){
  if(u==NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  
}

void preorder(Node u){
  if (u==NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}

Node treesearch(Node x,int k){
  if(x==NIL||k==x->key)
    return x;
  if(k < x->key)
    return treesearch(x->left,k);
  else
    return treesearch(x->right,k);
}

void treedelete(Node z){
  Node y;//node to be deleted
  Node x;//child of y
  if(z->left==NIL||z->right==NIL)
    y=z;
  else y=treesuccessor(z);

  if(y->left!=NIL)
    x=y->left;
  else
    x=y->right;

  if(x!=NIL)
    x->parent=y->parent;
  if(y->parent==NIL)
    root=x;
  else if(y==y->parent->left)
    y->parent->left=x;
  else
    y->parent->right=x;

  if(y!=z)
    z->key = y->key;
}

Node treesuccessor(Node x){
  Node y;
  if(x->right!=NIL)
    return treeminimum(x->right);
  
  y=x->parent;
  while(y!=NIL&&x==y->right){
    x=y;
    y=y->parent;
  }
  return y;
}

Node treeminimum(Node x){
  while(x->left!=NIL)
    x=x->left;
  return x;
}



Measured memory_bytes: 20440