akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstring>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<vector>
using namespace std;
int main() {

	long long int x, y;
	cin >> x >> y;
	if (abs(x - y) <= 1) {
		cout << "Brown" << endl;
	}
	else {

		cout << "Alice" << endl;

	}
	return 0;

	/*int n;
	cin >> n;
	long long int a[100000];
	int i;
	long long int sum = 0, counter = 0;
	for(i = 0;i<n;i++){
		cin >> a[i];

		if (sum < 0) {
			if (sum + a[i] <= 0) {
				counter = counter + abs(-sum + 1 - a[i]);
				a[i] = -sum + 1;
			}
			
		}
		else if (sum > 0){
			if (sum + a[i] >= 0) {
				counter = counter + abs(-sum - 1 - a[i]);
				a[i] = -sum - 1;
			}
		}
		sum = sum + a[i];
		//cout << counter << ' ';
	}
	cout << counter << endl;
	return 0;
	*/
}

Measured memory_bytes: 3616
N=int(input())
H=[0]+list(map(int, input().split()))
#print(N,H)

dp=[0]*(N+1)
dp[1]=0
dp[2]=abs(H[2]-H[1])

for i in range(3,N+1):
  a = dp[i-2]+abs(H[i]-H[i-2])
  b = dp[i-1]+abs(H[i]-H[i-1])
  dp[i]= a if (a<=b) else b

print( dp[N] )



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

int main(){
    int N, L;
    cin >> N >> L;
    vector<string> s(N);
    
    for(int i=0; i<N; i++){cin >> s[i];}
    sort(s.begin(), s.end());
    
    string ans = "";
    for(int i=0; i<N; i++){ans += s[i];}
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
	char data[1201];
	int num = -1;

	do {
		num++;
		scanf("%c", &data[num]);
	} while (data[num] != '\n');

	data[num+1] = '\0';
	int delay = -'a' + 'A';

	for (int i = 0; i < num; i++) {
		if ('a' <= data[i] && data[i] <= 'z') {
			data[i] += delay;

		} else if ('A' <= data[i] && data[i] <= 'Z') {
			data[i] += -delay;

		}

	}
	printf("%s", data);

	return 0;
}


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

int main() {
    int N;
    cin >> N;
    map<string, long long> map;
    for(int i=0; i<N; i++){
        string str;
        cin >> str;
        sort(str.begin(), str.end());
        map[str]++;
    }

    long long ans = 0;
    for(auto pair : map){
        ans += (pair.second*(pair.second-1))/2;
    }

    cout << ans << endl;
}

