akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ull unsigned long long int
#define ll long long
#define f(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define vl vector<ll>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define pb push_back
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";
#define printv(v) for(auto it : v) cout<<it<<" ";


//#include<boost/multiprecision/cpp_int.hpp>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//(Uncomment when needed and be sure it not give TLE bcoz it requires time)
//#pragma GCC optimize "trapv"//to check integer overflow and gives RE.
//typedef tree<pair<int,int>,null_type, 
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement
//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;

using namespace std;
const long long int MOD = 1e9+7;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map

int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
const long long int N = 1000000;
vector<int> adj[N+1];
vector<bool> vis(N+1,false);
ll cc = 0 ; 
void dfs(int u){
    vis[u]=true;
    for(auto child: adj[u]){
        if(!vis[child])
        dfs(child);
    }
    cc++;
}
int main()
{fast_io

int t;
//cin>>t;
t = 1;
while(t--)
{
 ll n,m;
 cin>>n>>m;
 while(m--){
     int u,v;
     cin>>u>>v;
     adj[u].push_back(v);
     adj[v].push_back(u);
 }
 ll ans = 0 ; 
 for(int i  =1 ;i<=n ;i++){
     if(!vis[i]){
         dfs(i);
         ans = max(ans,cc);
         cc=0 ; 
     }
 }
 cout<<ans<<endl;
}
}


Measured memory_bytes: 39528
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

r = int(input())
g = int(input())

print(2*g-r)




Measured memory_bytes: 8960
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<map>
#include <algorithm>
#include<cstdlib>
#include<cmath>
#include<deque>
#include <numeric>
typedef unsigned long long ull;
typedef  long long ll;

int main() {
	std::string S;
	std::cin >> S;

	if ((S[5] > '0') || ((S[5] == '0')) && (S[6] > '4')) {
		std::cout << "TBD" << std::endl;
	}
	else {
		std::cout << "Heisei" << std::endl;
	}

	return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<ll> a(n);
	rep(i, n) cin >> a[i];
	deque<ll> b;
	int fb = 1;
	rep(i, n) {
		if (fb == 1) {
			b.push_back(a[i]);
			fb = 2;
		}
		else {
			b.push_front(a[i]);
			fb = 1;
		}
	}
	if (fb == 1) {
		rep(i, n) {
			ll c = b.front();
			b.pop_front();
			cout << c << " ";
		}
	}
	else {
		rep(i, n) {
			ll c = b.back();
			b.pop_back();
			cout << c << " ";
		}
	}
}

Measured memory_bytes: 5376
#include <iostream>

using namespace std;
void swap(int *a ,int *b)
{
    int temp = *a;
    *a = *b;
    *b =temp;
}
int main()
{   int a,b,c;
    cin>> a>>b>>c;
    swap(a,b);
    swap(a,c);
    cout<<a<<" "<<b<<" "<<c;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int x, y;
    cin >> x >> y;
    set<int> g1 = {1, 3, 5, 7, 8, 10, 12};
    set<int> g2 = {4, 6, 9, 11};
    set<int> g3 = {2};
    if ((g1.count(x) == 1 && g1.count(y) == 1) || (g2.count(x) == 1 && g2.count(y) == 1) ||
        (g3.count(x) == 1 && g3.count(y) == 1))
        cout << "Yes"
             << "\n";
    else
        cout << "No"
             << "\n";
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] h = new long[n];
    for(int i = 0; i < n; i++) {
      h[i] = sc.nextLong();
    }
    System.out.println(func(h));
  }

  public static long func(long[] h) {
    long m = Long.MAX_VALUE;
    for(int i = 0; i < h.length; i++) {
      if(m > h[i]) m = h[i];
    }
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < h.length; i++) {
      if(h[i] == m) list.add(i);
    }
    long ret = m;
    int k1 = 0;
    int k2 = list.get(0) - 1;
    if(k2 >= k1) {
      long[] s = new long[k2 + 1];
      for(int i = 0; i <= k2; i++) {
        s[i] = h[i] - m;
      }
      ret += func(s);
    }
    for(int i = 0; i < list.size(); i++) {
      int t1 = list.get(i) + 1;
      int t2 = 0;
      if(i < list.size() - 1) {
        t2 = list.get(i + 1) - 1;
      } else {
        t2 = h.length - 1;
      }
      if(t2 >= t1) {
        long[] s = new long[t2 - t1 + 1];
        for(int j = 0; j < (t2 - t1 + 1); j++) {
          s[j] = h[t1 + j] - m;
        }
        ret += func(s);
      }
    }
    return ret;
  }
}

