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

const int MAXV = 1010, MAXE = 1000000;

struct edge { int u, v, weight, next; } g[MAXE];


int n;
int head[MAXV], idx;

int parent[MAXV], visited[MAXV], dist[MAXV];

void bfs(int u){
    memset(parent, -1, sizeof(parent));
    memset(visited, 0, sizeof(visited));
    memset(dist, -1, sizeof(dist));
    
    queue<int> q;
    q.push(u);
    visited[u] = 1;
    dist[u] = 0;
    
    while (!q.empty()) {
        int u = q.front();
        q.pop();
        for (int i = head[u]; ~i; i = g[i].next) {
            int v = g[i].v;
            if (!visited[v]) {
                q.push(v);
                visited[v] = 1, parent[v] = u, dist[v] = dist[u] + 1;
            }
        }
    }
}

int main(int argc, char *argv[])
{
    
 
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    idx = 0;
    memset(head, -1, sizeof(head));
    
    cin >> n;
    
    for (int i = 0, u, m, v; i < n; i++) {
        cin >> u >> m;
        for (int j = 0; j < m; j++) {
            cin >> v;
            g[idx] = edge{u, v, 0, head[u]};
            head[u] = idx++;
        }
    }
    
    bfs(1);
    
    for (int i = 1; i <= n; i++) {
        cout << i << " " << dist[i] << endl;
    }
    
    return 0;
}



Measured memory_bytes: 3172
#include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>
#define MAXN 1000
#define MAXM 2000
#define MO 1000000007
using namespace std;
typedef long long LL;
struct node
{
	int to;
	int val;
	node(){};
	node(int _to,int _val):to(_to),val(_val){}
};
struct edge
{
	int u,v,len;
}line[MAXM+5];
vector<node> G[MAXN+5];
int N,M;
LL X;
LL diff[MAXM+5];
int fa[MAXN+5],fal[MAXN+5];
int depth[MAXN+5];
int Pow[MAXM+5];
bool used[MAXM+5];
int cnt=0;
LL sum=0;
bool operator < (edge a,edge b)
{
	return a.len<b.len;
}
void Init()
{
	Pow[0]=1;
	for(int i=1;i<=MAXM;i++)
		Pow[i]=2LL*Pow[i-1]%MO;
	for(int i=1;i<=MAXN;i++)
		fa[i]=i;
}
int FindSet(int i)
{
	if(fa[i]==i)
		return i;
	return fa[i]=FindSet(fa[i]);
}
bool UniteSet(int x,int y)
{
	int fx=FindSet(x);
	int fy=FindSet(y);
	if(fx==fy)
		return false;
	fa[fx]=fy;
	return true;
}
void Build(int u,int fa1)
{
	fa[u]=fa1;
	depth[u]=depth[fa1]+1;
	for(int i=0;i<G[u].size();i++)
	{
		int v=G[u][i].to;
		if(v==fa1)
			fal[u]=G[u][i].val;
		else
			Build(v,u);
	}
}
int Find_MaxEdge(int x,int y)
{
	int ret=0;
	if(depth[x]<depth[y])
		swap(x,y);
	while(depth[x]!=depth[y])
	{
		ret=max(ret,fal[x]);
		x=fa[x];
	}
	while(x!=y)
	{
		ret=max(ret,max(fal[x],fal[y]));
		x=fa[x];
		y=fa[y];
	}
	return ret;
}
int main()
{
	Init();
	scanf("%d %d %lld",&N,&M,&X);
	int u,v,len;
	for(int i=1;i<=M;i++)
	{
		scanf("%d %d %d",&u,&v,&len);
		line[i].u=u;
		line[i].v=v;
		line[i].len=len;
	}
	sort(line+1,line+1+M);
	for(int i=1;i<=M;i++)
		if(UniteSet(line[i].u,line[i].v))
		{
			used[i]=true;
			G[line[i].u].push_back(node(line[i].v,line[i].len));
			G[line[i].v].push_back(node(line[i].u,line[i].len));
			sum+=1LL*line[i].len;
		}
//	memset(fa,0,sizeof(fa));
	X=X-sum;
	if(X<0)
	{
		printf("0");
		return 0;
	}
	Build(1,0);
	for(int i=1;i<=M;i++)
		if(used[i]==false)
		{
			int maxd=Find_MaxEdge(line[i].u,line[i].v);
			diff[++cnt]=line[i].len-maxd;
		}
	LL res=0;
	sort(diff+1,diff+1+cnt);
	if(X==0)
		res=(1LL*Pow[M]-2LL*Pow[M-N+1]%MO+2LL*MO)%MO;
	for(int i=1;i<=cnt;i++)
		if(X==diff[i])
			res=(1LL*res+2LL*Pow[cnt-i]%MO)%MO;
	printf("%lld",res);
	return 0;
}

Measured memory_bytes: 384
while True:
  stones = [0, 0]
  n = input()
  if not n:
    break
  stones.append(input())
  stones.append(1)
  for i in range(n - 1):
    m = input()
    if i % 2 == 1:
      if stones[-2] == m:
        stones[-1] += 1
      else:
        stones.append(m)
        stones.append(1)
    else:
      if stones[-2] == m:
        stones[-1] += 1
      else:
        if len(stones) > 2:
          stones[-3] += stones[-1] + 1
          stones = stones[:-2]
        else:
          stones[-2] = m
          stones[-1] += 1
  ans = 0
  for j in range(0, len(stones), 2):
    if stones[j] == 0:
      ans += stones[j + 1]
  print ans

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

