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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);
  long long K;
  scanf("%lld", &K);
  std::vector<long long> h(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &h[i]);
  }

  ll ans = 0;
  for (ll val : h) {
    if (val >= K) ans++;
  }

  put(ans);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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;
}

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}


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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  while(1){
    int h,w;
    cin >> h >> w;
    if(w==0) return 0;
    vector<int> x(21,0),y(21,0);
    int c;
    for(int i=0;i<h;i++){
      cin >> c;
      y[c]++;
    }
    for(int i=0;i<w;i++){
      cin >> c;
      x[c]++;
    }
    int ans=0;
    for(int i=1;i<=20;i++){
      ans+=i*max(x[i],y[i]);
    }
    cout << ans << endl;
  }
  return 0;
}



Measured memory_bytes: 3072
#include<bits/stdc++.h>
using namespace std;
int mod=1e9+7;
int dp[1005][1005];
char arr[1005][1005];
 
int main()
{
	int h,w;
	scanf("%d%d",&h,&w);
	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			scanf(" %c",&arr[i][j]);
	if(arr[0][0]=='*' || arr[h-1][w-1]=='*')
		printf("0\n");
	else
	{
		dp[0][0]=1;
		for(int i=0;i<h;i++)
		{
			for(int j=0;j<w;j++)
			{
				if(arr[i][j]=='.')
				{
					dp[i+1][j]+=dp[i][j];
					dp[i+1][j]=dp[i+1][j]%mod;
				}
				if(arr[i][j]=='.')
				{
					dp[i][j+1]+=dp[i][j];
					dp[i][j+1]=dp[i][j+1]%mod;
				}
			}
		}
		printf("%d\n",dp[h-1][w-1]);
	}
}


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

