akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <limits.h>

int main(void){
    int N,C;
    scanf("%d%d",&N,&C);
    int d[C][C];
    for (int i=0; i<C; i++){
        for (int j=0; j<C; j++){
            scanf("%d",&d[i][j]);
        }
    }
    int c[N][N];
    for (int i=0; i<N; i++){
        for (int j=0; j<N; j++){
            scanf("%d",&c[i][j]);
        }
    }
    int sum1[C],sum2[C],sum3[C];
    for (int i=0; i<C; i++){
        sum1[i]=0;
        sum2[i]=0;
        sum3[i]=0;
    }
    for (int i=0; i<N; i++){
        for (int j=0; j<N; j++){
            for (int k=0; k<C; k++){
                if ((i+j)%3==0){
                    sum1[k]+=d[c[i][j]-1][k];
                } else if ((i+j)%3==1){
                    sum2[k]+=d[c[i][j]-1][k];
                } else {
                    sum3[k]+=d[c[i][j]-1][k];
                }
            }
        }
    }
    int ans=INT_MAX,tmp=0;
    for (int i=0; i<C; i++){
        for (int j=0; j<C; j++){
            for (int k=0; k<C; k++){
                if (i!=j && j!=k && k!=i){
                    tmp=sum1[i]+sum2[j]+sum3[k];
                    if (ans>tmp){
                        ans=tmp;
                    }
                }
            }
        }
    }
    printf("%d\n",ans);
	return 0 ;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define fi first
#define se second
#define pb push_back
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forr(i,n) for(int i=n;i>=0;i--)
#define all(x) x.begin(), x.end()
const int MAXN = 1e5 +5;

void fio(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main(){
  fio();
  vector<int> v(5);
  forn(i,5){
	cin>>v[i];
	if(v[i]==0){cout<<i+1<<endl; return 0;
	}
}
  return 0;
}

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

using namespace std;

int main(){
    string S;
    cin >> S;
    string first = S.substr(0, 2);
    string second = S.substr(2, 2);
    int f = stoi(first);
    int s = stoi(second);
    if(f<=12 && f>=1){
        if(s<=12 && s>=1) cout << "AMBIGUOUS" << endl;
        else cout << "MMYY" << endl;
    }
    else if(s<=12 && s>=1){
        cout << "YYMM" << endl;
    }
    else cout << "NA" << endl;
}


Measured memory_bytes: 256
using System;

namespace AtCoder.ABC098
{
    public class A
    {
        public static void Solve()
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);

            var max = -100000000;
            max = Math.Max(max, (a + b));
            max = Math.Max(max, (a - b));
            max = Math.Max(max, (a * b));
        
            Console.WriteLine(max);
        }    
    }
}

namespace AtCoder {
    class Program
    {
        static void Main(string[] args)
        {
            ABC098.A.Solve();
        }
    }
}


Measured memory_bytes: 11092
import java.util.*;

class Main{
    public static void main(String[] args){
	int sum=100000,add,k;
	Scanner s = new Scanner(System.in);

	k=s.nextInt();
	for(int i=0;i<k;i++){
	    sum*=1.05;
	    if( (add=sum%1000)>0 ){
		sum=sum-add+1000;
	    }
	}

	System.out.println( sum );

    }
}

Measured memory_bytes: 17292
#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<algorithm>
#include<cmath>
#include<iomanip>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
#define PI 3.14159265358979323846264338327950L
int main() {
	int a, b, h, m;
	cin >> a >> b >> h >> m;
	long double rad = PI * 2 * ( (long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long double)m / 60.0);
	long double ans = (long double)(a * a + b * b) - (long double)(2 * a *b) * cosl(rad);
    printf("%20.20Lf\n", sqrtl(ans));
	return 0;
}



Measured memory_bytes: 4060
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
	#define debug(...) printf(__VA_ARGS__)
#else
	#define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

const int MAXN = 3030;
const int MAXM = 3030;
const int MOD = 1000000007;
inline int add(int x, int y) { return (x + y) % MOD; }

char S[MAXN];
int cnt[MAXN];
int dp[MAXN][MAXN];
int l[MAXM], r[MAXM];

