akhauriyash/Code-Regression huggingface dataset:
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
elif (a**2 * b) == x:
  answer = 0
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)

Measured memory_bytes: 3064
N, M = gets.split.map(&:to_i)
s = []
c = []
str = Hash.new
M.times do |i|
  s[i], c[i] = gets.split.map(&:to_i)
  if str[s[i]-1].nil?
    str[s[i]-1] = []
  end
  str[s[i]-1] << c[i]
end

# puts "#{str}"

ans = []
ans = ans.fill('0',0..N-1)
if N>=2
  ans[0] = '1'
end

str.each do |key, val|
  if key==0 and val.first==0 and N>=2
    puts -1
    exit
  end
  val.uniq!
  if val.size >= 2
    puts -1
    exit
  end
  ans[key] = val.first.to_s
end
puts "#{ans.inject(:+)}"

# str.each do |key, val|
#   if key==0 and val.first==0 and N>=2
#     puts -1
#     exit
#   else
#     val.uniq!
#     if val.size >= 2
#       puts -1
#       exit
#     else
#       ans[key] = val.first.to_s
#     end
#   end
# end
# puts "#{ans.inject(:+)}"

Measured memory_bytes: 1788
#include<iostream>
#include<cstdio>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
#define rep(i,ra,re) for((i)=ra;(i)<(re);(i)++)
#define _rep(i,ra,re) for((i)=ra;(i)>(re);(i)--)
#define rep_(i,ra,re) for((i)=ra;(i)<=(re);(i)++)
#define _rep_(i,ra,re) for((i)=ra;(i)>=(re);(i)--)
#define put(n) cout << n << " "; 
#define puts(n) cout << n << endl;
#define pu(n) cout << n;
#define mod 1000000007
int i,j,l;
static const int MAX_N=10;
int k[MAX_N];
bool s[MAX_N][MAX_N],p[MAX_N];

int main(void){
	int N,M;cin >> N >> M;
	rep(i,0,M){
		cin >> k[i];
		rep(j,0,k[i]){
			int t;cin >> t;t--;
			s[i][t]=true;
		}
	}
	rep(i,0,M)
		cin >> p[i];
	
	int ans=0;
	for(int i=0;i<(1<<N);i++){
		bool res=true;
		rep(l,0,M){
			int cur=0;
			for(int j=1,u=0;u<N;++u,j=(1<<u)){
				if(j&i){
					//uに全列挙
					cur+=s[l][u];
				}
			}
			
			if(cur%2!=p[l]){
				res=false;
				break;
			}
		}
		
		
		ans+=res;
	}
	
	puts(ans);
	
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i <= 999; ++i) {
    string v = to_string(i);
    while (v.size() != 3) v = "0" + v;
    int p1 = -1, p2 = -1, p3 = -1;
    for (int p = 0; p < n; ++p) {
      if (s[p] == v[0]) {
        p1 = p;
        break;
      }
    }
    if (p1 == -1) continue;
    for (int p = p1 + 1; p < n; ++p) {
      if (s[p] == v[1]) {
        p2 = p;
        break;
      }
    }
    if (p2 == -1) continue;
    for (int p = p2 + 1; p < n; ++p) {
      if (s[p] == v[2]) {
        p3 = p;
        break;
      }
    }
    if (p3 == -1) continue;
    ans++;
  }
  cout << ans << endl;
  return 0;
}

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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;
// 約数列挙
template <class T>
set<T> dividers(T n) {
    set<T> ret;
    for (T x = 1; x * x <= n; x++) {
        if (n % x == 0) {
            ret.insert(x);
            ret.insert(n / x);
        }
    }
    return ret;
}
int main() {
    lint N;
    cin >> N;
    lint ans = dividers(N - 1).size() - 1;
    for (auto div : dividers(N)) {
        if (div == 1) continue;
        lint n = N;
        while (n % div == 0) {
            n /= div;
        }
        if (n % div == 1) { ans++; }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

// B - Common Raccoon vs Monster
// https://atcoder.jp/contests/abc153/tasks/abc153_b
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int H = Integer.parseInt(scanner.next());
        int N = Integer.parseInt(scanner.next());
        int attackDamageSum = 0;
        for (int i = 0; i < N; i++) {
            attackDamageSum += Integer.parseInt(scanner.next());
        }
        scanner.close();

        System.out.println(H <= attackDamageSum ? "Yes" : "No");
    }
}


Measured memory_bytes: 44236
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define ll_MAX LONG_LONG_MAX
#define ll_MIN LONG_LONG_MIN
#define pi pair<int,int>
#define endl "\n"
#define MAXN 100005
#define mod ((ll)(1e9 + 7))
using namespace std;

int n;

