akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#include <list>
#include <chrono>
#include <thread>

using namespace std;

//template<typename T>
//using Matrix2D = std::vector<vector<T>>;

//#define cerr


#ifndef M_PI
    const double M_PI = acos(-1.0);
#endif // M_PI

#define y1 roman_kaban
#define rank oryshych_konb
#define ull unsigned long long
#define ll long long
const int mod = int(1e9) + 7;
//const long long infLL = 1e18;
//const int MX2 = 10100500; //  e7
const int MX = 400500; //       e5

long long f[MX];
long long f1[MX];
vector<int> a[MX];

int pow_mod(long long a, int st){
    a %= mod;
    long long res = 1;
    while(st){
        if(st & 1){
            res *= a;
            res %= mod;
        }
        st >>= 1;
        a *= a;
        a %= mod;
    }
    return res;
}

int c(int n, int k){
    long long ans = f1[n - k] * f1[k];
    ans %= mod;
    ans *= f[n];
    return ans % mod;
}

void init(){
    f[0] = 1;
    for(int i = 1; i < MX; i++){
        f[i] = f[i - 1] * i;
        f[i] %= mod;
    }
    f1[MX - 1] = pow_mod(f[MX - 1], mod - 2);
    for(int i = MX - 1; i > 0; i--){
        f1[i - 1] = f1[i] * i;
        f1[i - 1] %= mod;
    }
    //cerr << f[2] <<  ' ' << f1[2] << endl;
}

int main()
{
    init();
    //freopen("/Users/ozzy/Documents/in.txt","r", stdin);
    ios_base::sync_with_stdio(false);
    int n, x, y;
    cin >> n >> x >> y;
    for(int i = 0; i < n; i++){
        int c, w;
        cin >> c >> w; c--;
        a[c].push_back(w);
    }
    long long first = mod;
    long long second = mod;
    for(int i = 0; i < n; i++){
        sort(a[i].begin(), a[i].end());
        if(a[i].size()){
            if(a[i][0] < second) second = a[i][0];
            if(second < first) swap(first, second);
        }
    }
    long long total = 0;
    long long ans = 1;
    for(int i = 0; i < n; i++){
        auto &b = a[i];
        while(b.size()){
            long long curr = first;
            if(b[0] == curr) curr = second;
            if(b[ b.size() - 1] + curr <= y) break;
            if(b[0] + b[ b.size() - 1] <= x && b[0] + curr <= y) break;
            b.pop_back();
        }
        if(b.size()){
            total += b.size();
            ans *= c(total, b.size());
            //cerr << total << ' ' << ans << endl;

            ans %= mod;
        }
    }
    //ans = pow_mod(ans, mod - 2);
    //ans *= f[total];
    cout << ans % mod << endl;

    return 0;
}


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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 1e5+5;

int mod = 2019;

int main()
{

    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ll l , r , c = 5000 , c2=5000 , tmp , ans = 1e18;
    cin >> l >> r;
    for(int i=l; i<=r; i++)
    {
        c--;
        if (!c) break;
        c2=5000;
        for(int j=i+1; j<=r; j++)
        {
            c2--;
            if (!c2) break;
            tmp = 1ll*i*j;
            ans = min(ans , tmp%mod);
        }
    }

    cout << ans << '\n';
//
    return 0;
}

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

using namespace std;

int field[100][100];

int dy[] = {-1,0,0,1};
int dx[] = {0,-1,1,0};

int m,n;

int dfs(int y,int x){
//	if(field[y][x]==0)
	//	return 0;

	int maxNum = 0;
	for(int i = 0; i < 4; i++){
		int ny = y + dy[i];
		int nx = x + dx[i];
		if(ny >= 0 && ny < n && nx >= 0 && nx < m){
			if(field[ny][nx] == 1){
				field[ny][nx] = 0;
				maxNum = max(maxNum,dfs(ny,nx)+1);
				field[ny][nx] = 1;
			}
		}
	}
	return maxNum;
}

int main(){

	while(cin >> m >> n && !(n == 0 && m == 0)){
		int maxNum = 0;
		for(int i = 0; i < n; i++)
			for(int j = 0; j < m; j++)
				cin >> field[i][j];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				if(field[i][j] == 1)
					maxNum = max(maxNum,dfs(i,j));
			}
		}
		cout << maxNum << endl;
	}

}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset
typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
//void IO(){
//	#ifndef ONLINE_JUDGE
//	    freopen("input.txt", "r", stdin);
//	    freopen("output.txt", "w", stdout);
//	#endif
//}
// end of Template

int a,b,k,c,d;
int main(){
	//IO();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>a>>b>>k;
    c = min (b, a+k-1);
    d = max (a, b+1-k);
    if(d<=c){d=c+1;}
    for(int i=a;i<=c;i++)cout<<i<<newl;
    for(int i=d;i<=b;i++)cout<<i<<newl;
}


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

using namespace std;
#define REP(i, s, n) for(signed i = (s); i < signed(n); i++)
#define rep(i, n) REP(i, 0, n)

typedef pair<int, int> P;