int n;
int common_time=1;
int g[110][110];
int d[10000];
int f[10000];

int dfs(int node){
  if(d[node]==0){
    d[node]=common_time++;
    //cout<<node<<" "<<d[node]<<"#"<<endl;
  }
  else{
    return 0;
  }
  for(int i=0;i<=n;i++){
    if(g[node][i] == 1){
      //cout<<node<<"$"<<i<<endl;
			dfs(i);
    }
  }
	f[node] = common_time++;
  //cout<<node<<" "<<f[node]<<"&"<<endl;
}

int main(){

  cin>>n;

  for(int i=0;i<n;i++){
    for (int j=0;j<n;j++){
      g[i][j]=0;
    }
  }

  for(int i=0;i<10000;i++){
    d[i]=0;
    f[i]=0;
  }
  int u;
  int k;
  int v;
  for(int i=0;i<n;i++){
    cin >>u;
    cin>>k;
    for(int j=0;j<k;j++){
      cin>>v;
      v--;
      g[u-1][v]=1;
      //g[v][u-1]=1;
    }
  }
  
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      //cout<<g[i][j];
    }
    //cout<<endl;
  }
  
 for(int i=0;i<n;i++){
  dfs(i);
 }
  
  for(int i=0;i<n;i++){
    cout<<i+1<<" "<<d[i]<<" "<<f[i]<<endl;
  }
  return 0;
}




Measured memory_bytes: 3216
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;


int main()
{
  int N, M;
  cin >> N >> M;

  int initflag = 0;
  int errflag = 0;
  int Lmax, Rmin;
  for(int i=0; i<M; i++)
  {
    int L, R;

    cin >> L >> R;

    if(0 == initflag)
    {
      Lmax = L;
      Rmin = R;
      initflag = 1;
    }
    else{
      if(L > Rmin || R < Lmax)
      {
        errflag = 1;
        break;
      }

      if(L >= Lmax) Lmax = L;
      if(R <= Rmin) Rmin = R;
    }
  }

  if(0 == errflag)  cout << (Rmin - Lmax) + 1;
  else cout << 0;

  return 0;
}


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

int main() {
  int N, R;
  cin >> N >> R;
  if (N>=10) {
    cout << R << endl;
  }
  else {
    cout << R+100*(10-N) << endl;
  }
}


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

string Z(int m){
    if(m>=(1<<8))return "";
    string ret;
    for(int i=7;i>=0;i--){
        if((m>>i)&1)ret+="1";
        else ret+="0";
    }
    return ret;
}

string R(double r){
    double table[]={1.0/2,1.0/4,1.0/8,1.0/16};
    string ret;
    for(int i=0;i<4;i++){
        if(r>=table[i]){
            r-=table[i];
            ret+="1";
        }
        else ret+="0";
    }
    if(r!=0)return "";
    return ret;
}


int main(){

    double n;
    while(cin>>n,n!=-1){
        int m=(int)n;
        double r=n-m;

        if(Z(m)!=""&&R(r)!=""){
            cout<<Z(m)+"."+R(r)<<endl;
        }
        else cout<<"NA"<<endl;
    }
    return 0;
}

Measured memory_bytes: 1232
#include<iostream>
#include<cfloat>
#include<cmath>
using namespace std;

int main(){
    int n;
    while(cin >> n, n){ 
        int ans = -1;
        double mi = DBL_MAX;

        int p;
        double h, w;
        for(int i = 0; i < n; i++){
            cin >> p >> h >> w;
            h /= 100;
            double diff = fabs(22.0 - w/h/h);
            if(diff < mi){
                mi = diff;
                ans = p;
            }
        }

        cout << ans << endl;
    }
    return 0;
}


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

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

// int N,M;
// vector<vector<int> > G;
// int dp[110000];
int dp[3010][3010];



int main(){
    string s,t;
    cin >> s >> t;
    int sizes = s.size();
    int sizet = t.size();
    for(int i=0;i<sizes;++i){
        for(int j=0;j<sizet;++j){
            chmax(dp[i+1][j+1],dp[i+1][j]);
            chmax(dp[i+1][j+1],dp[i][j+1]);
            if(s[i]==t[j]) chmax(dp[i+1][j+1],dp[i][j] + 1);
        }
    }

    string ans = "";
    while(sizes>0 && sizet >0){
        if(dp[sizes][sizet]==dp[sizes][sizet-1]){
            sizet--;
        } else if(dp[sizes][sizet]==dp[sizes-1][sizet]){
            sizes--;
        } else{
            ans = s[sizes-1] + ans;
            sizes--;sizet--;
        }
    }
    cout << ans << endl;
    return 0;
    

}



Measured memory_bytes: 35584
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var one = nextIntArray();
	var N = one[0];
	var K = one[1];
	var list = nextIntArray();
	list.sort(function(a,b){
		return a - b;
	});
	var output = 0;
	for(var i = 0; i < K; i++){
		output += list[i];
	}
	myout(output);
}


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

int main(){
	int N;
	scanf("%d", &N);
	vector<long long> A(N);
	for(int i = 0; i < N; i++)scanf("%lld", &A[i]);
	deque<long long> B;
	for(int i = 0; i < N; i++){
		if(i % 2 == 0){//末尾
			B.push_back(A[i]);
		}else{
			B.push_front(A[i]);
		}
	}
	
	if(N % 2 == 0){
		for(int i = 0; i < N; i++){
			cout << B.front() << " ";
			B.pop_front();
		}
	}else{
		for(int i = 0; i < N; i++){
			cout << B.back() << " ";
			B.pop_back();
		}
	}
	cout << '\n';
}

