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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

template<class V> class MaxFlow_dinic {
public:
	struct edge { int to,reve;V cap;};
	static const int MV = 10101;
	vector<edge> E[MV];
	int itr[MV],lev[MV];
	void add_edge(int x,int y,V cap,bool undir=false) {
		E[x].push_back((edge){y,(int)E[y].size(),cap});
		E[y].push_back((edge){x,(int)E[x].size()-1,undir?cap:0});
	}
	void bfs(int cur) {
		MINUS(lev);
		queue<int> q;
		lev[cur]=0;
		q.push(cur);
		while(q.size()) {
			int v=q.front(); q.pop();
			ITR(e,E[v]) if(e->cap>0 && lev[e->to]<0) lev[e->to]=lev[v]+1, q.push(e->to);
		}
	}
	V dfs(int from,int to,V cf) {
		if(from==to) return cf;
		for(;itr[from]<E[from].size();itr[from]++) {
			edge* e=&E[from][itr[from]];
			if(e->cap>0 && lev[from]<lev[e->to]) {
				V f=dfs(e->to,to,min(cf,e->cap));
				if(f>0) {
					e->cap-=f;
					E[e->to][e->reve].cap += f;
					return f;
				}
			}
		}
		return 0;
	}
	V maxflow(int from, int to) {
		V fl=0,tf;
		while(1) {
			bfs(from);
			if(lev[to]<0) return fl;
			ZERO(itr);
			while((tf=dfs(from,to,numeric_limits<V>::max()))>0) fl+=tf;
		}
	}
};

int H,W;
string S[101];
MaxFlow_dinic<int> mf;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>H>>W;
	FOR(y,H) cin>>S[y];
	
	FOR(y,H) FOR(x,W) if(S[y][x]=='.') {
		if((y+x)%2==0) {
			mf.add_edge(10000,y*100+x,1);
			if(y) mf.add_edge(y*100+x,(y-1)*100+x,1);
			if(y+1<H) mf.add_edge(y*100+x,(y+1)*100+x,1);
			if(x) mf.add_edge(y*100+x,y*100+x-1,1);
			if(x+1<W) mf.add_edge(y*100+x,y*100+x+1,1);
		}
		else {
			mf.add_edge(y*100+x,10001,1);
		}
	}
	
	int num=mf.maxflow(10000,10001);
	
	FOR(y,H) FOR(x,W) if(S[y][x]=='.' && (y+x)%2==0) {
		FORR(e,mf.E[y*100+x]) if(e.cap==0 && e.to<10000) {
			if(e.to-1==y*100+x) S[y][x]='>',S[y][x+1]='<';
			if(e.to+1==y*100+x) S[y][x]='<',S[y][x-1]='>';
			if(e.to-100==y*100+x) S[y][x]='v',S[y+1][x]='^';
			if(e.to+100==y*100+x) S[y][x]='^',S[y-1][x]='v';
		}
	}
	cout<<num<<endl;
	FOR(y,H) cout<<S[y]<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

int main() {
  int N,M,sum=0;
  cin >> N;
  vector<int> T(N);
  for(int i=0;i<N;i++){
  	cin >> T.at(i);
    sum+=T.at(i);
  }
  cin >> M;
  for(int i=0;i<M;i++){
  	int P,X;
    cin >> P >> X;
    cout << sum-T.at(P-1)+X << endl;
  }
}

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n;cin>>n;
  std::vector<int> v(n);
  int mx = 0, mx2=0;
  for(int i=0;i<n;i++){
    cin>>v[i];
    mx = max(v[i], mx);
  }
  for(int i=0;i<n;i++){
    if(v[i]==mx)continue;
    mx2 = max(v[i], mx2);
  }
  int mx_count = count(v.begin(), v.end(), mx);
  for(int i=0;i<n;i++){
    if(mx_count >= 2){
      cout<<mx<<endl;
    }else{
      if(v[i]==mx){
        cout<<mx2<<endl;
      }else{
        cout<<mx<<endl;
      }
    }
  }

  return 0;
}


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

#define ll long long int
ll mod=1e9+7;

vector<ll> DecToBinary(ll num,ll trailing_zero, ll nbits)
{
    vector<ll> bits;
    while(num > 0)
    {
        bits.push_back(num%2);
        num /= 2;
    }

    if(trailing_zero == 1)
    {
        while(bits.size() < nbits)
        {
            bits.push_back(0);
        }
    }

    return bits;
}


int main()
{
    /* Faster input ouput */
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.tie(NULL);

    /* To read input from a file and output to a file */
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    
    ll t = 1;
    // cin >> t;
    while(t--)
    {        
        ll n,i,j,rows,cols,k;
        cin >> rows >> cols >> k;
        
        char board[rows][cols];

        for(i=0;i<rows;i++)
        {
            for(j=0;j<cols;j++)
            {
                cin >> board[i][j];
            }
        }

        int ways = 0;
        for(i=0;i<pow(2,rows);i++)
        {
            for(j=0;j<pow(2,cols);j++)
            {
                // copy board
                char copy[rows][cols];
                for(int ii=0;ii<rows;ii++)
                {
                    for(int jj=0;jj<cols;jj++)
                    {
                        copy[ii][jj] = board[ii][jj];
                    }
                }

                // int which_rows = i;
                // int which_cols = j;

                vector<ll> which_rows = DecToBinary(i,(ll)1,rows);
                vector<ll> which_cols = DecToBinary(j,(ll)1,cols); 

                int ii,jj;

                for(ii=0;ii<which_rows.size();ii++)
                {
                    for(jj=0;jj<which_cols.size();jj++)
                    {
                        if(which_rows[ii] == 1 || which_cols[jj] == 1)
                        {
                            copy[ii][jj] = '-';
                        }
                    }
                }

                int bc = 0;
                for(ii=0;ii<rows;ii++)
                {
                    for(jj=0;jj<cols;jj++)
                    {
                        if(copy[ii][jj] == '#')
                        {
                            bc++;
                        }
                    }
                }

                if(bc == k)
                {
                    ways++;
                }

            }
        }

        cout << ways << '\n';
    }
    
    return 0;
}