Measured memory_bytes: 11136
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000
typedef pair<ll, ll> pll;

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

    string s, t;
    cin >> s >> t;
    for (int i = s.size() - 1; i > -1; i--) {
        string ss1 = s.substr(0, i);
        string ss2 = s.substr(i);
        string ss3 = ss2 + ss1;
        if (ss3 == t) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define INIT  ios_base :: sync_with_stdio(0); cin.tie(); cout.tie();mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define mp make_pair
#define pb push_back
#define ft first
#define sc second
#define ll long long
#define pii pair<int, int>
#define count_bits __builtin_popcount



int n, x;
bool v[200];


int32_t main(){
INIT
cin>>x>>n;
for(int i=1; i<=n; i++){
    int p; cin>>p;
    v[p]=true;
}



int r=10e8;
for(int i=0; i<=101; i++){
    if( abs(x-i)<abs(x-r) && v[i]==false ){
            r=i; continue;
    }
    if( abs(x-i)==abs(x-r) && v[i]==false ){
        r=min(i, r); continue;
    }

}


cout<<r;

return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
typedef vector<pi> vp;

#define pb push_back
#define mp make_pair
#define fora(i, a, n) for(int i = a; i < n; i++)
#define forb(i, a, n) for (int i = a; i >= (n); --i)
#define PI 3.1415926535897932384626433832795
#define INF 1e9

int main(){ 
ios::sync_with_stdio(false);
cin.tie(NULL);
//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

string s;
cin >> s;
bool ans = false;
if(s[0] != s[1] && s[1]!=s[2] && s[2]==s[3] && s[4] == s[5]) ans = true;
if(ans) cout << "Yes" << endl;
else cout << "No" << endl;
}

Measured memory_bytes: 256
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;

int solve() 
{
	//happy coding

	ll n,year=0,plus;
	cin>>n;
	ll now = 100;
	while(now<n){
		year++;
		plus = now/100;
		now = now + plus;
	}	
	cout<<year<<endl;
	
	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <string>
#include <numeric>
#include <algorithm>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <complex>
#include <ctime>
#define ll long long
#define inf 0x3f3f3f3f
#define N 100010
//ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
char s[5];

int main(){
	scanf("%s",s);
	if(s[0]=='R'&&s[1]=='R'&&s[2]=='R')
        printf("3\n");
    else if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R'))
        printf("2\n");
    else if(s[0]=='R'||s[1]=='R'||s[2]=='R')
        printf("1\n");
    else printf("0\n");
	return 0;
}


Measured memory_bytes: 3672
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <cmath>
#include <utility>
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1e9
typedef long long int ll;
using namespace std;

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

    if(a%2==0 or b%2==0 or c%2==0){
        cout << 0 << endl;
        return 0;
    }
    cout << min(min(a*b,b*c),c*a) << endl;

    return 0;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
# define mkp make_pair
//# define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"

using namespace std;

int q , w , e;

    string s = "War" ;

int main()
{
	speed;

    vector<pair<int,int>>vc;

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

        if(i>a[n-1] && i <= b[0]){
            s = "No War";
        }

    }
    cout<<s;
}


Measured memory_bytes: 256
N,M = map(int,input().split())
X=sorted([int(i) for i in input().split()])

Y=list()
for i in range(M)[1:]:
  diff = X[i]-X[i-1]
  Y.append(diff)

Y=sorted(Y)

if N==1:
  print(sum(Y))
else:
  print(sum(Y[:-(N-1)]))


Measured memory_bytes: 13832
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=100009;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}


 main()

{
    fast
    int n,m;
    cin>>n>>m;
    int sum=0;
    f(i,1,m)
    {
        int x;
        cin>>x;
        sum+=x;
    }
    if(sum>n)
    {
        cout<<"-1"<<endl;

    }
    else
    {
        cout<<n-sum<<endl;
    }


















    return 0;

}













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

int main () {
	lli x,y,z;

	cin >> x >> y;
	if(y>x){
		z = x;
		x = y;
		y = z;
	}

	while(1){
		z = x % y;
		if(z == 0)break;
		x = y;
		y = z;
	}

	cout << y << endl;
	return 0;
}

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

using namespace std;

char arr[100010];

int main()
{
    int n, i;
    scanf("%s", arr);
    n = strlen(arr);

    int r = 0;
    for(i = 0; i < n - 1; i++)
        if(arr[i] != arr[i + 1])
            r++;

    printf("%d\n", r);
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<functional>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
LL A,B,X;

int main(){
    cin>>A>>B>>X;
    int b1=min(A,B*2);
    int ans=X/1000*b1;
    X%=1000;
    if(X!=0)ans+=min(((X-1)/500+1)*B,A);
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 3092
#include<bits/stdc++.h>
using namespace std;
int main(){
    int arr[105]={0};
    int n=0;
    scanf("%d", &n);
    for(int i=0;i<n;i++){
        int a=0;
        scanf("%d", &a);
        arr[a]+=1;
    }
    int sum=0;
    for(int i=0;i<=100;i++){
        if (arr[i]!=0){
            sum+=1;
        }
    }
    printf("%d", sum);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf=1e15;
const int N=2e5+50;
int n;
char s[N];
int ans[N];
bool check()
{
	for(int i=2;i<=n-1;i++)
	{
		if(ans[i]==0)
		{
			if(s[i]=='o')
			ans[i+1]=ans[i-1];
			else
			ans[i+1]=1-ans[i-1];
		}
		else
		{
			if(s[i]=='o')
			ans[i+1]=1-ans[i-1];
			else
			ans[i+1]=ans[i-1];
		} 
	}
	if(ans[1]==0)
	{
		if(s[1]=='o'&&ans[n]!=ans[2])
		return false;
		if(s[1]=='x'&&ans[n]==ans[2])
		return false;
	}
	if(ans[1]==1)
	{
		if(s[1]=='o'&&ans[n]==ans[2])
		return false;
		if(s[1]=='x'&&ans[n]!=ans[2])
		return false;
	}
	if(ans[n]==0)
	{
		if(s[n]=='o'&&ans[n-1]!=ans[1])
		return false;
		if(s[n]=='x'&&ans[n-1]==ans[1])
		return false;
	}
	if(ans[n]==1)
	{
		if(s[n]=='o'&&ans[n-1]==ans[1])
		return false;
		if(s[n]=='x'&&ans[n-1]!=ans[1])
		return false;
	}
	return true;
	
}
int main()
{
	while(cin>>n)
	{
		bool flag=false;
		scanf("%s",s+1);
		//0:sheep 1:wolf
		//只要确定两个的种类 就能确定整个序列种类了 
		for(int i=0;i<=1;i++)
		{
			for(int j=0;j<=1;j++)
			{
				ans[1]=i;
				ans[2]=j;
				if(check())
				{
					flag=true;
					break;
				}
			}
			if(flag)
			break;
		}
		if(flag==false)
		puts("-1");
		else
		{
			for(int i=1;i<=n;i++)
			{
				if(ans[i])
				cout<<"W";
				else
				cout<<"S";
			}
			cout<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <functional>
#include <assert.h>
#include <iomanip>
using namespace std;
const int N = 105;
const int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
typedef long long ll;

int X[N], Y[N], H[N];
int main() {
    int n;
    while(~scanf("%d", &n)) {
        for(int i = 1; i <= n; ++i) {
            scanf("%d %d %d", &X[i], &Y[i], &H[i]);
        }
        bool flag = true;
        for(int i = 0; i <= 100 && flag; ++i) {
            for(int j = 0; j <= 100 && flag; ++j) {
                int ans = -INF; bool success = true;
                for(int z = 1; z <= n && success; ++z) {
                    int tt = - abs(i - X[z]) - abs(j - Y[z]);

                    if(H[z] != 0) {
                        if(ans == -INF) ans = -tt + H[z];
                        else if(ans != -tt + H[z]) success = false;
                    }
                }

                if(ans == 0) continue;

                for(int z = 1; z <= n && success; ++z) {
                    int tt = - abs(i - X[z]) - abs(j - Y[z]);
                    if(H[z] == 0) {
                        if(ans < 0) {
                            if(tt == 0) success = false;
                            ans = max(ans, tt);
                        }
                        else if(ans + tt > 0) success = false;
                    }
                }
                if(ans < 0) ans = -ans;

                if(success && ans) {
                    printf("%d %d %d\n", i, j, ans);
                    flag = false;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;

namespace AOJ.Volume2
{
    public class AdmissionFee
    {
        public static int Main()
        {
            int cnt = int.Parse(Console.ReadLine());
            for(int i = 0; i < cnt; i++)
            {
                var input = Console.ReadLine().Split(' ');
                int spa = int.Parse(input[0]);
                int pool = int.Parse(input[1]);
                int ti_spa = int.Parse(input[2]);
                int ti_pool = int.Parse(input[3]);

                // ??????????????£?????´????????????
                int fee_normal = (spa * ti_spa) + (pool * ti_pool);
                // ????????????
                int ti_spa_dis = ti_spa < 5 ? 5 : ti_spa;
                int ti_pool_dis = ti_pool < 2 ? 2 : ti_pool;
                int fee_discount = ((ti_spa_dis * spa) + (ti_pool_dis * pool)) * 8 / 10;

                Console.WriteLine(Math.Min(fee_normal, fee_discount));
            }

            return 0;
        }
    }
}

Measured memory_bytes: 9148
#include <stdio.h>

int main()
{
    int n;
    scanf("%d",&n);
    int a[n],odd=0;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        if(a[i]%2==1)odd++;
    }
    if(odd==0)printf("second");
    else printf("first");

    return 0;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  for (int i=0; i<m; i++) {
	int a;
    cin >> a;
    n-=a;
  } if (n < 0) cout << -1;
  else cout << n;
}

Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] W = new int[N];
        for (int i = 0; i < N; i++) {
            W[i] = scanner.nextInt();
        }

        int S1 = 0;
        int S2 = 0;
        int abs = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            S1 = 0;
            S2 = 0;
            for(int s1i = 0; s1i < i; s1i++){
                S1 += W[s1i];
            }

            for(int s2i = i; s2i < N; s2i++){
                S2 += W[s2i];
            }

            int tmp = Math.abs(S1 - S2);
            if(tmp < abs) {
                abs = tmp;
            }

        }

        System.out.println(abs);

    }
}


Measured memory_bytes: 23252
#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int main(void) {
    int N, M; cin >> N >> M;
    vector<vector<int>> lights(M);
    for (int i = 0; i < M; i++) {
        int k; cin >> k;
        for (int j = 0; j < k; j++) {
            int tmp; cin >> tmp;
            lights[i].push_back(tmp-1);
        }
    }
    vector<int> p(M);
    for (int i = 0; i < M; i++) {
        cin >> p[i];
    }

    int ans = 0;
    for (int i = 0; i < (1 << N); i++) {
        vector<int> switch_state(N);
        for (int j = 0; j < N; j++) {
            if (i & (1 << j)) {
                switch_state[j] = 1;
            }
        }
        int cnt = 0;
        for (int j = 0; j < M; j++) {
            int cnt_tmp = 0;
            for (int k = 0; k < lights[j].size(); k++) {
                if (switch_state[lights[j][k]]) {
                    cnt_tmp++;
                }
            }
            if (cnt_tmp % 2 == p[j]) cnt++;
        }
        if (cnt == M) ans++;
    }    
    cout << ans << endl;
}

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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 modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  ll MOD = 1e9+7;

  ll N, K;
  cin >> N >> K;
  vector<int> A(N);

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

  //K = 1;のときの転倒数
  ll ans = 0;
  ll tmp_ans = 0;
  for(int i = 0; i < N; i++){
    for(int j = i+1; j < N; j++){
      if(A[i] > A[j]){
        if(K % 2 == 0){
          tmp_ans = K / 2;
          tmp_ans = tmp_ans * (K+1) % MOD;
        }else{
          tmp_ans = (K+1)/2;
          tmp_ans = tmp_ans * K % MOD;
        }
        ans = (ans + tmp_ans) % MOD;

      }else if(A[i] < A[j]){
        if(K % 2 == 0){
          tmp_ans = K/2;
          tmp_ans = tmp_ans * (K-1) % MOD;
        }else{
          tmp_ans = (K-1)/2;
          tmp_ans = tmp_ans * K % MOD;
        }
        ans = (ans + tmp_ans) % MOD;
      }
    }
  }

  cout << ans << endl;


  return 0;
}



Measured memory_bytes: 256
long a[3][1<<18],b,c,x,y,N[1<<18],M[1<<18],i,j;main(n){scanf("%d",&n);for(;i<3;++i)for(j=0;j<n;++j){scanf("%d",&a[i][j]);--a[i][j];}for(j=0;j<n;++j){if(a[0][j]/3!=a[1][j]/3||a[1][j]/3!=a[2][j]/3||a[2][j]/3!=a[0][j]/3||a[1][j]%3!=1||(a[1][j]/3-j)%2){puts("No");return 0;}x=a[1][j]/3+1;while(x){if(j&1)c-=M[x];else b-=N[x];x-=x&-x;}if(j&1)c+=j/2;else b+=j/2;y=a[2][j]/3+1;while(y<1<<18){if(j&1)++M[y];else++N[y];y+=y&-y;}if(a[0][j]%3){if(j&1)++b;else++c;}}puts(b&1|c&1?"No":"Yes");}

Measured memory_bytes: 5620
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define mod 1000000007
#define pb push_back
#define VJ ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair()
#define vi(x) vector<int>x
#define vl vector<long long int>
#define vc vector<char> 
#define Memset(a,num,l,r) for(int iii=l;iii<=r;iii++) a[iii]=num;
#define Printwithspace(a,l,r)for(int iii=l;iii<=r;iii++) cout<<a[iii]<<" ";
#define PrintwithNewline(a,l,r) for(int iii=l;iii<=r;iii++) cout<<a[iii]<<endl;
#define Max 1000001
using namespace std;

bool visited[Max];
vector<int>v[Max];

int nodes=0;

void dfs(int n){
	nodes++;
	visited[n]=true;
	for(auto it:v[n]){
		if(!visited[it])
			dfs(it);
	}
}


void solve(){
	int n,m;cin>>n>>m;
	int connected=0;
	// vi(z);
	for(int i=0;i<m;i++){
		int x,y;cin>>x>>y;
		v[x].pb(y);
		v[y].pb(x);
	}
	int ans=-1;
	for(int i=1;i<=n;i++){
		if(!visited[i])
		{
			dfs(i);
			ans=max(ans,nodes);
			nodes=0;
			connected++;
		}
	}
	cout<<ans;
}



int main(){
	 #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	 #endif
	VJ
	solve();
	return 0;
}



Measured memory_bytes: 39704
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;

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; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()

char opp(char c) {
    switch (c) {
        case 'U':
            return 'D';
        case 'D':
            return 'U';
        case 'R':
            return 'L';
        case 'L':
            return 'R';
        default:
            return 'X';
    }
}

string gen_come(string s) {
    string ret;
    rep (i, s.size()) {
        ret += opp(s[i]);
    }
    return ret;
}

int main() {
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    int dx = tx - sx;
    int dy = ty - sy;
    string go, come;
    rep (i, abs(dy)) {
        go += (dy > 0 ? 'U' : 'D');
    }
    rep (i, abs(dx)) {
        go += (dx > 0 ? 'R' : 'L');
    }
    come = gen_come(go);
    string second_go = go[0] + go + go[go.size() - 1];
    second_go = (second_go[second_go.size() - 1] == 'R' ? 'L' : 'R') + second_go;
    second_go += (second_go[1] == 'U' ? 'D' : 'U');
    string second_come = gen_come(second_go);
    cout << go + come + second_go + second_come << endl;
}


Measured memory_bytes: 384
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 0x6fffffff
#define INFL 0x6fffffffffffffffLL

int main() {
	ll		d,t,s,a,b,c,h,i,j,k,l,m,n,x,y;
	ll		ans = 0;
	cin >> d >> t >> s;
	if ( (d+s-1)/s <= t) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	
	return 0;
}


Measured memory_bytes: 3632
N = int(input())
TA = [tuple(map(int,input().split())) for i in range(N)]

t,a = TA[0]
for T,A in TA[1:]:
    t1 = t + (-t%T)
    a1 = (t1//T) * A
    a2 = a + (-a%A)
    t2 = (a2//A) * T
    if t > t2:
        t,a = t1,a1
    else:
        t,a = t2,a2
print(t+a)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
 #define mod 1000000007
using namespace std;
 
typedef long long ll;
 
 ll fib[100005];
ll arr[100005];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   fib[0]=1; fib[1]=1;
   for(int i=2;i<100005;i++) { fib[i]=fib[i-1]+fib[i-2]; fib[i]%=mod; }
//   for(int i=0;i<10;i++) cout<<fib[i]<<" ";
   ll n,m;
   cin>>n>>m;
   for(int i=0;i<m;i++) cin>>arr[i];
   sort(arr,arr+m);
   
   for(int i=0;i<m-1;i++){  if(arr[i]+1==arr[i+1]) {cout<<0<<endl; return 0; } }
   ll ans=1;
   ll init=0;
   for(int i=0;i<m;i++){
    //   cout<<arr[i]<<endl;
       if(arr[i]==1) { init=2; continue; }
       if(arr[i]==2) { init=3; continue; }
       ll val=arr[i]-1-init;
       ans*=fib[val];
       ans%=mod;
       init=arr[i]+1;
   }
//   cout<<ans;
   if((n-init)!=0) ans*=fib[n-init];
   ans%=mod;
   cout<<ans%mod<<endl;
   
   
   
   
    
}

Measured memory_bytes: 1792
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;

int fact[100001];
void factorial(){
    fact[0]=1;
    for(int i=1;i<=100001;i++){
        fact[i]=(fact[i-1]*(i))%MOD;
    }
}

int main() {
factorial();

    int n;
    int mm=0;
    cin>>n;
    vector<pair<int,int>> v;
    if(n%2==0){
        int m=fact[n-1]-n/2;
       // cout<<m<<endl;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){

                if(i+j!=n+1){
                    mm++;
                   // cout<<i<<" "<<j<<endl;
                   v.push_back({i,j});
                }

            }
        }


    }else{
        int m=fact[n-1]-n/2;
        //cout<<m<<endl;
        for(int i=1;i<=n-1;i++){
            for(int j=i+1;j<=n-1;j++){

                if(i+j!=n){
                   //cout<<i<<" "<<j<<endl;
                    v.push_back({i,j});
                    mm++;
                }

            }
        }
        for(int i=1;i<n;i++){
            //cout<<i<<" "<<n<<endl;
            v.push_back({i,n});
            mm++;

        }







    }
    cout<<mm<<endl;

    rep(i,mm){
        cout<<v[i].first<<" "<<v[i].second<<endl;
    }
    return 0;
}


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

using namespace std;
typedef long long ll;

bool prime[10000005];

int main(void){
	int n;
	scanf("%d",&n);
	memset(prime,true,sizeof(prime));
	for(int i=2;i<=10000002;i++){
		if(prime[i]){
			for(int j=i*2;j<=10000002;j+=i){
				prime[j]=false;
			}
		}
	}
	int ans=0;
	for(int i=2;i<=n;i++){
		if(n==1)break;
		if(prime[i] && prime[i+2])ans+=2;
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 13004
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

#define MAX_V 30000
struct Edge{
  int src, dest;
  int cap, rev;
};

const int INF = 1000000000;

using Edges = vector<Edge>;
using Graph = vector<Edges>;
bool visited[MAX_V];

void add_edge(Graph &g, int src, int dest, int cap) {
  g[src].push_back((Edge){src, dest, cap, (int)g[dest].size()});
  g[dest].push_back((Edge){dest, src, cap, (int)g[src].size() - 1});
}

int dfs(Graph &g, int v, int t, int f) {
  if (v == t) return f;
  visited[v] = true;
  for (int i:irange(0,(int)g[v].size())) {
    Edge &e = g[v][i];
    if (!visited[e.dest] && e.cap > 0) {
      int d = dfs(g, e.dest, t, min(f, e.cap));
      if (d > 0) {
        e.cap -= d;
        g[e.dest][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(Graph &g, int s, int t) {
  int flow = 0;
  for(;;) {
    memset(visited, 0, sizeof(visited));
    int f = dfs(g, s, t, INF);
    if (f == 0) return flow;
    flow += f;
  }
}

int main()
{
  int h,w;
  cin>>h>>w;
  Graph g(2*h*w+h+w);
  int sr=0, sc=0, tr=0, tc=0;
  for (int i:irange(0,h)) {
    string a;
    cin>>a;
    for (int j:irange(0,w)) {
      add_edge(g, i*w + j, 2*h*w + i, INF);
      add_edge(g, h*w + i*w + j, 2*h*w + h + j, INF);
      switch (a[j]) {
        case 'o':
          add_edge(g, i*w + j, h*w + i*w + j, 1);
          break;
        case 'S':
          add_edge(g, i*w + j, h*w + i*w + j, INF);
          sr = i;
          sc = j;
          break;
        case 'T':
          add_edge(g, i*w + j, h*w + i*w + j, INF);
          tr = i;
          tc = j;
          break;
      }
    }
  }
  int res = max_flow(g, sr * w + sc, tr * w + tc);
  if (res >= INF) {
    cout<<-1<<endl;
  } else {
    cout<<res<<endl;
  }
  return 0;
}


Measured memory_bytes: 2176
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cstdlib>
#include<cmath>
#include<numeric>
#include<iomanip>
#include<functional>
#include<cstdlib>
#include<queue>
#include<deque>
const double PI = acos(-1);
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
using ll =long long;
const int mod = 1000000007;

//map<string>a
class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% mod + mod) % mod) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint & a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint & operator-=(const mint & a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint & operator*=(const  mint & a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint & a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint & a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint & a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint & a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint & a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream & os, const mint & m) {
		os << m.x;
		return os;
	}
};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
//組み合わせ
void recursive_comb(vector<int> indexes, int s, int rest, std::function<void(vector<int>)> f) {
	if (rest == 0) {
		f(indexes);
	}
	else {
		if (s < 0) return;
		recursive_comb(indexes, s - 1, rest, f);
		indexes[rest - 1] = s;
		recursive_comb(indexes, s - 1, rest - 1, f);
	}
}

// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k, std::function<void(vector<int>)> f) {
	vector<int>indexes(k);
	recursive_comb(indexes, n - 1, k, f);
}

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

int main() {
	int N;
	cin >> N;
	vector<int>a(N);
	vector<int>b(N);
	vector<int>c(N);
	rep(i, N) cin >> a[i];
	rep(i, N) cin >> b[i];
	rep(i, N-1) cin >> c[i];
	ll ans = 0;
	ans += b[a[0]-1];
		for (int i = 1; i < N;i++) {

			if (a[i - 1]+1 == a[i]) {
				ans += c[a[i]-2];
			}
		
				ans += b[a[i]-1];
			
		}
		cout<< ans;
}
	

Measured memory_bytes: 3164
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll a,b,c,d,e,f,g,h,i,j;
    while(cin>>a>>b>>c){
//if(a==0&&b==0&&c==0)
//    return 0;
d=(b-a);
f=c-b;
if(d==f)
    cout<<"YES"<<endl;
else
    cout<<"NO"<<endl;
    }
return 0;}


Measured memory_bytes: 256
n = int(input())
s = input()
x = [0] * n

def pcnt(x):
    return bin(x).count('1')

def f(x):
    if x == 0: return 0
    return f(x % pcnt(x)) + 1

for i in range(n):
    x[i] = int(s[i])

pc = sum(x)
ans = [0] * n
for b in range(2):
    npc = pc
    if b == 0:
        npc += 1
    else:
        npc -= 1

    if npc <= 0: continue

    r0 = 0
    for i in range(n):
        r0 = (r0 * 2) % npc
        r0 += x[i]

    k = 1
    for i in range(n - 1, -1, -1):
        if x[i] == b:
            r = r0
            if b == 0:
                r = (r + k) % npc
            else:
                r = (r - k + npc) % npc
            ans[i] = f(r) + 1
        k = (k * 2) % npc

for i in ans:
    print(i)

Measured memory_bytes: 81936
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<functional>
using namespace std;
int v[100009], a[100009], n, maxn;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) { cin >> a[i]; v[a[i]]++; }
	for (int i = 1; i <= 100000; i++) { maxn = max(maxn, v[i - 1] + v[i] + v[i + 1]); }
	cout << maxn << endl;
	return 0;
}

Measured memory_bytes: 1024
use std::io::{stdin, BufRead};
fn main() {
    let stdin = stdin();
    let mut stdinlock = stdin.lock();
    let mut nk = String::new();
    let _ = stdinlock.read_line(&mut nk).expect("read nk");
    let nk: Vec<u32> = nk
        .trim()
        .split_whitespace()
        .map(|n| n.parse().expect("parse"))
        .collect();
    let mut expects: Vec<f64> = Vec::with_capacity(nk[0] as usize);
    for e_of_p in stdinlock
        .lines()
        .next()
        .expect("line")
        .expect("piline")
        .trim()
        .split_whitespace()
        .map(|p| {
            let pk: f64 = p.parse().expect("P");
            (pk + 1.0) / 2.0
        })
    {
        expects.push(e_of_p);
    }
    println!("{}", min_chain(&expects, nk[0] as usize, nk[1] as usize));
}

fn min_chain(expects: &[f64], n: usize, k: usize) -> f64 {
    if n == k {
        return expects.iter().sum();
    }
    let accms: Vec<f64> = ([0.0].iter().chain(expects))
        .scan(0.0, |acc, &n| {
            *acc += n;
            Some(*acc)
        })
        .collect();
    (k..n)
        .map(|i| accms[i + 1] - accms[i + 1 - k])
        .max_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal))
        .unwrap()
}


Measured memory_bytes: 5760
#include <stdio.h>
#include <math.h>

#define M_PI 3.141592653589793


int main(void) {

	int i, j, k, p;
	int num = 0;
	int sum, count;

	int combination[10000][2];

	while (1) {
		scanf("%d %d", &combination[num][0], &combination[num][1]);
		if (combination[num][0] == 0 && combination[num][1] == 0) {
			break;
		}
		num++;
	}

	for (p = 0; p < num; p++) {
		count = 0;
		for (i = 1; i <= combination[p][0] - 2; i++) {
			for (j = i + 1; j <= combination[p][0] - 1; j++) {
				for (k = j + 1; k <= combination[p][0]; k++) {
					sum = i + j + k;
					if (sum == combination[p][1]) {
						//("%d+%d+%d=%d\n", i, j, k, sum);
						count++;
					}
				}
			}
		}
		printf("%d\n", count);
	}
	

	return 0;

}

Measured memory_bytes: 2704
#line 1 "union_find_tree.yosupo.test.cpp"
#define PROBLEM "https://judge.yosupo.jp/problem/unionfind"
#line 1 "/Users/knaga/programming/procon_library/macro/macros.hpp"



/*
@title Macro
@category template
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
#define Yes "Yes"
#define No "No"
#define YES "YES"
#define NO "NO"
typedef long long ll;

template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

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

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;

const double PI = acos(-1.0);

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";


#line 1 "/Users/knaga/programming/procon_library/data_structure/unionfind.hpp"


#line 4 "/Users/knaga/programming/procon_library/data_structure/unionfind.hpp"
/*
@title 素集合データ構造(UnionFind Tree)
@category データ構造
@docs ../docs/data_structure/unionfind.md
*/
struct UnionFind{
    int n;
    vector<int> Parent;
    vector<int> sizes;
    UnionFind(int _n):n(_n),Parent(_n),sizes(_n,1){ rep(i,n)Parent[i]=i; }
    //find the root of x
    int root(int x){
        if(x!=Parent[x]){
        Parent[x] = root(Parent[x]);
        }
        return Parent[x];
    }
    //merge x and y
    void unite(int x,int y){
        x = root(x);
        y = root(y);
        if(x == y) return;
        if(sizes[x] < sizes[y]) swap(x, y);
        Parent[y] = x;
        sizes[x] += sizes[y];
    }
    bool same(int x,int y){ return root(x) == root(y); }
    int size(int x){ return sizes[root(x)]; }
    int group_num(){
        set<int> s;
        for(int i = 0; i < n; ++i){
            s.insert(root(i));
        }
        return int(s.size());
    }
};

#line 4 "union_find_tree.yosupo.test.cpp"

using namespace std;

int main() {
    int n, q; cin >> n >> q;
    UnionFind uft(n);
    rep (i, q) {
        int t, u, v; cin >> t >> u >> v;
        if (t == 0) {
            uft.unite(u, v);
        } else if (t == 1) {
            cout << uft.same(u, v) << endl;
        }
    }
    return 0;
}



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

int main() {
  char S[100100];
  cin >> S;

  int N = strlen(S);
  int pos = 0;
  bool ok = true;

  while (pos < N && ok) {
    if (!strncmp(&S[pos], "dream", 5)) {
      pos += 5;
      if (S[pos] == 'e' && S[pos+1] == 'r' && S[pos+2] != 'a') {
        pos += 2;
      }
    } else if (!strncmp(&S[pos], "erase", 5)) {
      pos += 5;
      if (S[pos] == 'r') {
        ++pos;
      }
    } else {
      ok = false;
    }
  }

  if (ok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


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

using namespace std;

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

    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    int c_n = -1, c_n_idx = -1;
    for (int i = 0; i < n; i++) {
        if (c_n_idx == -1 || c_n < a[i]) {
            c_n = a[i];
            c_n_idx = i;
        }
    }

    int c_r = -1, c_r_idx = -1;
    for (int i = 0; i < n; i++) {
        if (c_n_idx != i
                && (c_r_idx == -1
                        || min(abs(c_r - c_n / 2), abs(c_r - c_n / 2 - c_n % 2))
                                > min(abs(a[i] - c_n / 2), abs(a[i] - c_n / 2 - c_n % 2)))) {
            c_r = a[i];
            c_r_idx = i;
        }
    }

    cout << c_n << " " << c_r << endl;
}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 321;

int a[N][N], p[N], h[N];

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      scanf("%d", a[i]+j);
    }
  }
  int ans = 2e9;
  set<int> s;
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      ++h[a[j][p[j]]];
    }
    int hi = max_element(h, h+m+1)-h;
    s.insert(hi);
    ans = min(ans, h[hi]);
    for (int j = 0; j < n; ++j) {
      while (s.count(a[j][p[j]])) ++p[j];
    }
    for (int j = 0; j <= m; ++j) h[j] = 0;
  }
  printf("%d", ans);
}

