akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000000007
int main(){
    int H,W;
    cin>>H>>W;
    char a[H][W];
    for(int i=0;i<H;i++){
        cin>>a[i];
    }
    for(int k=0;k<W;k++){
        int count=0;
        for(int i=0;i<H;i++){

            if(a[i][k]=='.' or a[i][k]=='p')count++;

        }
        if(count==H){
            for(int i=0;i<H;i++){
                a[i][k]='p';
            }
        }
    }
    for(int k=0;k<H;k++){
        int count=0;
        for(int i=0;i<W;i++){

            if(a[k][i]=='.' or a[k][i]=='p')count++;

        }
        if(count==W){
            for(int i=0;i<W;i++){
                a[k][i]='p';
            }
        }
    }

    for(int i=0;i<H;i++){
        int count2=0;
        for(int k=0;k<W;k++){
            if(a[i][k]!='p'){
                cout<<a[i][k];
                count2++;
            }
        }
        if(count2>0)cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int ans = K / 2;
    if((K & 1) == 1) {
        ans = ans * (ans + 1);
    } else {
        ans = ans * ans;
    }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define MOD (int) (1e9+7)
#define INF (int) 2e9
#define LLINF (ll) 2e18

int main(){
    string s;
    cin >> s;
    rep(i, s.size()){
        cout << "x";
    }
    cout << endl;
    // printf("%d\n", N);
    return 0;
}

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

int main(){
    int n; cin >> n;
    int dp[50];
    dp[0] = 1; dp[1] = 1;
    for(int i = 0; i <= n; i++){
        if(i >= 2)dp[i] = dp[i - 1] + dp[i - 2];
    }
    cout << dp[n] << endl;
}


Measured memory_bytes: 3088
import string
N=int(input())
S=list(str(input()))

Alphabet_List=list(string.ascii_uppercase)
Alphabet_List.extend(2*Alphabet_List)

for i in range(len(S)):
    for j in range(len(Alphabet_List)):
        if S[i]==Alphabet_List[j]:
            S[i]=Alphabet_List[j+N]
            break
            
print(("").join(S))

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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            string tmp = Console.ReadLine();
            var s = new List<int>();

            for(var i=0;i<tmp.Length; i++)
            {
                s.Add(int.Parse(tmp[i].ToString()));
            }
            int a=0;//101010
            int b=0;//010101

            for (int i=0; i<s.Count; i++)
            {
                int judge = i % 2;
                if (s[i] == judge)
                {
                    a += 1;
                }
                else
                {
                    b += 1;
                }
                }
            
            if(a>b)
            {
                wr.wri(b);
            }
            else
            {
                wr.wri(a);
            }
        }
    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }
}


Measured memory_bytes: 14432
#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>

#define fir first
#define sec second
#define get(n) scanf("%d",&n);
#define gets(s) string s;cin >> (s);
#define All(s) (c).begin(), (c).end()
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

int N;
string S;

void input() {
    cin >> N ;
    cin >> S;
}

void solve(){
    input();
    if (1 == N%2) {
        cout << "No" << endl;
        return ;
    }
    int a = N / 2;
    int j=0;
    for (int i=0;i<a;i++){
        if(S[i] == S[i+a]){
            j++;
        }
    }
    if(j==a)cout << "Yes" << endl;
    else cout << "No" << endl;
    return ;
}

int main (){
    solve();
    return 0;
}

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

int main() {
  string S;
  cin >> S;
  int n = S.size();
  
  string answer = "Yes";
  for(int i = 0; i < (n - 1) / 2; i++){
    if(S.at(i) != S.at(n - 1 - i)){
      answer = "No";
      break;
    }
  }
  if(((n - 1) / 2) % 2 == 1){
    for(int i = 0; i < (n - 3) / 4; i++){
      if(S.at(i) != S.at(((n - 3) / 2) - i)){
        answer = "No";
        break;
      }
    }
    for(int i = (n + 1) / 2; i < (3 * n - 1) / 4; i++){
      if(S.at(i) != S.at(((3 * n - 1) / 2) - i)){
        answer = "No";
        break;
      }
    }
  }
  
  else{
    for(int i = 0; i < (n - 1) / 4; i++){
      if(S.at(i) != S.at(((n - 3) / 2) - i)){
        answer = "No";
        break;
      }
    }
    for(int i = (n + 1) / 2; i < (3 * n + 1) / 4; i++){
      if(S.at(i) != S.at(((3 * n - 1) / 2) - i)){
        answer = "No";
        break;
      }
    }
  
}
  cout << answer << endl;
}
    

Measured memory_bytes: 256
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n+1-i):
    if 10000*i+5000*j+1000*(n-i-j)==y and n-i-j>=0:
      print(i,j,n-i-j)
      sys.exit()
print(-1,-1,-1)

Measured memory_bytes: 40812
#include <stdio.h>