Measured memory_bytes: 4068
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 25005;
const int MAXK = 404;
const int mod = 1e9 + 7;
using lint = long long;
using pi = pair<int, int>;

int n, k, m, a[MAXN];

lint ipow(int x, int p){
	lint ret = 1, piv = x;
	while(p){
		if(p & 1) ret = ret * piv % mod;
		piv = piv * piv % mod;
		p >>= 1;
	}
	return ret;
}

bool colorful(){
	int chk[MAXN] = {};
	for(int i=0; i<k; i++){
		chk[a[i]]++;
	}
	if(count(chk + 1, chk + k + 1, 1) == k) return 1;
	for(int i=k; i<m; i++){
		chk[a[i-k]]--;
		chk[a[i]]++;
		if(count(chk + 1, chk + k + 1, 1) == k) return 1;
	}
	return 0;
}

bool uniq(){
	vector<int> v(a, a + m);
	sort(v.begin(), v.end());
	return unique(v.begin(), v.end()) == v.end();
}

lint f[MAXN][MAXK];
lint g[MAXN][MAXK];

void getdp(){
	for(int x=0; x<=n; x++){
		lint sumF = 0;
		lint sumG = 0;
		for(int y=0; y<k; y++){
			if(x == 0){
				f[x][y] = 1;
				g[x][y] = (y >= m);
				continue;
			}
			if(y > 0){
				sumF += f[x-1][y];
				sumG += g[x-1][y];
			}
			f[x][y] = sumF + (k - y) * f[x-1][y+1];
			f[x][y] %= mod;
			g[x][y] = (y >= m ? f[x][y] : 0) + sumG;
			g[x][y] += (k - y) * g[x-1][y+1];
			g[x][y] %= mod;
		}
	}
}

int main(){
	scanf("%d %d %d",&n,&k,&m);
	for(int i=0; i<m; i++) scanf("%d",&a[i]);
	lint ret = (n - m + 1) * ipow(k, n - m);
	if(colorful()){
		cout << ret % mod << endl;
		return 0;
	}
	getdp();
	if(uniq()){
		// problem found
		assert(k > m);
		lint ans = g[n][0];
		for(int i=k-m+1; i<=k; i++) ans = ans * ipow(i, mod - 2) % mod;
		ans = (ret - ans + mod) % mod;
		cout << ans << endl;
		return 0;
	}
	set<int> s;
	int lp = 0, rp = m;
	while(lp < m){
		if(s.find(a[lp]) != s.end()) break;
		s.insert(a[lp++]);
	}
	s.clear();
	while(rp > 0){
		if(s.find(a[--rp]) != s.end()) break;
		s.insert(a[rp]);
	}
	rp++;
	for(int i=m; i<=n; i++){
		ret += mod - f[i-m][lp] * f[n-i][m-rp] % mod;
		ret %= mod;
	}
	cout << ret << endl;
}


Measured memory_bytes: 158336
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int h, w; scanf("%d%d", &h, &w);
	std::vector<std::string> s(h);
	for(int i = 0; i < h; i++) cin >> s[i];
	
	std::vector<std::vector<int>> A(h, std::vector<int>(w));
	for(int i = 0; i < h; i++) {
		int c = 0;
		for(int j = 0; j < w; j++) {
			A[i][j] += c;
			if(s[i][j] == '.') c++;
			if(s[i][j] == '#') c = 0;
		}
		c = 0;
		for(int j = w - 1; j >= 0; j--) {
			A[i][j] += c;
			if(s[i][j] == '.') c++;
			if(s[i][j] == '#') c = 0;
		}
	}
	for(int j = 0; j < w; j++) {
		int c = 0;
		for(int i = 0; i < h; i++) {
			A[i][j] += c;
			if(s[i][j] == '.') c++;
			if(s[i][j] == '#') c = 0;
		}
		c = 0;
		for(int i = h - 1; i >= 0; i--) {
			A[i][j] += c;
			if(s[i][j] == '.') c++;
			if(s[i][j] == '#') c = 0;
		}
	}
	
	int ans = 0;
	for(int i = 0; i < h; i++) {
		for(int j = 0; j < w; j++) {
			if(s[i][j] == '#') continue;
			ans = std::max(ans, 1 + A[i][j]);
		}
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 20096
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ITP1_1B
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            Console.WriteLine(Math.Pow(num, 3));
        }
    }
}

Measured memory_bytes: 9368
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		int a=0;
		
		
		Scanner scanner=new Scanner(System.in);
			a=scanner.nextInt();
		if(a<100||a>0) {
		a=a*a*a;
		
		System.out.println(a);
		}
	}

}

Measured memory_bytes: 25984
#include <iostream>
using namespace std;
int main(){
  int A;
  int B;
  cin>>A;
  cin>>B;
if (B%2 == 0)
    {
      if (A >= 13)
      {
        cout<< B;
      }
      else if(A <= 12 && A >= 6)
      {
        cout<< B/2;
      }
      else 
      {
        cout<<0;
      } 
    }

}