Measured memory_bytes: 22996
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int n;
    cin >> n;
    vector<int> p(n), q(n);
    rep(i, n) cin >> p[i];
    rep(i, n) cin >> q[i];
    vector<int> base(n);
    rep(i, n) base[i] = i + 1;
    int cnt = 1;
    int a = 0;
    int b = 0;
    do {
        bool ok = true;
        //rep(i, n) {
        //    cout << base[i] << " ";
        //}
        //cout << endl;
        rep(i, n) {
            if (base[i] != p[i]) {
                ok = false;
                break;
            }
        }
        if (ok) a = cnt;
        //cout << a << " " << cnt << endl;
        ok = true;
        rep(i, n) {
            //if (cnt == 6) cout << base[i] << " " << q[i] << endl;
            if (base[i] != q[i]) {
                ok = false;
                break;
            }
        } 
        if (ok) b = cnt;
        //if (a != 0 && b != 0) break;
        //cout << b << " " << cnt << endl;
        ++cnt;
    } while(next_permutation(base.begin(), base.end()));
    //cout << a <<  " " << b << endl;
    cout << abs(a - b) << endl;
    return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,a) for(ll i=0;i<a;i++)
#define jkl ll debug = 0;
#define RREP(i,a) for(ll i=a-1;i>=0;i--)
#define rrep(i,a,b) for(ll i=a-1;i>=b;i--)
#define printall(n,array) {for(ll i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> Pi;
typedef pair<ll, Pi> V;
typedef vector<ll> VE;
const ll mod = 1e9 + 7; //10^9+7

int main(){
    int b;
    cin >> b;
    if(b == 3 || b == 5 || b == 7){
        print("YES");
    }else{
        print("NO");
    }
}

Measured memory_bytes: 256
def main():
    import sys

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

    def f(n, x):
        if n == 0:
            return 0 if x<=0 else 1
        elif x <= a[n-1]+1:
            return f(n-1, x-1)
        else:
            return p[n-1]+1+f(n-1, x-2-a[n-1])

    n, x = map(int, input().split())
    a, p = [1], [1]
    for i in range(n):
        a.append(2*a[-1]+3)
        p.append(2*p[-1]+1)
    print(f(n, x))





                
if __name__ == '__main__':
    main()

Measured memory_bytes: 9148
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, n) revi(i, 0, n)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define sp(n) cout << fixed << setprecision(n)
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