int main (){
	
	int n,c=0 ;
	scanf ("%d",&n);
	while (n>= 500){
		n-=500;
		c+=1000;
	}
		while (n>= 5){
		n-=5;
		c+=5;
	}
	printf ("%d",c);
	return 0 ;
}


Measured memory_bytes: 128
import java.awt.geom.Point2D;
import java.util.*;

public class Main {
	String str;
	int pos;
	char [] data;
	int ind;
	int ansindex;
	boolean flg;
	
	private String exp(){
		StringBuilder res = new StringBuilder(term());
		char word = str.charAt(pos);
		while(!(word == ')' || word == '#')){
			res.append(term());
			if(flg) break;
			word = str.charAt(pos);
		}
		return res.toString();
	}
	
	private String term(){
		if(flg) return "A";
		String res = fact();
		char input = res.charAt(0);
		if(Character.isDigit(input)){
			int times = Integer.parseInt(res);
			String word = fact();
			StringBuilder res2 = new StringBuilder(word);
			if(flg) return res2.toString();
			for(int i=1; i < times; i++){
				res2.append(word);
				for(int j=0; j < word.length();j++){
					data[ind++] = word.charAt(j);
					if(ind == ansindex + 1){
						flg = true;
						break;
					}
				}
				if(flg) break;
			}
			return res2.toString();
		}
		else{
			return res;
		}
	}
	
	private String fact(){
		if(flg) return "A";
		if(Character.isDigit(str.charAt(pos))){
			StringBuilder t = new StringBuilder(""+str.charAt(pos++)) ;
			while(Character.isDigit(str.charAt(pos))){
				t.append("" +(str.charAt(pos++)));
			}
			return t.toString();
		}
		else if(str.charAt(pos) == '('){
			pos++;
			String res = exp();
			pos++;
			return res;
		}
		else{
			String res = "" + str.charAt(pos++);
			data[ind++] = res.charAt(0);
			if(ind == ansindex + 1) flg = true;
			return res;
		}
	}
	
	private void doit(){
		Scanner sc = new Scanner (System.in);
		while(true){
			str = sc.next();
			ansindex = sc.nextInt();
			if(str.equals("0") && ansindex == 0) break;
			data = new char[ansindex + 1];
			str += "#";
			pos = 0;
			ind = 0;
			flg = false;
			String result = exp();
			if(data[ansindex] == '\u0000'){
				System.out.println(0);
				continue;
			}
			System.out.println(data[ansindex]);
		}
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 23000
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
typedef long long ll;

using namespace std;


int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    for(int i=0;i<S.size();i++){
        S[i] = S[i] + N;
        if(S[i] > 'Z'){
            S[i] -= 26;
        }
    }
    cout << S << endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array
#define int long long 
#define F(i,a,b) for(i=a;i<b;++i)
#define RF(i,b,a) for(i=b;i>=a;--i) 
#define NL cout<<"\n";

typedef long long ll;
typedef long double ld;
const ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll powm(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

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

int dp[3000][3000];
int ans=0;
int cards[51];



void solve()
{
   int i,n,a,j;
   cin>>n>>a;
   
   ans=0;
   F(i,0,n)
   {
   	cin>>cards[i];
   }
   
   dp[0][0]=1;
   
  // dp[i][j] -->no. of  subsets of size j having sum i 
    for(i=0;i<n;++i){
    	for(j=n;j>=1;--j){
    		for(int sum=2500;sum>=cards[i];--sum){
    			dp[sum][j]+=dp[sum-cards[i]][j-1];
    		}
    	}
    }
    for(i=1;i<=n;++i){
    	ans+=dp[i*a][i];
    }
    cout<<ans;
    
}


signed main()     
{
	fast;
	int t=1;
//	cin>>t;
	while(t--)
	{
		solve();
	}

}



Measured memory_bytes: 14512
import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val s = sc.next()
  val c = s.toCharArray()

  if (c.groupBy { it }.keys.size == 1) {
    println(0)
    return
  }

  var r = 0
  for (ci in c) {
    if (ci == 'R') r++
  }

  var ans = 0
  for (i in 0 until r) {
    if (c[i] == 'W') ans++
  }

  println(ans)



}

Measured memory_bytes: 45196
#include <stdio.h>

int main(){
	int n,x,count;
	while(true){
		scanf("%d %d",&n,&x);
		if(n == 0 && x == 0) break;
		count = 0;
		for(int min = 1; min < x/3 && min <= n-2;min++){
			for(int middle = min+1;middle < x - (min+middle) && middle <= n-1; middle++){
				if(x-(min+middle) <= n) count++;
			}
		}
		printf("%d\n",count);
	}

}



Measured memory_bytes: 2688
#include <iostream>
#include <algorithm>
using namespace std;
int N, W;
int dp[105][10005] = { 0 };
int v[105] = { 0 }, w[105] = { 0 };
int main() {
	cin >> N >> W;
	for (int i = 1; i <= N; i++) {
		cin >> v[i] >> w[i];
	}

	for (int i = 1; i <= N; i++) {
		for (int j = 0; j <= W; j++) {
			if ((j - w[i])>=0) {
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i]);
			}
			else {
				dp[i][j] = dp[i - 1][j];
			}
		}
	}
	cout << dp[N][W] << endl;
	return 0;
}


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