Measured memory_bytes: 3644
import java.util.*;
import static java.lang.System.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int x = sc.nextInt();
		int ans = 0;

			int start = x -  (k - 1);
			int num = k * 2 - 1;
		for(int i =0; i < num; i++)
			out.print(start + i + " ");			

	}
}

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

int main(){
  int a,b,c; cin >> a >> b >> c;
  
  if(b-a == c-b){
    cout << "YES" << endl;
  }
  
  else{
    cout << "NO" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
/*
　　こんにちは。あたしはｶｳｶﾞｰﾙ。
　　redcoderになるためAtCoderを巡る旅をしてます。

　　　 　 ＿_
　　　 ヽ|＿_|ノ　　　　ﾓｫ
　　　　||‘‐‘||ﾚ　　_)_, ―‐ 、
　　　　/(Ｙ (ヽ＿ /・ ヽ　　 ￣ヽ
　　　　∠ ＿ ゝ　 ｀^ヽ ﾉ.::::_(ノヽ
　　　　 _/ヽ　 　　  /ヽ￣￣/ヽ
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define COUT(x) cout << (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; }

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

    ll a, b, c; cin >> a >> b >> c;
    int ans = 0;
    while(1) {
        if((a == b && b == c) && !(a & 1)) {
            ans = -1;
            break;
        }
        if(a & 1 || b & 1 || c & 1) {
            break;
        }
        ll na = a, nb = b, nc = c;
        a = nb / 2 + nc / 2;
        b = na / 2 + nc / 2;
        c = na / 2 + nb / 2;
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);

	if(a*b >= c*d) printf("%d\n",a*b);
	if(a*b < c*d) printf("%d\n",c*d);

   	return 0;
}

Measured memory_bytes: 2112
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(vs) vs.begin(), vs.end()
using ii = pair<int, int>;
using ll = long long;

int32_t main(){
	ll n, a, b;
	cin >> n >> a >> b;
	ll k = n/(a+b);
	ll ans = k*a + min(a, n%(a+b));
	cout << ans << endl;	
}


Measured memory_bytes: 3632
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cassert>
#define ll long long
using namespace std;
inline int read(){
	int re=0,flag=1;char ch=getchar();
	while(ch>'9'||ch<'0'){
		if(ch=='-') flag=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9') re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
	return re*flag;
}
int n,first[200010],fa[200010],cnte,mex[200010] ;
bool vis[200010],cir[200010];
struct edge{
	int to,next;
}a[200010];
inline void add(int u,int v){
	a[++cnte]=(edge){v,first[u]};first[u]=cnte;
}
void dfs(int u){
	int i,v;mex[u]=0;
	for(i=first[u];~i;i=a[i].next) 
		if(!cir[v=a[i].to]) dfs(v);
	for(i=first[u];~i;i=a[i].next)
		if(!cir[v=a[i].to]) vis[mex[v]]=1;
	while(vis[mex[u]]) mex[u]++;
	for(i=first[u];~i;i=a[i].next)
		if(!cir[v=a[i].to]) vis[mex[v]]=0;
}
int main(){
	memset(first,-1,sizeof(first));
	n=read();int i,u,maxn=0,minn=1e9,cnt=0;
	for(i=1;i<=n;i++) fa[i]=read(),add(fa[i],i);
	u=1;
	while(!vis[u]) vis[u]=1,u=fa[u];
	while(!cir[u]) cir[u]=1,u=fa[u];
	for(i=1;i<=n;i++){
		if(!cir[i]) continue;
		dfs(i);cnt++;
		maxn=max(maxn,mex[i]);minn=min(minn,mex[i]);
	}
	if(maxn==minn&&cnt&1) puts("IMPOSSIBLE");
	else puts("POSSIBLE");
}

Measured memory_bytes: 4480
#include <stdio.h>
int main(){
int yoshio=315,kao=440,i=0,j=0;
  scanf("%d %d",&yoshio,&kao);
  j=2*yoshio-1;
  int kaochan[j];
  kaochan[0]=kao-yoshio+1;
  for(i=0;i<j;i++){
    kaochan[i+1]=kaochan[i]+1;
    printf("%d ",kaochan[i]);
    }
  printf("\n");
  return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int answer = 0;

		if (a + b >= 24) {
			answer = (a + b) - 24;
		} else {
			answer = a + b;
		}
		System.out.println(answer);

	}

}

Measured memory_bytes: 22612
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int a,b;
    cin>>a>>b;
    a+=b;
    a%=24;
    cout<<a<<endl;

    return 0;
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long int
#define pb push_back
#define mp make_pair
#define ip pair<int, int>
#define it pair<int, pair<int, int>>
#define F first
#define S second
#define fori(p, n) for(int i = p; i < n; i++)
#define forj(q, m) for(int j = q; j < m; j++)
#define fork(r, l) for(int k = r; k < l; k++)
#define revi(h) for(int i = h; i >= 0; i--)
#define all(v) v.begin(), v.end()
#define PI 3.14159265358
#define debug(x) cout<<"DEBUGGING --- "<<x<<endl;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define input_from_file  freopen("input.txt", "r", stdin);
#define output_to_file freopen("output.txt", "w", stdout);
signed main(){
    fastio;
    //input_from_file; 
    //output_to_file;
    int n, m; cin>>n>>m;
    vector<int>D(n + 1, 0);
    vector<vector<int>>G(n + 1);
    fori(0, m){
        int x, y; cin>>x>>y;
        G[x].pb(y), D[y]++;
    }
    vector<int>dist(n + 1, 0);
    vector<int>V;
    fori(1, n + 1) if(!D[i]) dist[i] = 0, V.pb(i);
    fori(0, V.size()){
        int u = V[i];
        for(auto v : G[u]){
            D[v]--;
            dist[v] = max(dist[v], 1 + dist[u]);
            if(!D[v]) V.pb(v);
        }
    }
    int ans = 0;
    fori(1, n + 1) ans = max(ans, dist[i]);
    cout<<ans<<endl;                   
}

Measured memory_bytes: 8440
def f(dirs)
    if dirs.size == 1
        dirs[0][0] == ?n ? Rational(0) : Rational(90)
    else
        d = (dirs[0][0] == ?n ? Rational(-90) : Rational(90))
        f(dirs[1..-1]) + d / 2 ** (dirs.size-1) 
    end
end 

loop {
    s = gets.chomp
    break if s == ?#
    r = f(s.scan(/north|west/))
    puts r.to_i == r ? r.to_i : r
}

Measured memory_bytes: 6128
#include <bits/stdc++.h>
using namespace std;
#define DEBUG_MODE
#define endl '\n'
#ifdef DEBUG_MODE
#define DEBUG(X) debug_func(X, #X)
#define DEBUG_ENDL endl
#define DEBUG_SEPARATOR_LINE cout<<"=================\n"
#else
#define DEBUG(X) 0
#define DEBUG_ENDL 0
#define DEBUG_SEPARATOR_LINE 0
#endif
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
#define DEBUG_ENDL_S(S) ((S).size() ? "\n" : "")
template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename Head, typename... Tail> const Head& var_min(const Head &head, const Tail&... tail) { return min(head, var_min(tail...)); }
template <typename Head, typename... Tail> const Head& var_max(const Head &head, const Tail&... tail) { return max(head, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
void debug_func_preffix(const string &s) { if(s.size()) cout << s << " = "; }
template <typename T>
void debug_func(const T &t, const string &s = "") {
    debug_func_preffix(s);
    cout << t << DEBUG_ENDL_S(s);
}
template <typename T, typename U>
void debug_func(const P<T, U> &p, const string &s = "") {
    debug_func_preffix(s);
    cout << "(";
    debug_func(p.first);
    cout << ", ";
    debug_func(p.second);
    cout << ")" << DEBUG_ENDL_S(s);
}
template <typename T>
void debug_func(const V<T> &v, const string &s = "") {
    for(ll i = 0; i < v.size(); i++) {
        string t = s + "[" + to_string(i) + "]";
        debug_func(v[i], t);
    }
}

char M(char a, char b) {
    if(a == 'T' && b == 'F') return 'F';
    return 'T';
}

int main() {
    V<pair<ll, char>> v;
    for(ll i = 0; i < 3; i++) {
        ll a;
        cin >> a;
        v.emplace_back(a, 'A' + i);
    }
    cout << max_element(ALL(v))->second << endl;
    return 0;
}



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

using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr ll mod = static_cast<ll>(1e9 + 7);

int n;
std::string s[100005];
std::map<std::string, ll> m;
int main()
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    std::cin >> n;

    for (int i = 0; i < n; ++i) {
        std::cin >> s[i];
        std::sort(s[i].begin(), s[i].end());
        ++m[s[i]];
    }

    ll ans = 0;
    for (auto& mm : m)
    {
        ans += mm.second * (mm.second - 1) / 2;
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 16640
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <iostream>
#include <limits>
#include <numeric>
#include <type_traits>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define MOD 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define REVERSE(s) reverse(s.begin(), s.end());
#define SUM(s) accumulate(s.begin(), s.end(), 0LL);
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
//#define int ll
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int ndx[8] = { 0,1,0,-1, 1,1,-1,-1 };
int ndy[8] = { 1,0,-1,0, 1,-1,-1,1 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }



int main() {
	int r;
	cin >> r;
	cout << (double)r * 3.141592 * 2 << endl;
}




Measured memory_bytes: 3704
k, t = map(int, raw_input().split())
a = map(int, raw_input().split())
a = sorted(a,reverse=True)
b = range(len(a))
c = a[:]
a = []
for i in xrange(len(b)):
    a.append([c[i], i])
d = 0
y = -1
while True:
    # print a
    # print y
    if len(a) == 1:
        d += a[0][0]-1
        break
    else:
        if a[0][0] == 0:
            break
        elif a[0][1] != y:
            a[0] = [a[0][0]-1,a[0][1]]
            y = a[0][1]
        else:
            if a[1][0] == 0:
                d += a[0][0]
                break
            a[1] = [a[1][0]-1,a[1][1]]
            y = a[1][1]
        a = sorted(a,reverse=True)
# if t == 1:
#     d = t-1
# else:
#     d = a[0] - sum(a[1:]) -1
#     if d < 0:
#         d = 0
print d

Measured memory_bytes: 2696
#include<bits/stdc++.h>
using ll = long long;
#define int ll
signed main(){
    int n;
    std:: cin >> n;
    int ans = 0;
    int temp = 1;
    /*1をビットシフトして探す*/
    while(temp <= n){
        temp <<= 1;
        ans++;
    }
    std::cout << ans << std::endl;
}





Measured memory_bytes: 3104
#include<iostream>
#include<utility>
#include<tuple>
#include<set>
#include<list>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FUNCTION__ << endl;
#define int long long

const long long MAXN = 1e6;
const long long MOD = 1e9+7;
const long long INF = __LONG_LONG_MAX__ / 2;

using namespace std;

int a[MAXN];

signed main(){
    int N;
    cin >> N;
    for (int i = 0; i < N; i++){
      cin >> a[i];
    }

    int sum = 0;
    for (int i = 0; i < N; i++) sum+=a[i];

    int sunuke_sum = a[0];
    int kuma_sum = sum - a[0];

    int min_diff = abs(sunuke_sum - kuma_sum);

    for (int i = 1; i < N-1; i++){// a[i] wo take siyouto siteiru
      sunuke_sum += a[i];
      kuma_sum -= a[i];
      min_diff = min(min_diff, abs(sunuke_sum - kuma_sum));
    }
    cout << min_diff << endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
map<char,int>::iterator it;
  vector<int>v[1000];
int main()
{
    int n,m,a,b;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    for(int i=1;i<=n;i++)
    {
        cout<<v[i].size()<<endl;
    }




}


Measured memory_bytes: 256
#include<stdio.h>
int graph[101][101],n,c,d;

void warshall_floyd(){
  int i,j;
  for(i=1;i<=n;i++)
    for(j=1;j<=n;j++)
      graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][c]+graph[c][d]+graph[d][j]);
}