int main(void)
{
	string s1, s2, s3, ans = "";
	cin >> s1 >> s2 >> s3;

	ans += toupper(s1[0]);
	ans += toupper(s2[0]);
	ans += toupper(s3[0]);
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int x[] = new int[N];
    int ans = 0;
    for(int i=0;i<N;i++){
      x[i] = sc.nextInt();
    }
    for(int i=0;i<N;i++){
      int hoge = K-x[i];
      if(2*x[i] < 2*hoge){
        ans += 2*x[i];
      }else{
        ans += 2*hoge;
      }
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 21844
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <functional>
#include <stack>
#include <utility>
#include <map>
#include <queue>
#include <set>
#include <array>
#include <climits>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const ll MOD = 10e9 + 7;
const ll INF = LLONG_MAX;
const ll MAX_V = 10e3;
const double EPS = 10e-6;
const double PI = 3.14159265359;

//int dx[] = { 0,1,0,-1 }, dy[] = { 1,0,-1,0 };
//int d[] = {0,1,0,-1};
//int nx = x + d[i];
//int ny = y + d[(i+1)%4]

int ipow(int a, int x) {
	int res = 1;
	for (int i = 0; i < x; i++)res *= a;
	return res;
}

int main() {
	int a, b, c, ans;
	cin >> a >> b >> c;
	ans = min(a + b, min(b + c, c + a));
	cout << ans << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int n,k;
int a[125252];

int main(){
  scanf("%d%d",&n,&k);
  REP(i,n)scanf("%d",a+i);
  printf("%d\n",(n-1+k-2)/(k-1));
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define X first
#define Y second
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;


template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int mod =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}
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;
}

ll RS(ll N,ll P,ll M){
    if(P==0){
        return 1;
    }else{
        if(P%2==0){
            ll t=RS(N,P/2,M);
            return t*t%M;
        }else{
            return N*RS(N,P-1,M)%M;
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N=in();
    void COMint();
    vector<int> x(N);
    vector<int> y(N);
    REP(i,N)cin>>x[i]>>y[i];
    double ans=0;
    int p=1;
    REP1(i,N){
        p*=i;
    }
    REP(i,N)REP(j,N){
        if(i==j)continue;
        double l;
        l=(x[i]-x[j])*(x[i]-x[j]);
        l+=(y[i]-y[j])*(y[i]-y[j]);
        ans+=sqrt(l)*p/N;
    }
    ans/=p;
    Sp(ans);
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
    int a, b, c;
    int tmp1, tmp2;
    scanf("%d%d%d", &a,&b,&c);
    tmp1 = a;
    a = b;
    b = tmp1;
    tmp2 = a;
    a = c;
    c = tmp2;
    printf("%d %d %d",a,b,c);
}

Measured memory_bytes: 128
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残さない
//数値計算 基本はdouble
//map<キー,値> p は辞書。p[キー] = 値
//絶対値 abs()
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// Nの桁数
ll dig(ll N) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= 10;
	}
	return dig;
}
// x,yの最大公約数
ll gcd(ll x, ll y) {
	ll r;
	while (x%y) {
		r = x % y;
		x = y;
		y = r;
	}
	return y;
}

int main() {
	int N, T; 
	cin >> N >> T;
	vector<int> c(N), t(N);
	rep(i, N) cin >> c[i] >> t[i];

	int mi = 10000;
	rep(i, N) {
		if (t[i] <= T && mi > c[i])mi = c[i];
	}

	if (mi == 10000) cout << "TLE" << endl;
	else cout << mi << endl;
}

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

S = input()

for i in range(1, len(S)):
    # 必要な部分の切り出し
    str1 = S[:len(S)-i]
    # 文字数が奇数ならそもそも論外
    if len(str1) % 2 != 0:
        continue
    # 前半部分と後半部分の比較
    tmp = len(str1)/2
    if str1[:len(str1)//2] == str1[len(str1)//2:]:
        print(len(str1))
        exit()

Measured memory_bytes: 3060
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
	static final long MOD=1000000007;//998244353;
	public static void main(String[] args) {
		PrintWriter out = new PrintWriter(System.out);
		InputReader sc=new InputReader(System.in);
		char[] cs=sc.next().toCharArray();
		int ans=0;
		int max=0;
		for (int i = 0; i < cs.length; i++) {
			if (cs[i]=='S') {
				max=Math.max(max, ans);
				ans=0;
			}else {
				ans++;
			}
		}
		System.out.println(Math.max(ans, max));
 	}
	static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
 
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}


Measured memory_bytes: 32540
#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector<vector<int>> mat;
//typedef unsigned int uint;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int N;
double P[3010];
double dp[2][3010];

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

	cin >> N;
	rep(i, 0, N)
	{
		cin >> P[i];
	}
	
	int cur = 1;
	dp[0][0] = 1.0;

	rep(i, 0, N)
	{
		rep(j, 0, N)dp[cur][j] = 0.0;
		rep(j, 0, i + 1)
		{
			dp[cur][j] += dp[cur ^ 1][j] * (1 - P[i]);
			dp[cur][j + 1] += dp[cur ^ 1][j] * P[i];
		}
		cur ^= 1;
	}

	double ans = 0.0;
	rep(i, N / 2 + 1, N + 1)
	{
		ans += dp[cur ^ 1][i];
	}

	printf("%.10lf", ans);

	return 0;
}

Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		int[] a=sc.Ia;
		Array.Sort(a);

		Console.WriteLine("{0}",a[n/2]-a[n/2-1],a[n/2]);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}


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

using namespace std;
 
#define int long long
#define ll long long
#define vi vector <int>
#define vii vector <pair<int,int> >
#define rep(i,a,b) for (int i=a;i<b;i++)
#define repD(i,a,b) for (int i=a;i>b;i--)
#define pb push_back
#define pii pair <int,int>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define MOD 1000000007
#define PI 3.14159265359
 
#define deb(x) {x}
#ifndef local
	#define deb(x) ;
#endif
///----------------------------------------------------------------------------------
 
int n;

void solve()
{
cin>>n;cout<<(3*n*n);
}

signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
 
    #ifdef local
    ///freopen("input.txt","r",stdin);
    ///freopen("output.txt","w",stdout);
    clock_t qwertyuiop = clock();
    #endif
 
 
    int t=1;
   // cin>>t;
    
    rep(a,0,t)
    {
        ///cout<<"Case #"<<a+1<<": ";
        solve();
    }
    #ifdef local
	{qwertyuiop = clock() - qwertyuiop;double time_taken = ((double)qwertyuiop)/CLOCKS_PER_SEC;cerr<<fixed<<setprecision(5)<<"\n\nTime Taken : "<<time_taken<<" seconds\n";}
	#endif
}

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

int main() {
	string s;
	cin >> s;
	s[5] = ' ';
	s[13] = ' ';
	cout << s;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり

6文字目と14文字目を' 'に置き換えれば解決
*/

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

int main() {
  int H, W;
  cin >> H >> W;
  string C[H];
  for (int i=0; i<H; i++)
    cin >> C[i];
  for (int i=0; i<H; i++) {
    cout << C[i] << endl;
    cout << C[i] << endl;
  }
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> s(n);
  for(int i=0; i<n; i++) cin >> s[i];
  int ans=10000000;
  
  for(int i=-100; i<=100; i++){
    int total=0;
    for(int y : s){
      total += (y-i)*(y-i);
    }
    ans=min(total,ans);
  }
  cout << ans << endl;
}

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

void fnInput(vector<int>& rvnSort)
{
  int nMaxSiz;
  cin >> nMaxSiz;

  rvnSort.resize(nMaxSiz);
  for (int i = 0; i < nMaxSiz; i++)
    cin >> rvnSort[i];
} 

void fnTrace(const vector<int>& cnrvnSort)
{
  for (int i = 0; i < cnrvnSort.size(); i++)
  {
    if (i) cout << " ";
    cout << cnrvnSort[i];
  }
  cout << endl;
}

void fnInsertionSort(vector<int>& rvnSort)
{
  for (int nxing = 1; nxing < rvnSort.size(); nxing++)
  {
    int nTrg = rvnSort[nxing];
    int nxed = nxing - 1;

    while (nxed >= 0          &&
           nTrg  < rvnSort[nxed])
    {
      rvnSort[nxed + 1] = rvnSort[nxed];
      nxed--;
    }
    rvnSort[nxed + 1] = nTrg;
    fnTrace(rvnSort);
  }
}

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

  vector<int> vnSort;

  fnInput(vnSort);
  fnTrace(vnSort);
  fnInsertionSort(vnSort);

  return 0;
}



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

#include <atcoder/mincostflow>
using namespace atcoder;


void solve(long long N, long long K, std::vector<std::vector<long long>> A){
    // 0..N-1: rows
    // N..2N-1: cols
    // 2N: s
    // 2N+1: t
    mcf_graph<long long, long long> g(2*N+2);
    int s_index = 2 * N;
    int t_index = 2 * N + 1;

    // サンプルより。「K以下」だから選ばなくても OK と。
    // we can "waste" the flow
    g.add_edge(s_index, t_index, N * K, 1e9);

    for (int i = 0; i < N; i++) {
        int row_index = i;
        g.add_edge(s_index, row_index, K, 0);
        for (int j = 0; j < N; j++) {
            int col_index = N + j;
            if (i == 0) {
                g.add_edge(col_index, t_index, K, 0);
            }
            g.add_edge(row_index, col_index, 1, 1e9 - A[i][j]);
        }
    }
    auto p = g.flow(s_index, t_index, N * K);
    long long cap = p.first;
    long long cost = p.second;
    long long result = N * K * (long long)1e9 - cost;
    cout << result << endl;

    vector<string> result_map(N, string(N, '.'));
    for (auto e: g.edges()) {
        if (e.from != s_index && e.to != t_index && e.flow != 0) {
            result_map[e.from][e.to - N] = 'X';
        }
    }
    for (int i = 0; i < N; i++) {
        cout << result_map[i] << endl;
    }
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<std::vector<long long>> A(N, std::vector<long long>(N));
    for(int i = 0 ; i < N ; i++){
        for(int j = 0 ; j < N ; j++){
            scanf("%lld",&A[i][j]);
        }
    }
    solve(N, K, std::move(A));
    return 0;
}