int main() {
	int N, M;
	scanf("%d%d", &N, &M);
	scanf("%s", S + 1);
	for(int i = 0; i < M; i++)
		scanf("%d%d", &l[i], &r[i]);
	cnt[0] = 0;
	for(int i = 1; i <= N; i++)
		cnt[i] = cnt[i - 1] + S[i] - '0';
	dp[l[0] - 1][cnt[l[0] - 1]] = 1;
	int ans = -1;
	for(int i = 0; i < M; i++) {
		int tl = l[i], tr = r[i];
		while(i + 1 < M && (l[i + 1] == tl || r[i + 1] <= tr)) {
			i++;
			tr = max(tr, r[i]);
		}
		debug("(%d, %d)\n", tl, tr);
		for(int j = tl; (i == M - 1 || j < l[i + 1]) && j <= tr; j++) {
			for(int k = 0; k <= N; k++) {
				if(cnt[tr] >= k && tr - cnt[tr] >= j - k) {
					if(k == 0)
						dp[j][k] = dp[j - 1][k];
					else
						dp[j][k] = add(dp[j - 1][k - 1], dp[j - 1][k]);
				}
				/*if(cnt[tr] )
					dp[j][k] += dp[j - 1][k];*/
				debug("dp[%d][%d] = %d\n", j, k, dp[j][k]);
			}
		}
		if(i == M - 1) {
			ans = dp[tr][cnt[tr]];
		}
		else {
			for(int j = tr + 1; j < l[i + 1]; j++)
				for(int k = 0; k <= N; k++) {
					if(S[j] == '1') {
						if(k > 0)
							dp[j][k] = dp[j - 1][k - 1];
					}
					else
						dp[j][k] = dp[j - 1][k];
					debug("dp[%d][%d] = %d\n", j, k, dp[j][k]);
				}
			debug("!\n");
		}
	}
	printf("%d\n", ans);
	return 0;
}


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

//#define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* cpp template {{{ */

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) REPS(i, 0, n)
#define REP0(i,n) for (ll i = 0; i <= (ll)(n); ++i)
#define REP1(i,n) for (ll i = 1; i <= (ll)(n); ++i)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいいです。
  return is;
}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : " " );
  }
  return os;
}
/* }}} */

signed main() 
{
  int a,b;
  cin >> a >> b;
  string s;
  cin >> s;
  bool flag=false;
  rep(i,s.size())
  {
    if(i==a)
      if(s[i]!='-') 
      {
        flag=false;
        break;
      }
      else flag=true;
    else
      if(s[i]<'0'||s[i]>'9') 
      {
        flag=false;
        break;
      }
      else flag=true;
  }
  flag?print("Yes"):print("No");
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define fr(i,a,b) for(ll i=a; i<b; i++)
#define fr1(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define viii vector <pair<ll,pair<ll,ll> > >
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define mp(i,j) make_pair(i,j)
#define fi first
#define se second
#define input(a,n) fr(i,0,n)cin>>a[i]
#define output(a,n) fr(i,0,n)cout<<a[i]<<endl
#define dbg cout<<"hurr"<<endl;
#define dbg2 cout<<"hurr2"<<endl;
#define md 1000000007
#define inf 999999999999999999
#define sp << " " <<
#define endl "\n"
#define pi 3.14159265358979323846
#define fixd(x) cout << fixed << setprecision(x);
#define sz size()
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
bool compare(pair<ll,ll> p1,pair<ll,ll> p2){
return p1.se>p2.se;
}
ll nc2(ll n){
return (n*(n-1))/2;
}
void solve(){
ll n,ans=0;
cin>>n;
ll a[n];
map<ll,ll> m;
fr(i,0,n){
cin>>a[i];
m[a[i]]++;
}
tr(m,it){
ans+=nc2(it->se);
}
fr(i,0,n){
cout<<ans-(m[a[i]]-1)<<endl;
}
}
int main()
{   fast;
    ll t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 11136
#include <iostream>
#include <cstdio>
#include <algorithm>
#define N 100005
using namespace std;

typedef long long ll;
ll n, ans, a[3][N], s[3][N];
int main()
{
	ll i, j, t, num;
	cin >> n;
	for (j = 0; j < 3; j++) {
		for (i = 0; i < n; i++) {
			scanf ("%lld", &a[j][i]);
		}
		sort(a[j], a[j] + n);
	}
	for (i = n - 1; i >= 0; i--) s[2][i] = s[2][i + 1] + 1;
	for (j = 1; j >= 0; j--) {
		for (i =n - 1; i>= 0; i--) {
			t = upper_bound(a[j +1], a[j + 1] + n, a[j][i]) - a[j + 1];
			num = s[j + 1][t];
			s[j][i] = s[j][i +1] + num;
			if (j == 0) ans += num;
		}
	}
	cout << ans;
    return 0;
}


Measured memory_bytes: 4992
/*g++ main.cpp -o main.out*/
/*./main.out*/

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

#define LL long long
#define LD long double
#define Mod 1000000007
#define L_Mod 17100000013

const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
const double PI = 3.1415926535;

#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define ree(a,n) memset(a,n,sizeof(a));

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))

int main()
{
    double r;
    cin>>r;
    printf("%.9f\n",2*PI*r);
    return 0;
}














Measured memory_bytes: 3784
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll,ll>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll k;
cin >> k;
ll ans = 0;
for(int i = 1; i <= k; i++)
    for(int j = 1; j <= k; j++){
        for(int l = 1; l <= k; l++){
            ans += gcd(i,gcd(j,l));
        }
    }
cout << ans << endl;
}

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

#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T> using V = vector<T>;
using P = pair<int, int>;