int main() {
  st S;
  ci(S);
  int c = 0;
  rep(i, 3){
    if(S.at(i) == 'o'){
      c++;
    }
  }
  co(700 + c * 100);
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long ans = 1;
    for(int i = 1; i <= N; i++){
      ans = (ans * i) % 1000000007L;
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 21844
/* ex4-1
   Sagzar1993  */


#include <stdio.h>
#include <math.h>

int main(void) {
    int treeNum, halfRange;  //木の本数と、監視できる片側範囲

    scanf("%d %d", &treeNum, &halfRange); //入力を受け取る

    int range = halfRange * 2 + 1;  //１人の監視員が監視できる木の最大本数

    /* 木の本数を、１人が監視できる最大の木の本数で割る
       余った木にはもう１人の監視員が必要なので切り上げる
       treeNumはint型からdouble型に変換 */
    double observerNum = ceil((double) treeNum / range);

    printf("%d\n", (int) observerNum); //整数に直して出力

    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define llong long long
#define pb(a) push_back(a)
#define INF 9999999

using namespace std;

typedef pair<int,int> P;

int dy[4]={0,0,1,-1};
int dx[4]={1,-1,0,0};
int main(){
	int A,B,C,D;
	cin>>A>>B>>C>>D;
	int sum=min(A,B)+min(C,D);
	cout<<sum;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define fi first
#define sc second
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define ANS cout << ans << endl
#define RETURN(x)    \
  cout << x << endl; \
  return 0
clock_t CLOCK;
#define START_TIMER CLOCK = clock()
#define SHOW_TIMER cerr << "time: " << (ld)(clock() - CLOCK) / 1000000 << endl
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

signed main() {
  init();
  ll A, B, C, D;
  cin >> A >> B >> C >> D;
  ll l = A + B;
  ll r = C + D;

  if (l == r) {
    COUT("Balanced");
    return 0;
  }
  
  if (l < r) {
    COUT("Right");
  } else {
    COUT("Left");
  }

  return 0;
}

Measured memory_bytes: 3616
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<algorithm>
using namespace std;
int t[101010];
long long d[101010];
int siz[101010],fa[101010];
bool cmp(const int &x,const int &y)
{
	return d[x]<d[y];
}
map<long long,int> mp;
int main()
{
	int n;
	scanf("%d",&n);
	mp.clear();
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&d[i]);
		siz[i]=1;
		mp[d[i]]=i;
		t[i]=i;
	}
	sort(t+1,t+n+1,cmp);
	for(int i=n;i>1;i--)
	{
		fa[t[i]]=mp[d[t[i]]+2*siz[t[i]]-n];
		if(fa[t[i]]==0)
		{
			printf("-1");
			return 0;
		}
		siz[fa[t[i]]]+=siz[t[i]];
	}
	for(int i=2;i<=n;i++)
		d[t[1]]-=siz[t[i]];
	if(d[t[1]]!=0)
	{
		printf("-1");
		return 0;
	}
	for(int i=2;i<=n;i++)
		printf("%d %d\n",fa[t[i]],t[i]);
	return 0;
}

Measured memory_bytes: 10112
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <numeric>
#include <map>
#include <utility>
using namespace std;
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(void){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<(a==b?c:a==c?b:a)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define bug1( x ) {cerr << (#x) <<"="<< x << endl;}
#define bug2( x , y ) {cerr << (#x) <<"="<< (x) << "    " << (#y) << "="<< (y) << endl;}
#define bug3( x , y , z ) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << endl;}
#define bug4( x , y , z , w) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << endl;}
#define bug5( x , y , z , w ,p) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << endl;}
#define bug6( x , y , z , w ,p , q) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << "    " << (#q) <<"="<< q << endl;}
#define bugn( x , n ) {cerr << (#x) <<":";for(int i=0;i<n;i++)cerr << x[i] <<"  "; cerr << endl;}
#define bugnm( x , n , m ) {cerr << (#x)<<endl;for(int i=0;i<n;i++){cerr << "Row #" << i<< ":";for(int j=0;j<m;j++)cerr << x[i][j] << "   ";cerr << endl;}}
typedef long long ll;
typedef long double ld;
using namespace std;


int32_t main(){
	IOS
	string s;cin>>s;
	int cnt = 0,prv1 = 0,n = s.length();
	for(int i=0;i<n;i++){
		if( prv1 ){
			if( s[i] == s[i-1] ){
				if( i+1<n ){
					i+=1;
					cnt++;
					prv1=0;
				}
			}else{
				cnt++;
			}
		}else{
			cnt++;
			prv1=1;
		}
	}
	cout<<cnt<<endl;
				
	
}
 
/*
 * long long or int?
 * index out of bound? 
 * Tested on own test case?corner?
 * Make more general solution.
 * Read Read Read Read ....
 */


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

#define rep(i,a,b)      for(int i=a;i<=b;i++)
#define revp(i,b,a)     for(int i=b;i>=a;i--)

string s;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    
    cin>>s;
    int maxi=0,cnt=0;
    rep(i,0,s.length())
    {
        if(s[i]=='A' || s[i]=='C' || s[i]=='G' || s[i]=='T')
            ++cnt;
        else
        {
            if(maxi==0)
                maxi=cnt;
            else
                maxi=max(maxi,cnt);
            cnt=0;
        }
    }
            if(maxi==0)
                maxi=cnt;
            else
                maxi=max(maxi,cnt);
    cout<<maxi;

}


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

int main() {
  
  string s;
  cin >> s;
  
  if(s=="AKIHABARA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHABARA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHBARA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHABRA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHABAR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHBARA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHABRA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHABAR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHBRA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHBAR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHABR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHBRA"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHBAR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHABR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="AKIHBR"){
    cout<< "YES"<<endl;
  }
  
  else if(s=="KIHBR"){
    cout<< "YES"<<endl;
  }
  
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.Map;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.lang.Math;

public class Main {

    private static Scanner sc = new Scanner(System.in);
    private static int mod = (int) 10e8 + 7;

    public static void main(String[] args) {
        int n = sc.nextInt();
        Map<String, Integer> strings = new TreeMap<String, Integer>();
        String s;
        for (int i = 0; i < n; i++) {
            s = sc.next();
            if (strings.containsKey(s)) {
                strings.put(s, strings.get(s)+1);
            } else {
                strings.put(s, 1);
            }
        }
        int max = Integer.MIN_VALUE;
        for (int i : strings.values()) {
            if (i > max) max = i;
        }
        for (Map.Entry<String, Integer> ans : strings.entrySet()) {
            if (ans.getValue() == max) {
                System.out.println(ans.getKey());
            }
        }
    }

}


Measured memory_bytes: 81124
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		
		int n=s.nextInt();
		
		int p=0;
		
		int count=0;
		
		for(int i=0;i<n;i++)
		{
			int a=s.nextInt();
			int b=s.nextInt();
			
			if(a==b)
			{
				count++;
			}
			else
			{
				count=0;
			}
			
			if(count>=3)
			{
				p=1;
			}
		}
		
		if(p==1)
		{
			System.out.println("Yes");
		}
		else
		{
			System.out.println("No");
		}
		
	}
	
}

Measured memory_bytes: 36256
#include<stdio.h>

int main(){
  int a,b,c,d,e,k;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  scanf("%d", &d);
  scanf("%d", &e);
  scanf("%d", &k);

  a=e-a;

  if(a>k){
    printf(":(");
  }else{
    printf("Yay!");
  }
  return 0;
}

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

using namespace std;

int main(){
    char s;
    scanf("%c", &s);
    if (s == 'A')
        puts("T");
    else if (s == 'T')
        puts("A");
    else if (s == 'C')
        puts("G");
    else if (s == 'G')
        puts("C");
    return 0;
}

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

int32_t main() {
	int n,m;
	cin >> n >> m;
	int a[n];
	for(int i = 0; i < n ; i++) 
		cin >> a[i];
	sort(a , a + n);
	array<int,2> b[m];
	for(int i=0;i<m;i++)
		cin>>b[i][1]>>b[i][0];
	sort(b,b+m);
	int i = 0;
	for(int j=m-1;j>=0;j--){
		while(i < n && a[i] < b[j][0] && b[j][1] > 0){
			a[i] = b[j][0];
			b[j][1]--;
			i++;
		}
	}
	int ans = 0;
	for(int i=0;i<n;i++)
		ans += a[i];
	cout<<ans<<endl;
}

Measured memory_bytes: 5928
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN
#define INF         100000000000000000
#define PI          3.1415926535897932384626433832795l



#define fi first
#define se second
#define pb push_back
#define f_s(a) sort(a.begin(), a.end())
#define b_s(a) sort(a.rbegin(), a.rend())
#define p(a) cout<<a<<"\n"


// ll mod = 1000000007;
// #define l(i, )
// #define rl(i, a, b) for(int i = a; i < b; i++)






// struct mycomp {
//     bool operator() (const pair<int,int> &a, const pair<int,int> &b) const{
//         if (a.second-a.first != b.second-b.first)
//         return (a.second-a.first > b.second-b.first);
//         return a.first < b.first;
//     }
// };



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


ll extended_gcd(ll a, ll b, ll& x, ll& y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1, y1;
	ll d = extended_gcd(b, a%b, x1, y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;
}

////////////////////SIEVE OF ERATOSTHENES//////////////////////
vector<int> sieveoferatosthenes(int n)
{
	vector<bool> prime(n+1, true);
	for(int i = 2; i <= sqrt(n); i++)
	{
		if(prime[i])
		{
			for(int j = i*i; j<=n; j+=i)
			{
				prime[j]=false;
			}
		}
	}	
	vector<int> all_primes;
	for(int i = 2; i <=n; i++)
	{
		if(prime[i]) all_primes.pb(i);
	}
	return all_primes;
}

////////////////////BINARY EXPONENTIATION///////////////////////
ll bin_exp(ll a, ll b, ll mod)
{
	ll ans = 1;
	while(b)
	{
		if(b%2)
		{
			b--;
			ans = (ans%mod*a%mod)%mod;
		}
		b/=2;
		a = (a%mod*a%mod)%mod;
	}
	return ans;
}


///////////////////////////BFS//////////////////////////////////
void bfs(vector<int>& distance, vector<int> a[], vector<bool>& visited, int u, vector<int>& parent)
{
	visited[u]=true;
	parent[u]=-1;
	distance[u]=0;
	queue<int> q;

	q.push(u); 
    while (!q.empty()) { 
  
        int f = q.front(); 
        q.pop(); 
  		for(int i =0; i < a[f].size(); i++)
  		{
  			if(visited[a[f][i]]==false)
  			{
  				distance[a[f][i]]=distance[f]+1;
  				parent[a[f][i]]=f;
  				visited[a[f][i]]=true;
  				q.push(a[f][i]);
  			}
  		}
    } 

}

void solve()
{

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

	// #ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	// #endif
	string s, t;
	cin>>s>>t;
	int ct = 0;
	for(int i = 0; i < 3; i++) if(s[i]==t[i]) ct++;
		p(ct);
	return 0;
}	

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int n,t,s[200002],i,sum=0;
  scanf("%d%d",&n,&t);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  sum+=t;
  for(i=1;i<n;i++){
    sum+= (s[i]-s[i-1]>t?t:s[i]-s[i-1]);
  }
  printf("%d",sum);
}

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

bool prime(int x) {
  int flr = floor(sqrt(x));
  for(int i = 2; i <= flr; i++) {
    if(x % i == 0) {
      return false;
    }
  }
  return true;
}

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

  int N;
  cin >> N;
  vector<int> A(N);
  int res = 0;
  REP(i, N) cin >> A[i];
  for(int k = 0; k < N; k++) {
    if(prime(A[k])) {
      res += 1;
    }
  }

  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3168
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	string a, b;
	cin >> a;
	cin >> b;
	int ans = 0;
	for (int i = 0; i < a.length(); i++) {
		if (b[i] != a[i]) {
			ans++;
		}
	}
	cout << ans;

}

Measured memory_bytes: 3920
#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 FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define PI 3.141592653589793
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main(){
    std::cout<<std::fixed<<std::setprecision(12);
    double L;
    cin >> L;
    double L1 = L/3;
    // double L2 = L1;
    // double L3 = L - L1 - L2;
    cout << pow(L1,3)  << endl;

}

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


ll num[30];
int main(){
    int n;
    string s;
    cin>>n>>s;

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

    ll res=1;
    rep(i,26){
        res*=num[i]+1;
        res%=MOD;
    }

    res-=1;
    if(res<0) res+=MOD;

    cout<<res<<endl;
}

Measured memory_bytes: 3760
#pragma GCC optimize("trapv")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
using pi = pair<ll, ll>;
using vi = vector<ll>;
const int maxn = 5e3 + 55;
ll n, a, b, dp[maxn][maxn], p[maxn];
ll cost(int i, int j) {
	if(p[i]==j-1) return 0;
	return p[i] < j-1 ? a : b;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> a >> b;
	for(int t, i = 1; i <= n; i++) {
		cin >> t;
		p[t] = i;
	}
	memset(dp, 0x3f, sizeof dp);
	for(int i = 0; i <= n+1; i++)
		dp[0][i] = 0;
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= n+1; j++) {
			dp[i][j] = min(dp[i][j-1], dp[i-1][j] + cost(i, j));
		}
	}
	cout << dp[n][n+1];
}