Measured memory_bytes: 3992
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

double L;

void solve() {
	cin >> L;
	cout << (L * L * L / 27) << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
#define INF 1000000
#define NIL -1
#define WHITE 0
#define GRAY 1
#define BLACK 2


int n;
int M[100][100];

void dkr(){
  int d[100];
  int color[100];
  int min,u;
  int i,v;

  for(i=0;i<n;i++){
    d[i] = INF;
    color[i] = WHITE;
  }

  d[0] = 0;
  color[0] = GRAY;

  while(1){
    min = INF;
    u = NIL;
    for(i=0;i<n;i++){
      if(color[i] != BLACK && d[i] < min){
        min = d[i];
        u = i;
      }
    }

    if(u == NIL)break;
    color[u] = BLACK;

    for(v=0;v<n;v++){
      if(color[v] != BLACK && M[u][v] != INF){
        if(d[u] + M[u][v] < d[v]){
          d[v] = d[u] + M[u][v];
          color[v] = GRAY;
        }
      }
    }
  }

  for(i=0;i<n;i++){
    printf("%d %d\n",i,(d[i] == INF? -1 : d[i]));
  }
}

int main(){
  int k,u,c,v;
  int i,j;


  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      M[i][j] = INF;
    }
  }

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

  dkr();

  return 0;
}

Measured memory_bytes: 636
N = int(input())
A = [[] for i in range(N)]
for i in range(N):
  n = int(input())
  for _ in range(n):
    x, y = map(int, input().split())
    A[i].append((x - 1, y))

ans = 0
for i in range(1 << N):
  ok = True
  cnt = 0
  for j in range(N):
    if (i >> j & 1) == 1:
      cnt += 1
  for j in range(N):
    if (i >> j & 1) == 1:
      for x, y in A[j]:
        if y == 0:
          if (i >> x & 1) == 1:
            ok = False
        elif y == 1:
          if (i >> x & 1) == 0:
            ok = False
  if ok:
    ans = max(ans, cnt)

print(ans)