void solve(long long a, long long b, long long h){
    cout <<  ((a+b)*h)/2 << endl;
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastIO std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0)
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
const int INF = 0x3f3f3f3f;
//int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

const int maxn = 2e5 + 10; 

int main()
{
	fastIO;
	ll n,k;
	cin >> n >> k;
	ll ans = n % k;
	if(ans > k - ans) ans = k - ans;
 	cout << ans << endl;	
	return 0;
}

Measured memory_bytes: 256
var
	N,i,id,sz,asz,t:Longint;
	pa,x,ans:Array[1..1000]of Longint;
	dp:Array[1..1000]of int64;
	cum:Array[0..1]of int64;
	cumpa:Array[0..1]of Longint;
begin
	read(N);
	for i:=1 to N do begin
		read(dp[i]);
		pa[i]:=0;
		if cum[i mod 2]>0 then begin
			inc(dp[i],cum[i mod 2]);
			pa[i]:=cumpa[i mod 2];
		end;
		if dp[i]>cum[i mod 2]then begin
			cum[i mod 2]:=dp[i];
			cumpa[i mod 2]:=i;
		end;
	end;
	id:=1;
	for i:=2 to N do if dp[i]>dp[id]then id:=i;
	writeln(dp[id]);
	while id>0 do begin
		inc(sz);
		x[sz]:=id;
		id:=pa[id];
	end;
	for i:=N downto x[1]+1 do begin
		inc(asz);
		ans[asz]:=i;
	end;
	for i:=2 to sz do begin
		t:=(x[i-1]-x[i])div 2;
		while t>0 do begin
			inc(asz);
			ans[asz]:=x[i]+t;
			dec(t);
		end;
	end;
	for i:=1 to x[sz]-1 do begin
		inc(asz);
		ans[asz]:=1;
	end;
	writeln(asz);
	for i:=1 to asz do writeln(ans[i]);
end.

Measured memory_bytes: 128
#include<cstdio>
#include<algorithm>
using namespace std;

#define INF (1<<29)

int m;
int graph[2][101][101];

void wa(int num){

  for(int i=1;i<=m;i++){
    for(int j=1;j<=m;j++){
      for(int k=1;k<=m;k++){
	graph[num][j][k] = min(graph[num][j][k],graph[num][j][i]+graph[num][i][k]);
      }
    }
  }
  
}

int main(){
  int n,a,b,c,d,k;
  
  while(scanf("%d %d",&n,&m),n!=0&&m!=0){
    
    fill_n(**graph,2*101*101,INF);
    for(int i=1;i<=m;i++){
      graph[0][i][i] = 0;
      graph[1][i][i] = 0;
    }
    
    for(int i=0;i<n;i++){
      scanf("%d %d %d %d",&a,&b,&c,&d);
      graph[0][a][b] = c;
      graph[0][b][a] = c;
      graph[1][a][b] = d;
      graph[1][b][a] = d;
    }
    
    wa(0);
    wa(1);
    
    scanf("%d",&k);
    for(int i=0;i<k;i++){
      scanf("%d %d %d",&a,&b,&c);
      printf("%d\n",graph[c][a][b]);
    }
    
  }
  return(0);
}



Measured memory_bytes: 2784
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

template<class Z> map<Z, int> factorize(Z n) {
  map<Z, int> res;
  for (Z i = 2; i * i <= n; ++i) while (n % i == 0) ++res[i], n /= i;
  if (n != 1) ++res[n];
  return res;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  V<> a(n); for (auto&& e : a) cin >> e;
  set<int> se;
  for (int e : a) for (const auto& f : factorize(e)) {
    se.insert(f.first);
  }
  lint res = 0;
  for (int d : se) {
    lint curr = 0;
    for (int e : a) if (e % d == 0) {
      curr += e;
    }
    res = max(res, curr);
  }
  cout << res << '\n';
}


Measured memory_bytes: 3272
#include<stdio.h>
#include<string.h>
int main()
{
	char s[30];
	scanf("%s",s);
	int t=0;
	int n=strlen(s);
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			if(s[i]==s[j]&&i!=j){
				t=1;break;
			}
	if(t==0) printf("yes");
	else printf("no");
}

Measured memory_bytes: 128
#include<iostream>
#include<string>

using namespace std;

bool isPal(string s,int start,int stop)
{
    while(s[start]==s[stop])
    {
        start++;stop--;
    }
    return (start==stop || start>stop);
}