int min(int x,int y){
  return x<y?x:y;
}

int main(){
  int k,i,j,x,e;

  while(scanf("%d %d",&n,&k),n,k){

    for(i=0;i<=n;i++)
      for(j=0;j<=n;j++)
	graph[i][j]=i==j?0:1000000;

    for(i=0;i<k;i++){
      if(scanf("%d",&x),x){
	scanf("%d %d %d",&c,&d,&e);

	if(graph[c][d]>e){
	graph[c][d]=graph[d][c]=e;
	warshall_floyd();
	}
      }else{
	scanf("%d %d",&c,&d);
	printf(graph[c][d]>=1000000?"-1\n":"%d\n",graph[c][d]);
      }
    }
  }
  return 0;
}

Measured memory_bytes: 0
# ALDS1_3_A.
# 逆ポーランド記法。

def main():
    A = input().split()
    A.reverse()
    B = []
    # Aを順にpopしていって演算子のときは
    # 手前の二つで演算してその数で置き換える感じ。
    while len(A) > 0:
        op = A.pop()
        if op == '+' or op == '-' or op == '*':
            y = B.pop(); x = B.pop()
            if op == '+': B.append(x + y)
            elif op == '-': B.append(x - y)
            elif op == '*': B.append(x * y)
        else:
            n = int(op); B.append(n)
    print(B[0])

