akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in1(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define inN(x, N) rep(i, N) in1(x[i])
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());

    const ll X = 753;

    string s;
    in1(s);

    ll ans = INF;

    rep(i, s.size() - 2)
    {
        ll Y = (s[i] - '0') * 100 + (s[i + 1] - '0') * 10 + (s[i + 2] - '0');
    
        chmin(ans, abs(X - Y));
    }

    outl(ans);

    return 0;
}


Measured memory_bytes: 3560
// C++ 14
#include <bits/stdc++.h>
using namespace std;
template <typename T>  ostream& operator<<(ostream& os, const vector<T>& v)  {  os << "[";  for (int i = 0; i < v.size(); ++i) {  os << v[i];  if (i != v.size() - 1)  os << ", ";  }  os << "]";  return os;  }
template <typename T> void print(T v) { cout << v << endl; }
template <typename T> void in(T &v) { cin >> v; }
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
//  cout.precision(15); cout << fixed;
/* Mod */
template<int MOD>
struct ModInt {
  ll x;
  ModInt():x(0){}
  ModInt(ll x):x((x%MOD+MOD)%MOD){}
  int getMod() { return MOD; }
  ModInt operator-() const { return ModInt(0) - *this;}
  ModInt& operator+=(const ModInt& a){ if((x+=a.x)>=MOD) x-=MOD; return *this;}
  ModInt& operator-=(const ModInt& a){ if((x+=MOD-a.x)>=MOD) x-=MOD; return *this;}
  ModInt& operator*=(const ModInt& a){ (x*=a.x)%=MOD; return *this;}
  ModInt operator+(const ModInt& a)const{ return ModInt(*this) += a;}
  ModInt operator-(const ModInt& a)const{ return ModInt(*this) -= a;}
  ModInt operator*(const ModInt& a)const{ return ModInt(*this) *= a;}
  bool operator<(const ModInt& a)const{ return x < a.x;}
  bool operator==(const ModInt& a)const{ return x == a.x;}
  friend ostream & operator << (ostream & out, ModInt<MOD> const & v) {
    out << v.x;
    return out;
  }
};
const int MOD = 1000000007;
using mint = ModInt<MOD>;

template<class T> struct BiCoef {
    vector<T> fact_, inv_, finv_;
    constexpr BiCoef() {}
    constexpr BiCoef(int n) noexcept : fact_(n, 1), inv_(n, 1), finv_(n, 1) {
        init(n);
    }
    constexpr void init(int n) noexcept {
        int MOD = fact_[0].getMod();
        fact_.assign(n, 1), inv_.assign(n, 1), finv_.assign(n, 1);
        for(int i = 2; i < n; i++){
            fact_[i] = fact_[i-1] * i;
            inv_[i] = -inv_[MOD%i] * (MOD/i);
            finv_[i] = finv_[i-1] * inv_[i];
        }
    }
    constexpr T perm(int n, int k) const noexcept {
        if (n < k || n < 0 || k < 0) return 0;
        return com(n, k) * fact(k);
    }
    constexpr T com(int n, int k) const noexcept {
        if (n < k || n < 0 || k < 0) return 0;
        return fact_[n] * finv_[k] * finv_[n-k];
    }
    constexpr T fact(int n) const noexcept {
        if (n < 0) return 0;
        return fact_[n];
    }
    constexpr T inv(int n) const noexcept {
        if (n < 0) return 0;
        return inv_[n];
    }
    constexpr T finv(int n) const noexcept {
        if (n < 0) return 0;
        return finv_[n];
    }
};



int main() {
  int n,k; in(n),in(k);
  vector<ll> A(n);
  loop(i,0,n) in(A[i]);

  BiCoef<mint> bc(n+1);
  mint ans = 0;
  {
    sort(A.begin(), A.end());
    // 0 1 2
    // 1 1 2
    // i = 2, k = 3
    loop(i,0,n) {
      if (i>=k-1) {
        ans += mint(A[i]) * bc.com(i, k-1);
      }
    }
  }
  {
    reverse(A.begin(), A.end());
    loop(i,0,n) {
      if (i>=k-1) {
        ans -= mint(A[i]) * bc.com(i, k-1);
      }
    }
  }
  print(ans);
  return 0;
}


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

using namespace std;

const int N = 5e3 + 10;

typedef pair<int, int> pi; 

int n;
string s, t;
vector<pi> S, T;