int main()
{
    bool ans;
    string s;
    cin>>s;
    int n = s.length();
    ans= isPal(s,0,n-1) && isPal(s,0,(n-3)/2) && isPal(s,(n+1)/2,n-1);

    cout<<(ans?"Yes":"No");
    return 0;
}


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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

// n回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;  // 2次元配列
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;
template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;

int dp[100010];  // dp[i] : 局面の状態。勝ちなら 1
/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    // cout << fixed << setprecision(15);

    int n,k; cin >> n >> k;
    vi a(n); rep(i,n) cin >> a[i];

    // 石の残数0 すなわち最後の局面から考えていく。
    for(int i = 0; i <= k; ++i) {
        
        // 石の残数 i から遷移できる局面の中に負け状態があれば、それを選べば自分は勝てる
        for(int j = 0; j < n; ++j) {
            if(i-a[j] >= 0 && dp[i-a[j]] == 0) dp[i] = 1;
        }
    }
    cout << (dp[k] ? "First" : "Second") << '\n';
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.141592653589793
using namespace std;



int main() {
//    cout << setprecision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin >> n;
    cout << 180 * (n - 2);

}



Measured memory_bytes: 256
#define lp(i,n) for(int i=0;i<n;i++)
#define pau system("pause")
#include<bits/stdc++.h>

using namespace std;
int main() {
    string s;
    cin>>s;
    lp(i,3){
        if(s[i]==s[i+1]){
            cout<<"Bad"<<endl;
            return 0;
        }
    }
    cout<<"Good"<<endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ in >> p.first >> p.second; return in; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> as(3); cin >> as;
    sort(as.begin(), as.end());
    int mini = M;
    do{
        mini = min(mini, abs(as[0] - as[1]) + abs(as[1] - as[2]));
    }while(next_permutation(as.begin(), as.end()));
    cout << mini << '\n';
}


Measured memory_bytes: 256
object Main {
  def main(args: Array[String]) {
    val s = io.StdIn.readLine().split(" ")
    val a = s map (i => Integer.parseInt(i))
    println("a %s b".format(if (a(0)==a(1)) "==" else if (a(0)>a(1)) ">" else "<"))
  }
}

Measured memory_bytes: 43732
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/math/common_factor.hpp>

#define rep_ui(k,n)      for(ui  i = (k); i < (n); ++i)
#define rep_si(k,n)      for(int i = (k); i < (n); ++i)
#define rep_ul(k,n)      for(ul  i = (k); i < (n); ++i)
#define rep_sl(k,n)      for(ll  i = (k); i < (n); ++i)
#define rep_ui_down(k,n) for(ui  i = (k); i > (n); --i)
#define rep_si_down(k,n) for(int i = (k); i > (n); --i)
#define rep_ul_down(k,n) for(ul  i = (k); i > (n); --i)
#define rep_sl_down(k,n) for(ll  i = (k); i > (n); --i)

#define rep_uj(k,n)      for(ui  j = (k); j < (n); ++j)
#define rep_sj(k,n)      for(int j = (k); j < (n); ++j)
#define rep_uj_down(k,n) for(ui  j = (k); j > (n); --j)
#define rep_sj_down(k,n) for(int j = (k); j > (n); --j)

#define rep(k,n)         rep_ui(k,n)

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

template<class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vc)
{
#ifdef BOOST_RANGE_ALGORITHM_FOR_EACH_HPP_INCLUDED
  boost::for_each(vc, [&os](T value) {
#else
  std::for_each(vc.begin(), vc.end(), [&os](T value) {
#endif
    os << value << '\n';
    });
  return os;
}

template<class T1, class T2>
inline
std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p)
{
  return os << p.first << ' ' << p.second;
}

void solve(void)
{
  using std::string;
  using std::vector;
  using std::map;
  using std::pair;
  using std::cin;
  //string S{}; std::cin >> S;
  ui N{}; cin >> N;

  vector<ull> A(N);
  rep(0, N) cin >> A[i];

  vector<pair<ull, ull>> G(N);
  G[0].first = 0;
  G[N - 1].second = 0;
  rep(1, N)
    G[i].first = boost::math::gcd(G[i - 1].first, A[i - 1]);
  rep_si_down(N - 2, -1)
    G[i].second = boost::math::gcd(G[i + 1].second, A[i + 1]);

  ull ans{};
  rep(0, N)
    ans = std::max(ans, boost::math::gcd(G[i].first, G[i].second));

  using std::cout;
  cout << ans << '\n';
  return;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>
using namespace std;

/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

/*---  Type ---*/
typedef long long ll;

/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// Util
int max(int a, int b, int c) {return max(a, max(b, c));}
int min(int a, int b, int c) {return min(a, min(b, c));}
ll max(ll x, ll y) {return x > y ? x : y;}
ll min(ll x, ll y) {return x < y ? x : y;}
ll max(ll a, ll b, ll c) {return max(a, max(b, c));}
ll min(ll a, ll b, ll c) {return min(a, min(b, c));}

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



int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  cout << s1[0] << s2[1] << s3[2] << endl;

  return 0;
}

Measured memory_bytes: 256
x = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
for i in range(x, x + 10000):
  f = factorization(i)
  if len(f) == 1 and f[0][1] == 1:
    print(i)
    exit()

Measured memory_bytes: 9304
#include <algorithm>
#include <cstdio>
const int N = 300050;
int A[N];
int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  if (a + b > n + 1 || (long long)a * b < n) return puts("-1") & 0;
  for (int i = 0; i < n; ++i) A[i] = i;
  std::reverse(A, A + b);
  int m = n - b, j = a - 1, i = b;
  while (j) {
    int t = m / j;
    std::reverse(A + i, A + i + t);
    m -= t; i += t; --j;
  }
  for (int i = 0; i < n; ++i) printf("%d ", A[i] + 1);
  return 0;
}


