akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>

typedef long long ll;

using namespace std;

int main() {
    int H, W; cin >> H >> W;
    vector<vector<char>> a(H, vector<char>(W));
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> a[i][j];
        }
    }

    vector<bool> dl(100, false);
    for (int i = 0; i < H; i++) {
        bool dl_f = true;
        for (int j = 0; j < W; j++) {
            dl_f &= a[i][j] == '.';
        }
        dl[i] = dl_f;
    }

    vector<int> dc(100, false);
    for (int j = 0; j < W; j++) {
        bool dc_f = true;
        for (int i = 0; i < H; i++) {
            dc_f &= a[i][j] == '.';
        }
        dc[j] = dc_f;
    }

    for (int i = 0; i < H; i++) {
        if (dl[i]) continue;
        for (int j = 0; j < W; j++) {
            if (dc[j]) continue;
            cout << a[i][j];
        }
        cout << endl;
    }

}


Measured memory_bytes: 256
let after = stdin.ReadLine() |> int

let before1 = 
  after
  |> float 
  |> fun x -> x / 1.08
  |> int
let before2 = before1 + 1
if int (float before1 * 1.08) = after then
  printfn "%d" before1
else if int (float before2 * 1.08) = after then
  printfn "%d" before2
else 
  printfn ":("

Measured memory_bytes: 29760
#include<iostream>

using namespace std;

/**
 * A - Transfer
 **/

int a, b, c;

void solve() {
    int res = 0;
    if (a-b >= c) {
        res = 0;
    } else {
        res = c - a + b;
    }
    cout << res << endl;
}

int main() {
    cin >> a >> b >> c;
    solve();
}

Measured memory_bytes: 256
#include <stdio.h>

  #define N 8
  #define OUT -1
  #define SAFE 1

  int a[N][N];

  int gyou[N],retsu[N],dp[2*N-1],deng[2*N-1];

  void initialize()
  {
    int i;

    for(i=0;i<N;i++) {gyou[i]=OUT;retsu[i]=OUT;}
    for(i=0;i<2*N-1;i++) {dp[i]=OUT;deng[i]=OUT;}
  }

  void print()
  {
    int   i,j;
    for(i=0;i<N;i++)
    {
      for(j=0;j<N;j++)
      {
        if(a[i][j])
        {
  	if(retsu[i]!=j) return;
        }
      }
    }

    for(i=0;i<N;i++)
    {
      for(j=0;j<N;j++)
      {
        if(retsu[i] == j) printf("Q");
        else printf(".");
      }
      printf("\n");
    }
  }

  void recursive(int i)
  {
    int j;

    if(i==N)
    {
      print();
      return;
    }

    for(j=0;j<N;j++)
    {
      if( SAFE==gyou[j] || SAFE==dp[i+j] || SAFE==deng[i-j+N-1]) continue;

      retsu[i] = j;gyou[j]=dp[i+j] = deng[i-j+N-1] = SAFE;
      recursive(i+1);
      retsu[i] = gyou[j] = dp[i+j] = deng[i-j+N-1] = OUT;
    }

  }



  int main()
  {
    int n,i,j,r,c;

    initialize();

    scanf("%d",&n);

    for(i=0;i<N;i++)
    {
      for(j=0;j<N;j++)
      {
        a[i][j] = 0;
      }
    }

    for(i=0;i<n;i++)
    {
      scanf("%d%d",&r,&c);
      a[r][c] = 1;
    }

    recursive(0);

     return 0;
  }



Measured memory_bytes: 2140
#include <iostream>
#include <string>
int main()
{
    std::string a, b;
    std::cin >> a >> b;

    int ab = std::stoi(a + b);

    // 100100
    bool ans = false;
    for (int i = 3; i < 1000; i++) {
        if ((i*i)==ab) {
            ans = true;
            break;
        }
    }

    std::cout << ((ans)?"Yes":"No") << std::endl;

    return 0;
}

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

using namespace std;