Measured memory_bytes: 199936
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=input()

R,S,P=t.count("s"),t.count("p"),t.count("r")
ans=r*R+s*S+p*P
l=[0]*n

for i in range(n-k):
    if t[i]==t[i+k]:
        if l[i]==0:
            if t[i]=="r":
                ans-=p
            elif t[i]=="s":
                ans-=r
            else:
                ans-=s
            l[i+k]=1
        else:
            pass
        
print(ans)

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

const int P = (int)1e9 + 7;

void add(int &x, const int &y) {
    if ((x += y) >= P)
        x -= P;
}

const int S = 2007;

int d[S];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int s;
    cin >> s;
    d[0] = 1;
    for (int i = 0; i <= s; ++i) {
        for (int k = 3; i + k <= s; ++k) add(d[i + k], d[i]);
    }
    cout << d[s];
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
#define INF (1 << 30)
struct Node{
    int val, min, size;
    Node *l, *r;
    Node(int v){
	size = 1;
	val = v;
	min = v;
	l = r = NULL;
    }
};

typedef pair<Node*, Node*> P;

Node *root = new Node(0);

Node *update(Node *a){
    if(a == 0)return a;
    a->min = min(a->l?a->l->min:INF, a->r?a->r->min:INF);
    a->min = min(a->min, a->val);
    a->size = 1 + (a->l?a->l->size:0) + (a->r?a->r->size:0);
    return a;
}