void solve()
{
    cin>>n;
    if(n%1000==0) cout<<0<<endl;
    else
    {
    	int cnt=n/1000+1;
    	cout<<(cnt*1000-n)<<endl;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
}

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

const int kN = 300 + 5;
char s[kN][kN], t[kN][kN];

int main() {
    int h, w; scanf("%d%d", &h, &w);
    for (int i = 0; i < h; ++i) scanf("%s", s[i]);
    long long ans = 0;
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (s[i][j] == '.') continue;
            for (int d = 2; ; d += 2) {
                if (i + d >= h) break;
                if (s[i + d][j] == '.') continue;
                if (j + d / 2 < w) ans += s[i + d / 2][j + d / 2] == '#';
                if (j - d / 2 >= 0) ans += s[i + d / 2][j - d / 2] == '#';
            }
            for (int d = 2; ; d += 2) {
                if (j + d >= w) break;
                if (s[i][j + d] == '.') continue;
                if (i + d / 2 < h) ans += s[i + d / 2][j + d / 2] == '#';
                if (i - d / 2 >= 0) ans += s[i - d / 2][j + d / 2] == '#';
            }
        }
    }
    for (int rot = 0; rot < 4; ++rot) {
        vector<vector<int>> cd(h + w, vector<int>(h));
        vector<pair<int, int>> v;
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) {
                if (s[i][j] == '.') continue;
                cd[i + j][i]++;
            }
        }
        for (int i = 0; i < h + w; ++i) {
            for (int j = 1; j < h; ++j) cd[i][j] += cd[i][j - 1];
        }
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) {
                for (int d = 1; i + d < h && j + d < w; ++d) {
                    if (s[i + d][j] == '.' || s[i][j + d] == '.') continue;
                    int sum = i + j + 3 * d;
                    if (sum < h + w) {
                        int l = i + d, r = sum - j - d;
                        int add = cd[sum][min(h - 1, r - 1)] - cd[sum][l];
                        ans += add;
                    }
                }
            }
        }
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) t[w - 1 - j][i] = s[i][j];
        }
        swap(h, w);
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) s[i][j] = t[i][j];
        }
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 1204
#include <cmath>
#include<vector>
#define rep(i, n) for (int i=0;i<(n);i++)
#include <map> 
#include<algorithm>
#include <numeric>
#include<iostream>
#include<deque>
#include<queue>
#include<string>
#include <iomanip>
using namespace std;
typedef long long ll;

int main(void){
    int n, k;
    cin>>n>>k;
    string s;
    cin>>s;
    vector <int>nums;
    int now=1;//今見ている数
    int cnt=0;
    rep(i, n){
        if(s[i]==(char)('0'+now)) cnt++;
        else{
            nums.push_back(cnt);
            now=1-now;
            cnt=1;
        }
    }
    if(cnt!=0) nums.push_back(cnt);

    if(nums.size()%2==0) nums.push_back(0);
    

    int add=2*k+1;
    int ans=0;
    int left=0;
    int right=0;
    int tmp=0;

    for(int i=0;i<nums.size();i+=2){
        int nextleft=i;
        int nextright=min(i+add, (int)nums.size());

        while(nextleft>left){
            tmp-=nums[left];
            left++;
        }
        while(nextright>right){
            tmp+=nums[right];
            right++;
        }
        ans=max(ans, tmp);


    }
    cout<<ans<<endl;
}

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

int main()
{
    int n; cin>>n; 
    int arr[n];
    for(int i=0;i<n;i++)
     cin>>arr[i];
     int count=0;
  sort(arr+0,arr+n);
    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){
                if(arr[i]!=arr[j] && arr[j]!=arr[k]){
                    if(arr[i]+arr[j]>arr[k]) count++;
                }
            }
        }
    }
    cout<<count<<endl;

    return 0;
}


Measured memory_bytes: 3592
// B - FizzBuzz Sum
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(ll n){return n*(n+1)/2;}