int main() {
  cin >> n >> s >> t;
  if (n <= 2) {
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] != t[i]) ans++;
    }
    cout << ans << endl;
    return 0;
  }
  if (s[0] == '0') {
    for (int i = n; i >= 0; i--) S.push_back(pi(0, i & 1));
  } else {
    for (int i = n; i >= 1; i--) S.push_back(pi(0, i & 1));
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == s[i - 1]) continue;
    S.push_back(pi(i, s[i] - '0'));
  }
  if (s[n - 1] == '0') {
    for (int i = 1; i <= n; i++) S.push_back(pi(n, i & 1));
  } else {
    for (int i = 0; i <= n; i++) S.push_back(pi(n, i & 1));
  }
  for (int i = 1; i < n; i++) {
    if (t[i] == t[i - 1]) continue;
    T.push_back(pi(i, t[i] - '0'));
  }
  int ans = n * n;
  for (int i = 0; i + T.size() - 1 < S.size(); i++) {
    if (S[i].second != T[0].second) continue;
    int cur = 0;
    for (int j = 0; j < S.size(); j++) {
      if (j < i) cur += abs(S[j].first);
      if (j > i + T.size() - 1) cur += abs(S[j].first - n); 
    }
    for (int j = 0; j < T.size(); j++) {
      cur += abs(S[i + j].first - T[j].first);
    }
    ans = min(ans, cur);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define pb push_back
#define fr(i,n) for(int i=0;i<n;i++)
#define Fr(i,n) for(int i=0;i++<n;)
#define ifr(i,n) for(int i=n-1;i>=0;i--)
#define iFr(i,n) for(int i=n;i>0;i--)

int main(){
  ll n,T,t[200010],s=0;
  cin>>n>>T;
  fr(i,n) cin>>t[i];
  t[n]=1e10;
  fr(i,n){
    if(t[i+1]-t[i]>T) s+=T;
    else s+=t[i+1]-t[i];
  }
  cout<<s<<endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N; cin >> N;
    int A[1010][1010];
    for(int i=0; i<N; i++){
        for(int j=0; j<N-1; j++){
            int a; cin >> a;
            a--;
            A[i][j] = a;
        }
    }
    
    int cur[1010];
    for(int i=0; i<1010; i++) cur[i]=0;

    
    int cnt = 0;
    while(1){
        
        
        bool nopair = true;

        int used[1010] = {};

        for(int i=0; i<N; i++){
            if(cur[i]==N-1) continue;
            int aite = A[i][cur[i]];
            
            if(used[i] || used[aite]) continue;
            if(i==A[aite][cur[aite]]){
                cur[i]++;
                cur[aite]++;
                used[i] = true;
                used[aite] = true;
                nopair = false;
            }
        }
        
        
        if(nopair){
            cout << -1 << endl;
            return 0;
        }
        
        cnt++;
        
        bool allend = true;
        for(int i=0; i<N; i++){
            if(cur[i]!=N-1) allend = false;
        }
        
        
        if(allend){
            cout << cnt << endl;
            return 0;
        }
        
    }
    
    return 0;
}



Measured memory_bytes: 4224
#include <iostream>
#include <string>
int main() {
	int a[100], b[100], c[100], i = 0, j;
	std::string op[100];

	while (1) {
		std::cin >> a[i] >> op[i] >> b[i];
		if (op[i] == "?") break;
		i++;
	}

	for (j = 0; j < i; j++) {
		if (op[j] == "+")
			c[j] = a[j] + b[j];
		else if (op[j] == "-")
			c[j] = a[j] - b[j];
		else if (op[j] == "*")
			c[j] = a[j] * b[j];
		else if (op[j] == "/")
			c[j] = a[j] / b[j];
	}

	for (j = 0; j < i; j++) {
		std::cout << c[j] << std::endl;
	}

	return 0;
}

Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
typedef vector<pii> vpii;
#define reps(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define all(g) (g).begin(),(g).end()
#define pb push_back
const int mod = 1e9 + 7;
#define INF 1<<25
/*
input case
output case
*/

int a,b;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b;
    if (a <= 0 and 0 <= b){
        cout << "Zero" << endl;
    } else if (0 <= a and 0 <= b){
        cout << "Positive" << endl;
    } else if ((a-b) % 2 == 0){
        cout << "Negative" << endl;
    } else{
        cout << "Positive" << endl;
    }
}

Measured memory_bytes: 764
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C,X,Y = LI()

ave = (A+B)/2
cost = 0
if ave > C:
    cost += C * min(X,Y) * 2
    if X > Y:
        if A > C * 2:
            cost += C*2*(X-Y)
        else:
            cost += A*(X-Y)
    elif X < Y:
        if B > C * 2:
            cost += C*2*(Y-X)
        else:
            cost += B*(Y-X)
else:
    cost += A*X + B*Y

print(cost)