Node *merge(Node *a, Node *b){
    if(a == NULL)return b;
    if(b == NULL)return a;
    if(rand() % (a->size + b->size) < a->size){
	a->r = merge(a->r, b);
	return update(a);
    }
    else{
	b->l = merge(a, b->l);
	return update(b);
    }
}

P split(Node *p, int v){
    if(v == 0)return P(NULL, p);
    int lsize = (p->l)?p->l->size:0;
    if(lsize < v){
	P tmp = split(p->r, v - lsize - 1);
	p->r = tmp.first;
	return P(update(p), update(tmp.second));
    }
    else{
	P tmp = split(p->l, v);
	p->l = tmp.second;
	return P(update(tmp.first), update(p));
    }
}

void shift(int l, int r){
    P tmpr = split(root, r + 1);
    P tmpl = split(tmpr.first, l);
    P tmpc = split(tmpl.second, r - l);
    tmpl.second = merge(tmpc.second, tmpc.first);
    
    tmpr.first = merge(tmpl.first, tmpl.second);
    root = merge(tmpr.first, tmpr.second);
}

int solve(int l, int r){
    P tmpr = split(root, r);
    P tmpl = split(tmpr.first, l);
    int ans = tmpl.second->min;
    tmpr.first = merge(tmpl.first, tmpl.second);
    root = merge(tmpr.first, tmpr.second);
    return ans;
}

void setnum(int x, int v){
    P tmpr = split(root, x);
    P tmpl = split(tmpr.second, 1);
    tmpr.second = merge(new Node(v), tmpl.second);
    root = merge(tmpr.first, tmpr.second);
}

int main(){
    int n, q, a, x, y, z;
    cin >> n >> q;
    for(int i = 1;i <= n;i++){
	cin >> a;
	root = merge(root, new Node(a));
    }
    
    for(int i = 0;i < q;i++){
	cin >> x >> y >> z;
	if(x == 0){
	    shift(y + 1, z + 1);
	}
	if(x == 1){
	    cout << solve(y + 1, z + 2) << endl;
	}
	if(x == 2){
	    setnum(y + 1, z);
	}
    }
    return 0;
}

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