Measured memory_bytes: 3328
//Robs Code

/***********HEADER***************/
#include <iostream>
#include <bitset>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <list>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <iomanip>

/***********MACROS***************/
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define endl "\n"
#define pb push_back
#define _1 first
#define _2 second
#define pii pair<int,int>

using namespace std;

const int N = 1e5 + 1;
int n,m,i,j,k,l,x,y,z,cnt[3],sum[3];

/***********MAIN**************/
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	cin >> k;
	string s;
	cin >> s;
	if(s.length() > k){
		cout << s.substr(0,k) << "...";
	}else{
		cout << s;
	}
}
//.........

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

int main(void)
{
  vector<char> output;
  string s,res;

  cin>>s;

  for(int i=0;i<3;i++)
  {
    output.push_back(s[i]);
  }

  sort(output.begin(),output.end());

  for(int i=0;i<3;i++)
  {
    res+=output[i];
  }

  if(res =="abc")
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>

using namespace std;
typedef long long ll;

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

int main() {

    ll N;
    cin >> N;
    map<ll,ll> mp;
    vector<ll> v;
    rep(i,N){
        ll a;
        cin >> a;
        if(mp.count(a)) mp[a]++;
        else{
            mp.emplace(a,1);
            v.push_back(a);
        }
    }
    ll M = v.size();
    ll out = 0;
    rep(i,M){
        if(mp[v[i]]>=v[i]) out += mp[v[i]]-v[i];
        else out += mp[v[i]];
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 7028
//
//  main.cpp
//  ProgrammingContestChallengeBook2
//
//  Created by Hisaki Kobayashi on 2020/04/04.
//  Copyright © 2020 Hisaki Kobayashi. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <string>
#include <bits/stdc++.h>
#include <stdlib.h>
//#include "mylibrary.hpp"



using namespace std;


int main(){
    int N;
    cin >> N;
    
    int sho,amari;
    sho = N/2;
    amari = N%2;
    
    cout << sho+amari << endl;
    
    return 0;
 
}


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

#define faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define sq(x)   (x)*(x)
#define PI      acos(-1.0)
#define nl      '\n'

typedef long long int ll;
typedef unsigned long long int  llu;

int main()
{
    faster
	string s,ans;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='?')
		{
			ans+='D';
		}
		else ans+=s[i];
	}
	cout<<ans<<nl;
	return 0;
}


Measured memory_bytes: 3824
#include "bits/stdc++.h"
using namespace std;
#define SQ(x) ((x) * (x))
typedef long long ll;
typedef pair<int, int> pii;

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define debug(x) cout << #x << ": " << x << endl
#define ALL(x) (x).begin(),(x).end()

const int INF = 1e9;
const ll LINF = 1e16;

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int s;
	int i;
	double x1, x2, x3;
	double y1, y2, y3;
	double a, b, c, d, e, f;
	double l, m, n;

	cin >> s;
	for (i = 0; i < s; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		a = (x1 - x2);
		b = (y1 - y2);
		c = -1 * (SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2));
		d = (x1 - x3);
		e = (y1 - y3);
		f = -1 * (SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3));

		l = (c * e - b * f) / (e * a - b * d);
		m = (d * c - a * f) / (d * b - e * a);

		n = -1 * (SQ(x1) + SQ(y1) + l * x1 + m * y1);

		printf("%.3f %.3f %.3f\n", l / -2.0, m / -2.0, sqrt(SQ(l) + SQ(m) - 4 * n) / 2.0);
	}

	return (0);
}

Measured memory_bytes: 3172
#include <stdio.h>