/*
 *  */

signed main() {
  int a[3][3];
  rep(i, 0, 3) rep(j, 0, 3) cin >> a[i][j];
  int n;
  cin >> n;
  V<int> b(n);
  rep(i, 0, n) cin >> b[i];

  V<V<int>> c(3, V<int>(3));
  rep(k, 0, n){
    rep(i, 0, 3) rep(j, 0, 3){
      if(a[i][j] == b[k]) c[i][j] = 1;
    }
  }

  bool ok = false;
  rep(i, 0, 3){
    int s1 = 0, s2 = 0;
    rep(j, 0, 3){
      s1 += c[i][j];
      s2 += c[j][i];
    }
    if(s1 == 3 or s2 == 3) ok = true;
  }

  if(c[0][0] + c[1][1] + c[2][2] == 3) ok = true;
  if(c[2][0] + c[1][1] + c[0][2] == 3) ok = true;

  cout << (ok ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1e9
#define LINF 1e18
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
struct edge{int to,cost;};
typedef pair<int,int> P;

bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}

bool f(string s){
    rep(i,0,s.size()/2){
        if(s[i]!=s[s.size()-i-1])return false;
        
    }
    return 1;
}

signed main (){
    int n;
    cin>>n;
    vector<vector<int>> v(n,vector<int>(10)),cost(n,vector<int>(11));
    rep(i,0,n)rep(j,0,10)cin>>v[i][j];
    rep(i,0,n)rep(j,0,11)cin>>cost[i][j];

    int ans=-1e18;
    rep(i,1,1<<10){
        int subans=0;
        rep(j,0,n){
            int count=0;
            bool notone=true;
            rep(k,0,10){
                if(i>>k&1 && v[j][k]==1){
                    count++;
                }
            }
            subans+=cost[j][count];
        }
        ans=max(subans,ans);
    }
    cout<<ans<<endl;
    




}
/*
1-2
0.5-2

010
01110
00111
000000111
*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define endl '\n'
#define mod 998244353
int n, k; 
int main() {
	io
	set<string>has;
	cin>>n;
	while(n--) {
		string s;
		cin>>s;
		has.insert(s);
	}
	cout<<has.size();
    return 0;
}


Measured memory_bytes: 19244
#include <bits/stdc++.h>
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using namespace std;
using pii = pair<int,int>;

int n,m,vis[100001],dist[100001];
vector<pii> adj[100001];

bool solve(int s) {
    queue<int> que;
    que.push(s);
    vis[s]=1;
    while(!que.empty()) {
        int cur=que.front();que.pop();
        for(auto &it:adj[cur]) {
            if(!vis[it.se]) {
                dist[it.se]=dist[cur]+it.fi;
                vis[it.se]=1;
                que.push(it.se);
            } else if(dist[it.se]!=dist[cur]+it.fi) return false;
        }
    }
    return true;
}
int main() {
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;i++) {
        int u,v,c;
        scanf("%d%d%d",&u,&v,&c);
        adj[u].push_back(pii(c,v));
        adj[v].push_back(pii(-c,u));
    }

    for(int i=1;i<=n;i++) if(!vis[i]) {
        if(!solve(i)) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    
    return 0;
}


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

int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    int ans=1e9;
    for(int i=-100;i<=100;i++){
        int cnt=0;
        for(int j=0;j<n;j++){
            cnt+=(a[j]-i)*(a[j]-i);
        }
        ans=min(ans,cnt);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String args[]) {
        // input

        int num;

        Scanner inp = new Scanner(System.in);

        num = inp.nextInt();

        int min = inp.nextInt();
        int max = (int) -(Math.pow(10,9));

        for (int i = 0; i < num-1; i++) {
            int r = inp.nextInt();
            max = Math.max(max, r-min);
            min = Math.min(min,r);
        }

        System.out.println(max);
    }
}


Measured memory_bytes: 100400
#include <stdio.h>
int main(void)
{
    double a,b,c,d,e,f;
    double x,y;
    
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!= EOF){
        x = (e*c-b*f)/(a*e-b*d);
        y = (c*d-a*f)/(b*d-a*e);
        if(x == -0.000000)x = 0.000000;
        if(y == -0.000000)y = 0.000000;
        printf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}

Measured memory_bytes: 652
#include<iostream>
using namespace std;
int main(){
  long long i,x,j,a,b,cnt=0;
  cin >> x;
  for(i=300; i>=-300; i--){
    for(j=-300; j<=300; j++){
      if(i*i*i*i*i-j*j*j*j*j==x){
        cnt++;
        a=i;
        b=j;
        break;
      }
    }
    if(cnt>0){
      break;
    }
  }
  cout << a << " " << b << endl;
}


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

using namespace std;

string S,T,U;
int A,B;

int main()
{
	cin>>S>>T;
	cin>>A>>B;
	cin>>U;
	if(S==U)
	    A--;
	if(T==U)
	    B--;
	cout<<A<<" "<<B<<endl;
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    int L,R,d;
    cin>>L>>R>>d;
    int ans=0;
    ans=R/d;
    int rem=(L-1)/d;

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

Measured memory_bytes: 3608
<?php
fscanf(STDIN, "%d %d %d", $x, $a, $b);

if ($b <= $a) {
    echo "delicious\n";
} else {
    $hoge = $b - $a;
    if ($hoge <= $x) {
        echo "safe\n";
    } else {
        echo "dangerous\n";
    }
}


Measured memory_bytes: 4856
#include<bits/stdc++.h>
#define ll long long
#define loop(n) for(ll i = 0; i<n; i++)
#define sort(a) sort(a.begin(), a.end())
using namespace std;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    string s; cin>>s;
    if(s=="ABC") cout<<"ARC\n";
    else cout<<"ABC\n";
    return 0;
}


Measured memory_bytes: 3592
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n;
    cin >> n;
    
    vector<vector<P>> G(n);
    rep(i, n-1) {
        ll a, b, cost;
        cin >> a >> b >> cost;
        a--;  b--;
        G[a].pb(make_pair(b, cost));
        G[b].pb(make_pair(a, cost));
    }
    
    vl dist(n, -1);  // dist[v] : 頂点vの根からの距離
    queue<ll> Q;
    const ll root = 0;  // デフォルトで根は頂点0
    dist[root] = 0;
    Q.push(root);
    while(!Q.empty()) {
        ll v = Q.front();
        Q.pop();
        for(auto p : G[v]) {
            ll u = p.first;
            ll cost = p.second; 
            if(dist[u] != -1) {
                continue;
            }
            dist[u] = dist[v] + cost;
            Q.push(u);
        }
    }
    
    rep(v, n) {
        out(dist[v]%2);
    }
    
    re0;
}

Measured memory_bytes: 8704
let bin_search x (a : int array) n =
  let l = ref 0 in
  let r = ref n in
  try
    while !l < !r do
      let m = (!l + !r) / 2 in
      if x = a.(m) then raise Exit;
      if x < a.(m) then r := m
      else l := m + 1;
    done;
    false
  with Exit -> true

let split_on_char sep s =
  let open String in
  let r = ref [] in
  let j = ref (length s) in
  for i = length s - 1 downto 0 do
    if get s i = sep then begin
      r := sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  sub s 0 !j :: !r

let () =
  let read_seq () = read_line () |> split_on_char ' ' |> List.map int_of_string in
  let n = read_int () in
  let s = read_seq () |> Array.of_list in
  let _ = read_int () in
  read_seq ()
  |> List.fold_left (fun acc e -> acc + (if bin_search e s n then 1 else 0)) 0
  |> Printf.printf "%d\n"

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

int main()
{
    string s;
    char a[5], b[7], c[5], x;
    int i;

    for(i=0; i<5; i++)
        cin>>a[i];
    cin>>x;
    for(i=0; i<7; i++)
        cin>>b[i];
    cin>>x;

    for(i=0; i<5; i++)
        cin>>c[i];

    for(i=0; i<5; i++)
        cout<<a[i];
    cout<<" ";
    for(i=0; i<7; i++)
        cout<<b[i];
    cout<<" ";
    for(i=0; i<5; i++)
        cout<<c[i];
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        sc.close();
        boolean n = false, w = false, s = false, e = false;
        for (char c : str.toCharArray()) {
            switch (c) {
                case 'N':
                    n = true;
                    break;
                case 'W':
                    w = true;
                    break;
                case 'S':
                    s = true;
                    break;
                case 'E':
                    e = true;
                    break;
            }
        }
        boolean ok = n == s && w == e;
        System.out.println(ok ? "Yes" : "No");
    }
}


Measured memory_bytes: 9940
class Node():
    def __init__(self):
        self.parent = None
        self.left = None
        self.right = None
        self.depth = None
        self.height = None
        self.type = None

n = int(input())

# preparing the tree
tree = []
for _ in range(n):
    tree.append(Node())
for _ in range(n):
    id, left, right = map(int, input().split())
    if left > -1:
        tree[id].left = left
        tree[left].parent = id
    if right > -1:
        tree[id].right = right
        tree[right].parent = id
        
        
def get_type(id):
    if tree[id].parent is None:
        return 'root'
    elif (tree[id].left is None) and (tree[id].right is None):
        return 'leaf'
    else:
        return 'internal node'

# recursively set the depth of each node    
def set_depth(id, d):
    tree[id].depth = d
    if tree[id].left is not None:
        set_depth(tree[id].left, d+1)
    if tree[id].right is not None:
        set_depth(tree[id].right, d+1)

# recursively set the height of each node
def set_height(id):
    if id is None:
        pass
    elif tree[id].type == 'leaf':
        tree[id].height = 0
    else:
        left_id = tree[id].left
        right_id = tree[id].right
        set_height(left_id)
        set_height(right_id)
        
        
        tree[id].height = max(
                0 if left_id is None else tree[left_id].height + 1,  
                0 if right_id is None else tree[right_id].height + 1 
            )
         

def get_num_child(id):
    return (tree[id].left is not None)  + (tree[id].right is not None)

def get_sibling(id):
    if tree[id].type == 'root':
        out = None
    else:
        parent_node = tree[tree[id].parent]
        out = (parent_node.right if (parent_node.left == id) else parent_node.left)
    return (-1 if out is None else out)

# ==========

for id in range(n):
    tree[id].type = get_type(id)
    if tree[id].type == 'root':
        root_id = id
set_depth(root_id, 0)
set_height(root_id)

for id in range(n):
    print(f"node {id}: parent = {-1 if tree[id].parent is None else tree[id].parent}, sibling = {get_sibling(id)}, degree = {get_num_child(id)}, depth = {tree[id].depth}, height = {tree[id].height}, {tree[id].type}")



Measured memory_bytes: 5636
import scala.io.StdIn.readLine
import scala.math.{max, min}
import scala.annotation.tailrec

object Main extends App {

  readLine()

  val xs = readLine().split(" ").map { _.toLong }

  val (minV, maxV, sumV) = solve(xs)
  println(s"$minV $maxV $sumV")

  def solve(zs: Seq[Long]): (Long, Long, Long) = {

    @tailrec
    def go(xs: List[Long], t: (Long, Long, Long)): (Long, Long, Long) =
      xs match {
        case Nil     => t
        case y :: ys =>
          val (minV, maxV, sumV) = t
          go(ys, (min(y, minV), max(y, maxV), y + sumV))
      }

    val x :: xs = zs.toList
    go(xs, (x, x, x))
  }
}



Measured memory_bytes: 50944
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main{
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String [] letters = new String[3];

        for (int i = 0; i < 3; i++) {
            letters[i] = input.readLine();
        }
        int current = 0;
        int [] positions = new int[3];
        while (true){
            if (positions[current] >= letters[current].length()){
                System.out.println((char)(current + 'A'));
                break;
            }
            current = letters[current].charAt(positions[current]++) - 'a';

        }
    }
}



Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
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; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int N;cin >> N;
    vector<int> B(N-1);
    rep(i,N-1)cin >> B[i];
    int ans = B[0];
    for(int i = 1;i <= N-2;i++){
        ans += min(B[i-1],B[i]);
    }
    ans += B[N-2];
    cout << ans << endl;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
	int a;
	int b;
	cin >> a;
	cin >> b;
    if(a>b){
        cout<<("a")<<(" ")<<(">")<<(" ")<<("b")<<endl;
    }else{
        if(a<b){
            cout<<("a")<<(" ")<<("<")<<(" ")<<("b")<<endl;
        }else{
            cout<<("a")<<(" ")<<("==")<<(" ")<<("b")<<endl;
        }
    }
    
}




Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define ll long long
#define fr(i,n) for(ll i=0;i<n;i++)
using namespace std;
const ll A = 1000005;
ll k[A],j[A];ll n;
bool pairwise(){
for(ll i=2;i<A;i++)
    {int cnt = 0;

        for(ll ii=i;ii<A;ii+=i)
        {
            cnt += j[ii];
        }
        if(cnt>1)
        {
            return false;
        }
    }
    return true;}

bool setwise(){
    ll gcd=k[0];
for(ll i=1;i<n;i++){
        gcd=__gcd(k[i],gcd);
        {if(gcd==1)return true;}
}
return false;}


int main() {
    cin>>n;
    fr(i,n)cin>>k[i],j[k[i]]++;
   if(pairwise())cout<<"pairwise coprime";
    else if(setwise())cout<<"setwise coprime";
    else  cout<<"not coprime";

    }


Measured memory_bytes: 19008
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 2019;
    static final int INF = 1 << 30;
    static final int ALF = 26;

    Main() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        // 3 673
        int[] k = new int[s.length()];
        for (int i = 0; i < s.length(); i++)
            k[i] = (int) s.charAt(i) - '0';
        int tmp = 0;
        int pom = 1;
        int[] mem = new int[s.length()];
        int[] map = new int[MOD];
        tmp = 0;
        map[0]++;
        for (int i = 0; i < s.length(); i++) {
            tmp += k[s.length() - i - 1] * pom;
            tmp %= MOD;
            pom *= 10;
            pom %= MOD;
            mem[i] = tmp;
            map[tmp]++;
        }
        long ans = 0;
        for(int i=0;i<2019;i++){
            ans += map[i]*(map[i]-1)/2;
        }
        System.out.println(ans);
        System.err.println(Arrays.toString(mem));
    }

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


Measured memory_bytes: 45660
#include <map>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
int t, a, b, c, d;
ll n, ans;
template<typename type>void Read(type &p)
{
	p = 0;
	char c = getchar();
	for (; c < '0' || c > '9'; c = getchar());
	for (; c >= '0' && c <= '9'; c = getchar())p = p * 10 + c - '0';
}
map<ll, ll>S;
ll Getans(ll x)
{
	if (!x)
		return 0;
	if (S.find(x) != S.end())
		return S[x];
	if (double(x) * d <= 4e18)
		S[x] = x * d;
	else
		S[x] = 1ll << 62;
	if (x % 2 == 0)
		S[x] = min(S[x], Getans(x / 2) + a);
	else
	{
		if ((x + 1) / 2 < x)
			S[x] = min(S[x], Getans((x + 1) / 2) + a + d);
		if ((x - 1) / 2 < x)
			S[x] = min(S[x], Getans((x - 1) / 2) + a + d);
	}
	if (x % 3 == 0)
		S[x] = min(S[x], Getans(x / 3) + b);
	else
	{
		if (x % 3 == 1)
			S[x] = min(S[x], Getans((x - 1) / 3) + b + d);
		else
			S[x] = min(S[x], Getans((x + 1) / 3) + b + d);
	}
	if (x % 5 == 0)
		S[x] = min(S[x], Getans(x / 5) + c);
	else
	{
		if (x % 5 == 1)
			S[x] = min(S[x], Getans((x - 1) / 5) + c + d);
		if (x % 5 == 2)
			S[x] = min(S[x], Getans((x - 2) / 5) + c + 2 * d);
		if (x % 5 == 3)
			S[x] = min(S[x], Getans((x + 2) / 5) + c + 2 * d);
		if (x % 5 == 4)
			S[x] = min(S[x], Getans((x + 1) / 5) + c + d);
	}
	return S[x];
}
int main()
{
	Read(t);
	while (t--)
	{
		Read(n), Read(a), Read(b), Read(c), Read(d);
		S.clear();
		printf("%lld\n", Getans(n));
	}
}


Measured memory_bytes: 4440
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;

#define INF 1LL << 55
#define MAX (1LL << 31) -1
#define MOD 1000000007
typedef long long ll;
typedef pair<int,ll> P;
typedef pair<pair<int,int>,ll> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={1,-1,0,0},dy[]={0,0,-1,1};
//#define F function<T(T,T)>

template<class T>
struct SegmentTree{
    using F=function<T(T,T)>;

    const F f;
    int size;
    vector<T> seg;
    const T inf;

    SegmentTree(int N,const F f,const T &inf) :f(f),inf(inf){
        size=1;
        while(size<N) size<<=1;
        seg.assign(2*size,inf);
    }
    void set(int k,const T &x){
        seg[k+size]=x;
    }
    void build(){
        for(int k=size-1;k>0;k--){
            seg[k]=f(seg[2*k],seg[2*k+1]);
        }
    }
    void update(int k,const T &x){
        k+=size;
        seg[k]=x;
        while(k>>=1){
            seg[k]=f(seg[2*k],seg[2*k+1]);
        }
    }
    //[a:b)
    T query(int a,int b){
        T L=inf,R=inf;
        for(a+=size,b+=size;a<b;a>>=1,b>>=1){
            if(a&1) L=f(L,seg[a++]);
            if(b&1) R=f(seg[--b],R);
        }
        return f(L,R);
    }

    T operator[](const int &k) const{
        return seg[k+size];
    }
};

signed main(){
    int N,M;
    cin>>N>>M;
    vector<P> V[110000];
    SegmentTree<ll> seg(N,[](ll a,ll b){return min(a,b);},INF);
    for(int i=0;i<M;i++){
        int l,r;
        ll c;
        cin>>l>>r>>c;
        l--; r--;
        V[l].push_back(P(r,c));
    }
    seg.update(0,0);
    for(int i=0;i<N-1;i++){
        ll v=seg.query(i,N);
        for(auto x:V[i]){
            if(seg[x.first]>v+x.second) seg.update(x.first,v+x.second);
            //cout<<x.first<<" "<<v+x.second<<endl;
        }

    }
    if(seg[N-1]==INF) cout<<-1<<endl;
    else cout<<seg[N-1]<<endl;


}

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


int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    bool ok = false;
    rep(i,n) {
        cin >> a.at(i);
    }

    sort(a.rbegin(), a.rend());
    int g = 1e9 + 5;
    if (k <= a.at(0)) {
        rep(i,n) {
            if (k == a.at(i)) ok = true;
            if (0 < i) g = min(g, gcd(a.at(i), a.at(i-1)));
        }
    }

    if (k % g == 0) ok = true;

    if (ok) cout << "POSSIBLE" << endl;
    else cout << "IMPOSSIBLE" << endl;
    return 0;
}

Measured memory_bytes: 3668
#ABC145C
def main():
    import sys, itertools as ite
    import math
    N = int(sys.stdin.readline())
    XY = [tuple(map(int, sys.stdin.readline().split())) for _ in range(N)]
    #print(XY)
    P = tuple(ite.permutations([i for i in range(N)]))
    #print(P)
    
    def d_calc(A, B):
        return math.sqrt((A[0]-B[0])**2 + (A[1]-B[1])**2)
    
    ans = 0
    for i in range(len(P)):
        for j in range(N-1):
            ans += d_calc(XY[P[i][j+1]], XY[P[i][j]])
    print(ans/len(P))
  

if __name__=='__main__':
    main()


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

int main(){
    int n; cin >> n;
    string ans = "No";
    for(int i = 1;i <= 9;i++){
        for(int j = 1;j <= 9;j++){
            if(n == i * j) ans = "Yes";
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
//using namespace __gnu_pbds;
//typedef tree<
//        pair<long long, int>, // change type
//        null_type,
//        less<pair<long long, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

//template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;


vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}

#ifdef LOCAL
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) ;
#endif


typedef long long ll;
#define rep(i, start, end) for(int i = start; i < end; ++i)
#define sz(x) (int)((x).size())
#define pb push_back
#define all(x) x.begin(), x.end()
#define clr(d, v) memset(d, v, sizeof(d))
#define pii pair<int, int>
//#define debug(x) cerr << #x << " : " << (x) << " "
const double PI = 3.14159265358979323846;
const double eps = (1e-8);
int isGreater(long double x, long double y)
{
    if (abs(x - y) < eps)
        return 0;
    if (x > y)
        return 1;
    return -1;
}


bool overflow(ll x, ll y)
{
    return x >= LLONG_MAX/y;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("AC.txt", "w", stdout);
#endif
    ll product = 1;
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,0,n)
    {
        cin >> a[i];
        if (a[i] == 0)
        {
            cout << 0 << '\n';
            return 0;
        }
    }
    for (ll x : a)
    {
        if (overflow(product, x))
        {
            cout << -1;
            return 0;
        }
        product *= x;
    }
    if (product > 1000000000000000000)
        cout << -1;
    else
        cout << product;
}

Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  double sum;
  cin >> N;
  vector<int> vec(N); 
  
  for(int i=0;i<N;i++ ){
    cin >> vec.at(i);
  } 
  sort(vec.begin(), vec.end());
  
  sum=vec.at(0);
  for(int i=1;i<N;i++){
    sum=sum+vec.at(i);
    sum=sum/2.0;
  }
  cout.precision(20);cout<<showpoint<<sum<<endl;
}  

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
using namespace std;
const long long NR=2100;
long long n,x,y,dis[NR],ans[NR];
vector<long long> v[NR];
void dfs(long long a,long long d)
{
	if(d>=dis[a])
	{
		return;
	}
	dis[a]=d; 
	for(long long i=0;i<v[a].size();i++)
	{
		dfs(v[a][i],d+1);
	}
}
int main()
{
	scanf("%lld%lld%lld",&n,&x,&y);
	for(long long i=1;i<n;i++)
	{
		v[i].push_back(i+1);
		v[i+1].push_back(i);
	}
	v[x].push_back(y);
	v[y].push_back(x);
	for(long long i=1;i<=n;i++)
	{
		for(long long j=1;j<=n;j++)
		{
			dis[j]=0x3f3f3f3f;
		}
		dfs(i,0);
		for(long long j=1;j<=n;j++)
		{
			ans[dis[j]]++;
		}
	}
	for(long long i=1;i<n;i++)
	{
		printf("%lld\n",ans[i]>>1);
	}
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }

main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    int n;
    cin >> n;
    cin >> s;
    if (n & 1) {
        cout << "No\n";
        rr;
    }
    if (s.substr(0, n / 2) + s.substr(0, n / 2) == s) {
        cout << "Yes\n";
    }
    else cout << "No\n";
}


Measured memory_bytes: 3644
import java.util.*;
 
public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a*b%2 == 0) {
			System.out.println("Even");
		}
		else {
			System.out.println("Odd");
		}
	}
 
}

Measured memory_bytes: 35672
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1000000007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }


long long bipow(long long n, int m) {
    if (m == 0) return 1;
    if (m % 2 == 0) {
        n = (n * n) % MOD;
        return bipow(n, m / 2) % MOD;
    } else
        return (n * bipow(n, m - 1)) % MOD;
}

long long func(long long n, long long a){
    long long ret = 1;
    for(int i=0; i<a; i++){
        ret *= (n-i) % MOD;
        ret %= MOD;
    }
    long long den = 1;
    for(int i=0; i<a; i++)
        den = (den * (i+1)) % MOD;
    den = bipow(den, MOD-2);
    return (ret * den) % MOD;
}

int main(){
    long long n, a, b;
    cin >> n >> a >> b;
    long long ans = bipow(2, n);
    ans = (ans + (MOD-1)) % MOD;
    ans = (ans + MOD - func(n, a)) % MOD;;
    ans = (ans + MOD - func(n, b)) % MOD;;
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	int n,i,j,p;cin>>n;
	for (i=0;i<=20;i++) if ((1<<i)==n){puts("No");exit(0);}else if ((1<<i)<n) p=i;
	puts("Yes");
	if (n&1)
	{
		for (i=2;i<=n;i+=2)
		{
			cout<<i<<' '<<i+1<<endl;
			cout<<i+n<<' '<<i+n+1<<endl;
			cout<<1<<' '<<i+1<<endl;
			cout<<1<<' '<<i+n<<endl;
		}
		cout<<n+1<<' '<<n+3;
	}
	else
	{
		int a=(1<<p),b=n-a;
		for (i=2;i<n;i+=2) 
		{
			cout<<i<<' '<<i+1<<endl;
			cout<<i+n<<' '<<i+n+1<<endl;
			if (i!=a) cout<<1<<' '<<i+1<<endl,cout<<1<<' '<<i+n<<endl;
		}
		cout<<b<<' '<<a<<endl;
		cout<<b+n+1<<' '<<a+n+1<<endl;
		cout<<n<<' '<<a<<endl;
		cout<<n+n<<' '<<b<<endl;
		cout<<n+1<<' '<<b+n+1;
	}
}
//a+1 a b b+1 1 b+n b+n+1 a+n+1 a+n
//5 4 2 3 1 8 9 11 10

Measured memory_bytes: 2304
fun main() {
    val grid = Array(50) { CharArray(100) { '#' } } + Array(50) { CharArray(100) { '.' } }
    val (a, b) = readLine()!!.split(' ').map { it.toInt() }

    for (i in 0 until a - 1) {
        grid[(i / 50) * 2][i % 50 * 2] = '.'
    }

    for (i in 0 until b - 1) {
        grid[(i / 50) * 2 + 51][i % 50 * 2] = '#'
    }

    println("100 100")
    println(grid.joinToString("\n") { it.joinToString("") })
}


Measured memory_bytes: 40420
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 文字列の入力
            string s = Console.ReadLine();

            var nickname = s.Substring(0, 3);

            Console.WriteLine(nickname);

            Console.Out.Flush();
        }
    }
}

Measured memory_bytes: 17320
#include <bits/stdc++.h>
using namespace std;
 
int main() {

  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < 10000; i++){
    if (n <= 1000*i){
        cout << (1000*i)-n << endl;
      	break;
    }   
  }
  return 0;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
       int S = scan.nextInt();
       int h = S/3600;
       int m = S%3600/60;
       int s = S%60;
        System.out.println(h+":"+m+":"+s);

    }
}



Measured memory_bytes: 26260
#include <bits/stdc++.h>
using namespace std;
const int maxn  = 100100;
vector<pair<int, int> > nxt[maxn];
int dist[maxn];
int deg[maxn];
int MAIN(){
  int n;
  if(!(cin >> n)) return 0;
  for(int e = 0; e < n; e++) nxt[e].clear();
  memset(dist, -1, sizeof(dist));
  memset(deg, 0, sizeof(deg));
  int m;
  cin >> m;
  for(int e = 0; e < m; e++){
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    u--; v--;
    nxt[u].push_back({v, w});
    deg[v]++;
  }
  queue<int> q;
  for(int e = 0; e < n; e++){
    if(deg[e] == 0){
      q.push(e);
      dist[e] = 0;
    }
  }
  int rr = 0;
  while(!q.empty()){
    int cur = q.front(); q.pop();
    rr++;
    for(auto e : nxt[cur]){
      int v, w;
      tie(v, w) = e;
      if(dist[v] != -1){
        if(dist[v] != dist[cur] + w){
          printf("No\n");
          return 1;
        }
      } else {
        dist[v] = dist[cur] + w;
      }
      deg[v]--;
      if(deg[v] == 0) q.push(v);
    }
  }
  if(rr == n) printf("Yes\n");
  else printf("No\n");
  return 1;
}
int main(){
  while(MAIN());
  return 0;
}


Measured memory_bytes: 6784
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    int n,m; cin >> n >> m;
    int a[m],b[m];
    vector<vector<int>> to(n);
    rep(i,m){
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
        to[a[i]].pb(b[i]);
        to[b[i]].pb(a[i]);
    }
    int ans=0;
    rep(i,m){
        queue<int> q;
        vector<bool> visit(n,0);
        q.push(0); visit[0]=1;
        int cnt=1;
        while(!q.empty()){
            int d=q.front(); q.pop();
            for(auto u:to[d]){
                if(visit[u]) continue;
                if(d==a[i]&&u==b[i]) continue;
                if(d==b[i]&&u==a[i]) continue;
                q.push(u);
                visit[u]=1;
                cnt++;
            }
        }
        if(cnt!=n) ans++;
    }
    cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    cout << n / 3;
    return 0;
}


Measured memory_bytes: 3612