int main()
{
    string a;
    cin >> a;
    int len = a.length();
    for (int i = 0;i < len;i++)
    {
        if (a[i] == '1')
            cout << "9";
        else if (a[i] == '9')
            cout << "1";
        else
            cout << a[i];
    }
    cout << endl;
    return 0;
}

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

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

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

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

constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

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

  int n, k; cin >> n >> k;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  vector<int> ans;


  int mi = INT_MAX;
  int pos = -1;
  int beforepos = -1;

  k++;
  while(k--) {
    mi = INT_MAX;
    rep(i, n) {
      if (i == beforepos) continue;
      if (a[i] < mi) {
        pos = i;
        mi = a[i];
      }
    }
    if (mi == 0) {
      cout << -1 << endl;
      return 0;
    }
    //debug(beforepos);debug(pos);debugln(mi);

    rep(i, n) {
      if (i != pos && i != beforepos) {
        a[i]--;
        ans.push_back(i+1);
        if (a[i] < 0) {
          cout << -1 << endl;
          return 0;
        }
      }
    }
    ans.push_back(pos+1);
    a[pos]--;
    beforepos = pos;
  }
  cout << ans.size() << endl;
  for(auto e: ans) {
    cout << e << ' ';
  }
  cout << endl;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

using ll = long long int;
using P = pair<int,int>;

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

const ll INF=(ll)1e19;
//const int INF=(1<<30);

int main(){
  int n,m,c;
  cin >> n >> m >> c;
  VI b(m);
  REP(i,m)cin >> b[i];

  int ans = 0;
  REP(i,n){
    int tmp=0;
    REP(j,m){
      int a;
      cin >> a;
      tmp += b[j] * a;
    }
    tmp += c;
    if(tmp > 0)ans++;
  }

  cout << ans << endl;

}



Measured memory_bytes: 256
//雪花飄飄北風嘯嘯
//天地一片蒼茫

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int n;
int arr[200005];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>n;
	rep(x,0,n) cin>>arr[x];
	
	sort(arr,arr+n);
	reverse(arr,arr+n);
	
	ll ans=0;
	rep(x,1,n) ans+=arr[x/2];
	
	cout<<ans<<endl;
}


Measured memory_bytes: 4412
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b;
    cin >> a >> b;
    ll ans = 0;
    if(a >= b){
        ans += a;
        a--;
    }else{
        ans += b;
        b--;
    }
    if(a >= b){
        ans += a;
        a--;
    }else{
        ans += b;
        b--;
    }
    print(ans);
    
    
}

Measured memory_bytes: 256
n = gets.to_i
a = gets.split(" ").map(&:to_i)

count = [1]
brick_b = 0
n.times do |i|
    if count.last != a[i]
        brick_b = brick_b + 1
    else count[0] == a[i]
        count.push(a[i]+1)
    end
end

if count.last == 1 and brick_b > 0
    puts -1
else
    puts brick_b
end

Measured memory_bytes: 16956
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define debug(...) cerr<<__LINE__<<" ["<<#__VA_ARGS__<<"]:",debug_out(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec)
    { for (auto v : vec) os << v << ' '; os << '\n'; return os; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa)
    { os << '(' << pa.first << ',' << pa.second << ')'; return os; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T)
    { cerr << " " << H; debug_out(T...); }
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 int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

void solve() {
    ll n, k;
    cin >> n >> k;
    vector<ll> A(n);
    rep(i, n) cin >> A[i];
    vector<ll> S(n + 1, 0);
    REP(i, 1, n) S[i] = S[i - 1] + A[i - 1];
    map<ll, int> mp;
    REP(i, 0, min(n, k - 1)) {
        mp[(S[i] - i) % k]++;
    }
    ll ans = 0;
    REP(i, 0, n) {
        mp[(S[i] - i) % k]--;
        ans += mp[(S[i] - i) % k];
        if (i + k > n) continue;
        mp[(S[i + k] - i - k) % k]++;
    }
    cout << ans << endl;
}

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


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

using LL = long long;
using LD = long double;
 
LL mod = 1e9+7;