int main()
{
	char w[101];
	scanf("%s", w);
	
	int i, flag = 1, parity[26] = {};
	for (i = 0; w[i] != 0; i++) parity[w[i] - 'a'] ^= 1;
	for (i = 0; i < 26; i++) if (parity[i] == 1) flag = 0;
	
	if (flag == 1) printf("Yes\n");
	else printf("No\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define mkp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
int main()
{
	int a,b,k;
	cin>>k>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(i%k == 0)
		{
			cout<<"OK\n";
			return 0;
		}
	}
	cout<<"NG\n";
	return 0; 
}

Measured memory_bytes: 3636
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D_fix
# CreatedDate:  2020-08-30 14:54:11 +0900
# LastModified: 2020-08-30 15:07:52 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    H = int(input())
    mul = 0
    while H != 1:
        mul += 1
        H //= 2
    print(2**(mul+1)-1)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9156
import java.util.Scanner;

public class Main {

  static final long MOD = 1_000_000_007;

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    long answer = 0;
    long[] array = new long[k + 1];
    for (int i = k; i >= 1; i--) {
      array[i] = myPow((long) k / i, n);
      for(int i2 = i * 2; i2 <= k; i2 += i){
        array[i] = (array[i] - array[i2]) % MOD;
      }
    }
    for (int i = 1; i <= k; i++) {
      long add = (array[i] * (long) i ) % MOD;
      answer = (answer + add) % MOD;
    }
    System.out.println(answer);
  }

  static long myPow(long x, int n) {
    long answer = 1l;
    while (n > 0) {
      if ((n & 1) == 1) {
        answer = answer * x % MOD;
      }
      x = x * x % MOD;
      n >>= 1;
    }
    return answer;
  }
}

Measured memory_bytes: 36576
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner stdIn = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String A = br.readLine();
        char[] B = A.toCharArray();
         
         
        for(int i = 0; i < B.length; i++) {
            if(Character.isLowerCase(B[i])) {
                B[i] = Character.toUpperCase(B[i]);
            }
            else if (Character.isUpperCase(B[i])) {
                B[i] = Character.toLowerCase(B[i]);
            }
        }
         
        A = new String(B);
         
        System.out.println(A);
    }
}


Measured memory_bytes: 26220
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y[100],z[100],a=0,b=0;
    for(int i=0;i<10;i++){
            scanf("%d",&z[i]);
    }
    for(int i=0;i<10;i++){
            scanf("%d",&y[i]);
    }
    sort(z,z+10);
    reverse(z,z+10);
    sort(y,y+10);
    reverse(y,y+10);

    for(int i=0;i<3;i++){
        a=a+z[i];
        b=b+y[i];
    }

    cout<<a<<' '<<b<<endl;
}

Measured memory_bytes: 3180
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

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

bool paint(VI &c, VVI &es, int s, int p, int color) {
    if (c[s] == 0) c[s] = color;
    else if (c[s] == color) return true;
    else return false;

    for (auto &&dst: es[s]) {
        if (dst == p) continue;
        if (!paint(c,es,dst,s,-color)) return false;
    }
    return true;
}

void solve() {
    int n;
    cin >> n;
    VS s(n);
    REP(i,0,n) cin >> s[i];
    VI c(n);
    VVI es(n);
    REP(i,0,n) {
        REP(j,0,n) {
            if (s[i][j] == '1') es[i].push_back(j);
        }
    }
    if (!paint(c,es,0,-1,1)) {
        cout << -1 << endl;
        return;
    }
    //dump("ok");
    VVI d(n,VI(n,10000));

    REP(i,0,n) REP(j,0,n) {
        if (i == j) d[i][j] = 0;
        else if (s[i][j] == '1') d[i][j] = 1;
        else d[i][j] = 1 << 10;
    }

    REP(k,0,n) REP(i,0,n) REP(j,0,n) {
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    }
    int ans = 0;
    REP(i,0,n) REP(j,0,n) ans = max(ans, d[i][j]);
    /*
    REP(i,0,n) {
        REP(j,0,n) cout << d[i][j] << " ";
        cout << endl;
    }
    */
    cout << ans + 1 << endl;
}