Measured memory_bytes: 44252
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		String str = sc.nextLine();
		int [] h = new int [n];
		int [] f = new int [n];
		for (int i=0; i<n; i++) {
			h[i] = sc.nextInt();
		}
		str = sc.nextLine();
		for (int i=0; i<m; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			if (h[a-1]>h[b-1]) {
				f[b-1]=1;
			} else if (h[a-1]<h[b-1]) {
				f[a-1]=1;
			} else {
				f[b-1]=1;
				f[a-1]=1;
			}
			str = sc.nextLine();
		}
		sc.close();
		int ans = 0;
		for (int i=0; i<n; i++) {
			if (f[i] == 0) ans+=1;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 50796
#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(0)
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
typedef long long ll;
#define pri(n) printf("%d\n",n)
#define lpri(n) printf("%lld\n",n);
#define rep(i,st,ed) for(int i=st;i<ed;i++)
#define var(n) int n; scn(n)
#define F first
#define S second 
#define pb push_back
const int N=1e5+5;
// const ll M = 998244353;
const ll M=1e9+7;
const ll inf=1e18;


int main()
{
	var(n);
	int a[n];
	ll dp[n][n],pre[n];
	memset(dp,0,sizeof(dp));
	rep(i,0,n)
	{
		scn(a[i]);
		pre[i]=a[i];
		if(i)
			pre[i]+=pre[i-1];
	}
	for(int len = 2;len<=n;len++)
	{
		for(int i=0;i<=n-len;i++)
		{
			int j=i+len-1;
			ll val = inf;
			for(int k=i+1;k<=j;k++)
			{
				ll left = pre[k-1];
				ll right = pre[j]-pre[k-1];
				if(i)
					left-=pre[i-1];
				ll res = left+right+dp[i][k-1]+dp[k][j];
				if(res<val)
				{
					val = res;
				}
			}			
			dp[i][j]=val;
		}
	}
	// for(int i=0;i<n;i++)
	// {
	// 	for(int j=0;j<n;j++)
	// 		printf("%lld ",dp[i][j]);
	// 	printf("\n");
	// }
	lpri(dp[0][n-1]);
}

Measured memory_bytes: 1536
def is_prime(n):
    if n == 1: return False
    i = 2
    while i**2 <= n:
        if n % i == 0: return False
        i += 1
    return True


n = int(input())
ans = 0

for _ in range(n):
    if is_prime(int(input())):
        ans += 1

print(ans)



Measured memory_bytes: 5612
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

int dp[3010][3010];
int main() {
    int N, T; cin >> N >> T;
    vector< pair<int, int> > items;
    for(int i=0; i<N; i++) {
        int A, B; cin >> A >> B;
        items.emplace_back(A, B);
    }
    sort(items.begin(), items.end());

    fill(dp[0], dp[N+1], -1);
    dp[0][0] = 0;
    for(int i=0; i<N; i++) {
        int A, B; tie(A, B) = items[i];
        for(int j=0; j<T; j++) {
            if(dp[i][j] < 0) continue;
            // 何もしない
            chmax(dp[i+1][j], dp[i][j]);

            // 食べる (終わりの時間は T と min とる)
            chmax(dp[i+1][min(T, j+A)], dp[i][j] + B);
        }
    }

    int ans = 0;
    for(int i=0; i<=N; i++) ans = max(ans, *max_element(dp[i], dp[i] + T + 1));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 35584
#include<bits/stdc++.h>
using namespace std;
#define m make_pair
#define I int
#define t first
#define u second
pair<I,I>x[1<<17],y[1<<17];I i,n,p[1<<17],s;
pair<I,pair<I,I>>G[2<<17];
I f(I a){return p[a]^a?p[a]=f(p[a]):a;}
main()
{
	for(cin>>n;i++<n;x[i].u=y[i].u=p[i]=i)cin>>x[i].t>>y[i].t;
	sort(x+1,x+n+1),sort(y+1,y+n+1);
	for(i=0;++i<n;)
	{
		G[i*2-1] = m(abs(x[i].t-x[i+1].t),m(x[i].u,x[i+1].u));
		G[i*2] = m(abs(y[i].t-y[i+1].t),m(y[i].u,y[i+1].u));
	}
	sort(G+1,G+n*2-1);
	for(i=0;++i<2*n-1;)
	{
		I x=G[i].u.t,y=G[i].u.u;
		if(f(x)^f(y))
		{
			s+=G[i].t;
			p[f(x)]=f(y);
		}
	}
	cout<<s<<endl;
}

Measured memory_bytes: 6144
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int n;
    string s, t;
    cin >> n >> s >> t;

    rep(i, n) {
        for (int j = i; j < n; j++) {
            bool ok = true;
            rep(k, n-j) {
                //printf("(i, j) = (%d, %d): s[j]=%c, t[k]=%c\n", j,k,s[j],s[k]);
                if (s[j+k] != t[k]) ok = false;
            }
            if (ok) {
                cout << n + j << endl;
                return 0;
            }
        }
    }
    cout << 2*n << endl;
}


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

from collections import defaultdict

def main():
  n = int(input())
  la = list(map(int, input().strip().split()))
  q = int(input())
  counts = defaultdict(int)
  for a in la:
    counts[a] += 1
  s = sum(la)
  for _ in range(q):
    b, c = map(int, input().strip().split())
    s -= b * counts[b]
    s += c * counts[b]
    print(s)
    
    counts[c] += counts[b]
    counts[b] = 0
    

if __name__=='__main__':
  main()



Measured memory_bytes: 24068
/**********************************************
*   UPDATE CONDITION & OVERFLOW CONDITION     *
**********************************************/

#include<bits/stdc++.h>
using namespace std;

#define pi 3.1415926535
#define endl "\n"
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define ll long long
#define llu unsigned long long
#define pb push_back
#define mp make_pair
#define tc int t; cin>>t; while(t--)
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n-1 ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define get(a,n) f(i,0,n) cin >> a[i];
#define show(a,n) f(i,0,n) cout << a[i] << " "; cout << endl;
#define fast ios:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const long long int inf64 = 1e18;
const int mod = inf + 7;
const int N = 2e5 + 10;

int main()
{
    fast;
    int x, y;
    cin >> x >> y;
    if(4*x < y || 2*x > y)
    {
        cout << "No";
        return 0;
    }
    if(y&1)
    {
        cout << "No";
        return 0;
    }
    else
        cout << "Yes";
}



Measured memory_bytes: 3612
#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	int answer;
	if (N <= 104) answer = 0;
	else if (N <= 134) answer = 1;
	else if (N <= 164) answer = 2;
	else if (N <= 188) answer = 3;
	else if (N <= 194) answer = 4;
	else answer = 5;
	cout << answer << '\n';
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }
        public void Solve(ConsoleInput cin)
        {
            // 解答はココに書く
            // 入力
            var n = cin.ReadInt;
            var p = cin.ReadIntArray(n);
            int count = 0;
            int max = 0;
            int min = 0;
            for (int i = 1;i < n - 1; i++)
            {
                max = Max(p[i - 1], p[i + 1]);
                min = Min(p[i - 1], p[i + 1]);
                if (p[i] < max && p[i] > min) count += 1;
            }
            WriteLine(count);
        }  
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

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