int main()
{
	LL n;
	cin >> n;

	string s;
	cin >> s;
	
	LL pre[3][n+1];

	for (LL i = 0; i < 3; ++i) {
		for (LL j = 0; j < n+1; ++j) {
			pre[i][j] = 0;
		}
	}
	char ch[3] = {'R', 'G', 'B'};
	map<char, LL> mp;
	mp['R'] = 0, mp['G'] = 1, mp['B'] = 2;

	LL cr = 0, cg = 0, cb = 0;  
	for (LL i = 1; i <= n; ++i) {
		if (s[i-1] == 'R') {
			cr++;
		}
		else if (s[i-1] == 'G') {
			cg++;
		}
		else {
			cb++;
		}
		pre[0][i] = cr, pre[1][i] = cg, pre[2][i] = cb;
		//cout << pre[1][i];
	}
	//cout << "\n";
	LL add = 0;
	for (LL i = 0; i < n; ++i) {
		for (LL j = i+1; j < n; ++j) {
			
			if (s[i] != s[j]) {
				LL third = 3 - mp[s[i]] - mp[s[j]];	
				LL cnt = pre[third][n] - pre[third][j+1];

				if (j + (j-i) < n && s[j+(j-i)] == ch[third]) {
					cnt--;
				}
				add += cnt;
				//cout << i << " " << j << " " << cnt << ch[third] << "!\n";
			}
		}
	}
	cout << add << "\n";


}

Measured memory_bytes: 3708
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define max0(a,b,c) max(max(a,b),c)
#define min0(a,b,c) min(min(a,b),c)
#define ft first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
using namespace std;
using Graph = vector<vector<int>>;
typedef long long lint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldouble;
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<ull> ulvec;
typedef vector<pair<int,int>> pvec;
typedef vector<pair<ll,ll>> plvec;
typedef vector<tuple<ll,ll,ll>> tvec;
typedef vector<string> svec;

int main(){
    double n;
    scanf("%lf",&n);
    double k;
    int m;
    k=n;
    n/=(double)1.080000000000000000000000000000000000;
    n=(int)n+1;
    m=n;
    n*=(double)1.08000000000000000000000000000000000000;
    
    if(n>=k&&n-k<1) printf("%d",(int)m);
    else cout<<":(";
}

Measured memory_bytes: 256
#include<stdio.h>
void swap(int *a,int *b) 
{
	int c;
	if (b > a) {
		c = *a;
		*a = *b;
		*b = *a;
	}
}
int main(void) {
	int A, B, C, D, E, F;
	scanf("%d", &A);
	scanf("%d", &B);
	C = A + B;
	D = A - B;
	E = A * B;
	if (D > C)
		swap(&C, &D);
	if (E > D)
		swap(&D, &E);
	if (D> C)
		swap(&C, &D);
	printf("%d", C);
	return 0;
}


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