Measured memory_bytes: 9152
#include<iostream>
#include<vector>
using namespace std;
int main(){
	string w;
	cin>>w;

	vector<int> count(26,0);
	for(int i=0;i<w.size();i++){
		count.at(w.at(i)-97) += 1;
	}

	bool flag = true;
	for(int i=0;i<26;i++){
		if(count.at(i)%2 != 0){
			flag = false;
			break;
		}
	}

	if(flag){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
}


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

using namespace std;


int main()
{
    int N, L;
    long sum;

    cin >> N >> L;

    for (int i = 0; i < N; i++) {
        
    }

    if (L-1 >= 0) {
        sum = L*(N-1) + (N+2)*(N-1)/2 - (N - 1);
    } else {
        if (L+N-1 < 0) {
            sum = L * N + (N+1)*N/2 - N - (L+N-1);
            //cout << L+N-1 << endl;
            //sum = L * N + (N+1)*N/2 - N;
        } else {
            sum = L * N + (N+1)*N/2 - N;
        }
    }

    cout << sum << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define llu unsigned long long
#define ld double
#define llu unsigned long long
#define rep(i,x,y)  for(int i=x;i<y;++i)
#define For(i,x,y)  for(int i=x;i<=y;++i)
#define FOr(i,x,y)  for(int i=x;i>=y;--i)
#define pi acos(-1)
#define mk make_pair<ll,ll>
#define pa pair<ll,ll>
#define lf else if
#define max(x,y)    ((x)<(y)?(y):(x))
#define min(x,y)    ((x)<(y)?(x):(y))
#define sqr(x)      ((x)*(x))
#define abs(x)      ((x)>0?(x):-(x))
#define Mul(x,y)    (x=1LL*(x)*(y)%mod)
#define Add(x,y)    (x=(x+(y))%mod)
#define Max(x,y)    ((x)=((x)<(y)?(y):(x)))
#define Min(x,y)    ((x)=((x)>(y)?(y):(x)))
#define E(x)        return writeln(x),0
#define p(x)        printf("~%lld~\n",x)
#define pp(x,y)     printf("~~%lld %lld~~\n",x,y)
#define ppp(x,y,z)  printf("~~~%lld %lld %lld~~~\n",x,y,z)
#define pppp(a,b,c,d)	printf("~~~%d %d %d %d\n",a,b,c,d)
#define f_in(x)     freopen(x".in","r",stdin)
#define f_out(x)    freopen(x".out","w",stdout)
#define open(x)     f_in(x),f_out(x)
#define fi first
#define se second
typedef complex<double> E;
namespace SHENZHEBEI{
#ifdef LOCAL
    struct _{_(){freopen("cf.in","r",stdin);}}_;
#endif
#define NEG 1
    inline char gc(){   return getchar();   }
#if NEG
    inline ll read(){    ll x=0,f=1; char ch=gc();   for (;!isdigit(ch);ch=gc()) if (ch=='-') f=-1;  for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x*f; }
    inline void write(ll x){    if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#else
    inline ll read(){    ll x=0; char ch=gc();   for (;!isdigit(ch);ch=gc());    for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x;   }
    inline void write(ll x){    if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#endif
    inline char readchar(){ char ch=gc();   for(;isspace(ch);ch=gc());  return ch;  }
    inline ll readstr(char *s){ char ch=gc();   int cur=0;  for(;isspace(ch);ch=gc());      for(;!isspace(ch);ch=gc())  s[cur++]=ch;    s[cur]='\0';    return cur; }
    inline void writeln(ll x){  write(x);   puts("");   }        
    inline ld getreal(){    static ld lbc;  scanf("%lf",&lbc);  return lbc; }
}using namespace SHENZHEBEI;
const ll N=310000;
ll m,n,A,B,pos,a[N],Down;
ll calc(ll x){return x+((n-x)%A==0?(n-x)/A:((n-x)/A+1));}
int main(){
	m=n=read(),A=read(),B=read();
	if (A+B>n+1)return puts("-1"),0;
	if (A*B<n)	return puts("-1"),0;
//last_all_dec
	ll l=0,r=n,ans=0;
	for(;l<=r;){
		ll mid=(l+r)>>1;
		if (calc(mid)>=B)ans=mid,r=mid-1;
		else l=mid+1;
	}
	FOr(i,n,n-ans+1)a[i]=++Down;n-=Down;m-=Down;
	for(;;){
		ll cur_pos=pos;
		pos+=A;Min(pos,m);
		For(j,1,A){
			a[pos--]=Down+n--;
			if (pos<=cur_pos)break;
		}
		pos+=A;Min(pos,m);
		if (pos==m)break;
	}
	For(i,1,m+Down)printf("%d ",a[i]);
}

Measured memory_bytes: 4480
// ProblemURL : https://atcoder.jp/contests/abc047/tasks/arc063_a
// ---------------------------------------------
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	ct := 0
	for i := 0; i < len(s)-1; i++ {
		if s[i] != s[i+1] {
			ct++
		}
	}
	fmt.Println(ct)
}


Measured memory_bytes: 1280
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <limits.h>
#include <math.h>

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

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef vector<int> vint;
const ll INF = LONG_LONG_MAX;
const int MAX_P = 55555+1;

bool isnot_primed[5*MAX_P];

void init(){
    isnot_primed[0] = isnot_primed[1] = true;
    for(int i=0;i*i<5*MAX_P;i++){
        if(isnot_primed[i]) continue;
        for(int j=2*i;j<5*MAX_P;j+=i){
            isnot_primed[j] = true;
        }
    }
}


int main() {
    // insert code here...    return 0;
    //////
    // input from txt
    /*
     std::ifstream in("input.txt");
     std::cin.rdbuf(in.rdbuf());
     std::ofstream out("output.txt");
     std::cout.rdbuf(out.rdbuf());
     ////
     */
    init();
    int N;
    cin >> N;
    vint ans;
    repeat(i, N){
        int j = 1;
        if(!ans.empty()) j = ans.back()+5;
        for(;j<MAX_P;j+=5){
            if(isnot_primed[j]) continue;
            ans.push_back(j);
            break;
        }
    }
    repeat(i, N){
        cout << ans[i];
        if(i==N-1){
            cout << endl;
        }else{
            cout << " ";
        }
    }
    return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
using namespace std;
bool cmp(int a, int b) {
    return a > b;
}
const int N = 110;
int votes[N];
int n, m;
int main() {
    cin >> n >> m;
    double sum = 0;
    for(int i = 0; i < n; i ++ ){
        cin >> votes[i];
        sum += votes[i];
    } 
    sort(votes, votes+n, cmp);
    double bound = sum /(double) (m*4);
    if(votes[m-1] >= bound) {
        cout << "Yes" << endl;
    } else cout <<"No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define maxn 405
using namespace std;
int col[maxn][4];
ll h[maxn];
inline ll cal(int a,int b,int c,int d) {
	vector<int> col = {a,b,c,d};
	ll ret = 1234567891234567ll;
	for(int rot=0;rot<4;rot++) {
		ll num = 0;
		for(int i=0;i<4;i++)
			num = num*1000+col[(rot+i)%4];
		ret = min(ret,num);
	}
	return ret;
}
int fac[5];
inline ll Pow(int a,int n) {
	ll ret = 1;
	ll base = a;
	while(n) {
		if(n&1)	ret *= base;
		base *= base;
		n >>= 1;
	}
	return ret;
}
inline ll C(int n,int m) {
	if(n < m)	return 0;
	ll ret = 1;
	for(int i=n-m+1;i<=n;i++)
		ret *= i;
	for(int i=1;i<=m;i++)
		ret /= i;
	return ret;
}
map<ll,pii> cnt;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	for(int i=1;i<=n;i++) {
		for(int j=0;j<4;j++)
			cin >> col[i][j];
		h[i] = cal(col[i][0],col[i][1],col[i][2],col[i][3]);
		int now_cnt = 0;
		for(int rot=0;rot<4;rot++) {
			ll num = 0;
			for(int j=0;j<4;j++)
				num = num*1000+col[i][(rot+j)%4];
			if(num == h[i])
				now_cnt++;
		}
		cnt[h[i]].first++;
		cnt[h[i]].second = now_cnt;
	}
	
	fac[0] = 1;
	for(int i=1;i<5;i++)
		fac[i] = fac[i-1] * i;
	
	ll ans = 0;
	for(int i=1;i<=n;i++) {
		cnt[h[i]].first--;
		for(int j=i+1;j<=n;j++) {
			cnt[h[j]].first--;
			reverse(col[j],col[j]+4);
			for(int rot=0;rot<4;rot++) {
				vector<int> t1(4),t2(4);
				for(int k=0;k<4;k++) {
					t1[k] = col[i][k];
					t2[k] = col[j][(rot+k)%4];
				}
				map<ll,int> need;
				for(int k=0;k<4;k++)
					need[cal(t1[k],t2[k],t2[(k+1)%4],t1[(k+1)%4])]++;
				ll now = 1;
				for(auto x : need)
					now *= C(cnt[x.first].first,x.second) * Pow(cnt[x.first].second,x.second) * fac[x.second];
				ans += now;
			}
			cnt[h[j]].first++;
			reverse(col[j],col[j]+4);
		}
//		cnt[h[i]].first++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 80128
#include <stdio.h>

int main(void)
{
    int t;
    int p;
    int i;
    
    while (1){
        scanf("%d", &t);
        if (t == 0){
            break;
        }
        
        for (i = 0; i < 9; i++){
            scanf("%d", &p);
            t -= p;
        }
        
        printf("%d\n", t);
    }
    return (0);
}

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

int main(void)
{
	int score[100010]={0};
	int a[100010];
	int n, k, q, i;
	scanf("%d %d %d", &n, &k, &q);
	
	for(i=0;i<q;i++){
		scanf("%d", &a[i]);
		score[a[i]]+=1;
	}

	for(i=1;i<n+1;i++){
		if(k-q+score[i]<=0){
			printf("No\n");
		}

		else{
			printf("Yes\n");
		}
	}
	return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    int n;
    cin>>n;
    cout<<"ABC"<<n<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int N,M;
vector<pair<int,int> >G[1<<17];
bool vis[2][1<<17];
long T[2][1<<17];
long ans=1e9;
void dfs(int u,int w)
{
	vis[w][u]=true;
	for(pair<int,int>p:G[u])
	{
		long t=p.second-T[w][u];
		if(vis[!w][p.first])
		{
			if(T[!w][p.first]!=t)
			{
				ans=0;
				break;
			}
		}
		else
		{
			T[!w][p.first]=t;
			dfs(p.first,!w);
		}
	}
}
main()
{
	cin>>N>>M;
	for(int i=0;i<M;i++)
	{
		int a,b,c;cin>>a>>b>>c;a--,b--;
		G[a].push_back(make_pair(b,c));
		G[b].push_back(make_pair(a,c));
	}
	dfs(0,0);
	long L=1,R=1e9;
	for(int i=0;i<N;i++)
	{
		if(vis[0][i]&&vis[1][i])
		{
			long X=T[1][i]-T[0][i];
			if(X<=0||X%2)ans=0;
			else ans=min(ans,1L);
		}
		if(vis[0][i])L=max(L,1-T[0][i]);
		if(vis[1][i])R=min(R,T[1][i]-1);
	}
	cout<<max(min(ans,R-L+1),0L)<<endl;
}

Measured memory_bytes: 18048
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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

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

constexpr ll mod = 1e9 + 7;
const double PI = acos(-1.0);

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

  int n, k; cin >> n >> k;
  vector<int> a(n), b(n);
  rep(i, n) {
    cin >> a[i] >> b[i];
  }
  ll ans = 0;
  rep(j, n) {
    if ((a[j] | k) == k) {
      ans += b[j];
    }
  }

  int tmp = k;
  bool flag = false;
  for(int i=0; i<30; i++) {
    ll now = 0;
    int s = 1<<i;
    if (k & s) {
      if (flag) {
        tmp -= s;
        //debugln(tmp);
        rep(j, n) {
          if ((a[j] | tmp) == tmp) {
            now += b[j];
          }
        }
        chmax(ans, now);
        tmp += s;
      }
    } else {
      tmp += s;
      flag = true;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

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

    bool f = a.back() == b.front() && b.back() == c.front();
    auto YesOrNo = [](bool f) { cout << (f ? "YES" : "NO") << endl; };
    YesOrNo(f);
}


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

int main(){
    int h,x,c500,c5;
    cin >> x;
    c500=x/500;
    c5=(x%500)/5;
    h=c500*1000+c5*5;
    cout << h << endl;

    

    return 0;
}

Measured memory_bytes: 256
d=list(map(int,input().split()))
n,a,b=d[0],d[1],d[2]
alist=[]
for x in range(1,n+1):
    if x==10000:
        if 1>=a and 1<=b:
            alist.append(x)
    else:
        f=x%1000
        e=int((x-f)/1000)
        h=f%100
        g=int((f-h)/100)
        j=h%10
        i=int((h-j)/10)
        wa=e+g+i+j
        if wa>=a and wa<=b:
            alist.append(x)

print(sum(alist))


Measured memory_bytes: 3316
//Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;

typedef long long              ll;
typedef long double            ld;
typedef pair<int, int>         pi;
typedef vector<int>            vi;
typedef vector<pair<int, int>> vpi;

#define pb       push_back
#define all(x)   begin(x), end(x)
#define sz(x)    (int)(x).size()
#define ff       first
#define ss       second
#define mp       make_pair
#define lb       lower_bound
#define ub       upper_bound
#define tcase()  int t; cin >> t; while(t--)

const int MOD = 1e9 + 7; // 998244353;
const int MX  = 2e5 + 5;
const ll  INF = 1e18;
const ld  PI  = acos((ld) -1);

void setIO(string name = "") {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    if(sz(name)){
        freopen((name+".in").c_str(), "r", stdin);
        freopen((name+".out").c_str(), "w", stdout);
    }
}

int main(){

    setIO();

    ll n, m;
    cin >> n >> m;

    ll a;
    priority_queue<ll> q;

    for(int i = 0; i < n; i++){
        cin >> a;
        q.push(a);
    }

    for(int i = 0; i < m; i++){
        a = q.top();
        q.pop();
        a >>= 1;
        q.push(a);
    }

    ll ans = 0;

    while(!q.empty()){
        ans += q.top();
        q.pop();
    }

    cout << ans;
}


Measured memory_bytes: 4216
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int a;
    int b;
    int c;
    int d;
    cin >> a >> b;
    
    
    c = a * b;
    d = (a + b) * 2;
    
    cout << c  << " "<< d << endl;
    
    return 0;
}



Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;

int n,m;
vector<int> s1,s2,s;

int main(){
	scanf("%d%d",&n,&m);
	int c0=0;
	for(int i=1;i<=m;i++){
		int t;
		scanf("%d",&t);
		if(t&1) s2.push_back(t);
		else s1.push_back(t);
	}
	if(s2.size()>2){
		puts("Impossible");
		return 0;
	}
	if(!s2.empty()){
		s.push_back(s2.back());
		s2.pop_back();
	}
	while(!s1.empty()){
		s.push_back(s1.back());
		s1.pop_back();
	}
	if(!s2.empty()){
		s.push_back(s2.back());
		s2.pop_back();
	}
	for(int i=0;i<s.size();i++) printf("%d ",s[i]);
	if(s.size()==1){
		if(s[0]==1){
			printf("\n1\n1");
			return 0;
		}
		printf("\n2\n%d %d\n",s[0]-1,1);
		return 0;
	}
	printf("\n%d\n",s[0]==1?s.size()-1:s.size());
	if(s[0]!=1) printf("%d ",s[0]-1);
	for(int i=1;i<s.size()-1;i++) printf("%d ",s[i]);
	if(s.size()>1) printf("%d\n",s.back()+1);
}


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



int main (void){
    int n,m;
    cin >> n >> m;

    int l[m + 5], r[m + 5];
    int minrindex = 0;
    int maxlindex = 0;
    for(int i=0;i<m;i++){
        cin >> l[i] >> r[i];
        if(l[i]>l[maxlindex]){
            maxlindex = i;
        }
        if (r[i] <r[minrindex]){
            minrindex = i;
        }
    }
    int ans = (r[minrindex] - l[maxlindex]) + 1;
    if(ans<0){
        ans = 0;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1024
P = 10**9+7
fa = [1]
for i in range(1, 1010): fa.append(fa[-1] * i % P)
fainv = [pow(fa[-1], P-2, P)]
for i in range(1, 1010)[::-1]: fainv.append(fainv[-1] * i % P)
fainv = fainv[::-1]

k = 70
kk = 1<<k
nu = lambda L: int("".join([bin(kk+a)[-k:] for a in L[::-1]]), 2)
st = lambda n: bin(n)[2:] + "0"
li = lambda s: [int(a, 2) % P if len(a) else 0 for a in [s[-(i+1)*k-1:-i*k-1] for i in range(N+1)]]

N, K = map(int, input().split())
A = [int(a) for a in input().split()]
X = [fa[N]] + [0] * N
for a in A:
    X = li(st(nu(X) * nu([fainv[i] * fa[N-i] * fainv[a-i] * fainv[N-a] % P if i <= a else 0 for i in range(N+1)])))

print(X[-1])

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

using namespace std;

#define st first
#define nd second
#define ALL(x) (x).begin(), (x).end()

template <class T>
void mini(T& l, T r) {
  l = min(l, r);
}
template <class T>
void maxi(T& l, T r) {
  l = max(l, r);
}

using LL = long long;
using LD = long double;
using ULL = unsigned long long;
const int dx[] = {0, 1, 0, -1, -1, -1, 1, 1},
          dy[] = {1, 0, -1, 0, -1, 1, -1, 1};
const int INF = 1e9;
const LL MOD = 1e9 + 7;

void Solve() {
  int a, b, c;
  cin >> a >> b >> c;
  cout << ((a + b + c >= 22) ? "bust\n" : "win\n");
}

void Prepare() {
  // TODO
  return;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Prepare();
  // int t, T;
  // cin >> T;
  // for (t = 1; t <= T; t++) {
  Solve();
  // }
  return 0;
}

Measured memory_bytes: 256
import Control.Monad
import Data.List
import Data.Maybe
import Data.Ord
import qualified Data.ByteString.Char8 as BS

main = do
    n <- readLn :: IO Int
    an <- map read <$> replicateM n getLine :: IO [Int]
    let ms = take 2 (sortBy (comparing (\a -> (- (abs a)))) an)
    mapM_ print (map (\x -> if x == ms!!0 then ms!!1 else ms!!0) an)
    

Measured memory_bytes: 101972
#include<algorithm>
#include<climits>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<utility>
#include<vector>
 
#define lint long long
#define REP(i, x, n) for(int i = x ; i < n ; i++)
#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for(int i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<string> s(n);
    rep(i, n){
        cin >> s[i];
    }
    vector< vector<int> > cnt(n);
    rep(i, n){
        cnt[i].resize(26);
        rep(j, s[i].size()){
            cnt[i][s[i][j]-'a']++;
        }
    }
    vector<int> ans(26, IINF);
    rep(i, 26){
        rep(j, n){
            ans[i] = min(ans[i], cnt[j][i]);
        }
    }
    rep(i, 26){
        char c = i + 'a';
        rep(j, ans[i]){
            cout << c;
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
using ll = long long;

constexpr int N = 12, M = 1009, INF = numeric_limits<int>::max() / 2;
int n, m, a[M], b[M], unlock[M], dp[1 << N];
int go(int msk) {
  // msk shows not yet unlocked locks
  if(dp[msk] != -1) return dp[msk];
  dp[msk] = INF;
  for(int i = 0; i < m; ++i) {
    int un = unlock[i] & msk;
    if(!un) continue;
    dp[msk] = min(dp[msk], a[i] + go(msk ^ un));
  }
  return dp[msk];
}

int32_t main() {
  ios::sync_with_stdio(0); cin.tie(0);
  cin >> n >> m;
  for(int i = 0; i < m; ++i) {
    cin >> a[i] >> b[i];
    for(int j = 0, x; j < b[i]; ++j) {
      cin >> x; --x;
      unlock[i] |= 1 << x;
    }
  }
  fill(dp, dp + (1 << N), -1);
  dp[0] = 0;
  int ans = go((1 << n) - 1);
  cout << (ans == INF ? -1 : ans) << '\n';
}


Measured memory_bytes: 256
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 + (y1 - y2)
y3 = y2 - (x1 - x2)
x4 = x3 + (x1 - x2)
y4 = y3 + (y1 - y2)
print(x3, y3, x4, y4)

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

using namespace std;

#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define sz(a) static_cast<int>((a).size())
#define pb emplace_back
#define mp make_pair
#define endl '\n'
#define f first
#define s second

#ifdef SEREZHKA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) { cerr << _s << " = " << _h << "\n"; }

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;
    
    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;
    
    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

using ll = long long;

const ll INF = static_cast<ll>(1e9) + 7ll;
const ll LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

int n;
string s;
int cnt[MAXN];

bool read() {
    if (!(cin >> s))
        return false;

    return true;
}

void solve() {
    for (auto c : s)
        ++cnt[c];

    cout << vector<string>({"No\n", "Yes\n"})[cnt['S'] * cnt['N'] >= max(cnt['S'], cnt['N']) && cnt['E'] * cnt['W'] >= max(cnt['E'], cnt['W'])];
}

int main() {
    cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    
    while (read())
        solve();
    
    return 0;
}



Measured memory_bytes: 256
n, c, k = map(int, input().split())
arr = sorted([int(input()) for _ in range(n)])

ans = 0
cnt = 0
tmp_t = 0
for t in arr:
    if cnt == 0:
        tmp_t = t
    cnt += 1
    if t - tmp_t > k:
        ans += 1
        cnt = 1
        tmp_t = t
    elif cnt == c:
        ans += 1
        cnt = 0
if cnt:
    ans += 1

print(ans)


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

int main(){
	int n, ans = 0, x = 0;
	string s;
	cin >> n >> s;
	for(int i = 0; i < s.size(); i++){
		x += s[i] == 'I' ? 1 : -1;
		ans = max(ans, x);
	}
	cout << ans << endl;
}

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

using namespace std;
using ll = long long;

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

	ll sum = 0;
	ll min_a = 1e18;
	int cnt = 0;
	for (int i = 0; i < N; ++i) {
		sum += abs(a[i]);
		min_a = min(min_a, abs(a[i]));
		if (a[i] < 0) { ++cnt; }
	}

	ll res = sum - (cnt % 2 ? 2 * min_a : 0);
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 1024
#+swank (declaim (optimize (speed 0) (safety 3) (debug 3)))
#-swank (declaim (optimize (speed 3) (safety 0) (debug 0)))

(defconstant +mod+ 1000000007)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1
        (write obj :stream stream)
      (terpri stream))))


(defmethod fast-sort ((sequence list) &key (test #'<))
  (declare (inline sort)
           (inline sb-impl::stable-sort-list))
  (sort sequence (lambda (x y)
                   (funcall test x y))))


(defmethod fast-sort ((sequence array) &key (test #'<))
  (declare (inline sort))
  (sort sequence (lambda (x y)
                   (funcall test x y))))

(defmacro read-numbers-to-list (size)
  `(progn
     (when (not (integerp ,size))
       (error "Size must be integer."))
     (when (< ,size 0)
       (error "Size must be plus or zero."))
     (loop repeat ,size collect (read))))



(defmacro read-numbers-to-array (size)
  `(progn
     (when (not (integerp ,size))
       (error "Size must be integer."))
     (when (< ,size 0)
       (error "Size must be plus or zero."))
     (make-array ,size :initial-contents (read-numbers-to-list ,size))))

(defmacro read-numbers-to-board (row-size column-size)
  (let ((board (gensym))
        (r (gensym))
        (c (gensym)))
    `(let ((,board (make-array '(,row-size ,column-size))))
       (dotimes (,r ,row-size)
         (dotimes (,c ,column-size)
           (setf (aref ,board ,r ,c) (read))))
       ,board)))


(defun princ-for-each-line (list)
  (format t "~{~a~&~}" list))

(defun unwrap (list)
  (format nil "~{~a~^ ~}" list))



(defmacro with-buffered-stdout (&body body)
  (let ((out (gensym)))
    `(let ((,out (make-string-output-stream :element-type 'base-char)))
       (let ((*standard-output* ,out))
         ,@body)
       (write-string (get-output-stream-string ,out)))))




;;; Write code here


(defun main ()
  (let* ((n (read))
         (m (read))
         (cities-list nil)
         (cities-list-modified nil)
         (cities-count (make-array (1+ n) :initial-element 0)))
    (dotimes (i m)
      (let ((pref (read))
            (year (read)))
        (push (list i pref year nil) ; (id pref year order)
              cities-list)))
    (loop for city in (sort (copy-seq cities-list) #'< :key #'third) do
          (setf (fourth city)
                (incf (aref cities-count (second city))))
          (push city cities-list-modified))
    (loop for city in (sort (copy-seq cities-list-modified) #'< :key #'first) do
          (format t "~6,'0d~6,'0d~&"
                  (second city)
                  (fourth city)))))



(main)


Measured memory_bytes: 85136
A, B, C, X, Y = map(int, input().split())

ans = 0

if A + B > 2 * C:
    buy = min(X, Y)
    ans += buy * 2 * C
    X -= buy
    Y -= buy

if X > 0:
    if A > 2 * C:
        ans += X * 2 * C
    else:
        ans += X * A

if Y > 0:
    if B > 2 * C:
        ans += Y * 2 * C
    else:
        ans += Y * B

print(ans)


Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Read();
            var list = new List<string> { "hi", "hihi", "hihihi", "hihihihi", "hihihihihi" };
            if (list.Contains(s))
            {
                WriteLine("Yes");
            }
            else
            {
                WriteLine("No");
            }
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

typedef unsigned long long int ull;
typedef long double ldb;
typedef long long int ll;

#define for01(k,n)  for (ll i=k; i<n; i++)
#define for02(k,n)  for (ll j=k; j<n; j++)
#define for03(k,n)  for (ll k=k; k<n; k++)
#define for11(k,n)  for (ll i=k; i<=n; i++)
#define for12(k,n)  for (ll j=k; j<=n; j++)
#define for13(k,n)  for (ll k=k; k<=n; k++)

#define pb push_back
#define mp make_pair
#define pf push_front
#define popf pop_front
#define popb pop_back
#define vll vector<ll>
#define F first
#define S second
#define pp pair <ll, ll>
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define si size()
#define bk back()
#define deci(n)  fixed<<setprecision(n)
#define mll map<ll,ll>
#define mint map<int,int>
#define mll_it map<ll,ll>::iterator
#define mint_it map<int,int>::iterator

#define p0(a) cout << a << " "
#define p1(a) cout << a << "\n"

#define mem(a,n) memset(a, n, sizeof(a)); // n = 0 OR -1 only

#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define MOD 1000000007
#define MOD2 998244353


int main()
{
    //BOOST;
    ll n;
    cin >> n;
    string *a = new string[n];

    for01(0, n)
        cin >> a[i];

    string ans = "";
  	string t = a[0];
  	ll l = t.length();
  
  	for01(1, n)
    {
      if(l > a[i].length())
      {
        l = a[i].length();
        t = a[i];
      }
    }
  	//p1(t);
  	
    for01(0, l)
    {
        ll f = 0;
        for02(0, n)
        {
			
              	//p1(j);
               	auto found = a[j].find(t[i]);
            	if(found != std::string::npos)
            	{
              	  f++;
              	  //p1(i << " Found = " << found << " " << a[j][found]);
              	  a[j][found] = '0';
          	 	}
            
        }
        if(f == n)
            ans += t[i];
      //p1(f);
    }

    sort(ans.begin(), ans.end());
    p1(ans);

    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] d = new int[n];
        for(int i = 0; i < n; i++){
            d[i] = scan.nextInt();
        }
        Arrays.sort(d);
        System.out.println(d[n / 2] - d[n / 2 - 1]);
    }
}

Measured memory_bytes: 50788
#define _USE_MATH_DEFINES
#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;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int a, b;
    cin >> a >> b;

    if(a <= b) cout << a << endl;
    else cout << a - 1 << endl;

    return 0;
}

Measured memory_bytes: 256
N,M = map(int,input().split())
AC = [0] * N
WA = [0] * N
a = 0
b = 0
for i in range(M):
    s = list(input().split())
    c = int(s[0])
    if s[1] == "AC":
        AC[c - 1] = 1
    elif AC[c - 1] == 0:
        WA[c - 1] += 1
for i in range (N):
    if AC[i] == 1:
        a += 1
        b += WA[i]
print(a,b)

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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  char a, b;
  cin >> a >> b;

  if (a < b) {
    cout << "<"
         << "\n";
  } else if (a > b) {
    cout << ">"
         << "\n";
  } else {
    cout << "="
         << "\n";
  }
}

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

int main(){

    int n,m;cin>>n>>m;
    vector<vector<int>>s(m);
    rep(i,m){
        int k;cin>>k;
        s[i].resize(k);
        rep(j,k){
            cin>>s[i][j];
            --s[i][j];
        }
    }
    vector<int>p(m);
    rep(i,m)cin>>p[i];
    int ans=0;
    for(int i=0;i<(1<<n);i++){
        bool ok=true;
        rep(j,m){
            int count=0;
            for(int id:s[j]){
                if((i>>id)&1)count++;
            }
            if(count%2!=p[j])ok=false;
        }
        if(ok)ans++;
    }
    cout<<ans;
}

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

int main () {
    int N, A[10];
    cin >> N;
    for (int i =0; i <N; i++){
        cin >> A[i];
    }

    int cur_max = A[0];
    for (int i=0; i< N; i++){
        cur_max = max(cur_max, A[i]);
    }

    int money = 0;
    for (int i=0; i<N; i++){
        money += A[i]; 
    }

    cout << money - cur_max/2;
    return 0;
}

Measured memory_bytes: 256
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using Pair = pair<int64_t, int64_t>;
constexpr int64_t kInf = INT64_MAX / 2L;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int64_t N, M;
  cin >> N >> M;
  for (int64_t g = M / N; g >= 1; --g) {
    if (M % g == 0 && M / g >= N) {
      cout << g << endl;
      return 0;
    }
  }
  cout << 1 << endl;
  return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
using namespace std;
#define fi first
#define se second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;

const int maxn = 1e5+5;
int arr[maxn];
ll ans[maxn];
int n;

struct node
{
	ll sum;
	int mx;
};

node st[4*maxn];
int lz[4*maxn];

void pushdown(int p, int L, int R)
{
	if(lz[p] == -1) return;
	st[p].sum = 1LL*(R-L+1)*lz[p];
	st[p].mx = lz[p];
	if(L != R)
	{
		lz[2*p] = lz[2*p+1] = lz[p];
	}
	lz[p] = -1;
}

node pull(node &x, node &y)
{
	node res;
	res.sum = x.sum + y.sum;
	res.mx = max(x.mx, y.mx);
	return res;
}

void update(int i, int j, int dx, int p = 1, int L = 1, int R = n)
{
	pushdown(p, L, R);
	if(i> R || j< L) return;
	if(i<= L && R<= j)
	{
		lz[p] = dx;
		pushdown(p, L, R);
		return;
	}
	int M = (L+R)/2;
	update(i, j, dx, 2*p, L, M);
	update(i, j, dx, 2*p+1, M+1, R);
	st[p] = pull(st[2*p], st[2*p+1]);
}

node ask(int i, int j, int p = 1, int L = 1, int R = n)
{
	if(i> R || j< L)
	{
		node res;
		res.sum = 0;
		res.mx = -1e9;
		return res;
	}
	pushdown(p, L, R);
	if(i<= L && R<= j) return st[p];
	int M = (L+R)/2;
	node x = ask(i, j, 2*p, L, M);
	node y = ask(i, j, 2*p+1, M+1, R);
	node res = pull(x, y);
	return res;
}

int main()
{
	scanf("%d", &n);
	for(int i = 1; i<= n; i++) scanf("%d", arr+i);
	vector< ii > st;
	for(int i = 1; i<= n; i++)
	{
		if(st.empty() || st.back().fi< arr[i]) st.push_back(ii(arr[i], i));
	}
	sort(arr+1, arr+n+1);
	for(int i = 1; i<= n; i++) update(i, i, arr[i]);
	for(int i = (int) st.size()-1; i>= 0; i--)
	{
		int tar = i?st[i-1].fi:0;
		int lo = 1, hi = n;
		while(lo< hi)
		{
			int mid = (lo+hi)/2;
			node here = ask(1, mid);
			if(here.mx>= tar) hi = mid;
			else lo = mid+1;
		}
		node res = ask(lo, n);
		update(lo, n, tar);
		ans[st[i].se] = res.sum - 1LL*(n-lo+1)*tar;
	}
	for(int i = 1; i<= n; i++) printf("%lld\n", ans[i]);
}

Measured memory_bytes: 10484
#include <stdio.h>

int main(){
    
    int arr[3][3];
    int arr1[3][3] = {};
    int n;
    
    for(int i = 0 ; i < 3 ; i++){
    	for(int j = 0 ; j < 3 ; j++){
    		scanf("%d", &arr[i][j]);
		}
	}
    
    scanf("%d", &n);
    int b[n];
    for(int i = 0 ; i < n ; i++){
    	scanf("%d", &b[i]);
	}
	
	for(int i = 0 ; i < n ; i++){
		if(b[i] == arr[0][0]){
			arr1[0][0] += 1;
			continue;
		}
		if(b[i] == arr[0][1]){
			arr1[0][1] += 1;
			continue;
		}
		if(b[i] == arr[0][2]){
			arr1[0][2] += 1;
			continue;
		}
		if(b[i] == arr[1][0]){
			arr1[1][0] += 1;
			continue;
		}
		if(b[i] == arr[1][1]){
			arr1[1][1] += 1;
			continue;
		}
		if(b[i] == arr[1][2]){
			arr1[1][2] += 1;
			continue;
		}
		if(b[i] == arr[2][0]){
			arr1[2][0] += 1;
			continue;
		}
		if(b[i] == arr[2][1]){
			arr1[2][1] += 1;
			continue;
		}
		if(b[i] == arr[2][2]){
			arr1[2][2] += 1;
			continue;
		}
	}
    
    if(arr1[0][0] > 0 && arr1[0][1] > 0 && arr1[0][2] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[0][0] > 0 && arr1[1][1] > 0 && arr1[2][2] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[1][0] > 0 && arr1[1][1] > 0 && arr1[1][2] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[2][0] > 0 && arr1[2][1] > 0 && arr1[2][2] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[0][0] > 0 && arr1[1][0] > 0 && arr1[2][0] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[0][1] > 0 && arr1[1][1] > 0 && arr1[2][1] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[0][2] > 0 && arr1[1][2] > 0 && arr1[2][2] > 0){
    	printf("Yes\n");
    	return 0;
	}
	if(arr1[0][2] > 0 && arr1[1][1] > 0 && arr1[2][0] > 0){
    	printf("Yes\n");
    	return 0;
	}
	printf("No\n");
    
    return 0;
}

Measured memory_bytes: 1644
n,m = map(int,input().split())

r = [False]*n
q = [0]*n

res = 0

for _ in [0]*m:
    p,s = map(str,input().split())
    p = int(p)-1
    if s == 'AC':
        if not r[p]:
            r[p] = True
            res += q[p]
    else:
        q[p] += 1

print(sum(r),res)

Measured memory_bytes: 53080
/*************************************************************************
    > File Name: test.cpp
    > Author: Akira 
    > Mail: qaq.febr2.qaq@gmail.com 
 ************************************************************************/

#include<bits/stdc++.h>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
#define ALL(a) a.begin(), a.end()
using namespace std;

#define MaxN 100001
#define MaxM MaxN*10
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626
const int mod = 1E9+7;
const double eps = 1e-6;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x << endl;
template<typename T> T abs(T val){return val>0?val:-val;}
inline int max2(int a, int b) {return ((a > b)? a : b);}
inline int min2(int a, int b) {return ((a < b)? a : b);}
inline int max3(int a, int b, int c) {return max2(a, max2(b, c));}
inline int min3(int a, int b, int c) {return min2(a, min2(b, c));}
int N,K,A[MaxN];

int main()
{
    //std::ios::sync_with_stdio(false);
    while(~scanf("%d%d", &N, &K))
    {
        for(int i=1;i<=N;i++) scanf("%d", A+i);
        sort(A+1,A+1+N);
        if(A[N]<K ) puts("IMPOSSIBLE");
        else
        {
            bool flag = true;
            int dis = A[1];
            for(int i=2;i<=N;i++)
            {
                dis = __gcd(dis,A[i]);
            }
            if( K%dis!=0) puts("IMPOSSIBLE");
            else puts("POSSIBLE");
        }
    }
    //system("pause");
    //printf("%lld\n", ((x)%mod+mod)%mod );
}


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

int main()

{
    char arra[121];
    scanf("%s", arra);

    int len=0;

    for(int i=0; arra[i]; i++)
        len++;


    int a=0;

    for(int i=0, j=len -1; i<=j; i++, j--)
       {
       if(arra[i] != arra[j])
          { a++;}
       }
    printf("%d", a);

    return 0;
}

Measured memory_bytes: 256