int main(){
    int t;
    cin >> t;
    int p[t];
    for(int i=0;i<t;i++){
        cin >> p[i];
    }
    sort(p,p+t);
    int ans=0;
    for(int i=0;i<t-1;i++){
        ans+=p[i];
    }
    cout << ans+p[t-1]/2 << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
/* clang-format on */

int main() {
  int D;
  while (cin >> D) {
    cout << "Christmas";
    for (int i = 0; i < 25 - D; i++) {
      cout << " Eve";
    }
    cout << endl;
  }
  return 0;
}


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

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;
}
struct Unionfind {
    vector<int> par;

    Unionfind(int n) : par(n) {
        for(int i = 0; i < n; ++i) par[i] = i;
    }

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

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if(rx == ry) return;
        par[rx] =ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

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

    string s;
    int q;
    cin >> s >> q;

    deque<char> dq;
    for(char c : s) {
        dq.emplace_back(c);
    }
    bool flip = false;

    rep(i, q) {
        int ti;
        cin >> ti;
        if(ti == 1) flip = !flip;
        else {
            int fi;
            char ci;
            cin >> fi >> ci;
            if(flip) fi = 3 - fi;

            if(fi == 1) dq.emplace_front(ci);
            if(fi == 2) dq.emplace_back(ci);
        }
    }