int main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 640
// eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
#define mod7 1000000007LL
#define INF  1023456789LL
#define INF16 10000000000000000LL
#define eps 1e-9
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define debug(...) printf(__VA_ARGS__)
#else 
#define debug(...)
#endif
inline LL getint(){
  LL _x=0,_tmp=1; char _tc=getchar();    
  while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
  if( _tc == '-' ) _tc=getchar() , _tmp = -1;
  while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
  return _x*_tmp;
}
inline LL add( LL _x , LL _y , LL _mod = mod7 ){
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline LL sub( LL _x , LL _y , LL _mod = mod7 ){
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline LL mul( LL _x , LL _y , LL _mod = mod7 ){
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
LL mypow( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 1LL;
  LL _ret = mypow( mul( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = mul( _ret , _a , _mod );
  return _ret;
}
LL mymul( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 0LL;
  LL _ret = mymul( add( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = add( _ret , _a , _mod );
  return _ret;
}
inline bool equal( D _x ,  D _y ){
  return _x > _y - eps && _x < _y + eps;
}
#define Bye exit(0)
int __ = 1 , _cs;
/*********default*********/
#define N 303030
void build(){

}
LL n , a[ N ];
void init(){
  n = getint();
  for( LL i = 1 ; i <= 3 * n ; i ++ )
    a[ i ] = getint();
}
LL bst[ N ];
void solve(){
  priority_queue<LL> heap;
  LL sum = 0;
  for( int i = 3 * n ; i > 2 * n ; i -- ){
    sum += a[ i ];
    heap.push( a[ i ] );
  }
  bst[ n + n + 1 ] = sum;
  for( int i = 2 * n ; i > n ; i -- ){
    sum += a[ i ];
    heap.push( a[ i ] );
    while( (int)heap.size() > n ){
      sum -= heap.top();
      heap.pop();
    }
    bst[ i ] = sum;
  }
  LL ans = -INF16;
  while( heap.size() ) heap.pop();
  sum = 0;
  for( int i = 1 ; i < n ; i ++ ){
    sum += a[ i ];
    heap.push( -a[ i ] );
  }
  for( int i = n ; i <= n + n ; i ++ ){
    sum += a[ i ];
    heap.push( -a[ i ] );
    while( (int)heap.size() > n ){
      sum += heap.top();
      heap.pop();
    }
    ans = max( ans , sum - bst[ i + 1 ] );
  }
  cout << ans << endl;
}
int main(){
  build();
  //__ = getint();
  while( __ -- ){
    init();
    solve();
  }
}


Measured memory_bytes: 4596
import sys

#+++++
		
def main():
	a=int(input())
	for i in range(1,10):
		for j in range(1,10):
			if i*j==a:
				return 'Yes'
	return 'No'
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 3060
n=int(input())
ar = []
for i in range(n):
    a = input()
    ar.append(a)
dic = {}

for i in range(n):
    if ar[i] not in dic:
        dic[ar[i]]=1
    else:
        dic[ar[i]]+=1

highest = max(dic.values())
ans = []

for keys in dic.keys():
    if dic[keys] == highest:
        ans.append(keys)

ans = sorted(ans)
for i in ans:
    print(i)

Measured memory_bytes: 38584
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int n,k;cin>>n>>k;
  vector<int> a(n+1);
  for(int i=1;i<=n;i++)
    cin>>a[i];
  vector<bool> vis(n+1);
  int m=1,c=0;
  while(!vis[m])
  {
    c++;
    vis[m]=true;
    m=a[m];
  }
  if(k<=c)
  {
  	m=1;
  	while(k>0)
	  {
	    m=a[m];
	    k--;
	  }
  }
  else
  {
  	k-=c;
  	c=0;
  	vector<bool> vis1(n+1);
  	while(!vis1[m])
	  {
	    c++;
	    vis1[m]=true;
	    m=a[m];
	  }
	k%=c;
	while(k>0)
	  {
	    m=a[m];
	    k--;
	  }
  }
  cout<<m<<endl;
  return 0;
}

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

int main() {
  int s1s2s3, s2s3, s3;
  cin >> s1s2s3;
  s2s3 = s1s2s3 % 100;
  s3 = s2s3 % 10;
  cout << s1s2s3 / 100 + s2s3 / 10 + s3 << endl;
}

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

using namespace std;

struct Team {
	int id, univ, ac, pen;
	Team(int id, int univ, int ac, int pen) : id(id), univ(univ), ac(ac), pen(pen){}
	Team(){}
	bool operator < (const Team x) const {
		if (ac != x.ac) return (ac < x.ac);
		if (pen != x.pen) return (pen > x.pen);
		return (id > x.id);
	}
};

int main()
{
	int n;

	while (scanf("%d", &n) && n){
		Team teams[512];
		for (int i = 0; i < n; i++){
			scanf("%d %d %d %d", &teams[i].id, &teams[i].univ, &teams[i].ac, &teams[i].pen);
		}

		sort(teams, teams + n);
		reverse(teams, teams + n);

		int sel = 0;
		int uCount[1024];
		memset(uCount, 0, sizeof(uCount));

		for (int i = 0; i < n; i++){
			if (sel < 10 && uCount[teams[i].univ] < 3){
				printf("%d\n", teams[i].id); uCount[teams[i].univ]++; sel++;
			}
			else if (sel < 20 && uCount[teams[i].univ] < 2){
				printf("%d\n", teams[i].id); uCount[teams[i].univ]++; sel++;
			}
			else if (sel < 26 && uCount[teams[i].univ] < 1){
				printf("%d\n", teams[i].id); uCount[teams[i].univ]++; sel++;
			}
		}
	}

	return (0);
}

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

int main(void){
    int H, W;
    std::cin >> H >> W;
    std::vector<std::vector<char>> grid(H, std::vector<char>(W));
    std::vector<int> ignore_col, ignore_raw;
    for (int i = 0; i < H; ++i){
        bool flg = true;
        std::string S;
        std::cin >> S;
        for (int j = 0; j < W; ++j){
            grid[i][j] = S.at(j);
            if (S.at(j) == '#') flg = false;
        }
        if (flg) ignore_raw.push_back(i);
    }

    for (int i = 0; i < W; ++i){
        bool flg = true;
        for (int j = 0; j < H; ++j){
            if (grid[j][i] == '#') flg = false;
        }
        if (flg) ignore_col.push_back(i);
    }

    for (int i = 0; i < H; ++i){
        bool flg = false;
        for (int j = 0; j < W; ++j){
            if (std::find(ignore_raw.begin(), ignore_raw.end(), i) == ignore_raw.end()){
                if (std::find(ignore_col.begin(), ignore_col.end(), j) == ignore_col.end()) {
                    std::cout << grid[i][j];
                    flg = true;
                }
            }
        }
        if (flg) std::cout << std::endl;
    }

    return 0;
}


Measured memory_bytes: 3576
#include<iostream>
using namespace std;
int kiriageru(int);

int main() {
	int money = 100000;
	int n;
	cin >> n;
	
	for(int i = 0; i < n; ++i) {
		money += money / 20;
		money = kiriageru(money);
	}
	
	cout << money << endl;
}

int kiriageru(int a) {
	int ddd = a % 1000;
	return (ddd==0? (a-ddd):(a-ddd+1000));
}

Measured memory_bytes: 0
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_D main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif


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


    int N,C; cin >> N>>C;
    vi s(N), t(N), c(N);
    REP(i, N) {
        cin >> s[i] >> t[i] >> c[i];
        s[i]--; c[i]--;
    }

    const int XMAX = (int)1e5 + MGN;
    vvb x(C, vb(XMAX, false));

    REP(i,N) { 
        for(int j=s[i]; j<t[i]; j++){
            x[c[i]][j] = true;
        }
    }

    int ans = 0;
    for(int i=0; i<XMAX; i++) {
        int ch = 0;
        for(int j=0; j<C; j++) {
            if (x[j][i]) ch++;
        }
        ans = max(ans, ch);
    }

    cout << ans << endl;


    return 0;
}

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

int main() {

    int h, a, n;
    n = 0;
    cin >> h >> a;
    while(h>0){
    	h -= a;
    	n += 1;
    }
    cout << n << endl;
} 

Measured memory_bytes: 256
from sys import stdin

N, *A = map(int, stdin.read().split())

A_min = min(A)

k = 1
for i in range(int(A_min**0.5))[::-1]:
    if A_min % (i+1) != 0:
        continue
    k1, k2 = i+1, A_min//(i+1)
    if all(a % k2 == 0 for a in A):
        k = max(k, k2)
    elif all(a % k1 == 0 for a in A):
        k = max(k, k1)

print(k)

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

using namespace std;

typedef pair<int,int> ii;

vector< vector<int> > adjlist;
vector<bool> isArt;
vector<int> d, low;
int counter, root; // root >= 2 <=> Wurzel Artikulationspunkt
vector<ii> bridges; // Nur fuer Brücken.

void dfs(int v, int parent) { // Mit parent=-1 aufrufen.
  d[v] = low[v] = counter++;
  if (parent == 0) root++;
  
  for (auto w : adjlist[v]) {
    if (!d[w]) {
      dfs(w, v);
      if (low[w] >= d[v]) isArt[v] = true;
      if (low[w] > d[v]) bridges.push_back(ii(v, w));
      low[v] = min(low[v], low[w]);
    } else if (w != parent) {
      low[v] = min(low[v], d[w]);
}}}

void findArticulationPoints() {
  counter = 1; // Nicht auf 0 setzen!
  low.resize(adjlist.size());
  d.assign(adjlist.size(), 0);
  isArt.assign(adjlist.size(), false);
  bridges.clear(); //nur fuer Bruecken
  for (int v = 0; v < (int)adjlist.size(); v++) if (!d[v]) dfs(v, -1);
}

int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  adjlist.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    adjlist[a].push_back(b);
    adjlist[b].push_back(a);
  }
  findArticulationPoints();
  printf("%d\n", (int)bridges.size());
  return 0;
}


Measured memory_bytes: 256
public class Main {

  private static void solve() {
    int n = ni();
    int[] b = na(n - 1);

    int ret = b[0] + b[n - 2];
    for (int i = 0; i < n - 2; i++) {
      ret += Math.min(b[i], b[i + 1]);
    }
    System.out.println(ret);

  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}



Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}
int main() {
  string s;
  cin>>s;
  int n=s.size();
  for(int i=n-2;i>=0;i--){
    int l=i+1;
    string t=s.substr(0,l/2);
    string r=s.substr(l/2,l/2);
    if(l%2==0&&t==r){cout<<l<<endl;return 0;}
  }
  return 0;
}

Measured memory_bytes: 3580