Measured memory_bytes: 5376
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <cmath>
#include <set>
#include <stack>
#include <queue>
#include <numeric>
#include <deque>
#include <cstring>
#include <iterator>
#include <map>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <complex>
#include <bitset>
#include <chrono>
#include <random>
#include <assert.h>
#include <array>

using namespace std;

template<typename M, typename N>
istream& operator>>(istream&is, pair<M,N> & p){is >> p.first >> p.second; return is;}
template<typename M>
istream& operator>>(istream&is, vector<M> & v){for(auto &it:v) is >> it; return is; }
template<typename M>
istream& operator>>(istream&is, vector<vector<M>> & v){for(auto &it:v) is >> it; return is; }
template<typename M, typename N>
ostream& operator<<(ostream&os, const pair<M,N> &p){os << p.fi << ' ' << p.se << '\n';return os;}
template<typename M>
ostream& operator<<(ostream&os, const vector<M> &v){for(auto it: v)os << it << ' ';cout << '\n';return os;}
template<typename M>
ostream& operator<<(ostream&os, const vector<vector<M>> &v){for(auto it: v)os << it;return os;}

#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mn(x) *min_element((x).begin(),(x).end())
#define mx(x) *max_element((x).begin(),(x).end())
#define acc(x) accumulate((x).begin(),(x).end(),0ll)
#define eb emplace_back
#define el '\n'
typedef  long long  ll;
typedef  unsigned long long  ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<pll> vpll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

const ld pi=acos(-1);
const ll inf=(ll)1e9+10;
//const int mod=1000000007;
const int mod=998244353;

int n,m,k;
const int N=3e5+10;




int main()
{   ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;
    cin >> n;
    vi a(n), b(n);
    bool cond=false;
    for(int i=0; i<n; i++){
        cin >> a[i] >> b[i];
        if(i>1){
            if(a[i]==b[i]&&a[i-1]==b[i-1]&&a[i-2]==b[i-2]){
                cond=true;
            }
        }
    }
    cout << (cond?"Yes":"No") << el;
    return 0;
}








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

		// 整数の入力
		int n = sc.nextInt();
		int m = sc.nextInt();

		int[] t = new int[n+1];
		boolean flg = true;
		int ans = 0;
		int mod = 1000000007;

		for(int i=0;i<m;i++)t[sc.nextInt()]=-1;
		t[0]=1;

		for(int i=0;i<n-1;i++){
			if(t[i]!=-1){
				if(t[i+1]!=-1){
					t[i+1]=(t[i]+t[i+1])%mod;
				}
				if(t[i+2]!=-1){
					t[i+2]=(t[i]+t[i+2])%mod;
				}
				if(t[i+1]==-1&&t[i+2]==-1){
					flg=false;
					break;
				}
			}
		}

		if(flg){
			if(t[n-1]!=-1){
				ans = (t[n]+t[n-1])%mod;
				
			} else {
				ans = t[n]%mod;
			}
		}

		// 出力
		System.out.println(ans);
	}
}

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

int main() {
  int n;
  cin >>n;
  vector<int> a(n);
  vector<int> b(n);
  rep(i, n)  {
    cin >> a.at(i);
  }
  rep(i, n) {
    b.at(i) = a.at(i);
  }
  sort(b.begin(),b.end());
  reverse(b.begin(), b.end());
  rep(i,n) {
    if (a[i] == b[0])  {
      cout << b[1] << endl;
    } else {
      cout << b[0] << endl;
    }
  }
}


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

typedef long long ll;
const ll MOD = 1000000007;

ll check(int arr[], int N) {
    if (N%2 and arr[0] != 0) return 0;
    ll n = 1;
    for (int i = N%2; i < N-1; i+= 2) {
        if (arr[i] != i+1 or arr[i+1] != arr[i]) {
            return 0;
        }
        n = (n*2)%MOD;
    }
    return n;
}

int main() {
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) {
        cin >> arr[i];
    }
    sort(arr, arr+N);
    cout << check(arr, N) << endl;
}


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

long long cnt;
int l;
int A[1000000];
int B[1000000];
int N;
vector<int> G;

void insertionSort(int A[], int N, int g){
  for ( int i = g; i < N; i++ ){
    int v = A[i];
    int j = i - g;
    while( j >= 0 && A[j] > v ){
      A[j+g] = A[j];
      j -= g;
      cnt++;
    }
    A[j+g] = v;
  }
}

void shellSort(int A[], int N){

  for ( int h = 1; ;  ){
    if ( h > N ) break;
    G.push_back(h);
    h = 3*h + 1;
  }

  for ( int i = G.size()-1; i >= 0; i-- ){
    insertionSort(A, N, G[i]);
  }
}

main(){
  cin >> N;
  for ( int i = 0; i < N; i++ ) scanf("%d", &A[i]);
  for ( int i = 0; i < N; i++ ) B[i] = A[i];
  cnt = 0;
  shellSort(A, N);
  sort(B, B+N);
  //  for ( int i = 0; i < N; i++ ) assert(A[i] == B[i]);

  cout << G.size() << endl;
  for ( int i = G.size()-1; i >= 0; i-- ){
    printf("%d", G[i]);
    if ( i ) printf(" ");
  }
 printf("\n");
  printf("%d\n", cnt);
  for ( int i = 0; i < N; i++ ) printf("%d\n", A[i]);
}



Measured memory_bytes: 11016
#include <bits/stdc++.h>
#define mod 1000000007
#define ull unsigned ll
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi acos(-1)
#define nui 100
#define INF 100000000000
 