    if(flip) reverse(dq.begin(), dq.end());
    string ans;
    for(char c : dq) ans += c;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4244
#include <iostream>

using namespace std;
/** Problem0118 : Property Distribution **/
char in[100][100];
int H, W, ans;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void dfs(int x, int y)
{
	char c = in[x][y];
	in[x][y] = ' ';
	
	for (int i=0; i<4; i++) {
		int nx = x+dx[i], ny = y+dy[i];
		if (0<=nx && nx<W && 0<=ny && ny<H && c == in[nx][ny])
			dfs(nx, ny);
	}
}

int main()
{
	while (cin >> H >> W, H!=0 && W!=0) {
		ans=0;
		for (int y=0; y<H; y++) {
			for (int x=0; x<W; x++) {
				cin >> in[x][y];
			}
		}
		
		for (int y=0; y<H; y++) {
			for (int x=0; x<W; x++) {
				if (in[x][y] != ' ') {
					ans++;
					dfs(x, y);
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

/*
a_iをいじっていって同じ整数がいくつあるか
a_iは10^5のレンジなので、先にXを決めればよい？
Xはa_iのmin-maxを探索すれば十分っぽい。Xがmax+1、min-1の場合が求めるケースにはならない。
これだとO(N^2)で間に合わないっぽいな…。

やっぱり間に合わなかった。
map or vectorを用意して、A[i]を見たとき、A[i]がカウントされるのはX=A[i]-1 or A[i] or A[i]+1のとき、というふうに見ていってから、
maxを取れば良い？
*/

// int solve(vector<int> A, int x) {
//     // A[i] - xが-1以上１以下ならばカウント
//     int res = 0;
//     for (int i = 0; i < A.size(); i++)
//     {
//         int diff_i = abs(A[i] - x);
//         if (diff_i == 0 || diff_i == 1)
//             res++;
//     }
//     return res;
// }

// int main() {
//     int N;
//     cin >> N;

//     vector<int> A(N);
//     int minv = 100000000, maxv = -1;
//     for (int i = 0; i < N; i++)
//     {
//         cin >> A[i];
//         minv = min(minv, A[i]);
//         maxv = max(maxv, A[i]);
//     }

//     int res = 0;
//     for (int x = minv; x <= maxv; x++)
//     {
//         res = max(res, solve(A, x));
//     }

//     cout << res << endl;
// }

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

    map<int, int> X;
    for (int i = 0; i < N; i++)
    {
        X[A[i] - 1]++;
        X[A[i]]++;
        X[A[i] + 1]++;
    }

    int maxv = 0;
    for (auto x = X.begin(); x != X.end(); x++)
    {
        maxv = max(x->second, maxv);
    }
    cout << maxv << endl;
}

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

int main(){
	double w,h,x,y;
	cin>>w>>h>>x>>y;	
	double ans=w*h/2;
	cout<<ans<<" ";
	if(x==w/2 && y==h/2){
		cout<<1<<endl;
	}else{
		cout<<0<<endl;
	}
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e16+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define eb(x) emplace_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

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

    ll n,m,x,y;
    cin>>n>>m>>x>>y;

    ll xmax=-150;
    rep(i,n){
        ll tmp;
        cin>>tmp;
        chmax(xmax,tmp);
    }
    ll ymin=INF;
    rep(i,m){
        ll tmp;
        cin>>tmp;
        chmin(ymin,tmp);
    }

    bool nowar = false;

    REP(i,x+1,y+1){
        if(i>xmax&&i<=ymin){
            nowar = true;
            break;
        }
    }
    if(nowar){
        cout<<"No War"<<endl;
    }else{
        cout<<"War"<<endl;
    }
    return  0;
}


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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) {is >> x;} return is;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

  ll a, b;
  cin >> a >> b;
  if(b%a == 0) cout << a + b << endl;
  else cout << b - a << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template<class T> bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b){if(a<b) {a = b; return true;} return false;}
#define all(x) (x).begin(),(x).end()
#define debug(x)  cerr << #x << " = " << (x) << endl;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,Q;
    cin >> N >> Q;
    ll ans = (N-2)*(N-2);
    vec<int> valrow(N,-1),valcol(N,-1);
    int r = N-1,c = N-1;
    while(Q--){
        int t,x;
        cin >> t >> x;
        x--;
        if(t==1){
            if(valcol[x]!=-1) ans -= valcol[x];
            else{
                ans -= r-1;
                for(int i=x+1;i<c;i++) valcol[i] = r-1;
                c = x;
            }
        }else{
            if(valrow[x]!=-1) ans -= valrow[x];
            else{
                ans -= c-1;
                for(int i=x+1;i<r;i++) valrow[i] = c-1;
                r = x;
            }
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 4776
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    ll x;
    cin>>x;
    ll sum=100,ans=0;
    while(x>sum){
        sum+=sum/100;
        ++ans;
    }
    cout<<ans;
}


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

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);
    ll n,m,x,s = 0;
    cin>>n>>m;
    while(m--)
    {
        cin>>x;
        s+=x;
    }
    if(n-s<0)
        cout<<-1<<endl;
    else
        cout<<n-s<<endl;
    return 0;
}


Measured memory_bytes: 3644
#include <iostream>
using namespace std;
int main() {
    int S;
    cin >> S;
    int h, m, s;
    h = S / 3600;
    m = (S % 3600) / 60;
    s = (S % 3600) % 60;
    cout << h << ":" << m << ":" << s << endl;
    return 0;
}


Measured memory_bytes: 3100