int d(long long n)
{
    int cnt = 0;
    for (; n; n /= 10, cnt++);
    return cnt;
}
int main()
{
    long long n;
    cin >> n;

    int ans = 1 << 30;
    for (int i = 1; i <= sqrt(n); i++) {
        if (n % i == 0) ans = min(ans, max(d(i), d(n / i)));
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll md = 1000000007;
typedef vector<vector<ll>> vvl;
typedef vector<ll> vl;
vl p, fac(2, 1), ifac(2, 1);

ll add(ll a, ll b, ll mod = md) {
    return (a%mod + b%mod + mod) % mod;
}

ll mul(ll a, ll b, ll mod = md) {
    return ( (a%mod) * (b%mod) ) % mod;
}

ll power(ll x, ll n, ll mod = md) {
    ll res = 1;
    x %= mod;
    while (n) {
        if (n & 1)  res = ((res%mod) * (x%mod))%mod;
        n = (n >> 1);
        x = ((x%mod) * (x%mod))%mod;
    }
    return res;
}

void cachefact(ll lim, ll mod = md) {
    for(int i = 2; i <= lim; i++) {
        ifac.push_back((ifac[mod%i] * (mod - mod/i) % mod)%mod);
    }
    for(ll i = 2; i <= lim; i++) {
        fac.push_back((fac[i-1] * i)%mod);
        ifac[i] = (ifac[i-1] * ifac[i])%mod;
    }
}

ll C(ll n, ll r, ll mod = md) {
    if(n < r) return 0;
    return mul(fac[n], mul(ifac[r], ifac[n-r], mod), mod);
}

void sieve(ll n) {
	vector<bool> prime(n+1, true);
    for(int i = 2; i*i <= n; i++) {
        if(prime[i]) {
            for(int j = i*i; j <= n; j += i) {
                prime[j] = false;
            }
        }
    }
    p.push_back(2);
    for(int i = 3; i <= n; i += 2) {
        if(prime[i]) {
            p.push_back(i);
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   	ll n, m;
   	cin >> n >> m;
   	vl dp(n+1, 0), a(m, 0);
   	for(int i = 0; i < m; i++) {
   		cin >> a[i];
   	}
   	int cur = 0;
   	sort(a.begin(), a.end());
   	dp[0] = 1;
   	for(int i = 1; i <= n; i++) {
   		if(cur < m && i == a[cur]) {
   			cur++;
   		} else {
   			dp[i] = (dp[i-1] + (i-2 >= 0 ? dp[i-2] : 0))%md;
   		}
   	}
   	cout << dp[n] << "\n";
    return 0;
}


Measured memory_bytes: 4788
#include <bits/stdc++.h>
#define div1 1000000007
const long long INF = 1LL << 60;
using namespace std;
using ll = long long;
using ld = long double;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

ll H, W, i, j, d[1010][1010], ans;
string A[1010];

// 移動4方向のベクトル
ll dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};

queue<pair<ll,ll>> que;

void bfs(){
    // スタート地点をキューに入れ、その点の距離を0にする
    //que.push(pair<ll,ll>(x,y));
    //d[y][x] = 0;

    // キューが空になるまでループ
    while(que.size()){
        // キューの先頭を取り出す
        pair<ll,ll> p = que.front();

        que.pop();

        // 取り出してきた状態がゴールなら探索をやめる
        // if(p.first==gx && p.second==gy) break;

        // 移動4方向をループ
        for(i=0; i<4; i++){
            // 移動した後の点を(nx,ny)とする
            ll nx=p.first+dx[i], ny=p.second+dy[i];

            // 移動が可能かの判定と、すでに訪れたことがあるかの判定
            if(0<=nx && nx<W && 0<=ny && ny<H && A[ny][nx]!='#' && d[ny][nx]==INF){
                // 移動できるならキューに入れ、その点の距離+1で確定する
                que.push(pair<ll,ll>(nx,ny));
                //d[ny][nx] = d[p.second][p.first] + 1;
                chmin(d[ny][nx], d[p.second][p.first]+1);
            }
        }
    }

    return;
}

int main(void)
{   
    cin >> H >> W;

    for(i=0; i<H; i++){
        cin >> A[i];
    }

    // 全ての点をINFで初期化
    for(i=0; i<H; i++){
        for(j=0; j<W; j++){
            d[i][j] = INF;
        }
    }

    for(i=0; i<H; i++){
        for(j=0; j<W; j++){
            if(A[i][j]=='#'){
                que.push(pair<ll,ll>(j,i));
                d[i][j] = 0;
            }
        }
    }

    bfs();

    ans = 0;
    for(i=0; i<H; i++){
        for(j=0; j<W; j++){
            chmax(ans, d[i][j]);
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 25524
def main():
    n = int(input())
    nums = list(map(int, input().split()))
    s = set(nums)
    if 0 in s:
        print(0)
        return
    ans = 1
    bound = 10 ** 18
    for num in nums:
        ans *= num
        if ans > bound:
            print(-1)
            return
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 21692
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
 
#define ff                  first
#define ss                  second
#define endl                "\n"
#define loop(i,s,e)         for(int i=s;i<e;i++)
#define int                 long long
#define vi                  vector<int> 
#define S(v)                sort(v.begin(),v.end())
#define RS(v)               sort(v.rbegin(),v.rend())
#define R(v)                reverse(v.begin(),v.end())
#define mxpq(T)             priority_queue <T>
#define mnpq(T)             priority_queue<T,vector<T>,greater<T>>
#define prv(v)              for(auto &x : v)cout << x << " ";
#define piirv(v)            for(auto &x : v)cout << x.ff << " " << x.ss << endl;
#define prvv(v)             for(auto &x : v)for(auto &y : x.ss)cout << y << " ";
#define mp                  make_pair
#define pii                 pair<int,int>
#define mset(a,f)           memset(a , f , sizeof(a))
#define pb                  push_back
#define inf                 INT_MAX
#define INF                 LLONG_MAX
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;

const int N = 2e6 + 6;
int A[500][500];
int n;

void solve()
{
	int n , k ,d;
	cin >> n >> k;

	map<int,int> m;

	loop(i,0,k)
	{
		cin >> d;
		loop(j,0,d)
		{
			cin >> A[i][j];
			m[A[i][j]] = i+1;
		}
	}

	int ans = 0;

	loop(i,1,n+1)
	{
		if(m.find(i) == m.end())ans++;
	}

	cout << ans;
}
 
int32_t main()
{
 
cout<<fixed<<setprecision(16);

ios_base:: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
 	

 	int t = 1;
 	// cin >> t;
 	while(t--)solve();
  
}

Measured memory_bytes: 3964
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define MAX_N 100005

ull B=5575777;
ull mem[MAX_N];

ull pow(int x){
  assert(0<=x && x<MAX_N);

  if(x==0)return 1;
  if(mem[x]>0)return mem[x];
  if(x&1)return mem[x]=pow(x-1)*B;
  mem[x]=pow(x/2);
  mem[x]*=mem[x];
  return mem[x];
}

int n,q,l,r,t;
char s[MAX_N];
ull p[MAX_N];

ull get(int l,int r){
  if(l==r)return 0;

  return p[r]-p[l]*pow(r-l);
}

ull get(int l,int r,int x,char ch){
  if(l==r)return 0;

  ull res=p[r]-p[l]*pow(r-l);
  if(l<=x&&x<r){
    int dist=r-x-1;
    res-=pow(dist)*s[x];
    res+=pow(dist)*ch;
  }
  return res;
}

bool eq(int a,int b,int l,int r){
  assert(b-a==r-l);
  assert(a!=l);
  return ( get(a,b) == get(l,r) );
}

bool eq(int a,int b,int l,int r, int x,char ch){
  assert(b-a==r-l);
  assert(a!=l);
  return ( get(a,b,x,ch) == get(l,r,x,ch) );
}

bool calc(int a,int b,int l,int r){
  assert(b-a==r-l);
  assert(a!=l);

  if(b-a!=r-l)return false;
  int L=0,R=b-a+1,M;
  while(R-L>1){
    M=(L+R)/2;
    if( eq(a,a+M,l,l+M) ){
      L=M;
    }else{
      R=M;
    }
  }
  if(L==b-a)return true;
  return ( eq(a,b,l,r, l+L, s[a+L])  );
  //return ( eq(a,b,l,r, l+L, s[a+L]) || eq(a,b,l,r, a+L, s[l+L] )  );
}

bool intersect(int a,int b,int l,int r){
  if( b<=l || r<=a ) return false;
  else return true;
}

bool solve(){
  int len=r-l;
  if(t==len)return true;
  if(t*2>=len){
    return ( calc(l,l+(len-t),r-(len-t),r)   ||  calc(r-(len-t),r,l,l+(len-t)) );
  }


  if(len%t==0){
    return ( calc(l,r-t,l+t,r) || calc(l+t,r,l,r-t) );
  }
  int as=len%t;

  //  calc(l+as,r-t,l+as+t,r);
  //  if ( calc(l+as,r-t ,l+as+t,r) && ( eq(l,l+as,r-t,r-t+as) || eq(l,l+as,r-t-t,r-t-t+as) ) )return true;
  //if ( eq(l+as,r-t ,l+as+t,r) && ( calc(l,l+as,r-t,r-t+as) || calc(l,l+as,r-t-t,r-t-t+as) ) )return true;
 
  //if ( calc(l,r-as-t ,l+t,r-as) && (eq(l,l+as,r-as,r) ||eq(l+t,l+t+as,r-as,r) ) )return true;
  //if ( eq(l,r-as-t ,l+t,r-as) && ( calc(l,l+as,r-as,r) || calc(l+t,l+t+as,r-as,r) ) )return true;


  if ( calc(l,r-as-t ,l+t,r-as) && eq(l,l+as,r-as,r)  )return true;
  if ( calc(l+t,r-as ,l,r-as-t) && eq(l+t,l+t+as,r-as,r)  )return true;
  if ( eq(l,r-as-t ,l+t,r-as) && calc(l,l+as,r-as,r)  )return true;

  return false;
}

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

  p[0]=0;
  for(int i=1;i<=n;i++){
    p[i]=p[i-1]*B+s[i-1];
  }

  scanf("%d",&q);
  while(q--){
    scanf("%d %d %d",&l,&r,&t);

    l--;

    if(solve())printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}
 

Measured memory_bytes: 2832
dic = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
n = int(input())
for i in range(n):
    si = input()
    dic[si] += 1

print('AC x', dic['AC'])
print('WA x', dic['WA'])
print('TLE x', dic['TLE'])
print('RE x', dic['RE'])

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

int max_time(int x){
    return ((x + 9) / 10) * 10;
}

int diff_time(int x){
    return max_time(x) - x;
}

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

    int sum_time = max_time(a) + max_time(b) + max_time(c) + max_time(d) + max_time(e);
    sum_time -= max({diff_time(a),diff_time(b),diff_time(c),diff_time(d),diff_time(e)});

    print(sum_time);

}

Measured memory_bytes: 256
/**
 * @brief  : c++ code for AtCoder
 * @author : rk222
 * @created: 2019.05.25 20:43:49
 */

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<int, P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i, x) for (int i = 0; i < x; i++)
#define rep1(i, x) for (int i = 1; i <= x; i++)
#define rrep(i, x) for (int i = x - 1; i >= 0; i--)
#define rrep1(i, x) for (int i = x; i > 0; i--)
#define sor(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define lb(vec, a) lower_bound(vec.begin(), vec.end(), a)
#define ub(vec, a) upper_bound(vec.begin(), vec.end(), a)
#define uniq(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end())
#define mp1(a, b, c) P1(a, P(b, c))

#define disp(x) cout << #x << ": " << x << endl
#define disp_vec(v)                                                                           \
    cout << #v << ":";                                                                        \
    rep(i, v.size()) cout << " " << v[i];                                                     \
    cout << endl

const int INF = 100000000;
const int M = 100000000;
const int dir_4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int dir_8[8][2] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};

/* ------------------------------------- */

int main() {
    int a, b;
    scanf("%d%d", &a, &b);
    if (a >= 13) {
        printf("%d\n", b);
    } else if (a >= 6) {
        printf("%d\n", b / 2);
    } else {
        printf("%d\n", 0);
    }

    /* --------------------------------- */
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication27
{
    class Program
    {
        static void Main()
        {
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.WriteLine("{0} {1}",a[0]*a[1],(a[0]+a[1])*2);
           
        }
    }
}

Measured memory_bytes: 9588
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
 
const int N=1e5+10;
 
int main(){

  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin>>n;
  vector<int> dp(n,(int)1e9);
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  dp[0]=0;
  dp[1]=abs(a[1]-a[0]);
  for(int i=2;i<n;i++)
    dp[i]=min({dp[i],dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2])});
  cout<<dp[n-1]<<endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

#define EPS (1e-10)

double len(double x1, double y1, double x2, double y2){
	return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}
double heron(double a, double b, double c){
	double z = (a+b+c) / 2.0;
	return sqrt(z*(z-a)*(z-b)*(z-c));
}

int main(){
	double x0, x1, x2, x3, y0 ,y1 ,y2, y3;
	double ab, bc, cd ,da, ca, db, abc, bcd, cda, dab, maxS;
	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x0, &y0, &x1, &y1, &x2, &y2, &x3, &y3)){
		ab = len(x0,y0,x1,y1);
		bc = len(x1,y1,x2,y2);
		cd = len(x2,y2,x3,y3);
		da = len(x3,y3,x0,y0);
		ca = len(x0,y0,x2,y2);
		db = len(x1,y1,x3,y3);
		abc = heron(ab, bc, ca);
		bcd = heron(bc, cd, db); 
		cda = heron(cd, da, ca);
		dab = heron(da, ab, db);
		maxS = max(max(abc, bcd), max(cda, dab));
		
		if(fabs(maxS*2.0 - (abc+bcd+cda+dab)) < EPS){
			cout << "NO" << endl;
		}else{
			cout << "YES" << endl; 
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
using namespace std;
typedef pair<int,int> pre;

int main(){
  int n,a,b;
  int max_x=0,max_y=0,min_x=1<<30,min_y=1<<30;
  pre ans[1000];
  while(cin >> n && n){
    max_x=0,max_y=0,min_x=1<<30,min_y=1<<30;
    ans[0].first = 0;
    ans[0].second = 0;
    for(int i=0;i<n-1;i++){
      cin >> a >> b;
      ans[i+1] = ans[a];
      if(b == 0)ans[i+1].first--;
      else if(b == 1)ans[i+1].second++;
      else if(b == 2)ans[i+1].first++;
      else if(b == 3)ans[i+1].second--;
      max_x = max(max_x,ans[i+1].first);
      min_x = min(min_x,ans[i+1].first);
      max_y = max(max_y,ans[i+1].second);
      min_y = min(min_y,ans[i+1].second);
    }
    cout << max_x-min_x+1 << " " << max_y-min_y+1 << endl;

  }
  return 0;
}

Measured memory_bytes: 0
using System;

namespace AOJ0062
{
    class Program
    {
        public void Proc()
        {
            while (true)
            {
                String input = Console.ReadLine();
                if (string.IsNullOrEmpty(input)) break;
                int[,] arr = new int[10, 10];

                for (int i = 0;i < 10; i++)
                {
                    arr[0, i] = int.Parse(input.Substring(i,1));
                }
                for (int i = 1; i < 10; i++)
                {
                    for (int j = 0; j < 10 - i; j++)
                    {
                        arr[i, j] = arr[i - 1, j] + arr[i - 1, j + 1];
                        if (arr[i, j] >= 10) arr[i, j] -= 10;
                    }
                }
                Console.WriteLine(arr[9, 0]);
            }
        }
        static void Main(string[] args)
        {
            Program prg = new Program();
            prg.Proc();
        }
    }
}

Measured memory_bytes: 9032
#include <bits/stdc++.h>
using namespace std;
 
long long gcd(long x,long y){
    if(y==0)return x;

    return gcd(y,x%y);
}
long long lcm(long x,long y){
    return x*y/gcd(x,y);
}

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}


int main()
{
    long long x,y,mx,my,ans=1000000000000;

    cin>>x>>y;
    mx=-x;
    my=-y;

    if(y-x>=0){
        ans=min(ans,y-x);
    }

    if(y-mx>=0){
        ans=min(ans,y-mx+1);
    }

    if(my-x>=0){
        ans=min(ans,my-x+1);
    }

    if(my-mx>=0){
        ans=min(ans,my-mx+2);
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
s = input()
c = [int(s[i]) for i in range(len(s))]
count = 0
for i in range(1,len(s)):
  if c[i-1] == c[i]:
    if c[i] == 0:
      c[i] = 1
    else:
      c[i] = 0
    count += 1
print(count)

Measured memory_bytes: 3956
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	char a[123];
	int e=0,b=0,c=0,d=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%s",a);
		if(a[0]=='A')
		b++;
		else if(a[0]=='W')
		c++;
		else if(a[0]=='T')
		d++;
		else 
		e++;
	}
	printf("AC x %d\n",b);
	printf("WA x %d\n",c);
	printf("TLE x %d\n",d);
	printf("RE x %d\n",e);
}

Measured memory_bytes: 3824
#include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cassert>
#include <stack>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

int main()
{
  int n;
  scanf("%d",&n);
  map<int,int> m;
  for(int i=0;i<n;i++)
  {
    int a;
    scanf("%d",&a);
    m[a]++;
  }
  int res=0;
  for(pair<int,int> p:m)
  {
    if(p.second<p.first)
      res+=p.second;
    else if(p.second>p.first)
      res+=p.second-p.first;
  }
  cout<<res<<endl;
  return 0;
}


Measured memory_bytes: 4736
#include<stdio.h>
#include<math.h>
int main(void) {
	int  M, N, a;
	 
	scanf("%d", &N);
	scanf("%d", &M);
	double b = sqrt(M*1.0);
	a = 0;
		for (int i = 1; i <=b*1; i++) {
			if (M % i == 0 && M / N >= i) {
				if (a < i) {
					a = i;
				}
				if (a < M/i&& M / N >= M/i) {
					a = M/i;
				}
			}
		}
		printf("%d", a);
 
}

Measured memory_bytes: 128
using System;
using System.Linq;

namespace ARegularTriang
{
    class Program
    {
        private string Read()
        {
            return Console.ReadLine();
        }
        private int[] ReadInt()
        {
            return Read().Split().Select(int.Parse).ToArray();
        }

        public void C()
        {
            var a = ReadInt();
 
            var str = "";

            str = a[0] == a[1] && a[1] == a[2] && a[2] == a[0] ? "Yes" : "No";

            Console.WriteLine(str);
        }

        static void Main(string[] args)
        {
            new Program().C();
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod = 1000000007;

ll r(ll x, ll y) {
  if (y == 0) return 1;
  else if (y % 2 == 0) return r(x, y/2) * r(x, y/2) % mod;
  else return x * r(x, (y-1)/2) % mod * r(x, (y-1)/2) % mod;
}

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int sum = a + b + c;
  if (sum >=22) cout << "bust" <<endl;
  else cout << "win" <<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <set>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main (void) {
    int N;
    cin >> N;
    set<string> S;
    rep(i, N) {
        string s;
        cin >> s;
        S.insert(s);
    }
    
    cout << S.size() << endl;
}


Measured memory_bytes: 19148
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 10;
char S[maxn], T[maxn];

int main() {
    int n, m;
    scanf("%d %d %s %s", &n, &m, S, T);
    ll gcd = __gcd(n, m), lcm = 1ll * n * m / gcd, d1 = m / gcd, d2 = n / gcd;
    int ok = 1;
    for(ll i = 0; i / d1 < n && i / d2 < m; i += d1 * d2) {
        if(S[i / d1] != T[i / d2]) ok = 0;
    }
    printf("%lld\n", ok ? lcm : -1);
    return 0;
}

Measured memory_bytes: 384
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
import java.lang.Math.*;
public class Main {
    static HashMap<String,Integer> mem = new HashMap<>();
    static ArrayList<Integer>[] vertice;
    static int[] visited;
    static int [] cost ;
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int n = in.nextInt();
        int m = in.nextInt();
        visited = new int[n+1];
        cost = new int[n+1];
        int mx = (int)1e9;
        int ans = 0;
        vertice = new ArrayList[n+1];
        for(int i =0;i<=n;i++){
            vertice[i] = new ArrayList<>();
        }
        for(int i=0;i<m;i++){
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            vertice[a].add(b);
            vertice[b].add(a);
            String t = Integer.toString(a)+"-"+Integer.toString(b);
            String t2 = Integer.toString(b)+"-"+Integer.toString(a);
            mem.put(t,c);
            mem.put(t2,c);
        }

        for(int i =1;i<n;i++){
            for(int k=0;k<=n;k++){
                visited[k]=0;
                cost[k] = mx;
            }
            visited[i]=1;
            cost[i]=0;
            for(int j=i+1;j<=n;j++){
                String t = Integer.toString(i)+"-"+Integer.toString(j);
                if(mem.containsKey(t)){
                    cost[j]=mem.get(t);
                }
            }
            dijkstra(i);
            for(int j=i+1;j<=n;j++){
                String t = Integer.toString(i)+"-"+Integer.toString(j);
                if(mem.containsKey(t)){
                    if( mem.get(t)!= cost[j]){
                        ans++;
                    }
                }
            }
        }
        System.out.println(+ans);
    }
    public static void dijkstra(int node){
        for(int v :vertice[node]){
            String t = Integer.toString(node)+"-"+Integer.toString(v);
            cost[v] = Math.min(cost[node]+mem.get(t),cost[v]);
        }
        int low =(int)(1e9);
        int idex=-1;
        for(int i=1;i<=cost.length-1;i++){
            if (visited[i]==0 && cost[i]<low){
                low=cost[i];
                idex = i;
            }
        }
        if(idex>0){
            visited[idex]=1;
            dijkstra(idex);
        }
    }
}


Measured memory_bytes: 46824
/*
                   _ooOoo_
                  o8888888o
                  88" . "88　AC!AC!
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rep3(var, min, max) for (ll (var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll (var) = (max) - 1; (var) + 1 > (min); --(var))
#define Mp(a,b) make_pair((a),(b))
#define F first
#define S second
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; }
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll MOD = 1e9 + 7;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<max(0,a-2*b)<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n'
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
const ll Mod = 1e9 + 7;
const ll Inf = 2242545357980376863LL;
const ll Log = 20;
const ll N = 1ll << Log;
const int Maxn = 1e5 + 10;
const int Base = 101;

ll ps1[Maxn], ps2[Maxn];

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	str s, t;
	cin >> s >> t;
	ll n = s.size();
	ll m = t.size();
	s = '!' + s;
	t = '!' + t;
	for(int i = 1; i <= n; i++) ps1[i] = ps1[i - 1] + (s[i] == 'A' ? 1 : -1);
	for(int i = 1; i <= m; i++) ps2[i] = ps2[i - 1] + (t[i] == 'A' ? 1 : -1);
	ll q;
	cin >> q;
	ll a, b, c, d, v;
	for(int i = 0; i < q; i++){
		cin >> a >> b >> c >> d;
		v = (ps1[b] - ps1[a - 1]) - (ps2[d] - ps2[c - 1]);
		cout << (v % 3 == 0 ? "YES" : "NO") << '\n';
	}
	return 0;
}


Measured memory_bytes: 2540
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    vector<int> h(n);
    for(int i=0; i<n; ++i)
        cin >> h[i];

    int left = 1;
    int right = 1000000000;
    while(left < right){
        int mid = (left + right) / 2;
        long long cnt = 0;
        for(int i=0; i<n; ++i){
            long long x = max(0LL, h[i] - b * (long long)mid);
            cnt += (x + (a - b) - 1) / (a - b);
        }
        if(cnt <= mid)
            right = mid;
        else
            left = mid + 1;
    }
    cout << left << endl;

    return 0;
}


Measured memory_bytes: 640
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
RC112 D
"""

n,m = map(int,input().split())

from collections import deque
from math import sqrt
def divisors(x):
    divs = deque()
    sq = int(sqrt(x))
    if sq**2 == x:
        divs.append(sq)
        sq=sq-1
    for i in range (sq,0,-1):
        if x%i==0:
            divs.appendleft(i)
            divs.append(x//i)
    return(divs)


cand = [i for i in divisors(m) if n*i<= m]
print(max(cand))




Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 100000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
const int SIZE = 1<<18;
struct segtree{
	ll maximum[SIZE*2],lazy[SIZE*2];
	void lazy_evaluate(int k){
		maximum[k]+=lazy[k];
		if(k<SIZE-1)// k isn't leaf of SegmentTree
		{
			lazy[2*k+1]+=lazy[k];
			lazy[2*k+2]+=lazy[k];
		}
		lazy[k]=0ll;
	}
	void update(int a,int b,int k,int l,int r,ll x){
		lazy_evaluate(k);
		if(r<=a||b<=l)return;
		if(a<=l&&r<=b){
			lazy[k]+=x;
			lazy_evaluate(k);
		}else{
			update(a,b,k*2+1,l,(l+r)/2,x);
			update(a,b,k*2+2,(l+r)/2,r,x);
			maximum[k] = max(maximum[k*2+1],maximum[k*2+2]);
			return;
		}
	}
	ll query(int a,int b,int k,int l,int r){
		lazy_evaluate(k);
		if(r<=a||b<=l)return -LLINF; // min,max henkouji chuui !!!!!!!
		if(a<=l&&r<=b){
			return maximum[k];
		}else{
			ll lch = query(a,b,k*2+1,l,(l+r)/2);
			ll rch = query(a,b,k*2+2,(l+r)/2,r);
			return max(lch,rch);
		}
	}
}seg;
#define MAX_N 200100
struct BIT{
	ll bit[MAX_N+1];
	void add(int i,ll x){
		i++;
		while(i<=MAX_N){
			bit[i]+=x;
			i+=i&-i;
		}
		return;
	}
	ll sum(int i){
		i++;
		ll res=0ll;
		while(i>0){
			res+=bit[i];
			i-=i&-i;
		}
		return res;
	}
	ll sum(int l,int r){// [l,r]
		if(l==0)return sum(r);
		else return sum(r)-sum(l-1);
	}
};
BIT cnt,rui;
int Q;
int type[200100],a[200100],b[200100];
vector<int> zip;
int main(){
	cin >> Q;
	for(int i=0;i<Q;i++){
		cin >> type[i];
		if(type[i]==1){
			cin >> a[i] >> b[i];
			zip.pb(a[i]);
		}
	}
	zip.pb(-INF);
	zip.pb(INF);
	sort(all(zip));
	zip.erase(unique(all(zip)),zip.end());
	for(int i=0;i<Q;i++){
		a[i] = lower_bound(all(zip),a[i])-zip.begin();
	}
	int N = zip.size();
	ll base = 0ll;
	for(int i=0;i<Q;i++){
		if(type[i]==1){
			base += b[i];
			seg.update(0,a[i],0,0,SIZE,-1ll);
			seg.update(a[i],SIZE,0,0,SIZE,1ll);
			cnt.add(a[i],1);
			rui.add(a[i],zip[a[i]]);
		}else{
			int l = 0,r = N-1;
			while(r-l>1){
				int mid = (l+r)/2;
				if(seg.query(0,mid+1,0,0,SIZE)<0ll)l=mid;
				else r=mid;
			}
			ll ans = zip[r]*cnt.sum(0,r-1)-rui.sum(0,r-1)+rui.sum(r+1,N)-zip[r]*cnt.sum(r+1,N);
			cout << zip[r] << ' ' << ans+base << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 15608
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k;
	bool flag;
	cin>>n>>k;
	int arr[10];
	for(int i=0;i<10;i++)
	{
		arr[i]=0;
	}
	for(int i=0;i<k;i++)
	{
		int q;
		cin>>q;
		arr[q]=1;
	}
	for(int i=n;i<1000000;i++)
	{   flag =true;
		string s = to_string(i);
		for(int j=0;j<s.size();j++){
			if(arr[s[j]-'0']==1)
				{flag=false;
					break;}
		}
		if(flag==true)
		{cout<<i<<endl;
	    break;}

	}
	

}

Measured memory_bytes: 256
h,w,k = map(int, input().split())
l = []
lh = []
lw = []
s = 0
r = 0
for i in range(h):
    il = input()
    l.append(il)
    s += il.count('#')
    lh.append(il.count('#'))
for i in range(w):
  j = 0
  for il in l:
    if il[i] == '#':
      j += 1
  lw.append(j)
    
t = s - k
if t == 0:
    r += 1
    
from itertools import combinations

for nh in range(1,h+1):
  for ih in combinations(range(h), nh):
    if sum([lh[x] for x in ih]) == t:
      r += 1
      
for nw in range(1,w+1):
  for iw in combinations(range(w), nw):
    if sum([lw[x] for x in iw]) == t:
      r += 1
      
for nh in range(1,h+1):
    for nw in range(1,w+1):
        for ih in combinations(range(h), nh):
            for iw in combinations(range(w),nw):
                ik = sum([lh[x] for x in ih]) + sum([lw[x] for x in iw])
                for jh in ih:
                    for jw in iw:
                        if l[jh][jw] == '#':
                            ik -= 1
                if ik == t:
                    r += 1
                    
print(r)

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

int main() {
  int A, B;
  int count = 0;
  int socket = 1;
  cin >> A >> B;
  while (socket < B) {
    --socket;
    socket += A;
    ++count;
  }
  cout << count;
  
  return 0;
 }

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main()
{
    int a[] = {61, 230, 865, 3247, 12185, 45719, 171531, 643550, 2414454, 9058467, 33985227, 127504505, 478366600, 794717734, 733354121, 261943303, 776803305, 580025381, 51688048, 44657419, 737209731, 604119499, 159693437, 858533109, 639056669, 549054109, 996291083, 531294469, 23314687, 783022045, 855462856, 649970414, 68697295, 409213624, 604356692, 88638656, 978442997, 534833116, 763737161, 785892908, 123883652, 639213333, 181836645, 998121103, 124885216, 501575626, 39816123, 113468411, 799008836, 775465589, 256852905, 664630886, 971550783, 751629411, 51018086, 702530485, 725438992, 696683714, 792638194, 221791721, 149602322, 414054379, 986519078, 981760191, 305799096, 515140586, 406959393, 975058685, 245601370, 324759692, 673385295, 191483611, 570246669, 427196161, 781042769, 569725155, 842176273, 25328739, 847501730, 206282374, 353770801, 323137024, 371653459, 940737264, 123820509, 915711339, 847205021, 252858375, 718889563, 866398347, 738390145, 133009077, 333099663, 170591295, 329869205, 616680192, 597534442, 388130742};
    int n;
    cin >> n;
    cout << a[n - 3] << endl;
}

Measured memory_bytes: 256
from collections import defaultdict
vertices, edges = map(int, input().split(" "))
connect = defaultdict(set)
for i in range(edges):
    a, b = map(int, input().split(" "))
    connect[a] |= {b}
    connect[b] |= {a}

answer = 0
queue = [[set(), 1]]
while queue:
    visited, now = queue.pop()
    visited |= {now}
    # print(visited, now, need_visit)
    if len(visited) == vertices:
        answer += 1
    else:
        for conn in connect[now]:
            if conn not in visited:
                queue.append([visited | {conn}, conn])
        # print(visited, now, need_visit)

print(answer)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int n;
  cin >> n;
  cout << ceil(n/2.0) << endl;
  return 0;
}

Measured memory_bytes: 3776
#include<iostream>

using namespace std;

int n,m;
int A[50050];
int c[25];
int main(){
  cin >> n >> m;
  for(int i = 1; i <= m; ++i){
    cin >> c[i];
  }
  
  for(int j = 1; j <= n; ++j){
    A[j] = n;
  }
  for(int i = 1; i <= m; ++i){
    for(int j = 1; j <= n; ++j){
      if(i <= 0 || j <= 0){
        A[j] = 0;
      }
      else if(j - c[i] < 0){
        A[j] = A[j];
      }
      if(j - c[i] >= 0){
        A[j] =  min(A[j] , A[j - c[i]] + 1);
      }
    }
  }
  cout << A[n] << endl;
}


Measured memory_bytes: 3304
#include<stdio.h>

int main(){
  int n, i, a[200007], boss;
  scanf("%d",&n);
  a[1] = 0;
  for(i=2;i<=n;i++){
    a[i] = 0;
    scanf("%d",&boss);
    a[boss]++;
  }
  for(i=1;i<=n;i++){
    printf("%d\n",a[i]);
  }
}

Measured memory_bytes: 2516
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int ans;
  for (int i = 0; i < N; i++) {
      int a, num;
      if (i==0) {
        num = 0;
        cin >> a;
        while (a%2==0) {
          a /= 2;
          num ++;
        }
        ans = num;
      } else {
        num = 0;
        cin >> a;
        while (a%2==0 && num<ans) {
          a /= 2;
          num ++;
        }
      ans = num;
      }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){

  int r,w,c,rp,a,result;

  while(1){

    scanf("%d %d %d %d",&r,&w,&c,&rp);
    if(r == 0 && w == 0 && c == 0 && rp == 0) break;

    if(w*c <= r){

      printf("0\n");
      continue;

    }

    a=w*c-r;

    result=a/rp;
    if(a%rp != 0) result++;

    printf("%d\n",result);

  }

  return 0;

}

Measured memory_bytes: 612
import math

A,B,H,M = map(int, input().split())
H_angle = H*30 + 0.5*M #1s atari
M_angle = M*6
angle = abs(H_angle-M_angle)
dis =math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(angle)))
print(dis)

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,W;
    cin>>n>>W;
    ll dp[W+1];
for(int i=0;i<=W;i++){
dp[i]=0;
}
for(int i=0;i<n;i++){
ll w,v;
cin>>w>>v;
for(int j=W;j>=w;j--){

dp[j]=max(dp[j-w]+v,dp[j]);
}

}

ll ans=0;
for(int i=0;i<=W;i++)
ans=max(ans,dp[i]);
cout<<ans;

    return 0;}


Measured memory_bytes: 4316
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;

constexpr ll MOD = 1e9 + 7;

int main()
{

    string s;

    cin >> s;

    ll dp[112345][4];

    dp[0][0] = 1;
    for (int i = 1; i <= 3; i++)
        dp[0][i] = 0;

    for (int i = 1; i <= s.size(); i++)
    {
        int m = s[i - 1] == '?' ? 3 : 1;

        (dp[i][0] = dp[i - 1][0] * m) %= MOD;

        for (int j = 1; j <= 3; j++)
        {
            (dp[i][j] = dp[i - 1][j] * m + dp[i - 1][j - 1] * (s[i - 1] == 'A' + (j - 1) || s[i - 1] == '?')) %= MOD;
        }
    }

    cout << dp[s.size()][3] << endl;

    return 0;
}

Measured memory_bytes: 3968
#include <stdio.h>
int main(void)
{
  int n;
  int a,b;
  int apoint,bpoint;
  int i;

  while(1)
    {
      apoint = 0;
      bpoint = 0;

      scanf("%d",&n);
      if(n == 0) break;
      
      for(i = 0 ; i < n ; i++)
	{
	  scanf("%d %d",&a,&b);
	  if(a > b) apoint += (a + b);
	  if(b > a) bpoint += (a + b);
	  if(a == b)
	    {
	      apoint += a;
	      bpoint += b;
	    }
	}
      printf("%d %d\n",apoint,bpoint);
    }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define Roc ios_base::sync_with_stdio(false), cin.tie(NULL)
#define ll long long
#define NMAX 1010
#define mod 1000000007
using namespace std;
int n, m, x, pd[NMAX][NMAX];
char c;
int main()
{
    Roc;
    cin >> n >> m;
    for(int i = 1; i <= n; ++i)
        for(int j = 1; j <= m; ++j)
            {
                cin >> c;
                if(c == '#')
                    pd[i][j] = -1;
            }
    pd[1][1] = 1;
    for(int i = 1; i <= n; ++i)
        for(int j = 1; j <= m; ++j)
            if(pd[i][j] != -1)
            {
                pd[i][j] += pd[i][j - 1] > -1 ? pd[i][j - 1] : 0;
                pd[i][j] += pd[i - 1][j] > -1 ? pd[i - 1][j] : 0;
                pd[i][j] %= mod;
            }
    cout << pd[n][m];
    return 0;
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
#include<iomanip>
#include <numeric>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007
#define KETA 40

using namespace std;

typedef long long  ll;
typedef pair<ll,ll> P1;
typedef pair<string,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<Pi,int> P2;
const ll INF=10000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};


int main() {

	long double a,b,c;
	cin>>a>>b>>c;

	long double eps=1.0E-14;
	if(sqrt(a)+sqrt(b)+eps<sqrt(c))cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;

}


Measured memory_bytes: 256
from math import factorial
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def MI(): return map(int, input().split())


def S(): return input()


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


def MS(): return map(str, input().split())


YN = {False: 'No', True: 'Yes'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']


# show_flg = False
show_flg = True


def main():
    N = I()
    A = LI()
    a = set()

    for i in range(N):
        a.add(A[i])

    if len(a) == N:
        print('YES')
    else:
        print('NO')



if __name__ == '__main__':
    main()


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

int main() {
  string S;
  cin >> S;
  if(S.size() % 2 == 1){
    cout << "No" << endl;
  }
  else{
    int answer = 0;
    for(int i = 0; i < S.size(); i++){
      if(i % 2 == 0 && S.at(i) == 'h'){
        answer++;
      }
      if(i % 2 == 1 && S.at(i) == 'i'){
        answer++;
      }
    }
    if(answer == S.size()){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
  }
}


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

int main (void) {
    int d,t,s;
    scanf("%d %d %d",&d,&t,&s);
    if((float)d/s <= (float)t)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

Measured memory_bytes: 1656
//config = {stdin: 'tmp', newline: '\r\n'}; // win
config = {stdin: '/dev/stdin', newline: '\n'}; // linux

line = require('fs').readFileSync(config.stdin, 'ascii').split(' ')
       .map(Number);
dx = line[2] - line[0], dy = line[3] - line[1];
console.log(Math.sqrt(dx * dx + dy * dy));

Measured memory_bytes: 15756
#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
typedef long long LL;
const int N=6e3,inf=1e9;
struct edge{
	int to,nxt,cap,cost;
}e[N*10];
int n,cnt=1,head[N],T,iter[N];
LL dist[N],ans;
bool vis[N];
queue<int>q;
inline void addedge(int u,int v,int cost,int cap){
	e[++cnt]=(edge){v,head[u],cap,cost},head[u]=cnt;
	e[++cnt]=(edge){u,head[v],0,-cost},head[v]=cnt;
}
int dfs(int u,int f){
	if(u==T||!f)return f;
	vis[u]=1;
	int ret=0;
	for(int&i=iter[u];i;i=e[i].nxt)
	if(e[i].cap&&!vis[e[i].to]&&dist[e[i].to]==dist[u]+e[i].cost){
		int d=dfs(e[i].to,min(f,e[i].cap));
		e[i].cap-=d,e[i^1].cap+=d,f-=d,ret+=d;
		if(!f)break;
	}
	vis[u]=0;
	return ret;
}
bool MCMF(){
	for(int i=1;i<=T;++i)dist[i]=-1e18;
	for(q.push(0);!q.empty();){
		int u=q.front();
		q.pop();
		vis[u]=0;
		for(int i=head[u];i;i=e[i].nxt)
		if(e[i].cap&&dist[e[i].to]<dist[u]+e[i].cost){
			dist[e[i].to]=dist[u]+e[i].cost;
			if(!vis[e[i].to])
			vis[e[i].to]=1,q.push(e[i].to);
		}
	}
	if(dist[T]<-1e17)return 0;
	memcpy(iter,head,sizeof(int)*(T+2));
	while(int f=dfs(0,inf))ans+=dist[T]*f;
	return 1;
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n;
	T=2*n+9;
	for(int i=1;i<=n;++i){
		int x,y,c;
		cin>>x>>y>>c;
		addedge(0,i,0,c);
		addedge(i,2*n+1,x+y,c);
		addedge(i,2*n+2,x-y,c);
		addedge(i,2*n+3,y-x,c);
		addedge(i,2*n+4,-x-y,c);
	}
	for(int i=n+1;i<=2*n;++i){
		int x,y,c;
		cin>>x>>y>>c;
		addedge(i,T,0,c);
		addedge(2*n+5,i,x+y,c);
		addedge(2*n+6,i,x-y,c);
		addedge(2*n+7,i,y-x,c);
		addedge(2*n+8,i,-x-y,c);
	}
	addedge(2*n+1,2*n+8,0,inf);
	addedge(2*n+2,2*n+7,0,inf);
	addedge(2*n+3,2*n+6,0,inf);
	addedge(2*n+4,2*n+5,0,inf);
	while(MCMF());
	cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// __uint128_t
const ll MOD = 1e9+7;



int main(){
    ll N, M; cin >> N >> M;
    vector<vector<ll>> V(M);
    vector<ll> P(M);
    for(int i = 0; i < M; i++){
        ll k; cin >> k;
        for(int j = 0; j < k; j++){
            ll s; cin >> s; s--;
            V[i].push_back(s);
        }
    } 
    for(int i = 0; i < M; i++) cin >> P[i];

    ll ans = 0;
    for(int i = 0; i < (1<<N); i++){
        bitset<10> B = i;
        ll SUM = 0;
        for(int j = 0; j < M; j++){
            ll cnt = 0;
            for(auto x : V[j]){
                if(B[x]) cnt++;
            }
            if(cnt%2==P[j]) SUM++;
        }
        if(SUM == M) ans++;
    }
    cout << ans << endl;
} 


Measured memory_bytes: 3620
<?php
while( fscanf( STDIN, "%d", $n ) ){
  $cnt=0;
  for($a=0;$a<10;$a++){
    if($a>$n) break;
    for($b=0;$b<10;$b++){
      $t=$a+$b;
      if($t>$n) break;
      for($c=0;$c<10;$c++){
        $u=$t+$c;
        if($u>$n) break;
        $d=$n-$u;
        if($d>9) continue;
        ++$cnt;
      }
    }
  }
  printf("%d\n",$cnt);
}

Measured memory_bytes: 15220
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

void solve(){
	int n;
	cin>>n;
	cout<<(-(n%1000)+1000)%1000<<endl;
}

int32_t main(){
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		solve();	
	}
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
using namespace std;

int n;
int a[100];

int main() {
    ios_base::sync_with_stdio(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
    	cin >> a[i];
	}
	
	sort(a, a + n);
	cout << a[n - 1] - a[0];
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] arg) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;
		for (char ch : str.toCharArray()) {
			if(ch =='o')count++;
		
			}
		System.out.println(700+100*count);
	}
}


Measured memory_bytes: 21712
import java.util.*;

public class Main {
    static boolean[] bits;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        int x=sc.nextInt();
        int ans=0;
        for(int i=0;i<=a;i++){
            for(int j=0;j<=b;j++){
                for(int k=0;k<=c;k++){
                    if(500*i+100*j+50*k==x)ans++;
                }
            }
        }
        System.out.println(ans);
    }
    
}


Measured memory_bytes: 21844