int main(){
	ll N; cin>>N;
	cout<< sum(N) - sum(N/3)*3 - sum(N/5)*5 + sum(N/15)*15 <<endl;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

ll gcd(ll p,ll q){for(ll t;q;)t=p%q,p=q,q=t;return p;}

ll n,k,M,d;
ll a[100010];
int main(){
	scanf("%lld%lld",&n,&k);
	rep(i,0,n){
		scanf("%lld",a+i);
		M=max(M,a[i]);
		if(i==0)d=a[i];
		else d=gcd(d,a[i]);
	}
	puts(k<=M&&(M-k)%d==0?"POSSIBLE":"IMPOSSIBLE");
}

Measured memory_bytes: 896
#include<stdio.h>
#include<stdlib.h>
  
struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL
  
Node root;
  
void insert(int k){  
  Node a = root;
  Node b = NIL;
  Node c;
  
  c = malloc(sizeof(struct node));
  c->key = k;
  c->left = NIL;
  c->right = NIL;
  
  while(a != NIL){
    b = a;
    if(c->key < a->key){
      a = a->left;
    }
    else a = a->right;
  }
  
  c->parent = b;
  if(b == NIL) {
    root = c;  
  }
  else if(c->key < b->key){
    b->left = c;
  }
  else b->right = c;
}
  
  
void inorder(Node n){
  if(n->left != NIL){
    inorder(n->left);
  }
  printf(" %d",n->key);
  if(n->right != NIL){
    inorder(n->right);
  }
  
}
void preorder(Node n){
  printf(" %d",n->key);
  if(n->left!= NIL){
    preorder(n->left);
  }
  if(n->right!= NIL){
    preorder(n->right);
  }
    
}
  
int main(){
  int n,i,x;
  char com[20];
  scanf("%d", &n);
    
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}

Measured memory_bytes: 24040
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int main(void){
    int a,b;cin>>a>>b;
    if(b%a==0)cout<<a+b<<endl;
    else cout<<b-a<<endl;
}


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

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

int main()
{
  int p[3], j[2];

  cin >> p[0] >> p[1] >> p[2] >> j[0] >> j[1];
  cout << min(p[0], min(p[1], p[2])) + min(j[0], j[1]) - 50 << endl;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
char PS(char x){
return x+0X20;
}
int main() {
  int N;
  int K;
  string A;
  cin >>N>>K>>A;
  A.at(K-1)=PS(A.at(K-1));
  cout << A<< endl;
}
  
  

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<cstdlib>

int main()
{
    int N;
  	int	num=0;
    int i=0;
    double x,y,z=0;
    double Distance,D=0;

    std::cin >> N >> D;
    double X[N],Y[N]={0};

    for(i=0; i<N; i++)
    {
        std::cin >> X[i] >> Y[i];
        x=X[i]*X[i];
        y=Y[i]*Y[i];
        z=x+y;
        Distance = std::sqrt(z);
        if( Distance <= D)
        {
            num++;
        }
        std::cout << std::endl;
    }
  
    std::cout << num;

    return 0;
}

Measured memory_bytes: 6932
//include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
   int n,m;
   while(cin >> n >> m && n|m){
      vi a(n);
      rep(i,a.size()) a[i]=i+1;
      int oimo=0;
      while(a.size()>1){
         oimo+=m-1;
         if(oimo>=a.size()) oimo%=a.size(); 
         a.erase(a.begin()+oimo);
      }
      cout << a[0] << endl;
   }
}

Measured memory_bytes: 1212
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U> inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U> inline void cmin(T& a, U b) { if (a > b) a = b; }
constexpr char el = '\n';
template<class T, class U> ostream &operator<<(ostream &os, const pair<T, U>& p) { os << p.first << " " << p.second; return os; }
template<class T, class U> istream &operator>>(istream &is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<class T> ostream &operator<<(ostream &os, const vector< T > &v) { rep(i, v.size()) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }
template<class T> istream &operator>>(istream &is, vector< T > &v) { for(T &in : v) is >> in; return is; }
struct IoSetup {
  IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); }
} io_setup;
#line 3 "../../library/debug.hpp"

// https://codeforces.com/blog/entry/68809
void debug_print(int x) {cerr << x;}
void debug_print(long x) {cerr << x;}
void debug_print(long long x) {cerr << x;}
void debug_print(unsigned x) {cerr << x;}
void debug_print(unsigned long x) {cerr << x;}
void debug_print(unsigned long long x) {cerr << x;}
void debug_print(float x) {cerr << x;}
void debug_print(double x) {cerr << x;}
void debug_print(long double x) {cerr << x;}
void debug_print(char x) {cerr << '\'' << x << '\'';}
void debug_print(const char *x) {cerr << '\"' << x << '\"';}
void debug_print(const string &x) {cerr << '\"' << x << '\"';}
void debug_print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V> void debug_print(const pair<T, V> &x) {cerr << '{'; debug_print(x.first); cerr << ','; debug_print(x.second); cerr << '}';}
template<typename T> void debug_print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), debug_print(i); cerr << "}";}

void debug_print_() {cerr << "]\n";}
template <typename T, typename... V>
void debug_print_(T t, V... v) {debug_print(t); if (sizeof...(v)) cerr << ", "; debug_print_(v...);}

#ifdef LOCAL
#define debug(x...) cerr << "[" << #x << "] = ["; debug_print_(x)
#else
#define debug(x...)
#endif
#line 3 "e.cpp"

int main() {
  ll n;
  cin >> n;
  vl a(n);
  cin >> a;

  vl b(n);
  rep(i, n) {
    b[i] = a[i]-i;
  }

  map<ll, ll> cnt;
  rep(i, n) {
    cnt[b[i]]++;
  }

  debug(b);

  ll ans = 0;
  rep(i, n) {
    ans += cnt[-a[i]-i];
  }

  cout << ans << el;
}