#define F(i,a,n) for(ll i=a;i<n;i++)
#define B(i,a,n) for(ll i=n-1;i>=a;i--)
#define tc int t;cin>>t;while(t--)
#define tcf int t;cin>>t;for(int w=1;w<=t;w++)
 
 
 
using namespace std;
 
 
ll binpow(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
        {
            res *= a;
        }
        a *= a;
        b >>= 1;
    }
    return res;
}
 
ll fermat_inv(ll y) {return binpow(y, mod - 2);}
 
/*vector<ll>adj[100001];
vector<bool>visited(100001, 0);
vector<ll>parent(100001, 0);
vector<ll>a(100001, 0);
 
void dfs(ll node)
{
    visited[node] = 1;
    for (auto i : adj[node])
    {
        if (!visited[i])
        {
            dfs(i);
            a[node] += a[i];
            parent[i] = node;
        }
    }
}*/
int main()
{
 
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
 
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
    ll n,d;
    cin>>n>>d;
    ll ct=0;
    F(i,0,n)
    {
        ll x,y;
        cin>>x>>y;
        if(x*x+y*y<=d*d)
        {
            ct++;
        }
    }
    cout<<ct<<"\n";
    return 0;
 
 
 
 
 
}
 
 
 

Measured memory_bytes: 3648
N, M = map(int, input().split())
A = []

dp = []
for i in range(N + 1):
    dp.append(None)
    A.append(None)

for _ in range(M):
    a = int(input())
    A[a] = 1

dp.append(0)
dp[N] = 1

for i in range(N - 1, -1, -1):
    if A[i]:
        dp[i] = 0
        continue
    dp[i] = dp[i + 1] + dp[i + 2]

# print('dp', dp)
print(dp[0] % 1000000007)


Measured memory_bytes: 460884
#include<cstdio>
#include<iostream>
#include<string>
#include <algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
using ll = long long;



int main(){
	int a, b, c, d;
	cin >> a >> b >> c >> d;

	int e, f, g;

	e = a - b;
	f = b - c;
	g = a - c;
	if (e < 0) {
		e = e * (-1);
	}
	if (f < 0) {
		f = f * (-1);
	}
	if (g < 0) {
		g = g * (-1);
	}

	if (e <= d && f <= d || g <= d) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    ll x, y;
    cin >> x >> y;
    if (x % y == 0) {
        cout << -1 << endl;
    } else {
        vector<ll> cand = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
        for(auto val: cand) {
            if ((x*val) % y != 0) {
                cout << (x*val) << endl;
                return 0;
            }
        }
        return 0;
    }
    return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; }
template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; }
void print() { cout << "\n"; }
template <class T, class... Args>
void print(const T &x, const Args &... args) { cout << x << " "; print(args...);}
void debug_out() { cout << "\n"; }
template <class T, class... Args>
void debug_out(const T &x, const Args &... args) { cout << x << " "; debug_out(args...);}
#ifdef _DEBUG
  #define debug(...) debug_out(__VA_ARGS__)
#else
  #define debug(...) 
#endif

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  ll x;
  cin >> x;
  ll res = 100;
  int ans = 0;
  while (true) {
    res += res/100;
    ans++;
    if (res >= x) break;
  }
  cout << ans << endl;
  return 0;
}

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

#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

#define Grt ch = getchar()
#define DeBug(x) std::cout << #x << '=' << x << std::endl

const int MaxN = 1e5 + 10, MaxM = 1 << 15 + 10;

namespace IO
{
	char buf[1<<15], *fs, *ft;
	inline char getc() { return ft == fs && (ft = (fs = buf) + fread(buf, 1, 1<<15, stdin), ft == fs) ? 0 : *fs++; }
	template <typename T> inline void read(T &x)
	{
		x = 0;
		T f = 1, Grt;
		while (!isdigit(ch) && ch ^ '-') Grt;
		if (ch == '-') f = -1, Grt;
		while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), Grt;
		x *= f;
	}


	template <typename T, typename... Args>
	inline void read(T &x, Args &...args) { read(x); read(args...); }

	char Out[1<<24], *fe = Out;
	inline void flush() { fwrite(Out, 1, fe-Out, stdout); fe = Out; }
	template <typename T> inline void write(T x, char str)
	{
		if (!x) *fe++ = 48;
		if (x < 0) *fe++ = '-', x = -x;
		T num = 0, ch[20];
		while (x) ch[++ num] = x % 10 + 48, x /= 10;
		while (num) *fe++ = ch[num --];
		*fe++ = str;
	}
}

using IO::read;
using IO::write;

template <typename T> inline bool chkMin(T &a, const T &b) { return a > b ? (a = b, true) : false; }
template <typename T> inline bool chkMax(T &a, const T &b) { return a < b ? (a = b, true) : false; }
template <typename T> inline T min(T a, T b) { return a < b ? a : b; }
template <typename T> inline T max(T a, T b) { return a > b ? a : b; }

