akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define Sheryang main
const int maxn=1e6+7;
typedef long long ll;
const int mod=1e9+7;
ll read(){ll c = getchar(),Nig = 1,x = 0;while(!isdigit(c))c = getchar();if(c == '-')Nig = -1,c = getchar();while(isdigit(c))x = ((x<<1) + (x<<3)) + (c^'0'),c = getchar();return Nig*x;}
#define read read()

int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
int n,m;
ll ans;
char s[1005][1005];
int tree[maxn],cnt[maxn],c[maxn];
int has(int x,int y){
    return x*400+y;
}

int find(int x){
    return x==tree[x]?x:tree[x]=find(tree[x]);
}

void Mer(int x,int y){
    x=find(x),y=find(y);
    if(x!=y){
        tree[x]=y;
        cnt[y]+=cnt[x];
        c[y]+=c[x];
    }
}

int Sheryang()
{
    for(int i=0;i<maxn;i++) tree[i]=i,cnt[i]=1;

    n=read;m=read;
    for(int i=1;i<=n;i++)
        scanf("%s",s[i]+1);

    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(s[i][j]=='#')
                c[has(i,j)]=1;

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            for(int k=0;k<4;k++){
                int x=i+dx[k];
                int y=j+dy[k];
                if(x>0&&x<=n&&y>0&&y<=m && s[i][j]!=s[x][y]){
                    Mer(has(x,y),has(i,j));
                }
            }
        }
    }

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            int h=find(has(i,j));
            if(cnt[h]>1){
                ans += 1ll*c[h]*(cnt[h]-c[h]);
                cnt[h] = -1;
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 11136
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.StringTokenizer;
import java.util.OptionalDouble;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] X = in.nextIntArray(N);

            int ave = (int) Math.round(IntStream.of(X).average().getAsDouble());
            long ans = 0;
            for (int x : X) {
                ans += Math.pow(Math.abs(ave - x), 2);
            }
            out.println(ans);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

    }
}



Measured memory_bytes: 28500
//第8回シンデレラガール総選挙は是非本田未央ちゃんに投票をお願いします！
//ファンのことも他のアイドルの子たちのことも本当に大事にしてて、今まで周りに色んなものを与えてくれました。
//今度は私たちが未央ちゃんにお返しをする番です。みんなでガラスの靴を履かせてあげましょう！
// #本田未央を一番星に #本田未央を令和のシンデレラガールに #第8回シンデレラガール総選挙
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
ostream &operator<<(ostream &os, const vector<int> &a) {
	os<<"[";
	rep(i,a.size()){
		os<<a[i];
		if(i<a.size()-1) os<<",";
	}
	os<<"]";
	return os; 
}
int n;
vector<int> inv(vector<int> a){
	vector<int> ret(n);
	rep(i,n) ret[a[i]]=i;
	return ret;
}
vector<int> mul(vector<int> a,vector<int> b){
	vector<int> ret(n);
	rep(i,n) ret[i]=b[a[i]];
	return ret;
}
map<int,vector<int> > me;
vector<int> rec(int a){
	if(me[a].size()>0) return me[a];
	return me[a]=mul(rec(a/2),rec(a-a/2));
}
vector<int> ama[10];
int main()
{
	vector<int> a,b,id;
	int m,c;
	cin>>n>>m;m--;
	rep(i,n) id.pb(i);
	rep(i,n){
		cin>>c;c--;a.pb(c);
	}
	rep(i,n){
		cin>>c;c--;b.pb(c);
	}
	ama[0]=a;ama[1]=b;
	rep(i,6) ama[i+2]=mul(inv(ama[i]),ama[i+1]);
	vector<int> A=inv(a),B=inv(b);
	//cout<<ama[2]<<endl;
	vector<int> x=mul(B,mul(a,mul(b,A)));
	me[0]=id;me[1]=x;
	vector<int> y=rec(m/6);
	//cout<<y<<endl;
	vector<int> out=mul(y,mul(ama[m%6],inv(y)));
	rep(i,n){
		cout<<out[i]+1;
		if(i<n-1) cout<<' ';else cout<<endl;
	}
}


Measured memory_bytes: 30200
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+11;
vector<int> g[N];
char s[N];
int n,m,d[N][2];
int vi[N];
int main(){
#ifdef flukehn
	freopen("g.in","r",stdin);
#endif
	int i,x,y;
	cin>>n>>m;
	scanf("%s",s+1);
	for(i=1;i<=n;++i)s[i]-='A';
	for(i=1;i<=m;++i){
		scanf("%d%d",&x,&y);
		g[x].push_back(y);
		g[y].push_back(x);
		++d[x][s[y]];
		++d[y][s[x]];
	}
	queue<int> q;
	for(i=1;i<=n;++i)
		if(!d[i][0]||!d[i][1])vi[i]=1,q.push(i);
	while(!q.empty()){
		x=q.front();
	//	cerr<<x<<endl;
		q.pop();
		for(int y:g[x]){
			if(!(--d[y][s[x]])&&!vi[y])vi[y]=1,q.push(y);
		}
	}
	for(i=1;i<=n;++i)
		if(!vi[i]){
			puts("Yes");
			return 0;
		}
	puts("No");
}

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

const int kMaxN = 100010;