Measured memory_bytes: 28884
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A , B , C ;
    cin >> A >> B >> C;
    
    if ( ( A + B + C ) == 17 && ( A == B || A == C || B == C ) && ( A == 5 || B == 5 || C == 5 ) && ( A > 0 && B > 0 && C > 0 ) && ( A != 6 && B != 6 && C != 6 )){
        
        cout << "YES" << endl;
        
     
    } 
    if ( ( A + B + C ) != 17 ){
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define pi pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912

const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int GCD(int x,int y){
    return y ? GCD(y,x%y) : x;
}
int r,d,x[11],tmp;
int main(){
    cin >> r >> d >> x[0];
    for(int i = 1; i <= 10; i++){
        x[i] = r*x[i-1] - d;
    } 
    for(int i = 1; i <= 10; i++){
        cout << x[i] << endl;
    }
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lli long long
const lli INF = (lli)(1e15);
lli dp[401][401];
lli a[401];
lli sum[401];

lli solve(int i, int j) {
    if(i>=j) return dp[i][j] = 0;
    
    if(dp[i][j]!=INF) return dp[i][j];
    
    lli mn = INF;
    
    for(int k=i;k<=j-1;k++){
        mn = min(mn, solve(i,k) + solve(k+1,j));
    }
    
    if(i==0) mn += sum[j];
    else mn += (sum[j]-sum[i-1]);
    
    return dp[i][j] = mn;
}

int main() 
{
    int n;
    cin >> n;
    
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n;j++){
            dp[i][j]=INF;
        }
    }
    
    for(int i=0;i<n;i++) {
        cin >> a[i];
        if(i>=1){
            sum[i] = sum[i-1]+a[i];       
        }
        else{
            sum[i] = a[i];
        }
    }
    
    lli ans = solve(0,n-1);
    
    cout << ans << endl;
	return 0;
}

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

int main(){
  string s,t;
  bool chk = false;
  
  cin >> s >> t;
  
  if(s == t) chk = true;
  
  for(int i = 0; i < s.size(); i++){
    s = s.substr(s.size()-1,1) + s.substr(0,s.size()-1);
    
    if(s == t){
      chk = true;
      break;
    }
  }
  
  if(chk == true) cout << "Yes";
  else cout << "No";
}

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