int v[MaxN], f[MaxN], cnt[20], xr[MaxN];
int main()
{
	int n, ans = 0, state = 0; read(n);
	for (int i = 1, x, y, z; i < n; ++ i) read(x, y, z), v[x] ^= z, v[y] ^= z;
	for (int i = 0; i < n; ++ i) ++ cnt[v[i]];
	for (int i = 1; i <= 15; ++ i)
	{
		ans += cnt[i] >> 1;
		state |= (cnt[i] & 1) << (i - 1);
	}
	for (int i = 1; i < (1 << 15); ++ i) f[i] = f[i >> 1] + (i & 1);
	for (int i = 1; i < (1 << 15); ++ i) -- f[i];
	for (int i = 1; i < (1 << 15); ++ i)
		for (int j = 0; j < 15; ++ j)
			if ((i >> j) & 1) xr[i] ^= (j + 1);
	for (int s = 1; s < (1 << 15); ++ s)
	{
		if (xr[s] != 0) continue;
		for (int t = (s - 1) & s; t; t = (t - 1) & s)
			if (xr[t] == 0) chkMin(f[s], f[t] + f[t ^ s]);
	}
	write(ans + f[state], '\n');
	IO::flush();
	return 0;
}

Measured memory_bytes: 896
import java.util.*;

public class Main {

  public static void main (String[] args) {

     Scanner sc = new Scanner(System.in);
 
    int N = sc.nextInt();
    int Y = sc.nextInt();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

}

Measured memory_bytes: 23892
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	ll N,M;
	scanf("%lld %lld",&N,&M);

	if(N >= M/2){

		printf("%lld\n",M/2);

	}else{

		ll ans = N;  //Nを前部使う
		M -= 2*N;

		ans += M/4; //c4個でScc1つができる

		printf("%lld\n",ans);
	}

	return 0;
}


Measured memory_bytes: 256
import numpy as np
N,K=map(int, input().split())
A =list(map(int,input().split()))
MOD = 10 ** 9 + 7
if N==K:
  ans0 = 1
  for a in A:
    ans0 = ans0*a%MOD
  print(ans0)
  exit()

A=sorted(A)  
if (K%2==1 and A[-1]<0):
  ans1 = 1
  for a in A[N-K:N]:
    ans1 = ans1*a%MOD
  print(ans1)
  exit()

A=sorted(A, key=lambda x:abs(x), reverse=True)
AA=[np.sign(i) for i in A]
 
ansA = 1
for a in A[0:K]:
  ansA = ansA*a%MOD
ansAA = AA[0:K].count(-1)%2
if ansA==0 or ansAA==0:
  print(ansA)
  exit()

B1=A[0:K]
C1=A[0:K]
B2=sorted(A[K:N])
Bp=[i for i in A[0:K] if i>0]
Bm=[i for i in A[0:K] if i<0]

if B2[0]>0:B2.insert(0,0)
if B2[-1]<0:B2.insert(-1,0)
if not Bp:Bp.insert(0,B1[-1])
if not Bm:Bm.insert(0,B1[0])
  
B1.remove(Bp[-1])
B1.append(min(B2[0],0))

ansB = 1
for a in B1[0:K]:
  ansB = ansB*a%MOD

C1.remove(Bm[-1])
C1.append(max(B2[-1],0))
 
ansC = 1
for a in C1[0:K]:
  ansC = ansC*a%MOD

BB1=[np.sign(i) for i in B1]
ansBB1 = BB1[0:K].count(-1)%2
BB2=[np.sign(i) for i in C1]
ansBB2 = BB2[0:K].count(-1)%2
if ansBB1==1:
  print(ansC)
  exit()
if ansBB2==1:
  print(ansB)
  exit()

if abs(Bp[-1]*B2[-1])-abs(Bm[-1]*B2[0])>=0:
  print(ansC)
else: print(ansB)

Measured memory_bytes: 65864
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	int R;
	cin>>R;
	cout<<fixed<<setprecision(10)<<R*2*3.1415926535<<endl;
	return 0;
}

Measured memory_bytes: 3776
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    A, B = map(int, input().split())
    if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
        print("Possible")
    else:
        print("Impossible")


if __name__ == '__main__':
    main()