int main(){
    int R,G,B,N;
    int count = 0;
    cin >> R >> G >> B >> N;
    int r_max = N/R,g_max =N/G,b_max =N/B;

    for(int i=0;i<=r_max;i++){
        for(int j=0;j<=(N-i*R)/G;j++){
            if((N-i*R-j*G)%B == 0){
                    count++;
            }
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
from collections import Counter
from copy import copy
N,A = map(int,input().split())
src = list(map(int,input().split()))

dp = [Counter()]
dp[0][0] = 1
for i,a in enumerate(src):
    dp.append(Counter())
    for j in reversed(range(i+1)):
        for k,v in dp[j].items():
            dp[j+1][k+a] += v
ans = 0
for i in range(1,N+1):
    ans += dp[i][A*i]
print(ans)


Measured memory_bytes: 5612
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

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

    int n;
    cin >> n;
    vi a(n);
    vi b(n-1);
    rep(i,n-1){
        cin >> b[i];
    }
    int ans = b[0];
    rep1(i,n-1){
        a[i] = min(b[i-1],b[i]);
        ans+=a[i];
    }
    ans+=b[n-2];
    cout << ans << endl;
    return 0;
}

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

ans = 0

for i in range(1000):
    t = str(i).zfill(3)
    t_index = 0
    for s_index in range(n):
        if s[s_index] == t[t_index]:
            t_index += 1
            if t_index == 3:
                break
    if t_index == 3:
        ans += 1

print(ans)

Measured memory_bytes: 41052
N = int(input())

l = []
for i in range(1, int(N**0.5)+1):
    if N%i==0:
        l.append(i)
        if i!=N//i:
            l.append(N//i)

ans = 0
for i in l:
    m = (N//i)-1
    if m:
        a, b = divmod(N, m)
        if a==b:
            ans += m

print(ans)

Measured memory_bytes: 3272
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

int main(){
  int m,n;
  while(cin>>m, m){
    set<pair<int,int> > s;
    vector<pair<int,int> > v(m);
    REP(i,m){
      int x,y; cin>>x>>y;
      v[i].f = x; v[i].s = y;
    }
    cin>>n;
    REP(i,n){
      int x,y; cin>>x>>y;
      s.insert(mp(x,y));
    }
    FOR(it, s){
      int x = it->f;
      int y = it->s;
      int dx = x - v[0].f;
      int dy = y - v[0].s;
      bool f = true;
      REP(i,m){
        int xx = v[i].f + dx;
        int yy = v[i].s + dy;
        if(s.find(mp(xx,yy)) == s.end()){
          f = false;
          break;
        }
      }
      if(f){
        cout << dx << " " << dy << endl;
        break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 0
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>

bool jud[101];
int mat[101][101];
int mincost[101];
int max;
int sum=0;


int prim();
void printall(int n)
{
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            printf("%d ", mat[i][j]);
        }
        printf("\n");
    }
}
bool judch()
{
    for (int i = 1; i <= max; i++)
    {
        if (!jud[i])
            return true;
    }
    return false;
}


int main()
{
    int n;

    scanf("%d", &n);
    max = n;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            scanf("%d", &mat[i][j]);
            if(mat[i][j]==-1)
                mat[i][j]=__INT_MAX__;
        }
    }

    //printall(n);


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

    return 0;
}

int prim(){
    int v,u;
    int ret=0;
    for(int i=1;i<=max;i++){
        mincost[i]=__INT_MAX__;
        jud[i]=false;
    }
    mincost[1]=0;
    while(true){
        v=-1;
        for(u=1;u<=max;u++){
            if(!jud[u]&&(v==-1||mincost[u]<mincost[v]))
                v=u;
        }
        if(v==-1)
            break;
            jud[v]=true;
            ret+=mincost[v];
            for(u=1;u<=max;u++){
                mincost[u]=mincost[u]<mat[v][u]?mincost[u]:mat[v][u];
            }
    }
    return ret;
}


Measured memory_bytes: 2004
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    if(b-a == c-b) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll a[114514];
ll cnt[50],be[50];
bool f[50];
int main(){
	ll n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		cin>>a[i];
		ll x=1;
		for(int j=0;j<40;j++){
			if(j)x=x<<1;
			be[j]=x;
			if(a[i]&x)cnt[j]++;
		}
	}
	for(int i=0;i<40;i++)if(cnt[i]>n/2)f[i]=1;
	ll ans=0,num=k+1;
	for(int i=0;i<n;i++)ans+=(a[i]^k);
	for(int i=0;i<40;i++){
		ll sum=0,x=be[i];
		if(i){
			if(f[i-1]&&(num&be[i-1]))num-=be[i-1];
			if(!f[i-1]&&!(num&be[i-1]))num+=be[i-1];
		}
		if(!(num&x))continue;
		num-=x;
		for(int j=0;j<n;j++)sum+=(a[j]^num);
		ans=max(sum,ans);
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 4408
#include <bits/stdc++.h>
using namespace std;
const int P=1e9+7,MAXN=200010;
int n,k,ans,fac[MAXN],inv[MAXN];
int qpow (int a,int b) {
	int res=1;
	while (b) {
		if (b&1) {res=(1ll*res*a)%P;}
		a=(1ll*a*a)%P,b>>=1;
	}
	return res;
}
void init () {
	fac[0]=inv[0]=1;
	for (int i=1;i<=n;i++) {fac[i]=(1ll*fac[i-1]*i)%P;}
	inv[n]=qpow(fac[n],P-2);
	for (int i=n-1;i>=1;i--) {inv[i]=(1ll*inv[i+1]*(i+1))%P;}
	return;
}
int c (int n,int m) {return (1ll*fac[n]*((1ll*inv[m]*inv[n-m])%P))%P;}
int main () {
	scanf("%d%d",&n,&k);
	init();
	for (int i=0;i<=min(n-1,k);i++) {
		ans=(ans+(1ll*c(n,i)*c(n-1,i))%P)%P;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
void ABC130(void);
void ABC131(void);
void ABC132(void);
void ABC133(void);
void ABC134(void);
void ABC135(void);
void ABC136(void);
void ABC137(void);
void ABC138(void);
void ABC139(void);

int main(void){
    ABC130();
}

void ABC130(){
    int x,a;
    cin>>x>>a;
    if(x<a)cout<<0<<endl;
    else cout<<10<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
 
int main()
{
  unsigned long long n,a,b,c,i,count;
 
  scanf("%llu", &n);
 
  count=0;
  
  for (a=1;a<n;a++) 
    {
      	count += (n-1) / a;
        
          //count+=1;
    }

  
  printf("%llu",count);
 
  return 0;
}

Measured memory_bytes: 2124
#include <iostream>

using namespace std;

int main(int argc, char ** argv){
  int N,M,K,idx;
  cin >> N >> M;
  int* like = new int[M];
  for(int i = 0; i < M; i++){
    like[i] = 0;
  }
  
  for(int i = 0; i < N; i++){
    cin >> K;
    for(int j = 0; j < K; j++){
      cin >> idx;
      like[idx-1] += 1;
    }
  }
  
  int cnt = 0;
  for(int i = 0; i < M; i++){
    if(like[i] == N) cnt++;
  }
  
  cout << cnt;
  
  return 0;
}


Measured memory_bytes: 256