int main() {
  string s, t;
  cin >> s >> t;
  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  reverse(t.begin(),t.end());
  if(s<t){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
    
}

Measured memory_bytes: 256
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        self.rnk = [0] * (n + 1)
        
    def Find_root(self, x):
        if (self.root[x] < 0):
            return x
        else:
            self.root[x] = self.Find_root(self.root[x])
            return self.root[x]
    
    def Unite(self, x, y):
        x = self.Find_root(x)
        y = self.Find_root(y)
        if (x == y):
            return
        elif (self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if (self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    
    def isSameGroup(self, x, y):
        return self.Find_root(x) == self.Find_root(y)
    
    def Count(self, x):
        return - self.root[self.Find_root(x)]

import collections    
    
n, k, l = map(int, input().split())
union = UnionFind(n)
union1 = UnionFind(n)

for _ in range(k):
    p, q = map(int, input().split())
    union.Unite(p, q)
for _ in range(l):
    p, q = map(int, input().split())
    union1.Unite(p, q)

parents = [(union.Find_root(i), union1.Find_root(i)) for i in range(1, n + 1)]
lc = collections.Counter(parents)
ans = []
for i in range(n):
    ans.append(lc[parents[i]])
print(*ans)

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

#define f first
#define s second
#define ins insert
#define eb emplace_back
#define endl '\n'
#define ll long long
#define ld long double
#define vl vector<ll>
#define tc ll t; cin >> t; while (t--)
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define sz(c) (ll) c.size()
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define trav(x,c) for(auto &x : c)
#define _for(i,a,n) for(ll i = a ; i < n ; ++i)
#define _rfor(i,a,n) for(ll i = n-1 ; i >= a ; --i)
#define dx(x) cout << #x << ": " << x << endl;
#define dc(c) trav(x,c) cout << x << " "; cout << endl;
#define dm(m) trav(x,m) cout << x.f << "->" << x.s << endl;
#define godspeed cin.tie(0) -> sync_with_stdio(0);

const int INFI = 2e9 + 5;
const ll INFLL = 1e18 + 5;
const ll N = 2e5 + 5;
const ll MOD = 1e9 + 7;
const ld PIE = acos(-1.0);

int main() {
    godspeed;

 	ll n, m, x; cin >> n >> m;
 	while(m--) {
 		cin >> x;
 		n -= x;
 	}

 	if(n >= 0) cout << n;
 	else cout << -1;
}

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

int main(){
    int n; cin >> n;
    vector<vector<ll>> A(n,vector<ll>(n));
    rep(i,n) rep(j,n) cin >> A[i][j];
    ll plusif[n][n]; //足すなら1、足さないなら0
    rep(i,n) rep(j,n) plusif[i][j] = 1; //初期値は1、不適なものに0を代入していく
    bool judge = true;
    //warshal_froid
    rep(k,n){
        rep(i,n){
            rep(j,n){
                if(A[k][i] > A[k][j] + A[j][i]){ //適した構造が存在しない場合
                    judge = false;
                }else if(A[k][i] == A[k][j] + A[j][i] && k != j && j != i){ //同じ長さの経路があった場合、足してはならない
                    plusif[k][i] = 0;
                }
            }
        }
    }
    ll ans = 0;
    rep(i,n-1){
        for(int j = i + 1; j < n; j++){
            if(plusif[i][j]) ans += A[i][j];
        }
    }
    if(judge){
        cout << ans << endl;
    }else cout << -1 << endl;
}

Measured memory_bytes: 1664
import java.util.Scanner;
public class Main{
private static Scanner scanner;
public static void main(String args[]) {
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	int count = 0;
	//int flag = 1;
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();
	}
	for(int i = 0;i < a;i++) {
			for(int j = a-1;j >= 1;j--) {
				if(b[j] < b[j-1]) {
					int tmp = b[j];
					b[j] = b[j-1];
					b[j-1] = tmp;
					count++;
			}
		}
	}
	for(int i = 0;i < a;i++) {
		System.out.print(b[i]);
		if(i == a - 1) {
			System.out.println("");
		}else {
			System.out.print(" ");
		}
	}
	System.out.println(count);
}
}



Measured memory_bytes: 26324
#include <bits/stdc++.h>
#define DIM 100007
#define INF 1000000007
using namespace std;

char c;
int a[4];
int main()
{
    for(int i=1;i<=3;++i)
    {cin>>c;
    a[c-'a']++;}
    if(a[0]==1 && a[1]==1 && a[2]==1) cout<<"Yes";
    else cout<<"No";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    int N;
    string S;
    cin >> N >> S;
    string s1, s2;
    int ans = 0;
    rep(1, i, N - 1)
    {
        bitset<26> bit1(0), bit2(0), bit3(0);
        s1 = S.substr(0, i);
        s2 = S.substr(i, N);
        for (auto a : s1)
        {
            bit1.set((int)(a) - 'a');
        }
        for (auto b : s2)
        {
            bit2.set((int)(b) - 'a');
        }
        bit3 = bit1 & bit2;
        int x = bit3.count();
        ans = max(ans, x);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
n, ww = gets.to_s.split.map{|i|i.to_i}

h = Hash.new(0)
h[0] = 0

n.times{
	a, b = gets.to_s.split.map{|i|i.to_i}
	h.to_a.each{ | w, v |
		  h[ w + a ] = v + b if w + a <= ww && h[ w + a ] < v + b
	}
}

puts h.values.max

Measured memory_bytes: 2428
using System;

namespace atcorder
{
    class Program
    {
        static void Main()
        {
            string[] homework = Console.ReadLine().Split(' ');
            var M = int.Parse(homework[0]);
            var N = int.Parse(homework[1]);

            string[] days = Console.ReadLine().Split(' ');
            if(days.Length != N) 
            {
                Console.WriteLine(-1);
                Environment.Exit(0);
            }
            int X = 0;

            foreach (string stDays in days)
            {
                var intDays = int.Parse(stDays);
                X += intDays;
            }

            if(X > M)
            {
                Console.WriteLine(-1);
            }
            else
            {
                Console.WriteLine(M - X);
            }
        }
    }
}


Measured memory_bytes: 28468
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)

int dxy[] = {0, 1, 0, -1, 0};

void solve();
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 123450
#endif

int A,B,C,D;

void solve() {
    cin>>A>>B>>C>>D;
    while(true) {
        C -= B;
        if (C<=0) {
            cout << "Yes" << endl;
            return;
        }
        A -= D;
        if (A<=0) {
            cout << "No" << endl;
            return;
        }
    }
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
int main(void){
   int N,K,h,cnt=0;
   cin>>N>>K;
   rep(i,N){
       cin>>h;
       if(h>=K){
           cnt++;
       }
   }
   cout<<cnt<<endl;

}


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

using namespace std;

int main() {
  int h, w;
  int sx, sy;
  int gx, gy;
  cin >> h >> w;
  cin >> sx >> sy;
  cin >> gx >> gy;
  sx--;
  sy--;
  gx--;
  gy--;
  string s[1000];
  for (int i = 0; i < h; i++) {
    cin >> s[i];
  }
  auto inside = [&](int i, int j) {
    return i >= 0 && i < h && j >= 0 && j < w && s[i][j] == '.';
  };

  vector<vector<int>> dist(h, vector<int>(w, 1e9));
  deque<pair<int, int>> que;

  dist[sx][sy] = 0;
  que.emplace_back(sx, sy);

  while (que.size()) {
    auto [i, j] = que.front();
    que.pop_front();
    for (int x = i - 2; x <= i + 2; x++) {
      for (int y = j - 2; y <= j + 2; y++) {
        if (inside(x, y)) {
          int warp = (abs(x - i) + abs(y - j) != 1);
          int d = dist[i][j] + warp;
          if (d < dist[x][y]) {
            dist[x][y] = d;

            if (warp) {
              que.emplace_back(x, y);
            } else {
              que.emplace_front(x, y);
            }
          }
        }
      }
    }
  }
  int ans = dist[gx][gy];
  if (ans == 1e9) ans = -1;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 9400
#include <iostream>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <deque>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <climits>
#include <numeric>
#include <bitset>
#include <random>
#include <tuple>
#include <initializer_list>
#include <fstream>
#include <cctype>
#include <string>
#include <cfloat>
#include <array>


int main() {
	int s, w; std::cin >> s >> w;
	if (w >= s) {
		std::cout << "unsafe\n";
	}
	else {
		std::cout << "safe\n";
	}
}

Measured memory_bytes: 3624
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>

#define PENALTY 1200
#define SIZE 15
#define MAXT 55

using namespace std ;

struct Data
{
	int Tid ;
	int Pid ;
	int Time ;
	char mess[20] ;
} ;

struct Team
{
	int idx ;
	int score ;
	int penalty ;
	int wrong[SIZE] ;
	Team ( )
	{
		score = penalty = 0 ;
		memset ( wrong , 0 , SIZE * sizeof ( int ) ) ;
	}
	bool operator < ( const struct Team &a ) const
	{
		return ( score > a.score ) || ( ( score == a.score && ( penalty < a.penalty || ( penalty == a.penalty && idx < a.idx ) ) ) ) ;
	}
} ;

struct Data *input ;
struct Team *arr ;

char const wr[] = "WRONG" ;
char const co[] = "CORRECT" ;

int tc ;
int pc ;
int rc ;

void init ( ) ;
void dispose ( ) ;

int main ( )
{
	while ( scanf ( "%d %d %d" , &tc , &pc , &rc ) == 3 && ( tc || pc || rc ) ) {
		init ( ) ;
		while ( rc-- ) {
			scanf ( "%d %d %d %s" , &( input -> Tid ) , &( input -> Pid ) , &( input -> Time ) , input -> mess ) ;
			if ( strcmp ( input -> mess , wr ) == 0 ) {
				arr[input -> Tid].wrong[input -> Pid]++ ;
			}
			else {
				arr[input -> Tid].score++ ;
				arr[input -> Tid].penalty += ( input -> Time + arr[input -> Tid].wrong[input -> Pid] * PENALTY ) ;
			}
		}
		sort ( arr + 1 , arr + tc + 1 ) ;
		for ( int i = 1 ; i <= tc ; i++ ) {
			printf ( "%d %d %d\n" , arr[i].idx , arr[i].score , arr[i].penalty ) ;
		}
		dispose ( ) ;
	}
	return 0 ;
}

void init ( )
{
	input = new struct Data ;
	arr = new struct Team [MAXT] ;
	for ( int i = 0 ; i < MAXT ; i++ ) {
		arr[i].idx = i ;
	}
}

void dispose ( )
{
	delete input ;
	delete [] arr ;
}

Measured memory_bytes: 1048
import Control.Monad

main :: IO ()
main = do
    [n, a, b] <- getInts
    putStrLn $ show (min a b) ++ " " ++ show (max 0 (a + b - n))

getLines :: Int -> IO [String]
getLines n = replicateM n getLine

getLinesInt :: Int -> IO [Int]
getLinesInt n = fmap read <$> getLines n

getInts :: IO [Int]
getInts = map (read :: String -> Int) . words <$> getLine

Measured memory_bytes: 508
import java.io.*
import java.util.*

var pw = PrintWriter(System.out)
fun solve(s: String){
    pw.println(s.count{ it == '1' })
    pw.flush()
    return
}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    solve(sc.next())
}



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

int main()
{
	long long n;
	cin>>n;
	long long  a[10000],m=n,j=1;
	
	memset(a,0,sizeof(a));
	   
	for(int i=2;i<=sqrt(n);i++)
	{
	   	if(m%i==0)
	   	{
	   	    while(m%i==0)
	   	    {
	   	      m/=i;
	   	      a[j]++;
			}
			j++;
	   	}
	}
	
	if(m>1)
	  a[j]=1;
	int s=0,sum=0,ans=0;
	for(int i=1;i<=j;i++)
	{
	   if (a[i]==1 )
		{
			ans++;
		}
		else
		{
			s=1;
			while((s+1)*s/2<=a[i])
			  s++;			
			ans+=s-1;
		}
	}
	
	cout<<ans;
	 
	return 0;
	    
}

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

ll binsum(ll a) {
  if (a % 4 == 0)
    return a;
  else if (a % 4 == 1)
    return 1;
  else if (a % 4 == 2)
    return a + 1;
  else
    return 0;
}

int main() {
  ll a, b;
  cin >> a >> b;
  ll ans = binsum(a - 1) ^ binsum(b);

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


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <utility>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

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

    string s1; cin >> s1;
    int n; cin >> n;
    string s2;

    REP(i, n) {
        int t; cin >> t;
        if (t == 1) swap(s1, s2);
        else {
            int f; cin >> f;
            char c; cin >> c;
            if (f == 1) s2 += c;
            else s1 += c;
        }
    }

    reverse(s2.begin(), s2.end());
    cout << s2 << s1 << endl;
    return 0;
}


Measured memory_bytes: 980
#include <string>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <limits>
#include <tuple>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()

int main()
{
	int N;
	cin >> N;
	int ans = 0;
	rep(i, N) {
		ll a;
		cin >> a;
		for (int x = a; !(x & 1); x /= 2)
			ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;

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

int main() {
  int n, q;
  cin >> n >> q;

  queue<pair<string, int>> qp;
  rep(i, n) {
    string s;
    int t;
    cin >> s >> t;

    auto p = make_pair(s, t);
    qp.push(p);
  }
  
  int total = 0;
  while (!qp.empty()) {
    auto p = qp.front();
    qp.pop();

    if (p.second > q) {
      total += q;
      p.second -=q;
      qp.push(p);
    } else {
      total += p.second;
      printf("%s %d\n", p.first.c_str(), total);
    }
  }
}



Measured memory_bytes: 6456
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin>>a>>b;
    double c;
    for(c=1.0;c<=100*a;c++){
    	if(int(c*8/100)==a&&int(c/10)==b){
    		cout << c<<endl;
    		return 0;
    	}
    }
    cout << -1<<endl;
    return 0;
}


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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

ll modpow(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    (a *= a) %= MOD;
    n >>= 1;
  }
  return res;
}

const ll maxf = 10000000;
ll fact[maxf+5];
ll ifact[maxf+5];

void fact_init(){
  fact[0] = 1;
  for(ll i=1; i<=maxf; i++) fact[i] = (fact[i-1] * i) % MOD;
  ifact[maxf]=modpow(fact[maxf],MOD-2);
  for(ll i=maxf; i>=1; i--) ifact[i-1] = (ifact[i] * i) % MOD;
}

ll comb(ll n, ll r){
  if(n<r || n<0 || r<0) return 0;
  if(fact[0] == 0) fact_init();
  return ((fact[n] * ifact[n-r]) % MOD * ifact[r]) % MOD;
}

ll naive_comb(ll n, ll r){
  ll res = 1;
  for (ll i = n; i > n - r; i--) res = res * i % MOD;
  for (ll i = 1; i <= r; i++) res = (res * modpow(i, MOD-2)) % MOD;
  return res;
}

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll n,m; cin>>n>>m;
  if(n>m) swap(n,m);
  
  
  if(n==m){
    fact_init();
    ll ans=fact[n];
    (ans*=ans)%=MOD;
    (ans*=2)%=MOD;
    cout<<ans<<endl;
  }else if(m-n==1){
    fact_init();
    ll ans=fact[n]*fact[m]%MOD;
    cout<<ans<<endl;
  }else{
    cout<<0<<endl;
  }
  
}

Measured memory_bytes: 159900
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    for(int i =1;i<6;i++){
	        int a = s.nextInt();
	        if(a==0){
                System.out.println(i);
                break;
            }
        }
    }
}

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

int gcd(int a,int b)
{
    if(a==0)
    {
        return b;
    }
    else
    {
        return gcd(b%a,a);
    }
}

int main()
{
    int n,i,j,k;
    cin>>n;
    ll ans;
    ans=0;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
        {
            for(k=1;k<=n;k++)
            {
                ans+=gcd(i,gcd(j,k));
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 3632
# ビンゴカード
bingo_card = list()
for i in range(3):
    bingo_card.append(input().split(' '))
# 引いた回数
pick_count = int(input().strip())
# 引いた番号
picked_number = list()
for j in range(pick_count):
    picked_number.append(input().strip())

# ビンゴ成立条件
bingo_line = list()
# 横
for i in range(3):
    bingo_line.append(bingo_card[i-1])
# 縦
bingo_line.append([bingo_card[0][0], bingo_card[1][0], bingo_card[2][0]])
bingo_line.append([bingo_card[0][1], bingo_card[1][1], bingo_card[2][1]])
bingo_line.append([bingo_card[0][2], bingo_card[1][2], bingo_card[2][2]])
# 斜め
bingo_line.append([bingo_card[0][0], bingo_card[1][1], bingo_card[2][2]])
bingo_line.append([bingo_card[0][2], bingo_card[1][1], bingo_card[2][0]])

established_line = [line for line in bingo_line if len(set(line) & set(picked_number)) == 3]
print('Yes' if len(established_line) > 0 else 'No')


Measured memory_bytes: 3064
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <vector>

#define FOR(i, a, b) for (int i = a; i < b; i++)
#define FORN(i, a, b) for (int i = a; i <= b; i++)
#define P(s) cout << s << endl
#define PC(condition, _true, _false) if (condition) _true; else _false;
#define toInt(_char) _char - '0'

using namespace std;
//
// Created by karayuu on 2018-12-18.
//

int main() {
    int a, b;
    cin >> a >> b;
    
    PC((a * b) % 2 == 0, P("Even"), P("Odd"));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

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

	int k, a, b;
	cin >> k >> a >> b;
	for (int i = a; i <= b; i++) {
		if (i % k == 0) {
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if (min(a, b) < 1 || max(a, b) > 9) cout << -1;
	else cout << a * b;
	return 0;
}


Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = Long.parseLong(sc.next());
        long v = Long.parseLong(sc.next());
        long b = Long.parseLong(sc.next());
        long w = Long.parseLong(sc.next());
        long t = Long.parseLong(sc.next());

        long vw = v - w;
        long diff = (long)Math.abs(a - b);
        if(vw * t >= diff){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
}

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


int main(){
    int n,k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i,n){
        cin >> p[i];
    }
    sort(p.begin(),p.end());
    int sum = 0;
    rep(i,k){
        sum += p[i];
    }
    cout << sum << endl;

}

Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>

using namespace std;

string::size_type find01(string S){

    return S.find(string("01"));
}

string::size_type find10(string S){

    return S.find(string("10"));
}

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

    string S;
    cin >> S;

    int N, N_0, N_1;

    N = S.length();

    N_0 = count(S.cbegin(), S.cend(), '0');
    N_1 = N - N_0;

    cout << 2 * min(N_0, N_1) << endl;

    return 0;
}


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

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

ll N;
map<string, int> mp;

int main(){
	cin>>N;
	string s;
	while(N--){
		cin>>s;
		mp[s]++;
	}

	cout<<"AC"<<" x "<<mp["AC"]<<endl;
	cout<<"WA"<<" x "<<mp["WA"]<<endl;
	cout<<"TLE"<<" x "<<mp["TLE"]<<endl;
	cout<<"RE"<<" x "<<mp["RE"]<<endl;
    return 0;
}






Measured memory_bytes: 3628
import java.util.*;

class Main {
  
  public static final int mod = 1000000007;
  public static final int fmax = 200005;
  public static long fac[] = new long[fmax];
  public static long inv[] = new long[fmax];
  public static long finv[] = new long[fmax];
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = Long.parseLong(sc.next());
    long a = Long.parseLong(sc.next());
    long b = Long.parseLong(sc.next());

    if(n==2 & a==1 & b==2){
      System.out.println("0");
      return;
    }
    
    NCRinit();
    
    long ap = n % mod;
    long bp = n % mod;
    
    for(long i=1; i<=a-1; i++){
      ap *= (n-i);
      ap %= mod;
    }
    for(long i=1; i<=b-1; i++){
      bp *= (n-i);
      bp %= mod;
    }
    
    for(int i=1; i<=a; i++){
      ap *= inv[i];
      ap %= mod;
    }
    for(int i=1; i<=b; i++){
      bp *= inv[i];
      bp %= mod;
    }
    
    long ans = modpow(2, (int)n);
    ans %= mod;
    
    ans -= 1L;
    ans %= mod;
    if(ans<0) ans += mod;
    ans -= ap;
    ans %= mod;
    if(ans<0) ans += mod;
    ans -= bp;
    ans %= mod;
    if(ans<0) ans += mod;
    
    System.out.println(ans);
    
  }

  // a^n mod を計算する
  public static long modpow(long x, int n) {
      long ret = 1;
      while (n > 0) {
          if ((n & 1) == 1) {
              ret = (ret * x)%mod;
          }
          x = (x * x)%mod;
          n >>= 1;
      }
      return ret;
  }

  // テーブルを作る前処理
  public static void NCRinit() {
    fac[0] = 1;
    fac[1] = 1;
    finv[0] = 1;
    finv[1] = 1;
    inv[0] = 1;
    inv[1] = 1;
    for (int i = 2; i < fmax; i++){
      fac[i] = fac[i - 1] * i % mod;
      inv[i] = mod - inv[mod%i] * (mod / i) % mod;
      finv[i] = finv[i - 1] * inv[i] % mod;
    }
  }
 
  // 二項係数計算
  public static long ncr(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
  }
  
}


Measured memory_bytes: 27476
A, B, C = map(int, input().split())
K = int(input())

for k in range(K):
  if A < B < C:
    print("Yes")
    exit()
  if A >= B:
    B *= 2
  elif B >= C:
    C *= 2

if A < B < C:
  print("Yes")
  exit()

print("No")


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

int sosu (int x)
{
	int flag;
	int i = 3;
	
	if (x == 2){
		return 1;
	}
	
	if (x<2 || x%2 == 0){
		return 0;
	}
	
	while (i<=sqrt((double)x)) {
		if (x%i == 0) {
			return 0;
		}
		i = i + 2;
	}
	
return 1;
}	

int main()
{
	int n[10000];
	int i;
	int a;
	int cnt = 0;
	scanf("%d",&a);
	for (i=0;i<a;i++) {
		scanf("%d",&n[i]);
	}
	for (i=0;i<a;i++) {
		if (sosu(n[i])) {
			cnt++;
		}
	}
	printf("%d\n",cnt);
return 0;
}


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

int main() {
  int N,sum,swap;
  cin >> N;
  
  swap = N;
  
  while(true){
    sum += N % 10;
    N /= 10;
    if(N==0)
      break;
  }
  
  if(sum!=0 && swap%sum==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

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

max_cnt, max_num = 0, 1
for i in range(1, n+1):
    cnt, a = 0, i

    while a%2 == 0:
        a //= 2
        cnt += 1

    if cnt > max_cnt:
        max_cnt = cnt
        max_num = i

print(max_num)


Measured memory_bytes: 2940
#include <iostream>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <stdlib.h>
#include <cmath>
#include <set>

using namespace std;
#define mk make_pair
typedef long long ll;
typedef pair<int,int> P;
const int maxn=100100;
const int mod=1000000007;
const ll INF=1000000000;

int a[maxn];

int main()
{
    int n;
    scanf("%d",&n);
    int sum=0;
    for(int i=1;i<=n;i++){
        int len=0,k=i;
        while(k){
            len++;
            k=k/10;
        }
        if(len%2==1)
            sum++;
    }
    cout<<sum<<endl;
    return 0;
}

/*
 2598708396863
*/


Measured memory_bytes: 256