Measured memory_bytes: 4076
#include <bits/stdc++.h>
using namespace std;
int A,B;
char m[50][101];
int main(){
    cin>>A>>B;
    A--;B--;
    for(int i=0;i<50;i++){
        for(int j=0;j<50;j++){
            m[i][j]='#';     
        }
        for(int j=50;j<100;j++){
            m[i][j]='.';
        }
    }
    for(int i=0;i<50;i+=2){
        for(int j=0;j<50;j+=2){
            if(A-->0){
                m[i][j]='.';
            }
        }
        for(int j=51;j<100;j+=2){
            if(B-->0){
                m[i][j]='#';
            }
        }
    }
    puts("50 100");
    for(int i=0;i<50;i++)
        puts(m[i]);
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
map<string,int> M1,M2;
string s[105];
int main()
{
	ios::sync_with_stdio(false);
	string str;int n,m;
	cin>>n;for(int i=1;i<=n;i++) {cin>>s[i];M1[s[i]]++;}
	cin>>m;for(int i=1;i<=m;i++) {cin>>str;M2[str]++;}
	int ans=0;
	for(int i=1;i<=n;i++)
	 ans=max(ans,max(0,M1[s[i]]-M2[s[i]]));
	printf("%d\n",ans);
	return 0;
} 

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;

const ll INF = 9223372036854775807;
const int inf = 2147483647;

ll max(ll a,ll b){
    if(a>b)return a;
    else return b;
}


int a,b;
char s[101][101];
int main() {
    cin >> a >> b;
    REP(i,100){
        REP(j,100){
            if(i<50){
                s[i][j]='#';
            }else{
                s[i][j]='.';
            }
        }
    }
    REP(i,100){
        REP(j,100){
            if(i<49&&(i+j)%2==0&&j%2==0&&(--a)>0){
                s[i][j]='.';
            }else if(i>50&&(i+j)%2==0&&j%2==0&&(--b)>0){
                s[i][j]='#';
            }
        }
    }
    
    put("100 100");
    REP(i,100){
        cout << s[i];
        cout<<endl;
    }
    
    return 0;
}


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

using namespace std;

struct query {
	int x;
	int y;
	query(int x, int y) {
		this->x = x;
		this->y = y;
	}

	bool operator< (const query& r) const {
		return this->x < r.x;
	}
	bool operator< (const int& r) const {
		return this->x < r;
	}
};
bool operator< (const int& l, const query& r) {
	return l < r.x;
}

struct node {
	int begin;
	int end;
	int sum = 0;
	node* child1;
	node* child2;
	vector<query> queries;
	node(int begin, int end) {
		this->begin = begin;
		this->end = end;
	}
};


node* root;

node* init(int begin, int end) {
	node* parent = new node(begin, end);
	if (begin != end) {
		int mid = (begin + end) / 2;
		parent->child1 = init(begin, mid);
		parent->child2 = init(mid + 1, end);
	}
	return parent;
}

void add(node* nod, int x, int y) {
	nod->queries.push_back(query{ x, y });
	//node* nod = root;
	//while (nod->begin != nod->end) {
	//	nod->sum += y;
	//	if (x <= nod->child1->end)
	//		nod = nod->child1;
	//	else
	//		nod = nod->child2;
	//}
	//nod->sum += y;
}

int getSum(node* nod, int x, int y) {
	if (nod->end < x)
		return 0;
	if (nod->begin > y)
		return 0;
	
	if (nod->begin == nod->end) {
		for (auto it : nod->queries) {
			nod->sum += it.y;
		}
		nod->queries.clear();
		return nod->sum;
	}

	sort(begin(nod->queries), end(nod->queries));
	auto separator = upper_bound(begin(nod->queries), end(nod->queries), nod->child1->end);
	for (auto it = begin(nod->queries); it != separator; ++it) {
		add(nod->child1, it->x, it->y);
		nod->sum += it->y;
	}
	for (auto it = separator; it != end(nod->queries); ++it) {
		add(nod->child2, it->x, it->y);
		nod->sum += it->y;
	}
	nod->queries.clear();

	if (nod->begin == x && y == nod->end)
		return nod->sum;
	return getSum(nod->child1, x, min(y,nod->child1->end)) + getSum(nod->child2, max(nod->child2->begin,x), y);	
}

int main() {
	int n, q;
	cin >> n >> q;
	root = init(1, n);
	for (int i = 0; i < q; ++i) {
		int com, x, y;
		cin >> com >> x >> y;
		if (com == 0)
			add(root, x, y);
		else
			cout << getSum(root,x, y) << endl;
	}
}

Measured memory_bytes: 18832
import math

results = []
while True:
    line = raw_input()
    if line == '0 0 0':
        for r in results:
            print r
        break
    else:
        t = [int(n) for n in line.split()]
        t.sort()
        size = math.sqrt(t[0] * t[0] + t[1] * t[1])
        entry = input()
        for i in range(entry):
            if float(2 * input()) > size:
                results.append('OK')
            else:
                results.append('NA')

Measured memory_bytes: 5648
#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll A,B,N;
int main(){
    cin>>A>>B>>N;
    if(N%B==0){
        cout<<(N-1)*A/B-A*((N-1)/B)<<endl;
        return 0;
    }
    cout<<max((N/B*B-1)*A/B-A*((N/B*B-1)/B),N*A/B-A*(N/B))<<endl;


    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define dbg(x) cout << #x << ": " << (x) << '\n'
#define ff first
#define ss second
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
const ll mod = 1e9 + 7;

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

   int n, k;
   cin >> n >> k;
   vector <int> a(n + 1);
   vector <vector <ll>> dp(n + 1, vector <ll> (k + 1));
   for (int i = 1; i <= n; i++) {
      cin >> a[i];
   }

   dp[0][0] = 1;
   for (int i = 1; i <= n; i++) {
      dp[i][0] = dp[i - 1][0];
      for (int j = 1; j <= k; j++) {
         dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
         if (j > a[i])
            dp[i][j] = (dp[i][j] - dp[i - 1][j - a[i] - 1] + mod) % mod;
      }
   }

   cout << dp[n][k] << '\n';

   return 0;
}

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

int main() {
  int sx, sy, tx, ty; cin >> sx >> sy >> tx >> ty;
  int dx = tx - sx, dy = ty - sy;
  cout << string(dx, 'R') << string(dy, 'U') << string(dx, 'L') << string(dy, 'D');
  cout << 'L' << string(dy + 1, 'U') << string(dx + 1, 'R') << 'D';
  cout << 'R' << string(dy + 1, 'D') << string(dx + 1, 'L') << 'U';
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
n=int(input())
s=input()
cnt=0
r=s.count("R")
g=s.count("G")
b=s.count("B")

ans=r*g*b

for i in range(n):
    for j in range(n):
        if s[i]!=s[j]:
            if j-i<=n//2:
                if i<j:
                    d=j-i
                    k=j+d
                    if k<n:
                        if s[k]!=s[j] and s[i]!=s[k]:
                            ans-=1
                        

      
print(ans)
        

Measured memory_bytes: 68092
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int main () {
	int n;
	int len;
	char c[5];
	cin>>c+1;
	len=strlen(c);
        len=len-1;
       // printf("%d",len);
	if(len==2) {
		for(int i=1;i<=2;i++) {
			printf("%c",c[i]);
		}
	}
	else {
		for(int i=3;i>=1;i--) {
			printf("%c",c[i]);
		}
	}
	return 0;

}

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

pair<ll,ll> dp[402][402];
ll arr[402];




int main(){
    int N;
    cin>>N;
    memset(dp,0,sizeof(dp));
    for(int i=1;i<=N;i++){  //one based indexing
        cin>>arr[i];
    }
    //base case all diagonal elements are zero
    int i=1,j=1;
    while(i<=N and j<=N){
        dp[i][j]=make_pair(arr[i],0);
        i++;
        j++;
    }
    
    //need to traverse diagonally
    int row=1,col=2;
    int cl=2;
    ll total_cost=0;
    int record=0;
    while(cl<=N){
        row=1;
        col=cl;
        while(row<=N and col<=N){
            pair<ll,ll> min_cost=make_pair(LLONG_MAX,LLONG_MAX);
            ll tot=LLONG_MAX;
            for(int k=row;k<col;k++){
                ll cost=dp[row][k].first+dp[k+1][col].first;
                if(cost<min_cost.first){
                    
                    min_cost.first=cost;
                    min_cost.second=min_cost.first+dp[row][k].second+dp[k+1][col].second;
                }
                if(cost==min_cost.first){
                    ll tot_1=min_cost.first+dp[row][k].second+dp[k+1][col].second;
                    min_cost.second=min(min_cost.second,tot_1);
                }
            }
            dp[row][col]=min_cost;
            row++;col++;
        }
        cl++;
    }
    /*for(int i=1;i<=N;i++){
        for(int j=1;j<=N;j++){
            cout<<'('<<dp[i][j].first<<" "<<dp[i][j].second<<")"<<" ";
        }
        cout<<"\n";
    }*/
    cout<<dp[1][N].second;
}


Measured memory_bytes: 2816
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
vector<vector<array<int,2>>> g;
vector<int> cost;
void dfs(int src,int parent,int travel_cost)
{
    cost[src]=travel_cost;
    for(auto i:g[src])
    {
        if(i[0]==parent)continue;
        dfs(i[0],src,travel_cost+i[1]);
    }
}
int32_t main()
{
     int n;
     cin>>n;
     g=vector<vector<array<int,2>>>(n);
     for(int i=1;i<n;i++)
     {
         int x,y,z;
         cin>>x>>y>>z;
         x--;
         y--;
         g[x].push_back({y,z});
         g[y].push_back({x,z});
     } 
   
     cost=vector<int>(n,0);

      int q,k;
      cin>>q>>k;
      k--;

      dfs(k,-1,0);
      
      for(int i=1;i<=q;i++)
      {
          int x,y;
          cin>>x>>y;
          x--;
          y--;
          cout<<cost[x]+cost[y]<<endl;
      }


  


    return 0;
}

Measured memory_bytes: 15612
n,m=map(int,input().split())
ab=[[0]*2 for _ in range(m)]
for i in range(m):
  a,b=map(int,input().split())
  ab[i][0],ab[i][1]=b,a
ab.sort()
cnt=0
chk=0
for b,a in ab:
  if chk<=a:
    cnt+=1
    chk=b
print(cnt)

Measured memory_bytes: 21876
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
    int N,K;
    cin >> N >> K;

    vector<int> a(N);
    long long sum_=0;

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

    long long ans=0;
    long long black=sum_;
    long long white=sum_;
    for(int i=0; i<N; i++){
        black+=min(0,a[i]);
        white-=max(0,a[i]);
        if(i<K-1)continue;
        else if(i==K-1){
            ans=max({ans,black,white});
            continue;
        }
        
        black-=min(0,a[i-K]);
        white+=max(0,a[i-K]);

        ans=max({ans,black,white});
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int d,t,s;
	cin>>d>>t>>s;
	if((t*s)>=d){
		cout<<"Yes"<<"\n";
	}else{
		cout<<"No"<<"\n";
	}




	
	
		


	
	return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define debug(...) cerr<<__LINE__<<" ["<<#__VA_ARGS__<<"]:",debug_out(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec)
{ for (auto v : vec) os << v << ' '; os << '\n'; return os; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa)
{ os << '(' << pa.first << ',' << pa.second << ')'; return os; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T)
{ cerr << " " << H; debug_out(T...); }
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; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

void solve() {
    int r;
    cin >> r;
    cout << 3 * r * r << endl;
}

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


Measured memory_bytes: 3636
#include <vector> 
#include <list> 
 #include <map>
 #include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

//conversion
//------------------------------------------
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();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << '=' << (x) << endl;
#define debug(x) cerr << #x << '=' << (x) << '('<<'L' << __LINE__ << ')' << ' ' << __FILE__ << endl;


int N;
multiset<LL, std::greater<LL> > As;

int main(){
    cin>>N;

    REP(i,N){
        LL a;
        cin>>a;
        As.insert(a);
    }

    
	// for (auto it1 = As.begin(); it1 != As.end(); ++it1) {
    //     std::cerr << *it1 << " num:"<<As.count(*it1)<<"  ";
	// }
	// std::cerr << std::endl;

    LL a=0,b=0;
    for (auto it1 = As.begin(); it1 != As.end(); ++it1) {
        if(As.count(*it1)>=2){
            a=*it1;
            auto it=As.find(a);
            As.erase(it);
            it=As.find(a);
            As.erase(it);
            // As.erase(a);
            break;
        }
        // else if(As.count(*it1)>=4){
        //     a=*it1;
        //     cout<<a*a<<endl;
        //     exit(0);
        // }
    }
    
    // for (auto it1 = As.begin(); it1 != As.end(); ++it1) {
    //     std::cerr << *it1 << " num:"<<As.count(*it1)<<"  ";
	// }
	// std::cerr << std::endl;


    for (auto it1 = As.begin(); it1 != As.end(); ++it1) {
        if(As.count(*it1)>=2){
            b=*it1;
            // auto it=As.find(a);
            // As.erase(it);
            // it=As.find(a);
            // As.erase(a);
            break;
        }
	}
    cout<<a*b<<endl;

}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
#define con continue
#define bk break
#define LL long long
#define db double
#define pt cout<<'\n'
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
int inf=2147483647;const long long ll =9223372036854775807,ninf=1000000000;const double eps = 1e-6; const long long nll =223372036854775807;
#define sz size()
#define len(X) strlen(X)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ULL unsigned long long
#define de cout<<"test"<<endl;
#define st system("pause");
#define M_PI 3.1415926
int vis[100005]={};
    int a;
  char A[100005]={};
int main()
{
while(cin>>a){
    cin>>A+1;
    int ok=0;
for(int i=1;i<=2&&!ok;i++){
    for(int j=1;j<=2&&!ok;j++){
            ms(vis,0);
        vis[1]=i;
        vis[2]=j;
        for(int k=2;k<=a;k++){
                int r=k+1;
                    if(r>a)
                    r=1;

            if(A[k]=='o'){
                if(vis[k-1]==1){
                        if(vis[k]==1){
                    vis[r]=1;
                    }
                    else{
                        vis[r]=2;
                    }
                }

              else  if(vis[k-1]==2){
                   if(vis[k]==1){
                    vis[r]=2;
                   }
                   else{
                    vis[r]=1;
                   }
                }
            }
            else if(A[k]=='x'){

                 if(vis[k-1]==1){
                        if(vis[k]==1){
                    vis[r]=2;
                        }
                        else{
                            vis[r]=1;
                        }
                }

             else   if(vis[k-1]==2){
                        if(vis[k]==1){
                    vis[r]=1;
                        }
                        else{
                            vis[r]=2;
                        }
                }

            }
        }
        int flag=0;
        if(vis[1]==1){
            if(A[1]=='o'){
                if(vis[2]==vis[a])
                    flag=1;
            }
            else{
                if(vis[2]!=vis[a])
                    flag=1;
            }
        }
        else{
            if(A[1]=='o'){
                  if(vis[2]!=vis[a])
                    flag=1;
            }
            else{
                   if(vis[2]==vis[a])
                    flag=1;
            }
        }
        if(vis[1]==i&&flag){
            ok=1;
            bk;
        }
    }
}

    if(!ok){
        cout<<-1<<endl;
    }

else{
    for(int i=1;i<=a;i++){
        if(vis[i]==1){
            cout<<"S";
        }
        else if(vis[i]==2){
            cout<<"W";
        }
    }
    pt;
}

}

    return 0;
}


Measured memory_bytes: 768
n=int(input())
inn = input()
# inn = input.lower()
output = []
for character in inn:
    number = ord(character) - 96
    output.append(number)
import numpy as np
x=np.array(output)
a=x+n
num2alpha = lambda c: chr(c+96)
y=[]
for i in range(len(a)):
	if a[i]>=-5:
		a[i]-=26
	# a[i]=num2alpha(int(a[i]))
	y.append(chr(int(a[i])+96))
# print(output)
print(''.join(map(str, y)))



Measured memory_bytes: 13632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,m;cin>>n>>m;
  ll a[n];
  ll ko[m+1];
  ll ko2[m+1];
  ll wa[m+1];
  fill(ko,ko+m+1,0);
  fill(wa,wa+m+1,0);
  fill(ko2,ko2+m+1,0);
  for(ll i=0;i<n;i++){
    cin>>a[i];
    if(i<n-1){
      ko2[a[i]]++;
    }
    if(i>0){
      ko[a[i]]++;
    }
    if(i>0){
      wa[a[i]]+=(a[i]-a[i-1]+m)%m-1;
    }
  }
  ll ans[m+1];
  fill(ans,ans+m+1,0);
  ll cnt=0;
  for(ll i=1;i<n;i++){
    if(a[i]<a[i-1]){
      cnt++;
      ans[1]+=a[i];
    }
    else{
      ans[1]+=a[i]-a[i-1];
    }
  }
  for(ll i=2;i<=m;i++){
    //cout<<cnt<<endl;
    ans[i]=ans[i-1];
    ans[i]+=wa[i-1];
    cnt-=ko[i-1];
    ans[i]-=cnt;
    cnt+=ko2[i-1];
  }
  ll anss=ans[1];
  for(ll i=2;i<=m;i++)anss=min(anss,ans[i]);
  cout<<anss<<endl;
  //for(ll i=1;i<=m;i++)cout<<ans[i]<<" ";
}
        
      

Measured memory_bytes: 4096
#include <stdio.h>

int main(){
	int A,B,C;
	
	scanf("%d%d%d",&A,&B,&C);
		if(A == B && A != C){
			printf("Yes");
		}
		else if(B == C && B != A ){
			printf("Yes");
		}
		else if(C == A && C != B){
			printf("Yes");
		}
		else{
			printf("No");
		}
	return 0;
}

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

int main(){
    map<int, int> mp;
    rep(i,6){
        int a; cin >> a;
            
        mp[a]++;
    }
    for(auto i : mp){
        if(i.second >= 3){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;

}


Measured memory_bytes: 256