akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         sort(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

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

void solve() {
  ll a, b, c; cin >> a >> b >> c;

  if (c % gcd(a, b) == 0) YES();
  else NO();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();

		String[] tmpArray = input.split(" ");

		int n = Integer.parseInt(tmpArray[0]);
		int m = Integer.parseInt(tmpArray[1]);

		String s = br.readLine();
		String t = br.readLine();

		if(s.charAt(0) != t.charAt(0)){
			System.out.println(-1);
			return;
		}
		
		if(m == n){
			if(s.equals(t)){
				System.out.println(n);
				return;
			}
			else {
				System.out.println(-1);
				return;
			}
		}

		long l = lcm(n, m);
		int g = gcd(n, m);
		
		if(g == 1){
			System.out.println(l);
		}
		else {
//			if(n > m){
//				String tmpS = s;
//				s = t;
//				t = tmpS;
//				
//				n = s.length();
//				m = t.length();
//			}
			
//			System.out.println(s+" "+t);
//			for(long i = 0; i < l; i+=l/n){
//				if(i%m != 0){
//					continue;
//				}
//				
//				System.out.println("i = "+i+" "+s.charAt((int)(i/n)) +" "+ t.charAt((int)(i/m)));
//
//				if(s.charAt((int)(i/n)) != t.charAt((int)(i/m))){
//					System.out.println(-1);
//					return;
//				}
//			}
			int idx1 = (int)(l/m);
			int idx2 = (int)(l/n);
			while(true){
				if(idx1 >= n || idx2 >= m){
					break;
				}
				if(s.charAt(idx1) != t.charAt(idx2)){
//					System.out.println(idx1 +" "+ idx2);
					System.out.println(-1);
					return;
				}
				
				idx1 += (int)(l/m);
				idx2 += (int)(l/n);
			}
			
			System.out.println(l);
		}
	}

	static int gcd(int a, int b){
		int tmp;

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

	static long lcm(int a, int b, int gcd){
		return (long)a*(b/gcd);
	}

	static long lcm(int a, int b){
		int g = gcd(a, b);

		return lcm(a,b,g);
	}

}


Measured memory_bytes: 24276
s=[i for i in input()]
t=len(s)-1
tmp=2**t
ans=0
for i in range(tmp):
    p=bin(i)[2:]
    p="0"*(t-len(p))+p
    x=""
    for j,k in enumerate(s):
        x+=k
        if j!=t and p[j]=="1":
            x+="+"
        if j!=t and p[j]=="0":
            x+="-"
    if eval(x)==7:
        print(x+"=7")
        break

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;


int main(){
	int n;
	int a[3000];

	scanf("%d", &n);
	for(int i=0;i<n;i++)scanf("%d", &a[i]);

	long long ans = 0;
	for(int i=0;i<n;i++) ans += a[i]-1;

	printf("%lld\n", ans);

	return 0;
}


Measured memory_bytes: 256
//g++ foo.cpp -o foo
#include <iostream>
using namespace std;

int main(){
    int countR = 0;
    int maxR   = 0;
    string data;
    cin >> data;
    for(int i=0;i<3;i++){
        if(data.at(i)=='R'){
            countR++;
            if(maxR<countR)  maxR = countR;
        }
        else{
            countR=0;
        }
            
    }
    cout << maxR << endl;
};

Measured memory_bytes: 3608
#include <iostream>
using namespace std;
int main(){
    int n,x;
    int count=0;
    while(1){
        cin>>n>>x;
        if(n==0 && x==0){
            break;
        }
        for(int i=1;i<=n-2;i++){
            for(int j=i+1;j<=n-1;j++){
                for(int k=j+1;k<=n;k++){
                    if(x==i+j+k){
                        count++;
                    }
                }
            }
        }
        cout<<count<<endl;
        count=0;
    }
    return 0;
}


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

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> mii;
typedef map<ll,int> mli;

///*********************************** C o n s t ***********************************///

const int       N=1e6+3;
const double    PI = acos(-1);
const ll        MOD=1000000007;  ///1e9+7

///********************************** M a r c o ***********************************///

#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ll p=MOD;a%=p;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=p;--b;}a*=a;a%=p;b/=2;}return pr;}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=2;ii<=mx;ii++)if(!a[ii])for(jj=ii*ii;jj<=N;jj+=ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///
const ll mx=100005;
ll n,ans,a,dp[mx][3],o[3][2];
vl v[mx];

ll recdp(ll ci,ll curi)
{
    if(ci==n) return 0;
    if(dp[ci][curi]!=-1) return dp[ci][curi];
    ll b=0,c=0,j=0;
    b=v[ci][curi]+recdp(ci+1,o[curi][0]);
    c=v[ci][curi]+recdp(ci+1,o[curi][1]);
    dp[ci][curi]=max(b,c);
    return dp[ci][curi];
}


main()
{
    fastio();
    mem(dp,-1);
    o[0][0]=1,o[0][1]=2,o[1][0]=0,o[1][1]=2,o[2][0]=0,o[2][1]=1;
    cin>>n;
    for(ll i=0;i<n;i++){ll m=3;while(m--) {cin>>a; v[i].pb(a);}}
    for(ll i=0;i<3;i++){
        ans=max(ans,recdp(0,i));
    }
    cout<<ans el;
}


///Thank you.


///Brainless_Loco Terminates Here!


Measured memory_bytes: 19284
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)
#define repd(i, n) for (int i = n-1; i >= 0; i--)
#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
//V,Pは大文字i,l,bは小文字
using ll = long long;
using Vi = vector<int>;
using VVi = vector<Vi>;
using Vl = vector<ll>;
using VVl = vector<Vl>;
using Vb = vector<bool>;
using VVb = vector<Vb>;
using P = pair<int,int>;
using Pll = pair<ll, ll>;
const ll mod = 1000000007;
const ll inf = 1000000000000;//10の12乗
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
};
int yaku(int x){
  int tot=0;
  rrep(i,1,sqrt(x)+1){
    if(x%i==0) tot++;
  }
  tot*=2;
  int p=sqrt(x);
  if(p*p==x) tot--;
  return tot;
}