int balls_num[kMaxN];
bool have_red[kMaxN];

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

    int N, M;
    cin >> N >> M;

    fill(balls_num, balls_num + N, 1);
    have_red[0] = true;

    for (int i = 0; i < M; i++) {
        int x, y;
        cin >> x >> y;
        x--; y--;
        have_red[y] = have_red[y] || have_red[x];
        balls_num[x]--; balls_num[y]++;

        if (balls_num[x] == 0) have_red[x] = false;
    }

    int ans = 0;
    for (int i = 0; i < N; i++) {
        if (have_red[i]) ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 768
#include <stdio.h>
int main(void){
        int d,a,b;
        scanf("%d %d %d", &d, &a, &b);
        if (b <= a) {
            printf("%s", "delicious");
        } else if (b <= a + d) {
            printf("%s", "safe");
        } else if (b > a + d) {
            printf("%s", "dangerous");
        }
        return 0;
}

Measured memory_bytes: 128
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		String s = fs.next();
		int k = fs.nextInt();
		TreeSet<String> ts = new TreeSet<>();
		for(int i=0;i<s.length();i++) {
			String t = "";
			for(int j=0;j<k;j++) {
				if(i+j>=s.length())break;
				t += s.charAt(i+j);
				ts.add(t);
			}
		}
		String ans = "";
		for(int i=0;i<k;i++)ans = ts.pollFirst();
		System.out.println(ans);
	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

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

int main()
{
    int n;
    cin >> n;
    const int sz=n;
    int a[sz],b[sz-1];
    for(int i=0;i<n-1;++i) cin >> b[i];
    for(int i=0;i<n;++i){
        if(i==0) a[i]=b[i];
        else if(i==n-1) a[i]=b[i-1];
        else a[i]=min(b[i-1],b[i]);
    }
    long sum=0;
    for(int i=0;i<n;++i) sum += a[i];
    cout << sum << endl;
    return 0;
}

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

int prime_number(int num) {
  if (num == 2)
    return 1;
  else if ((num % 2 == 0) || num == 1)
    return 0;
  else {
    for (int i = 3; i <= sqrt(num); i++) {
      if (num % i == 0)
	return 0;
    }
  }
  return 1;
}

int main(void) {
  int n;
  int i;
  int num;
  int count = 0;
  
  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    count += prime_number(num);
  }

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



Measured memory_bytes: 2132
if __name__ == "__main__":
    X = input()
    Y = input()
    N = len(X) + len(Y)
    res = ""
    cnt1 = 0
    cnt2 = 0
    for x in range(N):
        if (x % 2 == 0):
            res += X[cnt1]
            cnt1 += 1
        else:
            res += Y[cnt2]
            cnt2 += 1
    print (res)


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

int main(){
    int K,A,B;
    cin >> K >> A >> B;
    vector<int> L(1010);
    bool can = false;

    for(int i = 0;i <= B - A;i++){
        L.at(i) = i + A;
    }

    for(int i = 0;i <= B - A;i++){
        if(L.at(i) / K != 0 && L.at(i) % K == 0){
            can = true;
            break;
        }
    }
    
    if(can)
        cout << "OK" << endl;
    else
    {
            cout << "NG" << endl;
    }
    

}

Measured memory_bytes: 3600
def isSorted(x):
  return x == sorted(x)

n = int(raw_input())
a = map(int,raw_input().split())
flag = isSorted(a)
for i in range(n):
  if flag : break
  for j in range(i):
    t = a[i]
    a[i] = a[j]
    a[j] = t
    if(isSorted(a)==True):
       flag = True
    t = a[i]
    a[i] = a[j]
    a[j] = t
if flag:
  print "YES"
else:
  print "NO"

Measured memory_bytes: 31468
N,C = map(int,input().split())

D = []

for i in range(C):

    d = list(map(int,input().split()))

    D.append(d)

c = []

for i in range(N):

    cc = list(map(int,input().split()))
    c.append(cc)


lis1 = []
lis2 = []
lis3 = []

for c1 in range(C):

    c1 += 1

    now = 0

    for i in range(N):

        for j in range(N):

            if (i + j) % 3 == 0 and c[i][j] != c1:

                now += D[c[i][j]-1][c1-1]

    lis1.append(now)


for c2 in range(C):

    c2 += 1

    now = 0

    for i in range(N):

        for j in range(N):

            if (i + j) % 3 == 1 and c[i][j] != c2:

                now += D[c[i][j]-1][c2-1]

    lis2.append(now)


for c3 in range(C):

    c3 += 1

    now = 0

    for i in range(N):

        for j in range(N):

            if (i + j) % 3 == 2 and c[i][j] != c3:

                now += D[c[i][j]-1][c3-1]

    lis3.append(now)


ans = float("inf")

for i in range(C):

    for j in range(C):

        for k in range(C):


            if i == j or j == k or k == i :
                continue;

            ans = min(ans,lis1[i] + lis2[j] + lis3[k])

print (ans)

Measured memory_bytes: 46684
#include <iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	int itung=0;
	int arr[n+10];

	for(int i=0;i<n;i++){
		cin >> arr[i];
	}
	for(int i=1;i<n-1;i++){
		if((arr[i]>arr[i+1] && arr[i]<arr[i-1]) || (arr[i]>arr[i-1] && arr[i]<arr[i+1])){
			itung++;
		}
	}
	cout << itung << endl;
}

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

using ll = long long;