int main() {
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 4172
// ITP1_4_B Circle
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
 
int main() {
  
  // 初期値
  double r;
  double pi = 3.14159265358979;
  cin >> r;
  
  // メインループ
  printf("%f", r * r * pi);
  cout << " ";
  printf("%f", 2 * r * pi);
  cout << endl;
  return 0;
}


Measured memory_bytes: 3236
n,l = map(int, input().split())
a = [0]*n
# a = list(range(n+1))
# a.pop(0)
for i in range(n):
    t = l + i
    a[i] = t
if 0 in a:
    a.remove(0)
    print(sum(a))
elif max(a)>0:
    a.pop(0)
    print(sum(a))
else:
    a.pop(n-1)
    print(sum(a))      

Measured memory_bytes: 38256
#include<stdio.h>
#include<string.h>
 
 
typedef struct  {
    int first;
    int second;
    int third;
    int forth;
    int fifth;
    int sixth;
} Dice;
 
void NS(int *top, int *front, int *back, int *bottom, int a) {
    int tmp;
    if(a){
        // 南
        tmp = *top;
        *top = *front;
        *front = *bottom;
        *bottom = *back;
        *back = tmp;
    }else{
        // 北
        tmp = *top;
        *top = *back;
        *back = *bottom;
        *bottom = *front;
        *front = tmp;
    }
}
 
void EW(int *top, int *left, int *right, int *bottom, int a) {
    int tmp;
    if (a) {
        // 西
        tmp = *top;
        *top = *right;
        *right = *bottom;
        *bottom = *left;
        *left = tmp;
    }else{
        // 東
        tmp = *top;
        *top = *left;
        *left = *bottom;
        *bottom = *right;
        *right = tmp;
    }
}
 
int main() {
    Dice one;
    int i, l, com;
    char order[101];
 
    scanf("%d ", &one.first);
    scanf("%d ", &one.second);
    scanf("%d ", &one.third);
    scanf("%d ", &one.forth);
    scanf("%d ", &one.fifth);
    scanf("%d", &one.sixth);
 
    scanf("%s", order);
 
    l = strlen(order);
 
    for (i = 0; i < l; ++i) {
        switch(order[i]) {
            case 'N':
                com = 0;
                NS(&one.first, &one.fifth , &one.second, &one.sixth, com);
                break;
            case 'S':
                com = 1;
                NS(&one.first, &one.fifth , &one.second, &one.sixth, com);
                break;
            case 'E':
                com = 0;
                EW(&one.first, &one.forth , &one.third, &one.sixth, com);
                break;
            case 'W':
                com = 1;
                EW(&one.first, &one.forth , &one.third, &one.sixth, com);
                break;
        }
    }
    printf("%d\n", one.first);
    return 0;
}


Measured memory_bytes: 2148
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > > 
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s; cin >> s;
    rep(i,s.size()){
        if(i==0) continue;
        if(s[i] == s[i-1]){cout << i << " " << i+1 << endl; return 0;}
        if(i==1) continue;
        if(s[i] == s[i-2]){cout <<i-1 << " " << i+1 << endl; return 0;}
        
    }
    cout << "-1 -1" << endl;
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        boolean[] a = new boolean[2001];
        a[0] = true;

        for(int i = 0; i < n; i++){
            int q = sc.nextInt();

            for(int j = 2000 - q; j >= 0; j--){
                if(a[j]){
                    a[j+q] = true;
                }
            }
        }

        int m = sc.nextInt();

        for(int i = 0; i < m; i++){
            if(a[sc.nextInt()]){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }
        }
    }
}