int main() {
    ll n;
    cin >> n;
    ll nn=n;
    ll ans=0;
    n--;
    while(n>0){
      ans+=yaku(n);
      n--;
    }
    cout << ans << endl;

}


Measured memory_bytes: 3672
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

//You Are the Judge
public class Main{

	int[][] wrong;
	int[] penalty, solve;
	
	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			int T = sc.nextInt(), P = sc.nextInt(), R = sc.nextInt();
			if((T|P|R)==0)break;
			solve = new int[T];
			wrong = new int[T][P+1];
			penalty = new int[T];
			while(R--!=0){
				int t = sc.nextInt()-1, p = sc.nextInt(), time = sc.nextInt();
				String m = sc.next();
				if("WRONG".equals(m))wrong[t][p]++;
				else{
					penalty[t]+=wrong[t][p]*1200+time;
					solve[t]++;
				}
			}
			PriorityQueue<Integer> q = new PriorityQueue<Integer>(T, new Comparator<Integer>() {
				public int compare(Integer o1, Integer o2) {
					return solve[o2]!=solve[o1]?solve[o2]-solve[o1]:penalty[o1]!=penalty[o2]?penalty[o1]-penalty[o2]:o1-o2;
				}
			});
			for(int i=0;i<T;i++)q.add(i);
			while(!q.isEmpty()){
				int id = q.poll();
				System.out.println((id+1)+" "+solve[id]+" "+penalty[id]);
			}
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 13000
#include<bits/stdc++.h>
using namespace std;
#define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long int ll;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::vector<ll> vll;
typedef std::vector<vi > vvi;
typedef std::vector<vll > vvll;
typedef std::pair<int,int> ii;
typedef std::pair< ll, ll > lp;
typedef std::vector<ii> vii;
typedef std::vector<vii > vvii;

#define pb emplace_back 
#define PB pop_back
#define pf push_front
#define PF pop_front
#define mp make_pair
#define ub(a,b) upper_bound(all(a),b)
#define lb(a,b) lower_bound(all(a),b)
#define bs(a,b) binary_search(all(a),b)
#define mem(a,b) memset(a,b,sizeof(a))
#define in(a,n) F(i,0,n-1)cin>>a[i]
#define in1(a,n) F(i,1,n)cin>>a[i]
#define out(a,n) F(i,0,n-1)cout<<a[i]<<"\n";cout<<endl
#define ff first
#define ss second
#define F(i,a,b) for (ll i=a;i<=b;i++)
#define RF(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) F(i,0,n-1)
#define clr(a) (a).clear()
#define rz resize
#define sqr(a) ((a) * (a))
#define sz(a) int((a).size())
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin() ,(a).rend()
#define endl '\n'

#define mod 1000000007

ll add(ll a, ll b){return (a%mod + b%mod)%mod;}
ll sub(ll a , ll b){return (a%mod - b%mod + mod)%mod;}
ll mul(ll a, ll b){return (a%mod * b%mod)%mod;}
ull poww(ull a,ull b){ull res=1;while(b){if(b&1){res*=a;}a=a*a;b>>=1;}return res;}
ll poww(ll a,ll b,ll MOD){ll res=1;while(b){if(b&1){res*=a;res%=MOD;}a=a*a;a%=MOD;b>>=1;}return res;}

#define dbg(x) cout<<#x<<" :: "<<x<<endl;
#define dbg2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define dbg3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define dbg4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;

//end of template

const int N = 1e5 + 5;


int main(int argc, char const *argv[])
{
	crap;
	ll n, m , l, r, L, R;
	cin >> n >> m;
	cin >> l >> r;
	L = l, R = r;
	rep(i, m-1){
		cin >> l >> r;
		if (l > R || r < L){
			cout << "0\n";
			return 0;
		}
		L = max(l, L);
		R = min(r, R);
	}
	cout << R - L +1 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;
// const int mod = 998244353;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

LL a[2010], f[2010][2010];
int id[2010];
int n;

inline void work() {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        id[i] = i;
    }
    sort(id + 1, id + n + 1, [&](int i, int j) {return a[i] < a[j] || (a[i] == a[j] && i < j);});
    for (int i = n; i >= 1; --i) {
        f[i][i] = a[id[1]] * abs(id[1] - i);
        for (int j = i + 1; j <= n; ++j) {
            f[i][j] = max(f[i][j - 1] + a[id[j - i + 1]] * abs(id[j - i + 1] - j), f[i + 1][j] + a[id[j - i + 1]] * abs(id[j - i + 1] - i));
        }
    }
    cout << f[1][n] << "\n";
}

int main() {
    // freopen("input.txt", "r", stdin);
    quickread();
    work();
    return 0;
}

Measured memory_bytes: 26288
n, m = list(map(int, input().split()))
a = []

for i in range(m):
    a.append(int(input().strip()))

broken = [False] * (n + 1)

for i in range(m):
    broken[a[i]] = True

dp = []
dp.append(1)

if (broken[1]):
    dp.append(0)
else:
    dp.append(1)

for i in range(2, n + 1, 1):
    if (broken[i]):
        dp.append(0)
    else:
        dp.append((dp[i - 1] + dp[i - 2]) % 1000000007)

print(dp[n])


Measured memory_bytes: 56280
#include <bits/stdc++.h>
using namespace std;
int A, B, C, K;
int ans;
int main() {
  cin >> A >> B >> C >> K;
  if (K <= A) {
    ans = K;
  } else {
    ans += A;
    K -= A;
    if (K <= B) {
      ans += 0 * K;
    }
    else {
      K -= B;
      ans -= K;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3528
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,n) for(int i=0;i<n;i++)
int main()
{
	ll a,b,c,k;
	cin>>a>>b>>c>>k;
	ll sum=0;
	if(k-a>=0)
	{
		sum+=a;
		k=k-a;
		if(k-b>=0)
		{
			k=k-b;
			if(k-c>=0)
			{
				sum-=c;
			}
			else
			sum-=k;
		}
		else
		k=0;
		
	}
	else
	sum+=k;
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;

int main() {
    int x; cin >> x;
    int ans = x / 500 * 1000;
    ans += x % 500 / 5 * 5;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;
const int N=1e4+10;
#define PB push_back
int abs(int n){return n>0?n:-n;}
int main(){
    int n,a[N],mid,temp;
    set<int> s;
    vector<int> v;
    while(scanf("%d",&n)!=EOF){
        if(n==0)return 0;
        s.clear();
        v.clear();
        for(int i=1;i<n;i++)s.insert((i*i)%n);
        mid=n>>1;
        for(int i=1;i<=mid;i++)a[i]=0;
        for(int i:s)v.PB(i);
        for(int i=0;i<v.size();i++)for(int j=0;j<v.size();j++)if(i!=j){
            temp=abs(v[j]-v[i]);
            if(temp>mid)a[n-temp]++;
            else a[temp]++;
        }
        for(int i=1;i<=mid;i++)printf("%d\n",a[i]);
    }
}


Measured memory_bytes: 3036
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;



int main(){
    int n;
    cin >> n;
    if(n<=999) out("ABC");
    else out("ABD");
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0,1,0,-1 };
const ll dy[4] = { -1, 0, 1,0 };
const ll INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
double mysqrt(double x) {
	double l = 0, r = x;
	for (int i = 0; i < 64; ++i) {
		double m = (l + r) / 2.0;
		if (m*m < x)l = m;
		else r = m;
	}
	return l;
}
///////////////////////////////////////

//組み方の最適性を証明するテクニックとしてこのような組み方になっていないものは
//ある所を組み替えることで得をする。ということを示す方法がある
//Fが降順に並んでいないならばAi<=AjかつFi<FjであるようなFi,Fjを選んでスワップ
//することで得をするか損をしないように組み方を変更できる
//ある目標スコアXを決めてmaxAiFi<=Xとなるような合計修行回数はいくつか？
//を求めるような問題を考える
//つまり判定問題をある固定したXについて,maxAiFi<=Xとするための合計修行回数はK以下か？
//最大値の最小化は二分探索を使うことが多い。最大値をX以下にする=全ての要素をX以下にする
ll N, K; 
vector<ll>A;
vector<ll>F;
bool ok(ll x) {
	ll cnt = 0;
	REP(i, N) {
		if (A[i] * F[i] <= x)continue;
		if ((A[i] * F[i]-x) % F[i] == 0)cnt += (A[i] * F[i]-x) / F[i];
		else cnt += (A[i] * F[i]-x) / F[i] + 1;
	}
	return cnt <= K;
}//ok(x):=maxAiFi<=xとするための修行回数がk以下かどうか
int main() {
	cin >> N >> K;
	REP(i, N) {
		ll a; cin >> a;
		A.push_back(a);
	}
	REP(i, N) {
		ll f; cin >> f;
		F.push_back(f);
	}
	sort(A.begin(), A.end());
	sort(F.begin(), F.end(), greater<ll>());
	ll L = -1;
	ll R = 5 * 1e17;
	while (R - L > 1) {
		ll mid = (L + R) / 2;
		if (ok(mid)) {
			R = mid;
		}
		else {
			L = mid;
		}
	}
	cout << R << endl;
	return 0;
}


Measured memory_bytes: 4848
S=str(input())
count=[0,0]
for i in range(len(S)):
  if i%2==0:
    if S[i]=='0':
      count[0]+=1
    else :
      count[1]+=1
  else :
    if S[i]=='1':
      count[0]+=1
    else :
      count[1]+=1
print(min(count))

Measured memory_bytes: 3188
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>

//AtCoderC++.cpp

using namespace std;

void Show(vector<vector<int>> Ns) {
	for (int i = 0; i < Ns.size(); i++) {
		for (int j = 0; j < Ns[i].size(); j++) {
			if (j == Ns[i].size() - 1) {
				cout << Ns[i][j] << endl;
			} else {
				cout << Ns[i][j] << ",";
			}			
		}
	}
}

void Show(vector<int> N) {
	for (int i = 0; i < N.size(); i++) {
		cout << N[i];
		if (i != N.size() - 1) {
			cout << " ";
		} else {
			cout << endl;
		}
	}
}


int main() {
	long long A, B;
	cin >> A >> B;
	int Count = 0;
	while (A <= B) {
		Count++;
		A *= 2;
	}
	cout << Count << endl;
}

Measured memory_bytes: 256
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
kisu = []
gusu = []
for i in range(n):
    if i % 2 == 0:
        kisu.append(v[i])
    else:
        gusu.append(v[i])
k = sorted(Counter(kisu).items(), key=lambda x: x[1], reverse=True)
g = sorted(Counter(gusu).items(), key=lambda x: x[1], reverse=True)
ans1 = 0
ans2 = 0
#print(k, g)
if k[0][0] == g[0][0]:
    if k[0][1] > g[0][1]:
        ans1 = (n//2) - k[0][1]
        if len(g) < 2:
            ans2 = n // 2
        else:
            ans2 = (n//2) - g[1][1]
    elif k[0][1] < g[0][1]:
        ans1 = (n//2) - g[0][1]
        if len(k) < 2:
            ans2 = n // 2
        else:
            ans2 = (n//2) - k[1][1]
    else:
        if len(k) < 2:
            ans2 = n // 2
        else:
            if k[1][1] == g[1][1]:
                ans1 = (n // 2) - k[0][1]
                ans2 = (n // 2) - g[1][1]
            elif k[1][1] > g[1][1]:
                ans1 = (n // 2) - k[1][1]
                ans2 = (n // 2) - g[0][1]
            else:
                ans1 = (n // 2) - k[0][1]
                ans2 = (n // 2) - g[1][1]
else:
    ans1 = (n // 2) - k[0][1]
    ans2 = (n // 2) - g[0][1]
print(ans1 + ans2)




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

const int N = 1e5 + 10;
int n, cnt[N], par[N], mark[N];
ll sum[N];
pli ar[N];
unordered_map <ll, int> mp;
vector <int> ch[N];

void dfs(int v) {
	mark[v] = 1;
	for (int i : ch[v]) {
		dfs(i);
		sum[v] += sum[i] + cnt[i];
	}
}

int32_t main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	fill(cnt, cnt + N, 1);
	
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> ar[i].first;
		ar[i].second = i;
		mp[ar[i].first] = i;
	}
	sort(ar, ar + n);
	
	for (int i = n - 1; i > 0; i--) {
		int v = ar[i].second;
		ll nd = ar[i].first - n + (ll)2 * cnt[v];
		if (mp.find(nd) == mp.end() || 2 * cnt[v] > n)
			return cout << -1, 0;
		
		int p = mp[nd];
		ch[p].push_back(v);
		par[v] = p;
		cnt[p] += cnt[v];
	}
	
	dfs(ar[0].second);
	if (sum[ar[0].second] != ar[0].first)
		return cout << -1, 0;
	
	for (int i = 0; i < n; i++)
		if (!mark[i])
			return cout << -1, 0;
	
	for (int i = 0; i < n; i++)
		if (i != ar[0].second)
			cout << i + 1 << " " << par[i] + 1 << '\n';
}

Measured memory_bytes: 16804
#include <stdio.h>
#define ll long long

//(B)
int main(){
	ll n, fn = 0;
	scanf("%lld",&n);
	ll tmp = n;
	while(tmp){
		fn += tmp%10;
		tmp /= 10;
	}
	printf((n%fn==0) ? "Yes":"No");
	return 0;
}

Measured memory_bytes: 128
//By: Luogu@rui_er(122461)
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6+5;

int n, a[N];
map<int, bool> mp;

int tab[N], prime[N], tot, uGcd;
bool _1;

void initPrime() {
	int _ = ceil(sqrt(N));
	for(int i=2;i<=_;i++) tab[i] = 1;
	for(int i=2;i<=_;i++) {
		if(tab[i]) prime[tot++] = i;
		for(int j=0;j<tot&&prime[j]*i<=_;j++)
		{
			tab[prime[j]*i] = 0;
			if(i % prime[j] == 0) break;
		}
	}
}

int main() {
	initPrime();
	scanf("%d", &n);
	_1 = true;
	for(int i=1;i<=n;i++) {
		scanf("%d", &a[i]);
		if(i == 1) uGcd = a[i];
		else uGcd = __gcd(uGcd, a[i]);
		for(int j=0;j<tot;j++) {
			if(a[i] % prime[j] == 0) {
				if(mp[prime[j]]) _1 = false;
				else mp[prime[j]] = true;
				while(a[i] % prime[j] == 0) a[i] /= prime[j];
			}
			if(a[i] == 1) break;
		}
		if(a[i] != 1) {
			if(mp[a[i]]) _1 = false;
			else mp[a[i]] = true;
		}
	}
	if(_1) puts("pairwise coprime");
	else if(uGcd == 1) puts("setwise coprime");
	else puts("not coprime");
	return 0;
}

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

using namespace std;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vvs = vector<vector<string>>;
template<typename T> using vv = vector<vector<T>>;
template<typename T> using vvv = vector<vector<vector<T>>>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using pqg = priority_queue<T, vector<T>, greater<T>>;

const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
const int DX[4] = {1, 0, -1, 0};
const int DY[4] = {0, 1, 0, -1};

#define _sel(_1, _2, x, ...) x
#define repn(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, ...) _sel(__VA_ARGS__, reps, repn)(i, __VA_ARGS__)
#define reppn(i, n) for (ll i = 1; i <= (n); i++)
#define repps(i, a, b) for (ll i = (a); i <= (b); i++)
#define repp(i, ...) _sel(__VA_ARGS__, repps, reppn)(i, __VA_ARGS__)
#define rrepn(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rreps(i, a, b) for (ll i = (b) - 1; i >= (a); i--)
#define rrep(i, ...) _sel(__VA_ARGS__, rreps, rrepn)(i, __VA_ARGS__)
#define rreppn(i, n) for (ll i = (n); i >= 1; i--)
#define rrepps(i, a, b) for (ll i = (b); i >= (a); i--)
#define rrepp(i, ...) _sel(__VA_ARGS__, rrepps, rreppn)(i, __VA_ARGS__)

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define rng(v) (v).begin(), (v).end()
#define rrng(v) (v).rbegin(), (v).rend()
#define siz(x) int((x).size())
#define pow2(x) (1ll << (x))
#define bit(x, n) ((x) >> (n) & 1)
#define prt(x) cout << (x) << endl
#define dbg(x) dbgn(#x, x)

template<typename T, typename U> inline bool umax(T& m, U x) { if (m < x) { m = x; return true; } return false; }
template<typename T, typename U> inline bool umin(T& m, U x) { if (m > x) { m = x; return true; } return false; }
template<typename T> inline void errv(T& v) { for (auto x: v) cerr << x << " "; cerr << endl; }
inline void errv(vb& v) { for (auto x: v) cerr << (x ? 1 : 0) << " "; cerr << endl; }
template<typename T> inline void dbgn(string n, T x) { cerr << n << ": " << x << endl; }
template<typename T> inline void dbgn(string n, vector<T>& v) { cerr << n << ": "; errv(v); }
template<typename T> inline void dbgn(string n, vv<T>& m) { cerr << n << ":" << endl; for (auto& v: m) errv(v); }


int score(int d, const vi& c, const vvi& s, const vi& t) {
    int ans = 0;
    vi l(26, 0);

    rep(i, d) {
        ans += s[i][t[i]];
        l[t[i]] = i + 1;

        rep(j, 26)
            ans -= c[j] * (i + 1 - l[j]);

        prt(ans);
    }

    return ans;
}

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

    vi c(26);
    rep(i, 26) cin >> c[i];

    vvi s(d, vi(26));
    rep(i, d) rep(j, 26) cin >> s[i][j];

    vi t(d);
    rep(i, d) cin >> t[i], t[i]--;

    score(d, c, s, t);

    return 0;
}


Measured memory_bytes: 3680
import java.util.*;

class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] freq = new int[100002];
        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt() + 1;
            freq[a - 1]++;
            freq[a]++;
            freq[a + 1]++;
        }
        System.out.println(Arrays.stream(freq).max().getAsInt());
    }
}


Measured memory_bytes: 50560
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	s := nextString()
	t := nextString()

	count := 0
	if s[0] == t[0] {
		count++
	}
	if s[1] == t[1] {
		count++
	}
	if s[2] == t[2] {
		count++
	}
	fmt.Println(count)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
long long n,m,mn,mi,x1[100],y11[100],x2[100],y2[100];
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++) scanf("%lld%lld",&x1[i],&y11[i]);
	for(int i=1;i<=m;i++) scanf("%lld%lld",&x2[i],&y2[i]);
	for(int i=1;i<=n;i++)
	{
		mn=900000010;mi=1;
		for(int j=1;j<=m;j++)
		{
			if(abs(x1[i]-x2[j])+abs(y11[i]-y2[j])<mn)
			  mn=abs(x1[i]-x2[j])+abs(y11[i]-y2[j]),mi=j;
		}
		cout<<mi<<"\n";
	 } 
	return 0;
 } 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, l, r) for(int i = (int)l; i <= (int)r; ++i)
#define REP(i, r) for(int i = (int)0; i < (int)r; ++i)
#define FORD(i, l, r) for(int i = (int)l; i >= (int)r; --i)
#define REPD(i, r) for(int i = (int)r - 1; i >= 0; --i)
#define X first
#define Y second
#define debug(x) {cerr << #x << " = " << x << '\n';}
#define pr(A, n) {cerr << #A << " = "; FOR(i, 1, n) cerr << A[i] << ' '; cerr << '\n';}
#define pr0(A, n) {cerr << #A << " = "; REP(i, n) cerr << A[i] << ' '; cerr << '\n';}

using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
const int Nmax = 2e5 + 11;

int n, a[Nmax], ans;
map<int, int> mp;

int main() {
    scanf("%d", &n);
    FOR(i, 1, n) {
        scanf("%d", a + i);
        ++mp[a[i]];
    }
    sort(a + 1, a + n + 1, [](int b, int c) { return b > c; });
    FOR(i, 1, n) {
        int p = log2(2 * a[i]);
        if (mp[(1 << p) - a[i]] && mp[a[i]] && (a[i] != (1 << p) - a[i] || mp[a[i]] > 1)) {
            ++ans;
            --mp[a[i]];
            --mp[(1 << p) - a[i]];
        }
    }
    cout << ans;
}


Measured memory_bytes: 20224
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

long long  fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y){
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}

// index が条件を満たすかどうか

int main() {
	int n;
	cin >> n;
	long long int mans = 1000000000;
	for (int i = 0; i < n; i++) {
		long long int a;
		long long int ans = 0;
		cin >> a;
		while (a % 2 == 0) {
			a = a / 2;
			ans++;
		}
		mans = min(mans, ans);
	}
	cout << mans;
}

Measured memory_bytes: 256
H,W = map(int, input().split())
S = [input() for i in range(H)]
queue = [(0,0,1)]
done ={(0,0)}
count = sum(row.count("#") for row in S)

def bfs(x,y,c):
    if(x<0 or y<0 or x>=W or y>=H or S[y][x]=="#"):
        return
    
    if(x,y) in done:
        return
    
    queue.append((x,y,c+1))
    done.add((x,y))

dx = [1,-1,0,0]
dy = [0,0,1,-1] 
flag= -1
while queue:
    x,y,c = queue.pop(0)
    if x==W-1 and y==H-1:
        flag=1
        break
    for i in range(4):
        bfs(x+dx[i],y+dy[i],c)

print(flag if flag == -1 else (H*W-count-c))

Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}


int main(){
  int n;
  string s;
  cin >> n >> s;
  vector<vector<int> > alph(2,vector<int>(26,0));

  rep(i,n){
    alph[1][s[i]-'a'] ++;
  }

  int ans = 0;
  rep(i,n){
    alph[0][s[i]-'a'] ++;
    alph[1][s[i]-'a'] --;
    int cnt = 0;
    rep(j,26){
      if(alph[0][j] > 0 && alph[1][j] > 0){
        //cout << alph[0][j] << " " << alph[1][j] << " | " ;
        cnt++;
      }
    }
    ans = max(ans,cnt);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(V) (V).begin(),(V).end()
#define ALLR(V) (V).rbegin(),(V).rend()
#define endl '\n'
using namespace std;
using ll = int64_t;
using ull = uint64_t;
using PLL = pair<ll, ll>;
using TLL = tuple<ll, ll, ll>;
template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;

int main() {
    ll N, M;
    cin >> N >> M;
    V<PLL> xy(M);
    for(ll i = 0; i < M; i++) {
        ll x, y;
        cin >> x >> y;
        x--; y--;
        xy[i] = PLL(x, y);
    }

    sort(ALL(xy));
    V<PLL> ranges(N);
    for(ll i = 0; i < N; i++) ranges[i] = PLL(i, i + 1);

    for(auto &&ele : xy) {
        ll x, y;
        tie(x, y) = ele;
        ll a, b, c, d;
        tie(a, b) = ranges[y];
        tie(c, d) = ranges[y + 1];
        ranges[y] = ranges[y + 1] = PLL(min(a, c), max(b, d));
    }

    for(ll i = 0; i < N; i++) {
        ll x, y;
        tie(x, y) = ranges[i];
        cout << y - x << " \n"[i + 1 == N];
    }
    return 0;
}



Measured memory_bytes: 7544
#include <iostream>
typedef long long int ll;
using namespace std;
int main(int argc, char const *argv[]) {
  ll N, A, B;
  std::cin >> N >> A >> B;
  if(A > B) std::cout << 0 << '\n';
  else if(N==1){
    if(A==B)std::cout << 1 << '\n';
    else std::cout << 0 << '\n';
  }else std::cout << (B - A) * (N - 2) + 1 << '\n';
  return 0;
}

Measured memory_bytes: 256
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);   
int a[212345];
vii vec;
int ans[212345];
int main(){
    std::ios::sync_with_stdio(false);
    int n;
    cin>>n;
    int i;
    rep(i,n){
    	cin>>a[i];
    	vec.pb(mp(a[i],i));
    }
    sort(all(vec));
    rep(i,n){
    	if(i<n/2){
    		ans[vec[i].ss]=vec[n/2].ff;
    	}
    	else{
    		ans[vec[i].ss]=vec[n/2-1].ff;
    	}
    }
    rep(i,n){
    	cout<<ans[i]<<endl;
    }
    
}



Measured memory_bytes: 5488
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::f64::consts::*;

#[allow(unused)]
const INF: usize = std::usize::MAX / 4;
#[allow(unused)]
const M: usize = 1000000007;

fn main() {
    input! {
        n: usize,
        s: [String; n],
    }
    let mut count = HashMap::new();
    count.insert(String::from("AC"), 0);
    count.insert(String::from("WA"), 0);
    count.insert(String::from("TLE"), 0);
    count.insert(String::from("RE"), 0);
    for si in s {
        *count.entry(si).or_insert(0) += 1;
    }
    println!("AC x {}", count[&String::from("AC")]);
    println!("WA x {}", count[&String::from("WA")]);
    println!("TLE x {}", count[&String::from("TLE")]);
    println!("RE x {}", count[&String::from("RE")]);
}


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

int main() {
    int l, r, d;
    cin >> l >> r >> d;
    cout << r / d - (l - 1) / d << endl;
}


Measured memory_bytes: 3552
#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C,D;
  cin >> A >> B >> C;
  int highest = max(A,max(B,C));
  int manko = max(A,max(B,C));
  int K;
  cin >> K;
  int i=0;
  while(i<K){
    highest *= 2;
    i++;
  }
  cout << A+B+C-manko+highest<< endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long x,y,z,a,b,c,i,j,sum=0,ar[105];
   cin>>a>>b;
   vector<long long>vec;
   for(i=b-a+1;i<=b+a-1;i++)
   {
       vec.push_back(i);
   }
   sort(vec.begin(),vec.end());
   for(i=0;i<vec.size();i++)
    cout<<vec[i]<<" ";

}


Measured memory_bytes: 256
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);
function main(){
  var a = next(), b = next(), c = next();
  var Y = "Yes", N = "No";
  if(a === b){
    if(a === c)return N;
    else return Y;
  }
  if(a === c || b === c)return Y;
  return N;
}

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

typedef long long ll;
const long long LINF = 1LL << 60;
const long long LMINF = 1LL << 63;
const int INF = 1 << 30;

#define REP(i,n) for(int i = 0;i < n;++i)
#define REPS(i,x) for(int i = 1;i <= (int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i >= 0;i--)
#define RREPS(i,x) for(int i=((int)(x));i > 0;i--)
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << ": " << x << "\n"

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



int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    REP(i,n)cin >> a[i];    
    int ans = 0;
    REPS(i,n){
        if(i % 2 != 0 && a[i - 1] % 2 != 0){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(void) {
	int N, M;
	int a, b;
	vector<int> C;

	cin >> N >> M;
	C.resize(N + 1, 0);
	for (int i = 0; i < M; ++i) {
		cin >> a >> b;
		++C[a];
		++C[b];
	}
	for (int i = 1; i <= N; ++i)
		cout << C[i] << '\n';

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
 
int main(){
  
  string A,B,C;
  cin>>A>>B>>C;
  transform(A.begin(),A.end(), A.begin(), ::toupper);
  transform(B.begin(),B.end(), B.begin(), ::toupper);
  transform(C.begin(),C.end(), C.begin(), ::toupper);

    cout<<A.at(0)<<B.at(0)<<C.at(0)<<endl;
}

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

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}

int main() {
ll N,M;
cin>>N>>M;

vector<ll>d(M);
rep(i,M){
    cin>>d[i];
}
ll sum=0;
rep(i,M){
sum+=d[i];
}
if(sum>N){
    cout<<"-1"<<endl;

}
else{
    cout<<N-sum<<endl;
}
return 0;
}

Measured memory_bytes: 3676
//https://atcoder.jp/contests/abc128/tasks/abc128_b
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/














int N;
string S[101];
int P[101];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) cin >> S[i] >> P[i];

	vector<int> ans;
	rep(i, 0, N) ans.push_back(i);
	sort(all(ans), [&](int a, int b) {
		if (S[a] != S[b]) return S[a] < S[b];
		return P[a] > P[b];
	});

	fore(i, ans) cout << (i + 1) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

struct mint {
  ll x;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

mint factorial(ll n) {
  mint answer = 1;
  while (n > 1) {
    answer *= n;
    n--;
  }
  return answer;
}

mint combination(ll n, ll r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
}

mint permutation(ll n, ll r) { return factorial(n) / factorial(n - r); }

// setprecision(8) 桁数指定
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}

map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
// for (auto p : prime_factor(n)) {
//	while (p.second--) {
//		cout << p.first << endl;
//	}
//}

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

bool compare_by_b(pair<ll, ll> a, pair<ll, ll> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

vector<ll> Eratosthenes(const ll N) {
  bool is_prime[1000000 + 1];
  vector<ll> P;
  for (ll i = 0; i <= N; i++) {
    is_prime[i] = true;
  }
  for (ll i = 2; i <= N; i++) {
    if (is_prime[i]) {
      for (ll j = 2 * i; j <= N; j += i) {
        is_prime[j] = false;
      }
      P.emplace_back(i);
    }
  }
  return P;
}

typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

int main() {
  int n, a;
  cin >> n >> a;
  int ans = n * n - a;
  cout << ans << endl;
  return 0;
}

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

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

    if((a+b)%2 == 0){
        cout << (a+b)/2 << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>
#include <iomanip>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

int main() {
    ll N,M,C;
    cin >> N >> M >> C;
    vector<ll> B(M);
    for(int i=0;i<M;i++) cin >> B[i];
    ll ans=0;
    for(int i=0;i<N;i++){
        ll sum=C;
        for(int j=0;j<M;j++){
            ll tmp;
            cin >> tmp;
            sum+=tmp*B[j];
        }
        if(sum>0) ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256