ll gcd(ll a, ll b) {
  if (a < b) swap(a, b);

  ll r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

ll lcm(ll a, ll b) {
  if (a < b) swap(a, b);

  return a * b / gcd(a, b);
}

int main() {
  ll A, B, C ,D;
  scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
  
  ll LCM = lcm(C, D);
  // CでもDでも割ることができる集合
  ll q = 0;

  ll ans = B - A + 1;
  q += ((B / C) + (B / D) - (B / LCM));
  q -= (((A - 1) / C) + ((A - 1) / D) - ((A - 1) / LCM));

  // 全体集合とqの差集合が解答
  printf("%lld", ans - q);
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double Double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

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

void solve(long long N, long long M, std::vector<long long> p,
           std::vector<std::string> S) {
    set<int> ac;
    map<int, int> cnt;

    long long ans = 0;
    for (int i = 0; i < M; i++) {
        if (S[i] == "AC") {
            if (ac.count(p[i])) continue;
            ac.insert(p[i]);
            ans += cnt[p[i]];
        } else {
            cnt[p[i]]++;
        }
    }
    cout << ac.size() << " " << ans << endl;
}

int main() {
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    std::vector<long long> p(M);
    std::vector<std::string> S(M);
    for (int i = 0; i < M; i++) {
        scanf("%lld", &p[i]);
        std::cin >> S[i];
    }
    solve(N, M, std::move(p), std::move(S));
    return 0;
}


Measured memory_bytes: 15872
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <cctype>
#include <utility>
#include <map>
#include <string>
#include <climits>
#include <set>
#include <sstream>
#include <utility>
#include <ctime>
#include <cassert>
#include <fstream>
using namespace std;
typedef long long LL;
#define MSV(A,a) memset(A, a, sizeof(A))
#define MP make_pair
#define PB push_back
#define INF (int(1e9))
#define INFL (LL(1e18))
#define EPS 1e-12
#define chkbit(s, b) (s & (1<<b))
#define setbit(s, b) (s |= (1<<b))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)
#define MOD 1000000007
#define MAX 100005
#define in(x) scanf("%d", &x)
#define inl(x) scanf("%lld", &x)
#define in2(x, y) scanf("%d %d", &x, &y)
#define inl2(x, y) scanf("%lld %lld", &x, &y)
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
const char en = '\n';

int main() {

	LL n ,ans = 1, arr[1000001] = {0}, flag = 0, num = 7;

	cin>>n;

	if(n % 2 == 0){
		cout<<"-1"<<endl;
		return 0;
	} 

	while(true) {

		if(num % n == 0) {
			break;
		}

		ans++;

		//cout<<num % n << "for "<<num<<endl;

		if(arr[num % n] == 1) {
			flag = 1;
			break;
		} 

		arr[num % n] = 1;
		num = (num % n) * 10 + 7;
	}

	if(flag) cout<<"-1"<<endl;
	else cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 11444
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll mod = 1e9+7;

int main(void){
  int n;
  cin >> n;
  auto a = vector< ll >(n);
  for(int i = 0;i < n;++i){
    cin >> a[i];
  }
  ll res = 1;
  map<ll, ll> now;
  now[0LL] = 3LL;
  for(int i = 0;i < n;++i){
    if(now[a[i]] == 0){
      res = 0;
      break;
    }
    res = now[a[i]] * res % mod;
    now[a[i]]--;
    now[a[i]+1]++;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 7296
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Akash
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AX solver = new AX();
        solver.solve(1, in, out);
        out.close();
    }

    static class AX {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            out.println(Math.max(a * b, Math.max(a + b, a - b)));
        }

    }
}



Measured memory_bytes: 22612
#include <iostream>
using namespace std;
int main()
{
  int N, K, ans=0;
  string S;
  cin >> N >> K >> S;
  for (int l=0,r=0; l < N && r < N; ++l)
  {
    K += (l > 0 && (S[l]=='1') && (S[l-1]=='0'));
    while (r < N && (K || S[r]-'0'))
    {
      K -= ((S[r]=='1') && (S[r-1]=='0'));
      ++r;
    }
    ans = max(ans, r-l);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
	string a;
	cin>>a;
	for (int i = 0; i < a.length(); ++i)
	{
		if(a[i]=='?'){
			a[i]='D';
		}
	}
	cout<<a<<endl;
	return 0;
}

Measured memory_bytes: 3732
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(void){
  int a, b;
  cin >> a >> b;
  if(a < b)cout << "a < b" << endl;
  else if(a > b)cout << "a > b" << endl;
  else cout << "a == b" << endl;

  return 0;
}

Measured memory_bytes: 1156
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<vector>
#include<functional>
using namespace std;
typedef long long LL;
inline LL read()
{
	LL kk=0,f=1;
	char cc=getchar();
	while(cc<'0'||cc>'9'){if(cc=='-')f=-1;cc=getchar();}
	while(cc>='0'&&cc<='9'){kk=(kk<<1)+(kk<<3)+cc-'0';cc=getchar();}
	return kk*f;
}
LL a[1000222],n,cun[1000222];
LL asd=0;
vector<int>node;
int main()
{
	n=read();
	for(int i=1;i<=n;++i)
	{
		int k=read();
		if(!a[k])node.push_back(k);
		a[k]++;
		cun[i]=k;
	}
	for(int i=0;i<node.size();++i)
	{
		LL k=a[node[i]];
		asd+=(k*(k-1))/2;
	}
	for(int i=1;i<=n;++i)
	{
		printf("%lld\n",asd-a[cun[i]]+1);
	}
}

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

int main() {
  int n; cin>>n;
  for(int i=0;i*4<=n;i++) {
    for(int j=0;j*7<=n;j++) {
      if(4*i+7*j==n) {
        cout<<"Yes\n";
        return 0;
      }
    }
  }
  cout<<"No\n";
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  double K, sum = 0;
  cin >> N >> K;
  
  for (int i = 1; i <= N; i++){
    double d = 1/(double)N, o = d;
    int t = i;
    while(t < K){
      t *= 2;
      o /= 2;
    }
    sum += o;
  }
  
  printf("%.12f\n", sum);
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
  int N;
  cin >> N;
  if(N == 1){
    cout << "Hello World" << endl;
  }else if(N == 2){
    int A, B;
    cin >> A >> B;
    cout << A + B << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    int n;
    cin>>n;
    map<int,int> ma;
    REP(i,n){
        int t;
        cin>>t;
        ma[t]++;
    }
    int ans=0;
    for(auto i:ma)if(i.se%2)ans++;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4992
#include<string>
#include<iostream>
using namespace std;
int main() {
	string S;
	cin >> S;
	if (S.size() == 2) {
		cout << S << endl;
	}
	else if (S.size() == 3) {
		cout << S[2] << S[1] << S[0] << endl;
	}
	system("pause");
	return 0;
}

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

int mod = 1000000007;

int main()
{
    int A, B, C;
    cin >> A >> B >> C;
    if (A == B && B == C)
        cout << 1;
    else if (A == B || B == C || C == A)
        cout << 2;
    else
        cout << 3;
}

Measured memory_bytes: 256
import java.util.*;
import java.math.*;

class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int N = sc.nextInt();
        int[] A = new int[N];
        for(int i = 0; i < N; i++){
            A[i] = sc.nextInt();
        }
        int max = A[0] - A[N - 1] + K;
        for(int i = 0; i < N - 1; i++){
            if(max < A[i + 1] - A[i]){
                max = A[i + 1] - A[i];
            }
        }
        System.out.print(K - max);
	}

}

Measured memory_bytes: 67220
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

signed main(){

  string s; cin >> s;
  if(s[0] == '7' || s[1] == '7' || s[2] == '7'){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 3556
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define x first
#define y second
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
template <typename T> void chkmax(T &x,T y){x<y?x=y:T();}
template <typename T> void chkmin(T &x,T y){x>y?x=y:T();}
template <typename T> void readint(T &x)
{
	x=0;int f=1;char c;
	for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-1;
	for(;isdigit(c);c=getchar())x=x*10+c-'0';
	x*=f;
}
const int MAXN=600005,P=200003,g=2;
const double pi=acos(-1);

int n,a[MAXN],b[MAXN],d[MAXN];
int N,r[MAXN];
struct Complex
{
	double re, im;
	Complex(double _re = 0, double _im = 0)
		{ re = _re, im = _im; }
	Complex operator + (const Complex t) const
		{ return Complex(re + t.re, im + t.im); }
	Complex operator - (const Complex t) const
		{ return Complex(re - t.re, im - t.im); }
	Complex operator * (const Complex t) const
		{ return Complex(re * t.re - im * t.im, re * t.im + im * t.re); }
};
Complex c[MAXN];

void fft(Complex *A,int f){
	for(int i=0;i<N;i++) if(i<r[i]) swap(A[i],A[r[i]]);
	for(int i=1;i<N;i<<=1){
		Complex wn(cos(pi/i),f*sin(pi/i));
		for(int j=0;j<N;j+=(i<<1)){
			Complex w(1,0);
			for(int k=j;k<j+i;k++,w=w*wn){
				Complex x=A[k],y=A[k+i]*w;
				A[k]=x+y; A[k+i]=x-y;
			}
		}
	}
	if(f==-1)for(int i=0;i<N;++i)A[i].re/=N;
}

int main()
{
	#ifdef LOCAL
	freopen("code.in","r",stdin);
//	freopen("code.out","w",stdout);
	#endif
	readint(n);
	d[0]=1;b[1]=0;
	for(int i=1;i<=P-2;++i)d[i]=d[i-1]*g%P,b[d[i]]=i;
	int x;
	for(int i=1;i<=n;++i)
	{
		readint(x);
		if(x)++a[b[x]];
	}
	
	for(N=1;N<=P*2;N<<=1);
	for(int i=1;i<N;++i)r[i]=(r[i>>1]>>1)^((i&1)*(N>>1));
	for(int i=0;i<P;++i)c[i]=Complex(a[i],0);
	fft(c,1);
	for(int i=0;i<N;++i)c[i]=c[i]*c[i];
	fft(c,-1);
	ll ans=0;
	for(int i=0;i<P;++i)ans+=(ll)(c[i].re+c[i+P-1].re+0.5)*d[i];
	for(int i=0;i<P;++i)ans-=1ll*a[i]*d[2*i%(P-1)];
	cout<<ans/2<<endl;
	return 0;
}

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

using namespace std;

typedef long long ll;

ll n, k;
const ll maxn = 400+5;
const ll maxa = 1e9+5;
const ll INF = 1LL << 60;
ll MOD = 1e9+7;
ll a[maxn];
ll sum[maxn];
ll dp[maxn][maxn];

int main()
{
  cin >> n;
  a[0] = sum[0] = 0ll;
  for(int i = 1; i <= n; i++) cin >> a[i], dp[i][i] = 0ll, sum[i]=sum[i-1]+a[i];

  for(int l = 1; l < n; l++) for(int s = 1; s+l <= n; s++) // 1 is length - 1
  {
    int r = s+l;
    dp[s][r] = INF;
    for(int k = s; k < r; k++) dp[s][r] = min(dp[s][r], dp[s][k]+dp[k+1][r]+sum[r]-sum[s-1]);
    //cout << dp[s][r] << endl;
  }
  cout << dp[1][n] << endl;
  return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 200030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    1e9+7;

int main()
{ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int h,w,n;
cin>>h>>w>>n;
if(h<w)
swap(h,w);
w=h;
int ans=1;
while(h<n)
{
	h+=w;
	ans++;
}
cout<<ans;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(register int i=(a);i<(b);++i)
#define ROF(i,a,b) for(register int i=(a);i>=(b);--i)
#define pi pair<ll,int>
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef double db;
const int maxn = 100005;
const int maxm = 1000005;
const int inf = 2147483647;
typedef long long ll;
const double eps = 1e-9;
const long long INF = 9223372036854775807ll;
ll qpow(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=ans*a%c;a=a*a%c;b>>=1;}return ans;}


int main(){
	ll s,x1,x2,y1,y2;
	scanf("%lld",&s);
	if(s<=1e9)printf("%lld %lld %lld %lld %lld %lld\n",0,0,1,0,0,s);
	else if(s==1000000000000000000ll)printf("%lld %lld %lld %lld %lld %lld\n",0ll,0ll,1000000000ll,0ll,0ll,1000000000ll);
	else printf("%lld %lld %lld %lld %lld %lld\n",0ll,0ll,s/(1000000000ll)+1,(s/1000000000ll+1)*(1000000000ll)-s,1,1000000000ll);
}


Measured memory_bytes: 3800
import math

N = int(input())
al = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

x = N
keta = [0]*100
i = 0
while x > 0:
    if x % 26 == 0:
        keta[i] = 26
    else:
        keta[i] = x % 26
    x -= keta[i]
    x = int(x / 26)
    i += 1

ans = ""
for p in range(i):
    ans = al[keta[p]-1] + ans

print(ans)

Measured memory_bytes: 9220
//============================================================================
// Name        : AOJ_Test.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;

int main() {
	string answer;
	string S, T;
	cin >> S;
	cin >> T;

	unsigned int slen = S.length();
	unsigned int tlen = T.length();
	unsigned int lnum = slen - tlen + 1;

	unsigned int max = 0;
	unsigned int max_index = 0;
	for (unsigned int i = 0; i < lnum; i++) {
		unsigned int temp = 0;
		for (unsigned int j = 0; j < tlen; j++) {
			if(T[j]==S[i+j]){
				temp++;
			}
		}
		if(temp>max){
			max = temp;
			max_index = i;
		}
	}

	cout << tlen - max << endl;
	return 0;
}


Measured memory_bytes: 3632
n=int(input())


ac=0
wa=0
tle=0
re=0
for i in range(n):
    s=input()
    if s=="AC":
        ac+=1
    if s=="WA":
        wa+=1
    if s=="TLE":
        tle+=1 
    if s=="RE":
        re+=1

print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)

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

struct node{
	int num;
	node *parent,*left,*right;
};
node *root,*NIL;

node *treemin(node *x){
	while(x->left!=NIL)
		x=x->left;
	return x;
}

node *nextnode(node *x){
	if(x->right!=NIL) return treemin(x->right);
	node *y=x->parent;
	while(y!=NIL && x==y->right){
		x=y;
		x=y->parent;
	}
	return y;
}

void denode(node *z){
	node *x,*y;
	if(z->left==NIL||z->right==NIL) y=z;
	else y=nextnode(z);
	if(y->left!=NIL) x=y->left;
	else x=y->right;
	if(x!=NIL) x->parent=y->parent;
	if(y->parent==NIL) root=x;
	else{
		if(y==y->parent->left) y->parent->left=x;
		else y->parent->right=x;
	}
	if(y!=z) z->num=y->num;
	delete y;
	return ;
}

node *find(int a){
	node *x=root;
	while(x!=NIL){
		if(x->num<a) x=x->right;
		else if(x->num>a) x=x->left;
		else return x;
	}
	return NIL;
}

void print_inorder(node *x){
	if(x==NIL) return ;
	print_inorder(x->left);
	printf(" %d",x->num);
	print_inorder(x->right);
	return ;
}

void print_preorder(node *x){
	if(x==NIL) return ;
	printf(" %d",x->num);
	print_preorder(x->left);
	print_preorder(x->right);
	return ;
}

void insert(int a){
	node *x=root,*y=NIL;
	node *z=new node();
	z->num=a;z->left=NIL;z->right=NIL;
	while(x!=NIL){
		y=x;
		if(z->num < x->num) x=x->left;
		else x=x->right;
	}
	z->parent=y;
	if(y==NIL) root=z;
	else {
		if(z->num < y->num) y->left=z;
		else y->right=z;
	}
	return ;
}

int main(){
	int n;
	cin>>n;
	string s;
	node *f;
	int a;
	for(int i=0;i<n;i++){
		cin>>s;
		if(s[0]=='i') cin>>a,insert(a);
		else if(s[0]=='p'){
			print_inorder(root);
			printf("\n");
			print_preorder(root);
			printf("\n");
		}
		else if(s[0]=='f'){
			cin>>a;
			f=find(a);
			if(f==NIL) printf("no\n");
			else printf("yes\n");
		}
		else{
			cin>>a;
			denode(find(a));
		}
	}
	return 0;
}


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

int main(){
    char c[2][3];

    for(long long i = 0; i < 2; i++){
        for(long long j = 0; j < 3; j++){
            cin >> c[i][j];
             
        }
    }

    char c_re[2][3];

    for(long long i = 0; i < 2; i++){
        for(long long j = 0; j < 3; j++){
            if(i == 0) c_re[i][j] = c[i+1][2-j];
            else c_re[i][j] = c[i-1][2-j];
        }
    }

    for(long long i = 0; i < 2; i++){
        for(long long j = 0; j < 3; j++){
            if(c[i][j] != c_re[i][j]){
                printf("NO\n");
                return 0;
            }
        }
    }
    printf("YES\n");
    return 0;
}

Measured memory_bytes: 3624
N,M=map(int,input().split())
L=[]
R=[]
for _ in range(M):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r)
L.sort()
R.sort()
print(0 if R[0]<L[-1] else R[0]-L[-1]+1)

Measured memory_bytes: 11440
// author: hjy
// Problem:
#include<bits/stdc++.h>
//#pragma GCC optimize(2)
using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define rep(i,n) for(register int i=0; i<(int)(n); ++i)
#define per(i,n) for(register int i=(int)(n)-1; i>=0; --i)
#define rep1(i,n) for(register int i=1; i<=(int)(n); ++i)
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<"="<<x<<'\n'

inline int read() {
	int x=0,ng=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-') ng=1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return ng?-x:x;
}

const int mod=1e9+7;
const int inf=0x3f3f3f3f;
const int seed=20040305;

int n;
int c[410][5];
vector<pair<pii,pii> > v;
ll res;
map<pair<pii,pii>,int> have;


int same(pair<pii,pii> cur,pair<pii,pii> per)
{
	int cnt=0;
	if(cur==per) cnt++;
	if(cur==mp(mp(per.fi.se,per.se.fi),mp(per.se.se,per.fi.fi))) cnt++;
	if(cur==mp(mp(per.se.fi,per.se.se),mp(per.fi.fi,per.fi.se))) cnt++;
	if(cur==mp(mp(per.se.se,per.fi.fi),mp(per.fi.se,per.se.fi))) cnt++;
	return cnt;
}
/*
1---2
|   |
3---4
*/
int main()
{
	scanf("%d",&n);
	rep(i,n)
	{
		rep(j,4) scanf("%d",&c[i][j]);
		rep(j,v.size())
		{
			
			pair<pii,pii> x=v[j];
			pair<pii,pii> y=mp(mp(c[i][0],c[i][1]),mp(c[i][2],c[i][3]));
			pair<pii,pii> c1=mp(mp(x.se.se,x.se.fi),mp(y.fi.se,y.fi.fi));
			pair<pii,pii> c2=mp(mp(x.se.fi,x.fi.se),mp(y.se.fi,y.fi.se));
			pair<pii,pii> c3=mp(mp(x.fi.se,x.fi.fi),mp(y.se.se,y.se.fi));
			pair<pii,pii> c4=mp(mp(x.fi.fi,x.se.se),mp(y.fi.fi,y.se.se));
//			printf("x=%d%d%d%d\n",x.fi.fi,x.fi.se,x.se.fi,x.se.se);
//			printf("c1=%d%d%d%d\n",c1.fi.fi,c1.fi.se,c1.se.fi,c1.se.se);
			ll all=1;
			all*=have[c1]-same(c1,x);
			all*=have[c2]-same(c2,x)-same(c2,c1);
			all*=have[c3]-same(c3,x)-same(c3,c1)-same(c3,c2);
			all*=have[c4]-same(c4,x)-same(c4,c1)-same(c4,c2)-same(c4,c3);
			res+=all;
		}
		v.pb(mp(mp(c[i][0],c[i][1]),mp(c[i][2],c[i][3])));
		v.pb(mp(mp(c[i][1],c[i][2]),mp(c[i][3],c[i][0])));
		v.pb(mp(mp(c[i][2],c[i][3]),mp(c[i][0],c[i][1])));
		v.pb(mp(mp(c[i][3],c[i][0]),mp(c[i][1],c[i][2])));
		have[mp(mp(c[i][0],c[i][1]),mp(c[i][2],c[i][3]))]++;
		have[mp(mp(c[i][1],c[i][2]),mp(c[i][3],c[i][0]))]++;
		have[mp(mp(c[i][2],c[i][3]),mp(c[i][0],c[i][1]))]++;
		have[mp(mp(c[i][3],c[i][0]),mp(c[i][1],c[i][2]))]++;
	}
	printf("%lld",res);
}
/*
       1-------2          x
      /|      /|
	 4-------3 |
	 | 4-----|-3
	 |/      |/  
	 1-------2            y   
*/

Measured memory_bytes: 80128
#include<stdio.h>
#define MAX 100005

int main(){
  char s[MAX],*p;
  fread(s,sizeof(char),MAX,stdin);
  p=s;
  
  while(*p!='\n'){
    //  printf("%c , %c , %c\n",*p,*(p+1),*(p+2));
    if(*p==*(p+1)){
      printf("%d %d\n",&*p-s+1,&*p-s+2);
      return 0;
    }
    if(*p==*(p+2)){
      printf("%d %d\n",&*p-s+1,&*p-s+3);
      return 0;
    }
    
    *p++;
  }
  puts("-1 -1");
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    private const long INF = 1000000007;
    public static void Main()
    {
        int a = IntLine().Sum();
        Console.WriteLine((a < 10 ? a.ToString() : "error"));
    }
}

public class Atcoder
{
    public static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static long LCM(long a, long b)
    {
        long c = a * b;
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static string ToConvertBit(int N, int e)
    {
        string ret = "";
        int r = 0;
        while (N != 0)
        {
            r = N % e;
            ret += r.ToString();
            N -= r;
            N /= e;
        }
        ret = StrReverce(ret);
        return ret;
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static long LongRead()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] LongLine()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }
    public static int[] IntLine()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define submitStage int TCF = 1 ;
#define testStage int TCF = 1000 ;
#define Start while(TCF--)

void FastInputOutput(){
  ios_base :: sync_with_stdio( 0 ) ;
  cin.tie( 0 ) ;
  cout.tie( 0 ) ;
}
void ReadFromFile(){
  freopen( "in.txt", "r" , stdin ) ;
}
int D(){
	int t ;
	scanf( "%d" , &t ) ;
	return t ;
}
ll LLD(){
	ll t ;
	scanf( "%lld" , &t ) ;
	return t ;
}

const int N=1e6+7;
void init(){
}

int main(){
submitStage Start{
  int n=D(); int m=D();
  int mn=N+N+N;
  int mni=N+N+N;
  for(int i=m; i<n+m ; ++i){
    if(mn> abs(i)){
      mn=abs(i);
      mni=i;
    }
  }
  int sum=0;
  //cerr<<"&"<<mn<<endl;
  for(int i=m; i<n+m ; ++i){
    if(i==mni) continue;
    //cerr<<i<<" ";
    sum+=i;
  }
  printf("%d\n",sum);
}}

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

#define FOR(i,s,e) for(int i = (s);i <= (e);i++)

int M;
int N;

int manju[10010];
vector<int> box_size(510);
vector<int> box_value(510);


int dp[510][10010];
int main()
{
	cin >> M >> N;

	FOR(i,1,M)
	{
		cin >> manju[i];
	}

	FOR(i,1,N)
	{
		cin >> box_size[i] >> box_value[i];
	}

	sort(manju + 1,manju + M + 1);

	reverse(manju + 1,manju + M + 1);

	FOR(i,0,509)
	{
		FOR(j,0,10009)
		{
			dp[i][j] = 100000000;
		}
	}

	
	dp[0][0] = 0;

	FOR(i,1,N)
	{
		FOR(j,0,M)
		{
			dp[i][j] = min(dp[i - 1][j] , dp[i - 1][max(j - box_size[i],0)] + box_value[i]);
		}
	}

	int result = -1;

	int sum = 0;

	FOR(i,0,M)
	{
		sum += manju[i];

		int tmp = sum - dp[N][i];
		result = max(result , tmp);
	}

	cout << result << endl;
	return 0;
		

}



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

using ll = long long;

int main() {
    int N;
    string s;
    cin >> N >> s;
    vector<int> sheep(N), res(N);
    rep(i, N) {
        if (s[i] == 'o') res[i] = 1;
        else res[i] = 0;
    }
    rep(i, 2) rep(j, 2) {
        sheep[0] = i;
        sheep[1] = j;
        for (int k = 2; k < N; k++) {
            if (sheep[k - 1] ^ sheep[k - 2] ^ res[k - 1] == 1) sheep[k] = 1;
            else sheep[k] = 0;
        }
        if ((sheep[N - 1] ^ sheep[N - 2] ^ res[N - 1] ^ sheep[0] == 0) && (sheep[0] ^ sheep[N - 1] ^ res[0] ^ sheep[1] == 0)) {
            rep(k, N) {
                if (sheep[k] == 1) cout << "S";
                else cout << "W";
            }
            cout << endl;
            return 0;
        }
    }
    cout << "-1" << endl;
}

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

long max(long num1, long num2) {
  if(num1 > num2) {
    return num1;
  } else {
    return num2;
  }
}

long min(long num1, long num2) {
  if(num1 < num2) {
    return num1;
  } else {
    return num2;
  }
}

int main() {
  int A, B, C;
  long X, Y;
  cin >> A >> B >> C >> X >> Y;
  
  long minsum = 2 * C * 0 + A * max(0, X - 0) + B * max(0, Y - 0);
  long sum = 0;
  for(long i = 0; i <= 100000; i++) {
    sum = 2 * C * i + A * max(0, X - i) + B * max(0, Y - i);
    minsum = min(sum, minsum); 
  }
  
  cout << minsum << endl;
  
  return 0;
}

Measured memory_bytes: 256
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
const ll MOD = 1000000000000000001;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);


ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b){
  ll r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


ll LCM(ll a,ll b){
  ll c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

vector<pair<char,ll>> runlength(string s,vector<pair<char,ll>> p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
    return p;
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
  return p;
}



/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n,h,w,ans=0;
  cin>>n>>h>>w;
  vector<ll> a(n),b(n);
  rep(i,n){
    cin>>a[i]>>b[i];
    ans+=min(a[i]/h,b[i]/w);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ar array
#define endl '\n'
#define ll long long
#define in insert
#define pb push_back
#define vt vector
#define P_Q(x) priority_queue<x>
#define p_q(x) priority_queue<x, vector<x>, greater<x>>
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define Rev(i,a,b) for(ll i=a;i>=b;i--)
#define FOR(m) Rep(i,1,m)
#define For(m) Rep(i,0,m-1)
#define Rbl(x,a) for(auto &x : a)
#define FIO ios::sync_with_stdio(0);   cin.tie(0);
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define vpii vector<pii>
#define vpll vector<pll>
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
const ll INF = 0x3f3f3f3f3f3f3f3fll;
#define mod 1000000007
 
const int mxN = 2e5 + 1;
ll n;
ll h[mxN], b[mxN], dp[mxN] = {};
ll seg[4*mxN] = {};

void upd(ll seg[], ll i, ll val, ll st = 1,ll en = n, ll ind = 0)
{
    if(st <= i && i <= en)
        seg[ind] = max(seg[ind], val);
    if(i < st || i > en || st == en)
        return;
    ll mid = (st + en) / 2;
    upd(seg, i, val, st, mid, 2*ind+1);
    upd(seg, i, val, mid+1, en, 2*ind+2);
}

ll qry(ll seg[], ll qs, ll qe, ll st = 1, ll en = n, ll ind = 0)
{
    if(qe < st || en < qs)
        return -1e18;
    if(qs <= st && en <= qe)
        return seg[ind];
    ll mid = (st + en) / 2;
    return max(qry(seg, qs, qe, st, mid, 2*ind+1), qry(seg, qs, qe, mid+1, en, 2*ind+2));
}
 
int main()
{
FIO
 
    cin >> n;
    For(n) cin >> h[i];
    For(n) cin >> b[i];

    dp[h[0]] = b[0];
    upd(seg, h[0], dp[h[0]]);
    FOR(n-1)
    {
        ll temp = h[i] == 1 ? 0: qry(seg, 1, h[i]-1);
        dp[h[i]] = b[i] + temp;
        upd(seg, h[i], dp[h[i]]);
    }

    cout << *max_element(dp + 1, dp + n + 1);
}

Measured memory_bytes: 12428
import math
n=int(input())
a=list(map(int,input().split()))

a.sort()
g=a[0]

for i in range(1,n):
  g=math.gcd(g,a[i])

d=[set(),set()]
for i in range(2):
  b=a[i]//g
  f=1
  while f*f<b+1:
    if b%f==0:
      d[i].add(f)
      d[i].add(b//f)
    f+=1

an=d[0]&d[1]
an.remove(1)
xo=d[0]^d[1]

for i in range(2,n):
  e1=set()
  e2=set()
  for m in xo:
    if a[i]%m!=0:
      e1.add(m)
  for m in an:
    if a[i]%m!=0:
      e2.add(m)
      xo.add(m)
  for m in e1:
    xo.remove(m)
  for m in e2:
    an.remove(m)
an.add(1)
xo.add(1)
print(max(max(xo),max(an))*g)
    

Measured memory_bytes: 20560
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n,m;
    cin >> n >> m;
    vector<int> suki(m,0);
    string line;
    for(int i=0; i<n; i++){
        int k;
        cin>>k;
        for(int j=0;j<k;j++){
            int id;
            cin>>id;
            suki[id-1]++;
        }
    }
    int likecount=0;
    for(int i=0;i<suki.size();i++){
        if(suki[i]==n)likecount++;
    }
    cout<<likecount<<endl;
}

Measured memory_bytes: 256
//#include<iostream>
//#include<algorithm>
//#include<string>
//#include <cmath>
//#include <vector>
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define REP(x,n) for(int x=0;x<n;x++)

//vector//
#define vei vector<int> 
#define velli vector<long long int> 
#define pb(x) push_back(x) // 末尾にxを加える
#define pb2 pop_back() // 末尾削除
#define all(x) (x).begin(),(x).end() //イテレーター
#define be(x) (x).begin()
//auto  auto begin = v.begin()とか

typedef pair<int,int> P;  //q(p.first,p.second)

int main (){
    ll int a; cin >> a;
    double b; cin >> b;
    
    // b *= 100; // 小数点以下2桁を利用して整数にする
    // b += 0.01;
    // b = static_cast<ll int>(b);
    ll int bb = b*100 + 0.001;

    ll int ans = a * bb;
    ans /= 100;
    
    cout << ans;
}

Measured memory_bytes: 3716
from heapq import heappop as he
n=int(input())
s=[[]for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    s[a].append(b)
    s[b].append(a)
c=[0]*n
q=[1]
t=[1]*n
t[1]=0
fl=0
while q:
    fl^=1
    p=[]
    for j in q:
        for h in s[j]:
            if t[h]:
                t[h]=0
                c[h]=fl
                p.append(h)
    q=p.copy()
if c.count(1)>n//3 and c.count(0)>n//3:
    p,q,r=1,2,3
    for i in range(n):
        if c[i]:
            if q<=n:
                c[i]=q
                q+=3
            else:
                c[i]=r
                r+=3
        else:
            if p<=n:
                c[i]=p
                p+=3
            else:
                c[i]=r
                r+=3
elif c.count(1)<=n//3:
    p,q,r=1,2,3
    for i in range(n):
        if c[i]:
            c[i]=r
            r+=3
        else:
            if p<=n:
                c[i]=p
                p+=3
            elif q<=n:
                c[i]=q
                q+=3
            else:
                c[i]=r
                r+=3
else:
    p,q,r=1,2,3
    for i in range(n):
        if not c[i]:
            c[i]=r
            r+=3
        else:
            if q<=n:
                c[i]=q
                q+=3
            elif p<=n:
                c[i]=p
                p+=3
            else:
                c[i]=r
                r+=3
print(*c)

Measured memory_bytes: 55100
#include <stdio.h>
#include <stdlib.h>

int main(){
  int N;
  int W,sum=0;
  int S[101] = {0};
  int sub=100000;
  
  scanf("%d",&N);
  for(int i=0;i<N;i++){
    scanf("%d",&W);
    sum += W;
    S[i+1] += W + S[i];
  }


  for(int i=0;i<N;i++)
    if( sub > abs(sum-2*S[i+1]) )
      sub = abs(sum-2*S[i+1]);

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


Measured memory_bytes: 128
import numpy as np

X,Y = list(map(int,input().split()))
'''
print(X)
print(Y)
Z = np.sort(Z)[::-1]
#print(Z)
count = 0
if Z[0]==1 or Z[0]==0:
    print ('Brown')
else:
    while Z[0] != 1:
        Z[1] += int(Z[0]/2)
        Z[0] -= int(Z[0]/2)*2
        Z = np.sort(Z)[::-1]
        count += 1
        print (Z)
    if (count%2) == 1:
        print ('Alice')
    else: print ('Brown')
'''

if np.abs(X-Y)<=1:
    print('Brown')
else:
    print('Alice')

Measured memory_bytes: 12504
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int const INF = 1001001001;
ll const MOD = 1000000007;


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

int N;
cin >> N;

auto divisor_count = [&](int c) {
    int res = 0;
    rrep(i,c) {
        if(c % i == 0) res++;
    }
    return res;
};

int cnt = 0;
rrep(n,N) {
    if(n % 2 == 1 && divisor_count(n) == 8) cnt++;
}

cout << cnt << endl;

return 0;
}

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

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if((a==b && b!=c) || (b==c && c!=a) || (c==a && a!=b))
    cout<<"Yes";
    else
    cout<<"No";
    return 0;
}

Measured memory_bytes: 3592