if __name__ == "__main__":
    main()


Measured memory_bytes: 5600
#include<cstdio>
#include<algorithm>
#include<functional>

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

using namespace std;

int main(){
	for(int n,m;scanf("%d%d",&n,&m),n;){
		int p[1000];
		rep(i,n)	scanf("%d",p+i);

		sort(p,p+n,greater<int>());

		int total=0;
		rep(i,n) if((i+1)%m!=0) total+=p[i];
		printf("%d\n",total);
	}

	return 0;
}

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

signed main()
{
   int N; cin>>N;
   vector<int> a(N),b(N);
   for(int i=0;i<N;i++){
      cin>>a[i]>>b[i];
   }

   int x=a[0],y=b[0];
   for(int i=1;i<N;i++){
      int k1=(x+a[i]-1)/a[i];
      int k2=(y+b[i]-1)/b[i];
      x=max(k1,k2)*a[i];
      y=max(k1,k2)*b[i];
   }
   cout<<x+y<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <limits>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
#define fi(i,n) for( ll i=0 ; i<n ; i++ )
#define f(i, a, b) for( ll i=a ; i<b ; i++ )
#define vi vector<int>
#define pb push_back
#define MOD 1000000007
ll digits(ll n)
{
    return floor(log10(double(n))) + 1;
}
ll SieveOfEratosthenes(ll n)
{
    vector<bool>prime(n+1);
    int ans = 0;
    for(int i =0;i<=n;i++)
        prime[i] = true;
    prime[1] = false;
    for (ll p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (ll i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for(int i = 2;i<=n;i++)
    {
        if(prime[i])
        {
            ans++;
        }
    }
    return ans;
}
void permute(string a, int l, int r)
{
    if (l == r)
    {
        cout<<a<<endl;
    }
    else
    {
        for (int i = l; i <= r; i++)
        {
            swap(a[l], a[i]);
            permute(a, l+1, r);
        }
    }
}
ll modularExponentiation(ll x,ll n,ll M)
{
    ll result = 1;
    ll ans = 1;

    while(n>0)
    {
        if(n % 2 ==1)
        {
            result = (result*x)%MOD;
            ans = (ans + result)%MOD;
        }
        n = n/2;
        if(n>0)
        {

            x = x*x;
        }
    }
    return ans;
}
int d, x, y;
void extendedEuclid(int A, int B) {
    // for computing modular inverse
    // make b as Mod such that gcd of mod and a is 1
    // also the coeff x here will denote the modular inverse of a
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
        // x = y1
        // y = x1 - y1*(a/b);
    }
}
ll fact(ll n)
{
    ll ans = 1;
    for(ll i = 1;i<=n;i++)
        ans = (ans%MOD * i%MOD)%MOD;
    return ans%MOD;
}
ll maxpower(ll n,ll k)
{
    ll count = 0;
    while(n>0)
    {
        n = n/k;
        if(n>0)
            count++;
    }
    return count;
}
bool written(ll n,ll k,string s,ll power)
{
    while(power>=0 && n>0)
    {
            ll x = pow(k,power);
            if(n - x>=0)
            {
                if(s[power] == '1')
                    return false;
                n = n - x;
            }
            power--;
    }
    cout<<n<<endl;
    if(n!=0)
        return false;
    return true;
}
void improvise(string s,ll n,ll k,ll power)
{
    for(int i = power;i>=0;i--)
    {
        ll x = pow(k,i);
        if(n - x>=0)
        {
            s[i] = '1';
            n = n - pow(k,i);
        }
    }
}
int main()
{
    ll a,b,c;
    cin>>a>>b>>c;
    ll count5 = 0;
    ll count7 =0;
    if(a==5)
        count5++;
    else if(a==7)
        count7++;
    if(b==5)
        count5++;
    else if(b==7)
        count7++;
    if(c==5)
        count5++;
    else if(c==7)
        count7++;
    if(count5==2 && count7==1)
        cout<<"YES";
    else
        cout<<"NO";

}



Measured memory_bytes: 3592
#include<cstdio>
#include<algorithm>
#define ll long long
#define For(i,x,y)  for(ll i=x;i<=y;++i)
#define FOr(i,x,y)  for(ll i=x;i>=y;--i)
#define lf else if
using namespace std;
inline ll read(){   ll x=0,f=1;char ch=getchar();   while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}  while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}  return x*f; } 
inline void write(ll x){    if (x<0) putchar('-'),x=-x; if (x>=10) write(x/10);   putchar(x%10+'0');  } 
inline void writeln(ll x){ write(x);   puts("");   }
const ll N=100100;
ll f[N],a[N],b[N],c[N],n,ans;
int main(){
	n=read();
	For(i,1,n)	a[i]=read();
	For(i,1,n)	b[i]=read();
	For(i,1,n)	c[i]=read();
	sort(a+1,a+n+1);
	sort(b+1,b+n+1);
	sort(c+1,c+n+1);
	ll p=1;
	For(i,1,n){
		while(c[p]<=b[i]&&p<=n)	++p;
		f[i]=max(n-p+1,0ll);
	}
	FOr(i,n,1)	f[i]+=f[i+1];
	p=1;
	For(i,1,n){
		while(b[p]<=a[i]&&p<=n)	++p;
		ans+=f[p];
	}
	writeln(ans);
}