signed main() {
	int m, n;
	while (cin >> m && m) {
		vector<P> stars(m);
		rep(i, m) cin >> stars[i].first >> stars[i].second;

		cin >> n;
		vector<P> data(n);
		set<P> ss;
		rep(i, n) {
			int x, y; cin >> x >> y;
			P p = P(x, y);
			data[i] = p;
			ss.insert(p);
		}
		rep(i, n) {
			int dx = data[i].first - stars[0].first, dy = data[i].second - stars[0].second;
			bool ok = true;
			rep(j, m) {
				ok = ss.count(P(stars[j].first + dx, stars[j].second + dy));
				if (!ok) break;
			}

			if (ok) {
				cout << dx << " " << dy << endl;
				break;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 1256
#include <bits/stdc++.h>
#define f(i,a,b) for(i=a;i<=b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define ll long long
#define mod (1000*1000*1000+7)
#define scan1(x) scanf("%lld",&x)
#define scan2(x,y) scanf("%lld %lld",&x,&y)
#define scan3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define print(x) printf("%lld\n",x)
#define ff first
#define ss second
using namespace std;


int main(){
    ll n,i,j,k,a,b,c;
    scan1(n);
    vector<vector<ll>> dp(n+1,vector<ll>(3));
    f(i,1,n){
        scan3(a,b,c);
        if(i==1)
        dp[i][0]=a,dp[i][1]=b,dp[i][2]=c;
        else{
            dp[i][0]=max(a+dp[i-1][1],a+dp[i-1][2]);
            dp[i][1]=max(b+dp[i-1][0],b+dp[i-1][2]);
            dp[i][2]=max(c+dp[i-1][1],c+dp[i-1][0]);
        }
    }
    cout<<max({dp[n][0],dp[n][1],dp[n][2]})<<"\n";
    
}

Measured memory_bytes: 5760
// 6/22 解き直し
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main() {
    int N, K;  // 勝負回数、K回前と同じ手は出せない
    int R, S, P;  // グー、チョキ、パーの勝ち点
    cin >> N >> K >> R >> S >> P;
    string t;  // グーチョキパー：r, s, p
    cin >> t;

    vector<bool> victory(N, false);

    int ans = 0;

    for (int i = N-1; i >= 0; i--) {
        // nextから決めていく。
        int next = i + K;
        if (next < N) {
            // nextと同じで、かつnextで勝っていたら勝てない。
            if (t[i] == t[next] && victory[next]) {
                // printf("%d回目：勝てない\n", i);
                continue;
            }
        }

        // 勝てる。
        if (t[i] == 'r') ans += P;
        else if (t[i] == 's') ans += R;
        else ans += S;
        victory[i] = true;
        // printf("%d回目：勝てる\n", i);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3740
#include <iostream>

int main(){
  char b;
  char result;
  std::cin >> b;
  char code[]={'A','T','C','G'};
  for(int i=0;i<4;i++){
    if(code[i]==b) result=code[i-(i%2)+((i+1)%2)];
  }
  std::cout << result << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int a[100000][3];
int main()
{
	int f=1,i,j,n;
	cin>>n;
	for(i=0;i<=n;i++)
	{
		cin>>a[i][0]>>a[i][1]>>a[i][2];
		if(a[i][2]+a[i][1]>a[i][0]||a[i][0]%2!=(a[i][1]+a[i][2])%2) f=0;
	}
	if(f==1)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	return 0;
}

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

ll bfs(vector<vector<ll>> &adj,int n,int k)
{
    bool visit[n+1]={false}; visit[1]=true;
    ll mod=1000000007;
    ll ans=k;
    vector<ll> frontier{1};
    while(frontier.size())
    {
        vector<ll> next;
        for(auto u:frontier)
        {
            int t;
            if(u==1) t=k-1;
            else t=k-2;
            for(auto v:adj[u])
            {
                if(!visit[v])
                {
                    visit[v]=true;
                    ans=(ans*t)%mod;
                    t--;
                    next.push_back(v);
                }
            }
        }
        frontier=next;
    }
    return ans;

}

int main()
{
    ll n,i,j,k; cin>>n>>k;
    vector<vector<ll>> adj(n+1,vector<ll>());
    for(i=0;i<n-1;i++)
    {
        ll a,b; cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    cout<<bfs(adj,n,k);

}


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

int main()
{
  string buf, pat;
  cin >> buf >> pat;

  buf = buf + buf;
  if( buf.find( pat ) != string::npos ){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;


int main()
{
	int n,m,k,a,cnt[35]={},ans=0;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>a;
			cnt[a]++;
		}
	}
	for(int i=1;i<=m;i++)
	{
		if(cnt[i]==n)ans++;
	}
	cout<<ans<<endl;
	return 0;
}

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

// A[i]: S[0,i-1] longest match(pre and suf)
template <class T>
struct KMP {
  vector<int> A;
  int n;
  T s;
  KMP() {}
  KMP(T _s) {
    s = _s;
    n = s.size();
    A.assign(n + 1, -1);
    for(int i = 0, j = -1; i < n; ++i) {
      while(j >= 0 && s[i] != s[j]) j = A[j];
      ++j;
      //*
      if(i + 1 < n && s[i + 1] == s[j])
        A[i + 1] = A[j];
      else
        //*/
        A[i + 1] = j;
    }
  }
  inline const int &operator[](int k) const {
    return (A[k]);
  }
  vector<long long> calccycle() {
    vector<long long> res(n, 0);
    for(int i = 0; i < n; ++i) res[i] = i + 1 - A[i + 1];
    return res;
  }

  vector<int> search(const T &t) {
    vector<int> res;
    int tsize = t.size();
    for(int i = 0, j = 0; i + j < tsize;) {
      if(s[j] == t[i + j]) {
        if(++j != n) continue;
        res.push_back(i);
      }
      i += j - A[j];
      j = max(A[j], 0);
    }
    return res;
  }
};

int n;
vector<int> a, b, c, d, e;

void solve();

int main() {
  cin >> n;
  a.resize(n);
  for(int i = 0; i < n; ++i) cin >> a[i];
  b.resize(n);
  for(int i = 0; i < n; ++i) cin >> b[i];
  solve();
  return 0;
}

void solve() {
  for(int i = 0; i < n - 1; ++i)
    c.push_back(b[i] ^ b[i + 1]);
  for(int i = 0; i < 2 * n; ++i)
    d.push_back(a[i % n] ^ a[(i + 1) % n]);
  KMP<vector<int>> kmp(c);
  e = kmp.search(d);
  for(int i = 0; i < e.size(); ++i)
    if(e[i] < n)
      cout << e[i] << " " << (a[e[i]] ^ b[0]) << endl;
}

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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    string S;
    cin >> S;
    int n = 0;
    REP(i, S.length())
    {
        if (S[i] == 'o')
            n++;
    }

    if (n + 15 - S.length() >= 8)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

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

class BIT:
    def __init__(self, size):
        self.bit = [0] * (size + 1)
        self.size = size

    def sum(self, i):
        i += 1
        s = 0
        while i > 0:
            s += self.bit[i]
            i -= i & -i
        return s

    def add(self, i, x):
        i += 1
        while i <= self.size:
            self.bit[i] += x
            i += i & -i

n, m = map(int, input().split())
a = list(map(lambda x: int(x) - 1, input().split()))

bit0 = BIT(m)
bit1 = BIT(m)
for i in range(n-1):
    x, y = a[i], a[i+1]
    bit1.add(0, (y - x) % m)
    if (y - x) % m < 2:
        continue
    x = (x + 2) % m
    if x <= y:
        bit0.add(x, -1)
        bit1.add(x, x - 1)
        bit0.add(y + 1, 1)
        bit1.add(y + 1, -(x - 1))
    else:
        bit0.add(x, -1)
        bit1.add(x, x - 1)

        b = (0 - (x - 1)) % m
        bit0.add(0, -1)
        bit1.add(0, -b)
        bit0.add(y + 1, 1)
        bit1.add(y + 1, b)

ans = min(bit0.sum(i) * i + bit1.sum(i) for i in range(m))
print(ans)


Measured memory_bytes: 82204
#include <bits/stdc++.h>
using namespace std;
using pp=pair<int,int>;

int main() {
  int W, H, N;
  cin >> W >> H >> N;
  int mx=W, Mx=0, my=H, My=0;
  int x, y, a;
  for (int i=0; i<N; i++) {
    cin >> x >> y >> a;
    if (a==1) {Mx=max(Mx, x);}
    if (a==2) {mx=min(mx, x);}
    if (a==3) {My=max(My, y);}
    if (a==4) {my=min(my, y);}
  }
  cout << max(0, mx-Mx)*max(0, my-My) << endl;
}

Measured memory_bytes: 3532
// B - Crane and Turtle
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, leg; cin>>n>>leg;
	int crane = (4*n - leg) / 2;
	int turtle = (leg - 2*n) / 2;
	puts(abs(crane)+abs(turtle)==n? "Yes":"No");
}


Measured memory_bytes: 3580
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0079
#include <iostream>
#include <cstdio>
#include <iomanip> // setprecision
#include <complex>
#include <cmath>
using namespace std;

typedef complex<double> point;

double inner_product(point x, point y) {
  return (conj(x) * y).real();
}

double outer_product(point x, point y) {
  return (conj(x) * y).imag();
}

point normalize(point a) {
  return a * (1/abs(a)); // normはabsの2乗、absは本来のノルム。
}

point projection(point a, point b) {
  point e = normalize(b);
  return e * inner_product(a, e);
}

int main() {
  point P[110];
  double x, y;
  int n;
  cin >> n;
  n = 0;
  while (scanf("%lf %lf", &x, &y) != EOF) {
    P[n++] = point(x, y);
  }
  double S = 0;
  for (int i=1; i<n-1; i++) {
    S += outer_product(P[i]-P[0], P[i+1]-P[0])/2;
  }
  cout << fixed << setprecision(1) << abs(S) << endl;
}

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

int func(int x) {
    int res=0;
    while(x%100==0) {
        x/=100;
        res++;
    }
    return res;
}

int main() {
    int d,n;
    cin>>d>>n;
    int count=0,ans=0;
    while(count<n) {
        ans++;
        if (func(ans)==d) count++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll n,k;
int main(){
	cin >> n >> k;
	if(k == 0) {
		cout << n * n << endl;
		return 0;
	}

	ll c = 0;
	FOR(b,k + 1,n) {
		if(b + k - 1 >= n) {
			continue;
		}
		ll m = n - (b + k - 1);
		ll l = m / b;
		c += l * (b - k);
		if(l * b != m) {
			c += min(m % b,b - k);
		}
	}
	c += (n - k) * (n - k + 1) / 2;
	cout << c << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cassert>
#include <queue>
using namespace std;
typedef long long ll;

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define FOREQ(i, k, n) for (int i = (k); i <= (int)(n); ++i)
#define FORIT(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)

#define SZ(v) (int)((v).size())
#define MEMSET(v, h) memset((v), (h), sizeof(v))
#define FIND(m, w) ((m).find(w) != (m).end())

struct Edge {
    int to;
    int dist;
    int cost;
    Edge() {;}
    Edge(int to, int dist, int cost) : to(to), dist(dist), cost(cost) {;}
    bool operator<(const Edge &rhs) const {
        return dist > rhs.dist;
    }
};

int n, m;
vector<Edge> edges[10010];
int dist[10010];
int cost[10010];
bool visit[10010];

int main() {
    while (scanf("%d %d", &n, &m), n|m) {
        MEMSET(dist, 0x0f);
        MEMSET(cost, 0x0f);
        MEMSET(visit, false);
        REP(i, 10010) { edges[i].clear(); }
        REP(i, m) {
            int from, to, d, c;
            scanf("%d %d %d %d", &from, &to, &d, &c);
            from--; to--;
            edges[from].push_back(Edge(to, d, c));
            edges[to].push_back(Edge(from, d, c));
        }
        priority_queue<Edge> que;
        que.push(Edge(0, 0, 0));
        dist[0] = 0;
        while (!que.empty()) {
            Edge e = que.top();
            que.pop();
            int from = e.to;
            if (dist[from] == e.dist) {
                cost[from] = min(cost[from], e.cost);
            }
            if (visit[from]) { continue; }
            visit[from] = true;
            FORIT(it, edges[from]) {
                int to = it->to;
                int ndist = e.dist + it->dist;
                int ncost = it->cost;
                if (visit[to]) { continue; }
                if (dist[to] < ndist) { continue; }
                dist[to] = ndist;
                que.push(Edge(to, ndist, ncost));
            }
        }
        int ans = 0;
        REP(i, n) { ans += cost[i]; }
        printf("%d\n", ans);
    }
}

Measured memory_bytes: 2896
#include<stdio.h>
int main()
{
    int n, k;
    char s[51] = "";
    scanf("%d %d", &n, &k);
    scanf("%s", s);

    for (size_t i = 0; i < n; i++)
    {
        if (i+1 == k)
        {
            printf("%c", s[i] + 32);
        } else {
            printf("%c", s[i]);
        }
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 128
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();

    let mut result = Vec::new();
    for i in 1..=n {
        for j in 1..=n {
            if i >= j {
                continue;
            }
            if n % 2 == 0 {
                if i + j != n + 1 {
                    result.push((i, j));
                }
            } else {
                if i + j != n {
                    result.push((i, j));
                }
            }
        }
    }

    let mut ans = String::new();
    ans.push_str(&format!("{}\n", result.len()));
    for &(i, j) in &result {
        ans.push_str(&format!("{} {}\n", i, j));
    }
    ans.trim().to_string()
}


Measured memory_bytes: 2176
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
using namespace std;

int main(){
	int n,l;
	char cmp[107];
	
	char a[107][107];
	memset(a,0,sizeof(a));
	
	cin >> n >> l;
	for(int i = 0;i < n;i++){
		for(int j = 0;j < l;j++){
			cin >> a[i][j];
		}
	}
	
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n - i - 1;j++){
			if(strcmp(a[j],a[j+1])>0){
				strcpy(cmp,a[j]);
				strcpy(a[j],a[j+1]);
				strcpy(a[j+1],cmp);
			}
		}
	}
	
	for(int i = 0;i < n;i++){
		cout << a[i];
	}
}

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

int main()
{
    int N;
    cin >> N;
    int org = N;
    int S = 0;
    while (N > 0)
    {
        S += N % 10;
        N /= 10;
    }
    if (org % S == 0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "Yes" << endl;
#define POK cout << "OK" << endl;
#define PNO cout << "No" << endl;
#define PNG cout << "NG" << endl;

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

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

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;

// const
// 円周率
const double pi = M_PI;
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)

int main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  sort(ALL(a));
  ll res = 0;
  rep(i, n) {
    repz(j, i + 1, n) {
      ll li = a[i];
      ll lj = a[j];
      res += n - 1 - j -
             (a.end() - upper_bound(a.begin() + j, a.end(), li + lj - 1));
    }
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
int a[200005];
int check[200005] = {};
int main() {
	int n, k;
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		check[a[i]]++;
	}
	ll sum = 0;
	for (int i = 0; i <= 200005; i++) {
		if (check[i] > 0) {
			sum++;
		}
	}
	if (k >= sum) {
		cout << "0" << endl;
		return 0;
	}
	sort(check, check + 200005);
	ll ans = 0;
	ll count = 0;
	for (int i = 0; i <= 200005; i++) {
		if (check[i] > 0) {
			count++;
		    ans += check[i];
		}
		if (count == sum - k) {
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int n,a[100010],b[100010],x[100010],ans,f[100010];
vector<int> g[100010];
map<pair<int,int>,int> mp;
void dfs(int deep,int color){
	int c=1;
	for (int i=0;i<g[deep].size();i++)
		if (f[g[deep][i]]==0){
			f[g[deep][i]]=1;
			if (c==color) c++;
			mp[pair<int,int>(g[deep][i],deep)]=c;
			mp[pair<int,int>(deep,g[deep][i])]=c;
			dfs(g[deep][i],c);
			c++;
		}
}
int main(){
	cin>>n;
	for (int i=0;i<n-1;i++){
		cin>>a[i]>>b[i];
		x[a[i]]++;x[b[i]]++;
		g[a[i]].push_back(b[i]);
		g[b[i]].push_back(a[i]);
	}
	for (int i=1;i<=n;i++) ans=max(ans,x[i]);
	cout<<ans<<endl;f[1]=1;
	dfs(1,-1);
	for (int i=0;i<n-1;i++) cout<<mp[pair<int,int>(a[i],b[i])]<<endl;
	return 0;
}

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

int a[100001][3];
int dp[100001][3];
int main(){
	int n;
  	cin >> n;
  	for(int i=0;i<n;i++){
    	cin >> a[i][0] >> a[i][1] >> a[i][2];
    }
  	dp[0][0] = a[0][0];
  	dp[0][1] = a[0][1];
  	dp[0][2] = a[0][2];
  
  	for(int i=1;i<n;i++){
    	dp[i][0] = a[i][0] + max(dp[i-1][1], dp[i-1][2]);
      	dp[i][1] = a[i][1] + max(dp[i-1][0], dp[i-1][2]);
      	dp[i][2] = a[i][2] + max(dp[i-1][1], dp[i-1][0]);
    }
  	int ans = max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
  	cout << ans ;
}

Measured memory_bytes: 5896
#include <iostream> 
#include <algorithm>  
using namespace std;
typedef long long ll;

int main(){
	int k;
	cin >> k;
	ll sum = 0;
	for(int i = 1; i <= k; i++){
		for(int j = 1; j <= k; j++){
			for(int l = 1; l <= k; l++){
				sum += __gcd(__gcd(i, j), l);
			}
		}
	}
	cout << sum;
   return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>

int main() {
	int a, p;

	while (1) {
		scanf("%d %d", &a, &p);
		if (a >= 0 && 100 >= p) {
			printf("%d\n", (a * 3 + p) / 2);
			break;
		}
	}

	return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

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

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u; return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}

template<typename T>
struct SegmentTree {
	T id;
	function<T(T, T)> op;
	vector<T> dat;
	int size;

	SegmentTree(int n, T id, function<T(T, T)> op) : id(id), op(op) {
		size = 1;
		while (size < n) size <<= 1;
		dat.assign(size * 2 + 10, id);
	}

	void update(int k, T x) {
		k += size, dat[k] = x;
		while (k > 1) k >>= 1, dat[k] = op(dat[k << 1], dat[(k << 1) | 1]);
	}

	void merge(int k, T x) { update(k, op(x, dat[k + size])); }
	//[a, b)
	T query(int a, int b) {
		T tl = id, tr = id;
		for (int l = a + size, r = b + size; l < r; l >>= 1, r >>= 1) {
			if (l & 1) tl = op(tl, dat[l++]);
			if (r & 1) tr = op(tr, dat[--r]);
		}
		return (op(tl, tr));
	}
};


void Main() {
	int N; cin >> N;
	SegmentTree<int> seg(N, 0, [](int a, int b) { return (a | b); });
	string S; cin >> S;
	for (int i = 0; i < N; i++) {
		seg.update(i, 1<<(S[i]-'a'));
	}
	int Q;
	cin >> Q;
	while (Q--) {
		int a; cin >> a;
		if (a == 1) {
			int i; char c;
			cin >> i >> c; --i;
			S[i] = c;
			seg.update(i, 1<<(S[i]-'a'));
		} else {
			int l, r;
			cin >> l >> r; --l;
			cout << __builtin_popcount(seg.query(l, r)) << endl;
		}
	}
}

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

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

using namespace std;
typedef long long ll;

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

  ll a,b,x;cin>>a>>b>>x;
  ll ans=(b/x)-(a/x);
  if(a%x==0) ans++;
  cout<<ans<<endl;
}


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

int prod=1LL,resp=1LL;



int32_t main(){

    cin>>a>>b;
    c=__gcd(a,b);
    //cout<<c<<"\n";
    
    if(c%2==0)resp++;
    while(c%2==0)c/=2;
    for(int i=3;i*i<=c;i+=2){
        if(c%i==0){
            resp++;
            while(c%i==0)c/=i;
        }
    }
    if(c>2)resp++;

    

    cout<<resp;

}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i=0;i<n;i++) {
			a[i]=sc.nextLong();
		}

		int ans=0;
		for (int i=0;i<n;i++) {
			while (a[i]%2 == 0) {
				a[i]/=2;
				ans++;
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 34396
/* To Kaise Hain Aaplog*/

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) (x).begin(), (x).end()

void shuru_krte_hai_bina_kisi_bakchodi_ke()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE
}
const ll m = 998244353;

const ll s = 1e6 + 2;
ll a[s];

int main()
{
    //shuru_krte_hai_bina_kisi_bakchodi_ke();

    /* long long yaad se daal de har jagah*/
    #define int long long

    int n;
    cin>>n;
    int ar[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int xorr= a[0];
    for(int i=1;i<n;i++){
        xorr^=a[i];
    }
    for(int i=0;i<n;i++){
        cout<<(xorr^a[i])<<" ";
    }
    return 0;
}

Measured memory_bytes: 4992
s=input()+"T"
X,Y=map(int,input().split())
xy=[[],[]]
t=0
m=0
for i in s:
    if(i=="T"):
        xy[m].append(t)
        m^=1
        t=0
    else:
        t+=1
x,y=xy
l=[x[0]]
s=set()
for i in x[1:]:
    s.clear()
    for j in l:
        s.add(j+i)
        s.add(j-i)
    l=list(s)
if(not X in l):
    print("No")
    quit()
l=[0]
for i in y:
    s.clear()
    for j in l:
        s.add(j+i)
        s.add(j-i)
    l=list(s)
if(not Y in l):
    print("No")
else:
    print("Yes")

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

int main(){
      int x, n; cin >> x >> n;
      int ans;
      int min_d=9999999;
      int num[n];
      for (int i=0; i<n; i++){
          cin >> num[i];
      }
     
      for (int now=-150; now<=250; now++){
           bool found=false;
          for (int i=0; i<n; i++){
              if (now==num[i]){
                  found=true;
                  break;
              }
          }
          if (!found){
            int d=abs(x-now);
            if (min_d>d){
                min_d=d;
                ans=now;
            }
          }
      }
      cout << ans << endl;
}

Measured memory_bytes: 3648
#include <stdio.h>
#define M 1000000007

long powMod(long x, long n, long m){
	long value;	
	if(n == 0){
		return 1;
	}
	value = powMod((x * x) % m, n / 2, m);
	if(n % 2 == 1){
		return (value * x) % m;
	}
	return value;
}

int main(void){
	long m, n;
	scanf("%ld %ld", &m, &n);
	printf("%ld\n", powMod(m, n, M));
	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
#define li long long int
#define prDouble(x) cout<<fixed<<setprecision(10)<<x;
double dp[301][301][301];
double solve(li x,li y,li z,li n)
{
    if(x==0 && y==0 && z==0)
    {
        return dp[0][0][0]=0;
    }
    if(x<0 || y<0 || z<0)
    {
        return 0;
    }
    if(dp[x][y][z]>-0.9)
    {
        return dp[x][y][z];
    }
    double ans=0;
    ans=(n*1.0+ x*1.0*solve(x-1,y,z,n)+y*1.0*solve(x+1,y-1,z,n)+z*1.0*solve(x,y+1,z-1,n))/((x+y+z)*1.0);
    return dp[x][y][z]=ans;
}

int main()
{
    li n,a,i,x=0,y=0,z=0;
    memset(dp,-1,sizeof(dp));
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;
        if(a==1)x++;
        if(a==2)y++;
        if(a==3)z++;
    }
    cout<<fixed<<setprecision(9)<<solve(x,y,z,n);
    return 0;
}


Measured memory_bytes: 216864
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 998244353;
const ll MAX = 1000000;

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

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

//gcd,lcm,べき,二進展開
//組み合わせ、mod計算
//最短路問題、bit、union find

///////////////////////////


	
int main() {
	ll H, W;
	cin >> H >> W;
	ll A[100][100], B[100][100];

	repn(i, H)repn(j, W) cin >> A[i][j];
	repn(i, H)repn(j, W) cin >> B[i][j];

	bool dp[81][81][13000] = {};
	dp[1][1][abs(A[1][1]-B[1][1])] = 1;

	repn(i, H) {
		repn(j, W) {

			ll c = abs(A[i][j] - B[i][j]);
			rep(k, 13000) {
				if (dp[i - 1][j][k] == 1 || dp[i][j-1][k]==1) {
					dp[i][j][k + c] = 1;
					dp[i][j][abs(k - c)] = 1;
				}
			}
		}
	}

	
	rep(k, 13000) { if (dp[H][W][k] == 1) { cout << k; break; } }

	system("PAUSE");
}

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

ll gcd(ll a, ll b){
  if(b == 0){
    return a;
  }
  else{
    return gcd(b,(a%b));
  }
}
ll lcm(ll a,ll b){
  return a/gcd(a,b)*b;
}

int main() {
  int a,b;
  cin>>a>>b;
  if(a==b){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 764
#define _CRT_SECURE_NO_WARNINGS
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<utility>
#include<vector>

#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;

int main() {
	int N, K;
	ll x, y;
	vector<pair<ll, ll>> vx;
	
	cin >> N >> K;
	REP(i, N) {
		cin >> x >> y;
		vx.push_back(make_pair(x, y));
	}

	ll S = 4e+18 + 1;
	REP(i, N - 1) {
		FOR(j, i + 1, N) {
			REP(l, N - 1) {
				FOR(m, 1, N) {
					int cnt = 0;
					REP(k, N) {
						ll x1 = max(vx[i].first, vx[j].first), x2 = min(vx[i].first, vx[j].first);
						ll y1 = max(vx[l].second, vx[m].second), y2 = min(vx[l].second, vx[m].second);
						if (vx[k].first <= x1 && vx[k].first >= x2 && vx[k].second <= y1 && vx[k].second >= y2) {
							cnt++;
						}

						if (cnt >= K) {
							S = min(S, (x1 - x2)*(y1 - y2));
						}
					}
				}
			}
		}
	}

	cout << S << endl;


	return 0;
}

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

// macros
#define pb emplace_back
#define mk make_pair
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define irep(itr, st) for(auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for(auto itr = (st).rbegin(); itr != (st).rend(); ++itr)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define bit(n) (1LL<<(n))
// functions
template <class T>bool chmax(T &a, const T &b){if(a < b){a = b; return 1;} return 0;}
template <class T>bool chmin(T &a, const T &b){if(a > b){a = b; return 1;} return 0;}
template <typename T> istream &operator>>(istream &is, vector<T> &vec){for(auto &v: vec)is >> v; return is;}
template <typename T> ostream &operator<<(ostream &os, const vector<T>& vec){for(int i = 0; i < vec.size(); i++){ os << vec[i]; if(i + 1 != vec.size())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const set<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const unordered_set<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const multiset<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const unordered_multiset<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p){os << p.first << " " << p.second; return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const map<T1, T2> &mp){for(auto itr = mp.begin(); itr != mp.end(); ++itr){ os << itr->first << ":" << itr->second; auto titr = itr; if(++titr != mp.end())os << " "; } return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const unordered_map<T1, T2> &mp){for(auto itr = mp.begin(); itr != mp.end(); ++itr){ os << itr->first << ":" << itr->second; auto titr = itr; if(++titr != mp.end())os << " "; } return os;}
//  types
using ll = long long int;
using P = pair<int, int>;
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1000000007;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
// io
struct fast_io{
  fast_io(){ios_base::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20);}
} fast_io_;


int main(int argc, char const* argv[])
{
  int n, k; cin >> n >> k;
  vector<int> h(n); cin >> h;
  int res = 0;
  rep(i, n){
    if(h[i] >= k)res++;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define pb push_back 
#define mp make_pair
#define F first
#define S second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORR(i,a,b) for(int i=a;i<b;i++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define print(a) for(auto x:a) cout<<x<<' ';cout<<endl;
#define printM(b) for(auto y:b) {print(y);}
#define printP(p) cout<<p.first<<' '<<p.second<<endl;
typedef long long int ll;
typedef unsigned long long int ull;

template <typename T> 
T cmax(T x, T y) 
{return (x > y)? x: y;} 

/*
5 4
1 2
2 3
4 1
3 5 
 


1 2 4 3 5

a->b->c



*/

// User function template for C++

vector<int> parent;
int find(int x)
{
  return parent[x]==x ? x:parent[x]=find(parent[x]);
}

void solve()
{

  int n,m,t1,t2;
  cin>>n>>m;
  parent.resize(n+1,0);
  
 
  FOR(i,n+1)
  parent[i]=i;
 
  for(int i=0;i<m;i++)
  {
    cin>>t1>>t2;
 
    int x,y;
    x=find(t1);
    y=find(t2);
    if(x!=y)
    {

      int mn=min(x,y);
      int mx=max(x,y);
      
      
      parent[mx]=mn;
     }

  }

  unordered_map<int,int> mp;

int ans=0;
  for(int i:parent)
  {
   int j=find(i); 
    mp[j]++;
    ans=max(ans,mp[j]);

  }
  //print(parent);
  mp.clear();
  parent.clear();


  cout<<ans;
  


}



int main()
{
 
  fast;
  int t=1;
 // cin>>t;
  while(t--){
 
  solve();
  cout<<endl;
 
 }
 
 return 0;
}


Measured memory_bytes: 12052
using System;
class Program
{
  static void Main (string[] args)
  {
    string b = Console.ReadLine();
    if (b == "A") { Console.WriteLine("T"); }
    else if (b == "C") { Console.WriteLine("G"); }
    else if (b == "G") { Console.WriteLine("C"); }
    else { Console.WriteLine("A"); }
  }
}

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

#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

ll dp[3001][3001];
ll a[3000];
ll game(int l, int r)
{
    if (dp[l][r] != -1)
        return dp[l][r];
    if (r - l == 0)
        return a[l];
    return dp[l][r] = max(a[l] - game(l + 1, r), a[r] - game(l, r - 1));
}

int main()
{
    rep(l, 3001) rep(r, 3001) dp[l][r] = -1;
    int n;
    cin >> n;

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

    OP(game(0, n - 1));

    return 0;
}

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

int A[2000000],N = 0,dp[45];

int fibonacci(int n) {

  if(dp[n] != 0) return dp[n];

  if(n == 0 || n == 1) return dp[n] = 1;
  else return dp[n] = fibonacci(n - 1) + fibonacci(n - 2);
}


int main() {

  int N;
  cin >> N;

  int ans = fibonacci(N);
  cout << ans << endl;

}



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

int main(){
    int a, b, c, d, e, ans, tmp;
    
    cin >> a >> b >> c >> d >> e;
    
    if(a < 0){
        tmp = abs(0-a);
        ans = c*tmp;
        ans += d;
        a=0;
    }
    
    tmp = abs(a-b);
    ans += tmp*e;
    
    cout << ans << endl;
    
    return 0;
}

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

using namespace std;

#define SWAP(x,y,z) {if ( y > z ) swap(y,z); if ( x > y ) swap(x,y); if (y > z) swap(y,z);}
typedef long long ll;
typedef unsigned long long ull;

double const eps = 1e-6;
double const pi = 3.1415926535;
ll const mod = 1e9+7;

int a[55];

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

    int n,m;
    cin >> n >> m;
    for ( int i = 1; i <= m; i++ )
    {
        int x,y;
        cin >> x >> y;
        a[x]++;
        a[y]++;
    }

    for ( int i = 1; i <= n; i++ ) cout << a[i] << '\n';

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);


		int trees = scan.nextInt();
		int canSee =scan.nextInt()*2+1;

		int needMen=0;
		for(;trees>0;) {

			trees=trees-canSee;
			needMen++;
		}



		System.out.println(needMen);

	}
}


Measured memory_bytes: 23764
/* Author: Rennan Rocha
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define PB push_back
#define MP make_pair

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll, ll>
#define vpi vector<pi>
#define vpll vector<pll>

#define INF 1e18
#define MOD 1000000007
#define ld long double

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
//*find_by_order(); order_of_key();

int main() {
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    long double a, b, h, m;
    cin >> a >> b >> h >> m;

    ld ang = h * 30;
    ld bng = m * 6;
    ang += m/2;

    if(ang<bng) {
        swap(ang, bng);
        swap(a, b);
    }

    ld alfa = min(ang-bng, bng+360-ang);
    alfa *= acos(-1) / 180;

    ld ans = a*a + b*b - 2 * a * b * cos(alfa);
    cout << sqrt(ans) << "\n";
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<ld> vld;
typedef vector<string> vstr;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); ++i)
#define TS to_string
#define ALL(v) (v).begin(), (v).end()
#define endl "\n"

ll INF = 1e9;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "Yes" << endl;}
void no(){ cout << "No" << endl;}

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

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

  ll q;
  cin >> q;
  multiset<ll> st;
  REP(i,q){
    ll com;
    cin >> com;
    if(com == 0){
      ll x; cin >> x;
      st.insert(x);
      cout << st.size() <<endl;
    }
    else if(com == 1){
      ll x; cin >> x;
      auto s = st.lower_bound(x);
      auto t = st.upper_bound(x);
      cout << distance(s,t) << endl;
    }
    else if(com == 2){
      ll x;
      cin >> x;
      st.erase(x);
    }
    else{
      ll l, r;
      cin >> l >> r;
      auto s = st.lower_bound(l);
      auto t = st.upper_bound(r);
      for(auto i = s; i != t; ++i){
        cout << (*i) << endl;
      }
    }
  }
  return 0;
}




Measured memory_bytes: 12368
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define inf 1012345678
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lower_bound lowb
#define upper_bound upb
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



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

	int a[3];
	rep(i, 3) cin >> a[i];
	if(a[0] + a[1] + a[2] >= 22) puts("bust");
	else puts("win");
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m,tle=1,ans=0;
  cin >> n >> m;
  for(int i=0;i<m;i++){
    tle*=2;
  }
  ans+=tle*1900*m;
  ans+=(n-m)*100*tle;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#include <vector>
#include <numeric>
#include <map>
#include <cmath>
#include <iomanip>
#include <queue>
using ll =long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vs = vector<string>;

int main() {
    ll N;
    cin >> N;
    vl A(N);
    map<ll, ll> ma;
    for(ll i=0; i<N; i++){
        cin >> A.at(i);
        ma[A.at(i)] += 1;
    }
    vl ans(N);
    ll sum = 0;
    for(auto c : ma){
        ans.at(c.first-1) = c.second * (c.second-1)/2;
        sum += c.second * (c.second-1)/2;
    }

    for(ll i=0; i<N; i++){
        ll a = A.at(i);
        ll answer = sum;
        answer = sum - ans.at(a-1) + (ma.at(a)-1)*(ma.at(a)-1-1)/2;
        cout << answer << endl;
    }
}

Measured memory_bytes: 12672
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  ll r;
  cin >> r;

  double ans = 2 * M_PI * r;

  cout << setprecision(12) << ans << ln;

  return 0;
}

Measured memory_bytes: 3796