Measured memory_bytes: 26444
#include <algorithm> //STLͨ���㷨
#include <cmath> //������ѧ����
#include <cstdio> //��������/�������
#include <iostream> //����������/���
#include <cstring> //�ַ�������
#include <string> //�ַ�����
#include <ctime> //�������ʱ��ĺ���
#define itn int
#define fro for
#define ll long long
#define reg register
#define inf 1234567890
#define rep(i,a,b,c) for (int i=a;i<=b;i+=c)
/*#include <bitset> //STLλ������
#include <cstype> //�ַ�����
#include <cerrno> //���������
#include <complex> //������
#include <clocale> //���屾�ػ�����
#include <cstdlib> //������������ڴ���亯��
#include <deque> //STL˫�˶�������
#include <exception> //�쳣������
#include <fstream> //�ļ�����/���
#include <functional> //STL�������㺯��(���������)
#include <limits> //�����������������ֵ����
#include <list> //STL�����б�����
#include <map> //STLӳ������
#include <iomanip> //����������/���
#include <ios> //��������/���֧��
#include <iosfwd> //����/���ϵͳʹ�õ�ǰ������
#include <istream> //����������
#include <ostream> //���������
#include <queue> //STL��������
#include <set> //STL��������
#include <sstream> //�����ַ�������
#include <stack> //STL��ջ����
#include <stdexcept> //��׼�쳣��
#include <streambuf> //�ײ�����/���֧��
#include <utility> //STLͨ��ģ����
#include <vector> //STL��̬��������
#include <cwchar.h>//���ַ�����������/���
#include <cwctype.h> //���ַ�����*/