Measured memory_bytes: 3456
fun main(args: Array<String>) {

    val n = readLine()!!.toInt()

    val s = (1..n).map { readLine()!! }.toTypedArray()

    val map = mutableMapOf<String, Long>()

    var ans = 0L

    for (i in (0 until n)) {
        val sortedString = s[i].toList().sorted().toString()
        val count = map[sortedString]
        if (count != null) {
            ans += count
            map[sortedString] = count + 1L
        } else map[sortedString] = 1L
    }

    println(ans)
}

Measured memory_bytes: 100324
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        List<String> W = new ArrayList<>(Arrays.asList("Sunny", "Cloudy", "Rainy"));
        System.out.println(W.get((W.indexOf(new Scanner(System.in).next()) + 1) % 3));
    }
}


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

int main() {
    int A, B;
    cin >> A >> B;
    int result = -1;
    for(int i = 0; i < 1252; i++) {
        int genkaA = i * 0.08;
        int genkaB = i * 0.1;
        if(genkaA == A && genkaB == B) {
            result = i;
            break;
        }
    }
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	int a,b,c,x,y;
	cin >> a >> b >> c >> x >> y;
	c=c*2;
	int ans=0;
	if(a+b<=c)
		ans=a*x+b*y;
	else if(c<=a and c<=b)
		ans=c*max(x,y);
	else if(c<=a)
		ans=c*x+max(0,y-x)*b;
	else if(c<=b)
		ans=c*y+max(0,x-y)*a;
	else
		ans=c*min(x,y)+a*(x-min(x,y))+b*(y-min(x,y));
	

	cout << ans << endl;




	
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int n,k;
  scanf("%d%d",&n,&k);
  int h[n];
  int counter;
  counter = 0;
  
  int i;
  i = 0;
  while (i < n)
  {
    scanf("%d", &h[i]);
    if (h[i] >= k)
      counter++;
    i++;
  }
  printf("%d",counter);
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#pragma optimize("JARU SOSISONI")

using namespace std;

#define int long long
#define fast cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define geometry cout.setf(ios::fixed); cout.precision(15);
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;

const int INF = 1e9 + 100;
const int MOD1 = 998244353;
const int MOD = 1e9 + 7;
const int N = 2e5 + 10;
const int nul = 0;
const int SIZE = 1e6 * 3;


signed main() {
#ifdef parasha
    freopen("A.in", "r", stdin);
#endif // parasha
    fast;
    int w, h;
    cin >> w >> h;
    int cntw = w + 1, cnth = h + 1;
    vector<int> p(w), q(h);
    for (int &i : p) cin >> i;
    for (int &i : q) cin >> i;
    vector<vector<int> > smth;
    for (int i = 0; i < w; i++) {
        smth.push_back({p[i], 1, i});
    }
    for (int i = 0; i < h; i++) {
        smth.push_back({q[i], 2, i});
    }
    //cout << 888 << endl;
    sort(all(smth));
    int ans = 0;
    set<int> existh, existw;
    for (int i = 0; i < h; i++) existh.insert(i);
    for (int i = 0; i < w; i++) existw.insert(i);
    for (int i = 0; i < h + w; i++) {
        //cout << smth[i][0] << " " << smth[i][1] << " " << smth[i][2] << endl;
        if (smth[i][1] == 1) {
            ans += smth[i][0] * cnth;
            cntw--;
            int x = smth[i][2];
            //if (existw.find(x - 1) == existw.end() && existw.find(x + 1) == existw.end()) cntw--;
            existw.erase(x);
        } else {
            //cout << 777 << endl;
            ans += smth[i][0] * cntw;
            cnth--;
            int x = smth[i][2];
            //if (existh.find(x - 1) == existh.end() && existh.find(x + 1) == existh.end()) cntw--;
            existh.erase(x);
        }
        //cout << ans << endl;
    }
    cout << ans << endl;

}












Measured memory_bytes: 25048
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) find(rng(v),x)!=v.end()
#define incls(s,c) s.find(c)!=string::npos
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
//const long double EPS = 1e-14;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; scanf("%d",&x); return x;}
inline ll lin() { ll x; scanf("%lld",&x); return x;}
inline char chin() { char x; scanf("%c",&x); return x;}
inline string stin() { string x; cin >> x; return x;}
inline double din() { double x; scanf("%lf",&x); return x;}
//template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
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; }
char itoa(int n) { return n + '0';}
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

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

  ll a = 100;
  rrep(i,4000) {
    a = (ll)((double)a * 101/100);
    if (a >= x) {
      cout << i << endl;
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>

int main() {
    int a,b,c,k;
    int n = 0;
    
    scanf("%d %d %d",&a,&b,&c);
    
    for (k = a; k<=b;k++) {
        if(c % k == 0) n++;
    }
    printf("%d\n",n);
    return 0;
}


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

const int W = 100010, N = 105;
long long w[N], v[N], dp[N][W], n, m;

int main() {
    memset(dp, 0, sizeof(dp));
    cin >> n >> m;
    for (int i = 1; i <= n; ++i)
    	cin >> w[i] >> v[i];
    for (int i = 1; i <= n; i++)
    	for (int j = 0; j <= m; j++) {
			dp[i][j] = dp[i-1][j];
			if (j >= w[i]) dp[i][j] = max(dp[i][j], dp[i-1][j-w[i]] + v[i]);
		}			
	
	cout << dp[n][m];    
    return 0;
}

Measured memory_bytes: 82304
#include <iostream>
#include <vector>
using namespace std;
using ll = int64_t;

ll MOD = static_cast<ll>(1e9+7);
ll ADD(ll x, ll y) { return (x+y)%MOD; }

vector<ll> DP;
ll dp(ll left, bool has9, bool has0) {
  if(left==0) { return has9 && has0 ? 1LL : 0LL; }
  ll key = left*4+(has9?1:0)*2+(has0?1:0);
  if(DP[key]>=0) { return DP[key]; }
  ll ans = 0;
  for(ll d=0; d<=9; d++) {
    ans = ADD(ans, dp(left-1, has9 || d==9, has0 || d==0));
  }
  DP[key] = ans;
  return ans;
}
int main() {
  ll n;
  cin >> n;
  DP = vector<ll>(4*(n+1), -1);
  ll ans = dp(n, false, false);
  cout << ans << endl;
}


Measured memory_bytes: 96452
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<int,int>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;

int main(){
  int n;
  cin>>n;
  vector<pair<string,int>> st(n);
  int t_all=0;
  rep(i,n){
    cin>>st[i].first>>st[i].second;
    t_all+=st[i].second;
  }
  string x;
  cin >> x;
  int t_wake=0;

  rep(i,n){
    t_wake+=st[i].second;
    if(st[i].first==x){
      cout<<t_all-t_wake<<endl;
      break;
    }
  }




}


Measured memory_bytes: 256
N=int(input())
A = []
for n in range(N):
    A.append(int(input()))

forward = [0 for n in range(N)]
forward[0] = A[0]
backward = [0 for n in range(N)]
backward[N-1] = A[N-1]
for n in range(1,N):
    forward[n] = max(forward[n-1], A[n])
for n in range(N-1)[::-1]:
    backward[n] = max(backward[n+1], A[n])

# print(forward)
# print(backward)

print(backward[1])
for n in range(1,N-1):
    # print("====")
    # print(forward[n-1],backward[n+1])
    print(max(forward[n-1],backward[n+1]))
print(forward[N-2])


Measured memory_bytes: 76324
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<60);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  a=abs(a);
  b=abs(b);
  if(a==0)return b;
  if(b==0)return a;
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}


void solve(long long N, std::vector<long long> A){
  ll ans=1;
  ll MAX=1000000000000000000LL;
  REP(N){
    if(A[i]==0){
      cout<<0<<endl;
      return;
    }
  }
  REP(N){
    if(ans>MAX/A[i]){
      cout<<-1<<endl;
      return;
    }
    ans*=A[i];
  }
  cout<<ans<<endl;
}

int main(){
  cout<<setprecision(1000);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


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

struct edge {
	int x, y, w;
};
int L, n;
vector<edge> E;

int main() {
	scanf("%d", &L);
	for(int i=3;i<=20;++i) {
		E.push_back((edge){i-1, i, 1<<(20-i)});
		E.push_back((edge){i-1, i, 0});
	}
	if((L>>19)&1) {
		E.push_back((edge){1, 2, 1<<18});
		E.push_back((edge){1, 2, 0});
	}
	for(int i=2, tmp=(((L>>19)&1) ? 1<<19 : 0);i<=20;++i) {
		if((L>>(20-i))&1) {
			E.push_back((edge){1, i, tmp});
			tmp+=1<<(20-i);
		}
	}
	printf("20 %d\n", (int)E.size());
	for(int i=0;i<(int)E.size();++i) {
		printf("%d %d %d\n", E[i].x, E[i].y, E[i].w);
	}
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import bisect

def solve():
    n, m = map(int, input().split())
    l = [int(i) for i in input().split()]
    l.sort()
    t = [(0, 0)] * m
    for i in range(m):
        a, b = map(int, input().split())
        t[i] = (a, b)
    t.sort(key=lambda x: (-x[1], -x[0]))
    idx = 0
    for le, e in t:
        for i in range(le):
            if idx + i >= n or l[idx + i] >= e:
                return l
            l[idx + i] = e
        idx += le
        if idx >= n:
            break
    return l

if __name__=="__main__":
    _l = solve()
    print(sum(_l))


Measured memory_bytes: 71064
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.List;
import java.util.Scanner;
 
 
public class Main {
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner sc = new Scanner(System.in);
	
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int ans=0;
		if(A>=13){
			ans=B;
		}else if(A>=6){
			ans = B/2;
		}else{
			ans = 0;
		}
		
		System.out.println(ans);
		
		
	}
	
	
	
}

Measured memory_bytes: 21716
(n,m), *d = [list(map(int, s.split())) for s in open(0)]

s = [n+1]*(n+1)
for x,y in d:
    if s[x] > y:
        s[x] = y

ans = 0
_min = n+1
for i, x in enumerate(s):
    if _min == i:
        _min = n+1
        ans += 1
    
    if _min > x:
        _min = x

print(ans)

Measured memory_bytes: 28148
import sys
input = sys.stdin.readline

def main():
    H, W, d = map(int, input().split())
    color = ("R", "Y", "G", "B")
    d2 = d * 2
    for i in range(H):
        tmp = ""
        for j in range(W):
            tmp += color[2 * (((i+j) % d2) < d) + (((i-j) % d2) < d)]
        print(tmp)

if __name__ == "__main__":
    main()

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(15);
vector<int> forintinput(int n) {
	vector<int> x;
	for(int i = 0;i < n;i++){
		int ia;
		cin >> ia;
		x.push_back(ia);
	}
	return x;
}
int main(){
	int t,x;
	cin >> t >> x;
	cout << fixed << setprecision(15) << t/double(x) << endl;
}

Measured memory_bytes: 3660
n,q = [int(i) for i in input().split()]
string = input()
l = [[int(i) for i in input().split()] for _ in range(q)]

ans = [0 for _ in range(n)]

for i in range(n-1):
    if string[i] == 'A' and string[i+1] == 'C':
        ans[i+1] = ans[i] +1
    else:
        ans[i+1] = ans[i]
        
for x,y in l:
    print(ans[y-1] - ans[x-1])

Measured memory_bytes: 24480
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
static const int MAX = 200000;

int main() {
    int R[MAX], n;
    cin >> n;
    for(int i = 0; i < n; i++) cin >> R[i];
    
    int maxv = -2000000000;
    int minv= R[0];
    for (int i = 1;i < n; i++){
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    cout << maxv << endl;
    
    return 0;
    
}


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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M = MAP()
# あとで大きい値から数えたいので降順ソートしておく
A = sorted(LIST(), reverse=True)
B = sorted(LIST(), reverse=True)
MAX = N * M

# 同じリストに同じ値がいたら論外
# (各値1回ずつしか使えないのに、違う行で最大値が同じとか不可能)
if len(A) != len(set(A)) or len(B) != len(set(B)):
    print(0)
    exit()

# 1: Aにある, 2: Bにある, 3: 両方にある, 0: どちらにもない
flags = [0] * (MAX+1)
for i in range(N):
    flags[A[i]] += 1
for i in range(M):
    flags[B[i]] += 2

ans = 1
j = k = biga = bigb = 0
for i in range(MAX, 0, -1):
    # リスト内の、自分iより大きい値の数を数えながら進める
    if j != N and A[j] >= i:
        biga += 1
        j += 1
    if k != M and B[k] >= i:
        bigb += 1
        k += 1
    tmp = 1
    # どちらにもない
    if flags[i] == 0:
        # Aで自分以上の数 * Bで自分以上の数 - 自分以上の数
        tmp = biga * bigb - (N*M-i)
        if tmp <= 0:
            print(0)
            exit()
    # Aにある
    elif flags[i] == 1:
        # 自分の行が決まっているので、列を調べに行く
        tmp = bigb
    # Bにある
    elif flags[i] == 2:
        tmp = biga
    ans = (ans * tmp) % MOD
print(ans)


Measured memory_bytes: 13156
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using static MyIO;


public class B
{
	public static void Main()	
	{
		string S = GetString();
		int flag = 0;
		for(int i = 0; i < S.Length; i++)
		{
			int iChar = (int)(S[i] - 'a');
			if(((flag >> iChar) & 1) == 1)
			{
				Console.WriteLine("no");
				return;
			}
			flag |= (1 << iChar);
		}
		Console.WriteLine("yes");
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace  std;
int a,b,c,d;
int n;
string s[100100];
int main ()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>s[i];
		if(s[i]=="AC")a++;
		if(s[i]=="WA")b++;
		if(s[i]=="TLE")c++;
		if(s[i]=="RE")d++;
	}
	cout<<"AC x "<<a<<endl;
	cout<<"WA x "<<b<<endl;
	cout<<"TLE x "<<c<<endl;
	cout<<"RE x "<<d<<endl;
	return 0;
} 

Measured memory_bytes: 6732