using namespace std;

int ans;

int max(int x,int y){return x>y?x:y;}

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

int abs(int x){return x>0?x:-x;}

int gcd(int x,int y){return (!y)?x:gcd(y,x%y);}

void exgcd(int a,int b,int &d,int &x,int &y){if (!b){d=a,x=1,y=0;}else{exgcd(b,a%b,d,y,x);y-=x*(a/b);}}

int quick_power(ll a,int b){ll r=1;for (;b;b>>=1,a=a*a)if (b&1) r=r*a;return r;}

inline char read() {
	static const int IN_LEN = 1000000;
	static char buf[IN_LEN], *s, *t;
	return (s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin), (s == t ? -1 : *s++) : *s++);
}
template<class T>
inline void read(T &x) {
	static bool iosig;
	static char c;
	for (iosig = false, c = read(); !isdigit(c); c = read()) {
		if (c == '-') iosig = true;
		if (c == -1) return;
	}
	for (x = 0; isdigit(c); c = read()) x = x * 10 + (c ^ '0');
	if (iosig) x = -x;
}

char sr[10000000],z[20];int C=-1,Z=0;
void Ot(){fwrite(sr,1,C+1,stdout),C=-1;}
void print(int x){
	if (x<0) sr[++C]='-',x=-x;
    while(z[++Z]=x%10+48,x/=10);
    while(sr[++C]=z[Z],--Z);sr[++C]='\n';
}
//int find(int x){return fa[x]=fa[x]==x?x:find(fa[x]);}

//void add(int x,int y,int z){to[++cnt]=y;v[cnt]=z;Next[cnt]=head[x];head[x]=cnt;}
int main()
{
	int n;
	read(n);
	for (int i=1;i<=9;i++)
		for (int j=1;j<=9;j++)
			if (i*j==n) return puts("Yes"),0;
	puts("No");
	return 0;
}









Measured memory_bytes: 2304
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, 
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <bits/stdc++.h>

using namespace std;

int main()
{
    char pal[100];
    int n,k;
    cin >> pal >> k;
    
    if(strlen(pal)==1){
        cout << pal[0] << endl;
        return 0;
    }
    
    for(int x=0;x<k;x++){
        if(pal[x]!='1'){
        n=int(pal[x])-48;
        break;
        }
        n=1;
    }
    
    cout << n << endl;
    return 0;
}


Measured memory_bytes: 256