akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define Rep(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える


int main() {
	char alp; cin >> alp;
	bool flag = false;
	for (int i = 65; i <= 90; i++) {
		if (alp == i) flag = true;
	}

	if (flag) cout << 'A' << endl;
	else cout << 'a' << endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define re(i,a,b) for(int i=(a);i<(b);i++)
#define repd(i,a,b) for(int i=(a);i>=(b);i--)
#define run(a) for(int k=head[a];k;k=e[k].ne)
#define clr(a) memset(a,0,sizeof(a));
#define il inline
#define sz(a) ((int)a.size())
#define all(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back 
#define w1 first
#define w2 second
#define adm(a,b,c) {a=a+b;if(a>=c)a-=c;else if(a<0)a+=c;}
typedef double db;
typedef long long ll;typedef long double ld;typedef unsigned long long ull;
typedef pair<ll,ll> pa;
const int N=1e6+5,M=5e3+5,INF=1e9,mod=998244353;
const ll linf=1e18;const double eps=1e-8,pi=acos(-1);
il int gmin(int &a,int b){if(a>b)a=b;}il ll gmin(ll &a,ll b){if(a>b)a=b;}il int gmax(int &a,int b){if(a<b)a=b;}il ll gmax(ll &a,ll b){if(a<b)a=b;}
il void read(ll&x){ll f=1,t=0;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){t=t*10+ch-'0';ch=getchar();}x=t*f;}il ll read(ll&x,ll&y){read(x);read(y);}
il void read(int&x){int f=1,t=0;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){t=t*10+ch-'0';ch=getchar();}x=t*f;}il int read(int&x,int&y){read(x);read(y);}
il void read(int&a,int&b,int&c){read(a);read(b);read(c);}il void read(ll&a,ll&b,ll&c){read(a);read(b);read(c);}
il int read(){int x;read(x);return x;}
il ll qpow(ll a,ll b,ll p){ll ret=1;for(;b;b>>=1,a=a*a%p)if(b&1)ret=ret*a%p;return ret;}il ll qpow(ll a,ll b){ll ret=1;for(;b;b>>=1,a=a*a%mod)if(b&1)ret=ret*a%mod;return ret;}
il ll qmul(ll a,ll b,ll p){ll ret=0;for(;b;b>>=1,a=(a<<1)%p)if(b&1)adm(ret,a,p);return ret;}il ll qmul(ll a,ll b){ll ret=0;for(;b;b>>=1,a=(a<<1)%mod)if(b&1)adm(ret,a,mod);return ret;}
il void judge(){
	freopen("data.in","r",stdin);
	freopen("data.out","w",stdout);}
int n;
vector<int>e[N];
int dfs(int x,int f){
	int res=0;
	re(i,0,e[x].size())if(e[x][i]!=f)res^=dfs(e[x][i],x)+1;
	return res;
}
int main(){
	read(n);re(i,1,n){
		int x,y;read(x,y);
		e[x].pb(y);e[y].pb(x);
	}
	cout<<(dfs(1,0)?"Alice":"Bob");
}

Measured memory_bytes: 33152
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll x,n;
	cin>>x>>n;
	map<ll,ll>a;
	for(ll i=0;i<n;i++){
		ll x;
		cin>>x;
		a[x]++;
	}
	ll sa=inf;
	ll ans=inf;
	for(ll i=200;i>=-200;i--){
		ll now=i;
		bool ch=true;
		for(auto itr=a.begin();itr!=a.end();itr++){
			ll val=itr->first;
			if(now==val){
				ch=false;
				break;
			}
		}
		if(ch){
			if(abs(now-x)<=sa){
				sa=abs(now-x);
				ans=now;
			}
		}
	}
	cout <<ans;
	// your code goes here
	return 0;
}

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

struct node{
    int data;
    node *next;
    node *prev;
};
class linked_list{
    private:
        node *head; 
        node *tail;
        int size;
    public:
    linked_list(){
        head=NULL;
        tail=NULL;
        size = 0;
    }
    void add_node(int n){
        node *temp = new node;
        temp->data = n;
        temp->next = NULL;
        if(head==NULL){
            head = temp;
            tail = temp;
        }else{
            temp->next = head;
            head = temp;
        }
        if(size>0){
            (temp->next)->prev = temp;
        }
        size++;
    }
    void delete_node(int n){
        if(size==0) return;
        node *curr = head;
        node *prev=head;
        if(size==1 && head->data==n){
        	head=NULL;
        	tail=NULL;
        	return;
        }
        while(true){
        	if(curr->next == NULL && curr->data != n){
        		break;
        	}
            if(curr->data == n){
                if(curr == head){
                    head = head->next;
                    break;
                }else{
                	if(curr->next==NULL){
                		tail = prev;
                	}else{
                		(curr->next)->prev = prev;
                	}
                    prev->next = curr->next;
                    break;
                }
            }else{
            	prev = curr;
                curr = curr->next;
            }
            
        }
        size--;
    }
    void delete_first(){
    	if(size==1){
        	head=NULL;
        	tail=NULL;
        }else{
	        if(size==0) return;
	        head = head->next;	
        }
        size--;
    }
    
    void delete_last(){
        // if(size==0) return;
        // node *curr = head;
        // node *prev=head;
        // if(size==1){
        // 	head=NULL;
        // 	tail=NULL;
        // }else{
	       // while(true){
	       //     if(curr==tail){
	       //         tail = prev;
	       //         prev->next = NULL;
	       //         break;
	       //     }
	       //     prev = curr;
	       //     curr = curr->next;
	       // }	
        // }
        if(size==1){
        	head=NULL;
        	tail=NULL;
        }else{
	        if(size==0) return;

	        tail = tail->prev;	
	        tail->next = NULL;
        }
        size--;
    }
    
    void print(){
        node *temp = head;
        while(temp != NULL){
            cout << temp->data << " \n"[temp==tail];
            temp = temp->next;
        }
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
	int temp;
	cin >>temp;
    string command;
    int n;
    linked_list a;
    while(cin >> command){
        if(command=="insert"){
            cin >> n;
            a.add_node(n);
        }else if(command=="delete"){
            cin >> n;
            a.delete_node(n);
        }else if(command=="deleteFirst"){
            a.delete_first();
        }else{
            a.delete_last();
        }
    }
    a.print();

    return 0;
}




Measured memory_bytes: 37544
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 500;
const int INF = (int)1e9 + 7;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int n, ma, mb; cin >> n >> ma >> mb;
    vector<vector<int>> dp(MAX, vector<int>(MAX, INF));
    dp[0][0] = 0;
    while (n--) {
        int a, b, c; cin >> a >> b >> c;
        for (int na = MAX - 1; na >= a; na--) {
            for (int nb = MAX - 1; nb >= b; nb--) {
                chmin(dp[na][nb], dp[na - a][nb - b] + c);
            }
        }
    }
    int ans = INF;
    for (int a = 1; a < MAX; a++) for (int b = 1; b < MAX; b++) {
        if (a * mb == b * ma) chmin(ans, dp[a][b]);
    }
    if (ans == INF) {
        cout << -1 << endl;
    } else {
        cout << ans << endl;
    }
    return 0;
}

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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(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) int(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>>;

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 = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;

class UnionFind{
private:
  vector<ll> Parent; 
 public:
  UnionFind(ll N){
    Parent = vector<ll>(N, -1);
  }
  
  ll root(ll A){
    if(Parent[A] < 0) return A;
    return Parent[A] = root(Parent[A]);
  }
  
  ll size(ll A){
    return -Parent[root(A)]; 
  }
  
  bool connect(ll A, ll B){
    A = root(A);
    B = root(B);
    if(A == B){
      return false;
    }
    if(size(A) < size(B)) swap(A, B);
    Parent[A] += Parent[B];
    Parent[B] = A;
    return true;
  }
  
  bool isSame(ll A, ll B){
    return root(A) == root(B);
  }
};

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n,m; cin>>n>>m;
  UnionFind uf(n);
  rep(i,m){
    ll a,b,z; cin>>a>>b>>z;
    a--,b--;
    uf.connect(a,b);
  }
  ll ans=0;
  set<ll> s;
  rep(i,n){
    if(s.count(uf.root(i))) continue;
    ans++;
    s.insert(uf.root(i));
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 5760
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
  ifstream ifs("in.txt");
  cin.rdbuf(ifs.rdbuf());
#endif
  int N;
  while (cin >> N) {
    vector<int> A(N);
    for (auto& x : A) cin >> x;
    A.insert(A.begin(), 0);
    ++N;
    auto cost = [&](int i, int j) {
      return abs(A[j] - A[i]);
    };
    ll sum = 0;
    for (int i = 0; i < N; i++) {
      sum += cost(i, (i + 1) % N);
    }
    for (int i = 1; i < N; i++) {
      int pre = i - 1;
      int cur = i;
      int nxt = (i + 1) % N;
      ll res = sum;
      res -= cost(pre, cur);
      res -= cost(cur, nxt);
      res += cost(pre, nxt);
      cout << res << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 1656
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <numeric>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string>

using namespace std;

typedef long long ll;
typedef pair<int, int> p_i;

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
#define vec_all(vec) vec.begin(), vec.end()

// vectorデバッグ
template <typename T>
void dump_vec(vector<T> vec)
{
    rep(i, vec.size())
    {
        cout << vec[i] << endl;
    }
}

p_i add_point(p_i p1, p_i p2) {
    return p_i(p1.first + p2.first, p1.second + p2.second);
}

bool valid_point(p_i p, int height, int width) {
    int x = p.first;
    int y = p.second;

    return x >= 0 && x < width && y >= 0 && y < height;
}

int main()
{
    const int INF = 100000;
    vector<p_i> d_point;
    d_point.push_back(p_i(1, 0));
    d_point.push_back(p_i(0, 1));
    d_point.push_back(p_i(-1, 0));
    d_point.push_back(p_i(0, -1));

    int h, w;
    cin >> h >> w;

    vector<string> map(h);
    rep(i, h) {
        cin >> map[i];
    }

    vector<vector<int>> distances(h, vector<int>(w, -1));
    int wall_count = 0;
    rep(i, h) {
        rep(j, w) {
            if (map[i][j] == '#') {
                wall_count++;
                distances.at(i).at(j) = INF;
            }
        }
    }

    p_i point = p_i(0, 0);
    distances.at(0).at(0) = 0;
    int current_distance;
    queue<p_i> que;

    que.push(point);
    
    p_i tmp_point;
    int x;
    int y;
    while (que.size() != 0) {
        point = que.front();
        que.pop();
        current_distance = distances.at(point.second).at(point.first);
        rep(i, 4) {
            tmp_point = add_point(point, d_point[i]);
            x = tmp_point.first;
            y = tmp_point.second;
            if (valid_point(tmp_point, h, w) && map[y][x] != '#' && distances.at(y).at(x) == -1) {
                distances.at(y).at(x) = (current_distance + 1);
                que.push(tmp_point);
            }
        }
    }

    if (distances.at(h - 1).at(w - 1) != -1) {
        cout << h * w - distances.at(h - 1).at(w - 1) - wall_count - 1 << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}

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

int main(void) {
    int k; cin >> k;
    vector<ll> a;
    for(int i = 1; i <=9; i++) a.push_back(i);

    while(1) {
        if(a.size()>=k) {
            cout << a[k-1] << endl;
            return 0;
        }
        k -= a.size();
        vector<ll> old;
        swap(a,old);
        for(ll v : old) {
            int x = v % 10;
            for(int p = -1; p <= 1; p++) {
                int add = x + p;
                if(add < 0 || add > 9) continue;
                ll newa = v * 10 + add;
                a.push_back(newa);
            }
        }
    }
    return 0;
}


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

 using namespace std;
 using ll = long long;
 
 #define global extern
 #define inf (int)1e9
 #define odd(x) x&1
 #define pow2(x) 1 << x
 #define log2bin(x) 32-__builtin_clz(x)-1
 #define popcnt(x) __builtin_popcount(x)
 #define mod7(x) x%1000000007
 #define $ <<'  '<<

 #define cinarr(A,len) for(int i=0;i<len;i++){cin>>A[i];}
 #define coutarr(A,len) for(int i=0;i<len;i++){cout<<A[i]<<' ';}cout<<endl
 #define coutin(V) for(auto& i : V){cout << i << ' ';}cout<<endl // for vect and set
 #define coutmap(U) for(auto& i : U){cout << i.first << "->" << i.second << ' ';}cout<<endl // for map

 // ==== fast function ====
 /*
 bool prime(long long n){ const long long sqrtn = floor(sqrt(n)); if(n!=2 && n&1^1){return false;} for(long long i = sqrtn; i>=3; i-=2){ if(n%i==0){ return false;} } return true;}
 long long fastexp(long long base, long long pwr){ if(!pwr || !base)return 0; if(n&1^1){return fastexp(a*a, b/2);}else{return a*fastexp(a*a, b/2);}}
 */
 
/*========================================================================*/
/* strategi/note:

dp[i][w] denotes max value pada progress pengambilan ke-i, dengan progress weight w

/================================*/

int n, maxW;

long long knap(int W[], int V[]){
    long long dp[n+1][maxW+1]; 

    // from gfg
    dp[0][0] = 0;
    for (int w = 1; w<=maxW; w++){
        dp[0][w] = 0;
    }
    for (int i = 1; i<=n; i++){
        dp[i][0] = 0;
    }
    for (int i = 1; i<=n; i++) { 
        for (int w = 1; w<=maxW; w++) { 
            if(W[i-1] <= w){
                dp[i][w] = max(V[i-1]+dp[i-1][w-W[i-1]] ,  dp[i-1][w]); // pilih nggak
            }
            else{
                dp[i][w] = dp[i-1][w]; 
            }
        } 
    } 
  
    return dp[n][maxW]; 
}

void solve(){
    cin >> n >> maxW;
    
    int W[n];
    int V[n];
    
    for(int i = 0; i<n; i++){
        cin >> W[i] >> V[i];
    }
    
    cout << knap(W,V) << endl;
    

}

int main(){
     ios_base::sync_with_stdio(0);
     cin.tie(0);
     //cout.setprecision( ) // iomanip **

	solve();
//	int t;cin>>t;while(t--){solve();}
//	int t;cin>>t;((int))* ans=new ((int))[(( ))];solve();((int)) in;while(t--){cin>>in;cout<<ans[in-(( )) ];}delete[] ans;

	 //cout.flush(); cin.get();
     return 0;
}


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

int main() {
	int a,b;
	cin >> a >> b;
	if( a > b ) {
		cout << "a > b" << endl;
	} else if( a < b ) {
		cout << "a < b" << endl;
	} else {
		cout << "a == b" << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
program linear_approximation
  implicit none
  integer :: n, a(200000) = 0, i
  read(*,*) n
  read(*,*) a(1:n)
  do i = 1, n
    a(i) = a(i)-i
  end do
  call quick_sort(a(1:n))
  if (mod(n,2) == 0) then
    write(*,'(i0)') min(sum(int(abs(a(1:n)-a(n/2)),8)),sum(int(abs(a(1:n)-a(n/2+1)),8)))
  else
    write(*,'(i0)') sum(int(abs(a(1:n)-a((n+1)/2)),8))
  end if
contains
  recursive subroutine quick_sort(a)
    integer, intent(inout) :: a(:)
    integer :: n, l, r, m
    integer :: p
    n = size(a)
    l = 1
    r = n
    m = (n+1)/2
    p = a(l)+a(m)+a(r)-max(a(l),a(m),a(r))-min(a(l),a(m),a(r))
    do
      do while (a(l) < p)
        l = l+1
      end do
      do while (a(r) > p)
        r = r-1
      end do
      if (l >= r) exit
      a(l) = xor(a(l),a(r))
      a(r) = xor(a(l),a(r))
      a(l) = xor(a(l),a(r))
      l = l+1
      r = r-1
    end do
    if (l-1 > 1) call quick_sort(a(1:l-1))
    if (n > r+1) call quick_sort(a(r+1:n))
  end
end program linear_approximation

Measured memory_bytes: 1536
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(int argc, const char * argv[]) {
    string pattern[] = {"remaerd", "resare", "maerd", "esare"};
    string S;
    cin >> S;
    //Sを反転
    reverse(S.begin(), S.end());
    cout << S.substr(S.length(),-5);
    int temp = 0;
    
    bool possible = true;
    while(temp < S.length()){
        bool clear = false;
        for(auto p:pattern){
            string t = S.substr(temp,p.length());
            if(t == p){
                temp += p.length();
                clear = true;
                break;
            }
        }
        if(!clear){ possible = false; break;}
    }
    
    if(possible) cout << "YES";
    else cout << "NO";
    return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;

using ll = long long;
using ld = long double;
const int INF = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

const string YES = "Yes";
const string NO = "No";

int main()
{
  long long A;
  scanf("%lld", &A);
  long long B;
  scanf("%lld", &B);
  long long C;
  scanf("%lld", &C);
  long long K;
  scanf("%lld", &K);

  int cnt = 0;
  while (A >= B)
  {
    B *= 2;
    cnt++;
  }
  while (B >= C)
  {
    C *= 2;
    cnt++;
  }
  if (cnt <= K)
    cout << YES << endl;
  else
    cout << NO << endl;

  return 0;
}


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

int main() {
	int N = 0;
	int A[1000] = { 0 };
	int X[1000] = { 0 };
	int M = 0;

	cin >> N;
	for (int i= 0; i < N; i++) {
		cin >> X[i];
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < M; i++) {
			if (X[A[i]-1] + 1 == X[A[i]]||X[A[i]-1]==2019) {

			}
			else {
				X[A[i]-1] += 1;
			}
	}

	for (int i = 0; i < N; i++) {
		cout << X[i] << endl;
	}


}


Measured memory_bytes: 3108
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String[] sp = new String[n];

            for (int i = 0; i < n; i++) {
                sp[i] = in.next() + "," + (1100 - Integer.parseInt(in.next())) + "," + (i + 1);
            }

            Arrays.sort(sp);

            for (String s : sp) {
                String ans = s.split(",")[2];

                // 出力
                out.println(ans);
            }

        }

    }
}



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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

int64 dfs(int64 n, int64 k) {
  if (n == 1) return 0;
  return (dfs(n-1, k) + k) % n;
}

int main(void) {
  int64 n, k, m;
  while (cin >> n >> k >> m && n + k + m) {
     cout << ((dfs(n-1, k) + m) % n)+1<< endl;
  }
}



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


void solve(long long K){
    long long sum = 0;
    rep(i,K){
        rep(j,K){
            rep(k, K){
                sum += __gcd(i, __gcd(j, k));
            }
        }
    }
    cout << sum << endl;
}

int main(){
    long long K;
    scanf("%lld",&K);
    solve(K);
    return 0;
}


Measured memory_bytes: 3764
#include <iostream>
#include <algorithm>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	ll x,y,a,b,c;
	cin >> x >> y >> a >> b >> c;
	ll p[a],q[b],r[c];
	rep(i,a)cin>>p[i];
	rep(i,b)cin>>q[i];
	rep(i,c)cin>>r[i];
	sort(p,p+a);
	sort(q,q+b);
	sort(r,r+c);
	ll a_=a-1,b_=b-1,c_=c-1,a_count=0,b_count=0,c_count=0,sum=0;
	while(a_count<x && b_count<y && a_count+b_count+c_count<x+y){
      	ll max_ = max(p[a_],max(q[b_],r[c_]));
		if(max_==p[a_]){
				sum+=p[a_];
				a_--;
				a_count++;
        }else if(max_==q[b_]){
				sum+=q[b_];
				b_--;
				b_count++;
    	}else{
				sum+=r[c_];
				c_--;
				c_count++;
		}
	}
	if(a_count==x){
		while(a_count+b_count+c_count<x+y){
          	ll max_ = max(q[b_],r[c_]);
			if(max_==q[b_]){
				sum+=q[b_];
				b_--;
				b_count++;
            }else{
				sum+=r[c_];
				c_--;
				c_count++;
			}
		}
	}else if(b_count==y){
		while(a_count+b_count+c_count<x+y){
          ll max_ = max(p[a_],r[c_]);
			if(max_==p[a_]){
				sum+=p[a_];
				a_--;
				a_count++;
            }else{
				sum+=r[c_];
				c_--;
				c_count++;
			}
		}
	}
	cout << sum << endl;
	
}

Measured memory_bytes: 2560
#include <iostream>

#define INF 1e9;

int N;
int dp[100001];

int main() {
  std::cin>>N;
  for (int i = 0; i <= N; ++i)
    dp[i] = INF;
  dp[0] = 0;
  for (int i = 1; i <= N; ++i) {
    dp[i] = std::min(dp[i], dp[i-1] + 1);
    int d6 = 1;
    while (6*d6 <= i) {
      d6 *= 6;
      dp[i] = std::min(dp[i], dp[i-d6]+1);
    }
    int d9 = 1;
    while (9*d9 <= i) {
      d9 *= 9;
      dp[i] = std::min(dp[i], dp[i-d9]+1);
    }
  }
  std::cout<<dp[N]<<"\n";

  return 0;
}


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

using namespace std;

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

const ll N = 1005;
const ll INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-7;
const double PI = acos(-1.0);

ll h, w, dp[N][N];
char grid[N][N];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	cin >> h >> w;

	for(int i = 0; i < h; i++)
		for(int j = 0; j < w; j++)
			cin >> grid[i][j];

	dp[0][0] = 1;
	for(int i = 0; i < h; i++)
		for(int j = 0; j < w; j++) {
			if(grid[i][j] == '.') {
				if(j > 0)
					dp[i][j] = dp[i][j - 1] % MOD;
				if(i > 0)
					dp[i][j] = (dp[i][j] + dp[i - 1][j]) % MOD;
			}
		}

	cout << dp[h - 1][w - 1] << endl;
}




Measured memory_bytes: 9088
class Sai():
    def __init__(self, m1, m2, m3, m4, m5, m6):
        self.t = m1
        self.s = m2
        self.e = m3
        self.w = m4
        self.n = m5
        self.b = m6
    def furu(self, arg):
        if arg == 'N':
            tmp = self.s
            self.s = self.b
            self.b = self.n
            self.n = self.t
            self.t = tmp
        elif arg == 'S':
            tmp = self.n
            self.n = self.b
            self.b = self.s
            self.s = self.t
            self.t = tmp
        elif arg == 'W':
            tmp = self.e
            self.e = self.b
            self.b = self.w
            self.w = self.t
            self.t = tmp
        else:
            tmp = self.w
            self.w = self.b
            self.b = self.e
            self.e = self.t
            self.t = tmp

s = list(map(int, input().split()))
c = input()
sai = Sai(s[0], s[1], s[2], s[3], s[4], s[5])
for i in c:
    sai.furu(i)
    
print(sai.t)


Measured memory_bytes: 5604
# 2019/06/07
# AtCoder Beginner Contest 104 - B

# Input
s = input()

# Check 1-2
if s[0] == "A" and s[1].islower() == True and s[len(s)-1].islower() == True:
    ccnt = 0
    bflg = False
    for i in range(2, len(s)-1):
        if s[i] == "C":
            ccnt += 1
        elif s[i].islower() == False:
            bflg = True
            break
        if bflg == False and ccnt == 1:
            ans = "AC"
        else:
            ans = "WA"
else:
    ans = "WA"

# Output
print(ans)


Measured memory_bytes: 3060
n, w = map(int, input().split())
v = [0] * n
we = [0] * n

for i in range(n):
    v[i], we[i] = map(int, input().split())

dp = [[0 for i in range(w + 1)] for j in range(n + 1)]

for i in range(n):
    for j in range(w + 1):
        if j >= we[i]:
            dp[i + 1][j] = max(dp[i][j - we[i]] + v[i], dp[i][j])
        else:
            dp[i + 1][j] = dp[i][j]

print(dp[n][w])


Measured memory_bytes: 42264
/**
 *   author: sahushivam
 *   created: 08 December 2019 (Sunday)  17:29:28
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,a,b) for(int i = a; i<b; i++)
#define MOD 1000000007
#define INF 1e18
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define int long long

signed main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int t=1;
    int a,b,c; cin>>a>>b>>c;
    if(a+b+c >=22) cout<<"bust\n";
    else cout<<"win";	
return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
 
#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
 
signed main() {
    IOS;
    #ifdef LOCAL
        freopen("input.txt","r", stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n;  cin >> n;
    cout << n*n*n;   
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sq(n) ((n)*(n))
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define MEMSET(a) memset(a,0,sizeof(a))
using namespace std;

int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a==b)cout<<c<<'\n';
	else if(a==c)cout<<b<<'\n';
	else cout<<a<<'\n';
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cstdlib>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
    int n;
    int ans = 0;
    vector<string> s;
    cin >> n;
    rep(i, n) {
        string input;
        cin >> input;
        s.push_back(input);
    }
    sort(s.begin(), s.end());
    string prev = "";
    rep(i, n) {
        if (s[i] != prev) {
            prev = s[i];
            ans++;
        } 
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 11604
#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
 

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

  bool flg=false;
  for(int i=1;i<=1000000;i++)
  if( (a*i)%b==c ){
    flg=true;
  }

  if(flg)
    cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;

	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <list>
#include <string>
using namespace std;

int main() {
	int N;
	cin >> N;
	while (N--) {
		string str;
		cin >> str;

		list<char> dt;
		list<char>::iterator it = dt.begin();
		bool r;
		dt.push_back(str[0]); it++;
		for (int i=1; i<str.size(); i++)
			if (i%3==0)
				if (r) {
					if (it == --dt.end()) dt.push_back(str[i]);
					it++;
				} else { 
					if (it == dt.begin()) dt.push_front(str[i]);
					it--;
				}
			else
				r = (str[i++]=='-') ? true : false;

		it = dt.begin();
		while (it != dt.end())
			cout << *(it++);
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>

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

struct StCoCo {
  vector<vector<int>> g, rev_g, h;
  vector<int> seen, ord, root;

  StCoCo(vector<vector<int>> &g) : g(g) {
    auto n = g.size();
    rev_g.resize(n);
    seen.resize(n, false);
    root.resize(n, -1);
  }
  int operator[](int i) { return root[i]; }
  void dfs(int i) {
    if (not seen[i]) {
      seen[i] = true;
      for (auto j : g[i]) {
        dfs(j);
      }
      ord.push_back(i);
    }
  }
  void rev_dfs(int i, int rt) {
    if (root[i] < 0) {
      root[i] = rt;
      for (auto j : rev_g[i]) {
        rev_dfs(j, rt);
      }
    }
  }
  vector<vector<int>> build() {
    // Kosaraju
    rep(i, g.size()) for (int j : g[i]) rev_g[j].push_back(i); // 逆辺を張る
    rep(i, g.size()) dfs(i);
    reverse(ord.begin(), ord.end());
    int sz = 0; // 圧縮後のグラフの頂点数
    for (auto i : ord) {
      if (root[i] < 0) rev_dfs(i, sz++);
    }
    h.resize(sz);
    rep(i, g.size()) for (auto j : g[i]) {
      int _i = root[i], _j = root[j];    // 連結成分の代表元
      if (_i != _j) h[_i].push_back(_j); // 多重辺もありうる
    }
    return h;
  }
};

int main() {

  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n);
  rep(i, m) {
    int s, t;
    cin >> s >> t;
    g[s].emplace_back(t);
  }
  StCoCo scc(g);
  scc.build();
  int q;
  cin >> q;
  while (q--) {
    int u, v;
    cin >> u >> v;
    cout << (scc[u] == scc[v]) << endl;
  }
  return 0;
}



Measured memory_bytes: 5080
import java.util.Scanner;

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

		if (A > 8 || B > 8) {
			System.out.println(":(");
		} else {
			System.out.println("Yay!");
		}
		sc.close();

	}

}

Measured memory_bytes: 21588
#include <iostream>
using namespace std;
 
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  string ans = "No";
  if (a == b && a != c) ans = "Yes";
  if (a == c && a != b) ans = "Yes";
  if (b == c && b != a) ans = "Yes";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInteger = readLn :: IO Integer
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readIntegers = map ( fst . fromJust . B.readInteger ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

modifyArray a i f = writeArray a i =<< f <$> readArray a i

main = do
	[ a, b, c, d ] <- readInts
	putStrLn $ which "Yes" "No" $ solve a b c d 0

solve a b c d t
	| a <= 0 = False
	| c <= 0 = True
	| otherwise = solve a' b c' d ( succ t )
	where
		a' = if odd t then a - d else a
		c' = if even t then c - b else c

Measured memory_bytes: 3752
#define y1 askjdkasldjlkasd
#include <bits/stdc++.h>
#undef y1

using namespace std;

#define pb push_back
#define mp make_pair
#define fi(a, b) for(int i=a; i<=b; i++)
#define fj(a, b) for(int j=a; j<=b; j++)
#define fo(a, b) for(int o=a; o<=b; o++)
#define fdi(a, b) for(int i=a; i>=b; i--)
#define fdj(a, b) for(int j=a; j>=b; j--)
#define fdo(a, b) for(int o=a; o>=b; o--)
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;

#ifdef LOCAL
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...) while (0)
#endif

double START_TIME;

void exit() {
#ifdef LOCAL	
	cerr << "TIME: " << setprecision(5) << fixed << (clock() - START_TIME) / CLOCKS_PER_SEC << endl;
#endif	
	exit(0);
}

template<typename A, typename B>
ostream& operator<<(ostream& os, pair<A, B> p) {
	os << "(" << p.first << ", " << p.second << ")";
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, vector<T> v) {
	fi(0, sz(v) - 1) {
		os << v[i] << " ";
	}
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T> t) {
	for (auto z : t) {
		os << z << " ";
	}
	return os;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
	cerr << endl;
	for (auto z : t) {
		os << "\t" << z.first << " -> " << z.second << endl;
	}
	return os;
}

#ifdef LOCAL
#define dbg(x) {cerr << __LINE__ << "\t" << #x << ": " << x << endl;}
#define dbg0(x, n) {cerr << __LINE__ << "\t" << #x << ": "; for (int ABC = 0; ABC < n; ABC++) cerr << x[ABC] << ' '; cerr << endl;}
#else
#define dbg(x) while(0){}
#define dbg0(x, n) while(0){}
#endif

#ifdef LOCAL
#define ass(x) if (!(x)) { cerr << __LINE__ << "\tassertion failed: " << #x << endl, abort(); }
#else
#define ass(x) assert(x)
#endif

///////////////////////////////////////////////////

int a[41];
int b[41];
int n;

ll ans;

vi l[2];

const int MAX = 25 * 1000 * 1000 + 41;
const ll INF = 1e18 + 41;

ll d[MAX];

void solve () {	
	ans = n;
	fi(0, 2) {
		if (a[i] < b[i]) {
			l[0].pb(i);
		} else if (b[i] < a[i]) {
			l[1].pb(i);
		}
	}
	fi(0, 2) {
		if (a[i] > b[i]) swap(a[i], b[i]);
	}

	ans = n;
	fo(0, 1) {
		if (sz(l[o]) == 0) continue;		
		fill_n(&d[0], MAX, -INF);
		d[ans] = 0;
		fdi(ans, 0) {
			for (int id : l[o]) {
				if (i >= a[id]) {
					d[i - a[id]] = max(d[i - a[id]], d[i] + b[id]);
				}
			}
		}		
		fi(0, MAX - 1) ans = max(ans, d[i] + i);
	}
	
	printf("%lld\n", ans);
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	START_TIME = (double)clock();
#endif
	
	scanf("%d", &n);
	fi(0, 2) scanf("%d", &a[i]);
	fi(0, 2) scanf("%d", &b[i]);
	solve();

	exit();
	return 0;
}





Measured memory_bytes: 195584
#include <iostream>
#include <unordered_set>

using namespace std;

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

	unordered_set<long long> set;

	long long n,a;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		cin >> a;
		if (!set.insert(a).second)
		{
			set.erase(a);
		}
	}
	cout << set.size() << endl;
}

Measured memory_bytes: 4388
inp1 = input()
inp1 = list(inp1)
inp2 = input()
inp2 = int(inp2)

ans = 1
count = 0
for i in inp1:
    if i != '1':
        ans = int(i)
        break
    else:
        count += 1

if count >= inp2:
    ans = 1

print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}

//combination(Nが小さい時はこれを使う)
const int MAX = 330000;
int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
int COMB(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;
}

bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

//debug処理
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int n;
int count(int p) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(p); i++) {
		if (p % i == 0 && i * i != p)cnt += 2;
		else if (p % i == 0)cnt++;
	}
	return cnt;
}
signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << c << " " << a << " " << b << endl;
	ggr
}


Measured memory_bytes: 256
import java.util.Scanner;

/**
 * https://abc053.contest.atcoder.jp/tasks/arc068_a
 */
public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		sc.close();
		
		long ans = (x/11)*2;
		long mod = x%11;
		if(mod>0){
			if(mod>6){
				ans+=2;
			}else{
				ans++;
			}
		}
		
		System.out.println(ans);

	}

}


Measured memory_bytes: 21844
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;

int n;
int x[25],y[25],r[25],c[25];
int cover[25];
bool use[25];
int cnt,comb,a,b;
int m,ans;

double dis(int i,int j){
  return sqrt( (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j]) * (y[i]-y[j]) );
}

void cov(int a){
  cover[a] = -1;
  for(int j=a-1;j>=0;j--){
    if(dis(a,j)<r[a]+r[j] && !use[j]){
      cover[a] = j;
      break;
    }
  }
} 

  
void rec(void){
  int cnt;
  for(int i=1;i<=4;i++){
    cnt = 0;
    for(int j=0;j<n;j++){
      if(!use[j] && (cover[j]<0 || use[cover[j]]) && c[j] == i)cnt++;
    }
    if(cnt==6){
      for(int j=0;j<n;j++){
	if(c[j] == i)use[j] = true;
      }
      for(int j=0;j<n;j++)cov(j);

      ans += 6;
      m = max(m,ans);
      rec();
      ans -= 6;

      for(int j=0;j<n;j++){
	if(c[j] == i)use[j] = false;
      }
      for(int j=0;j<n;j++)cov(j);
    }else{
      for(int j=0;j<n;j++){
	if(!use[j] && cover[j]<0 && c[j] == i){
	  for(int k=j+1;k<n;k++){
	    if(!use[k] && cover[k]<0 && c[k] == i){
	      use[j] = true;
	      use[k] = true;
	      for(int l=0;l<n;l++)cov(l);
	      
	      ans += 2;
	      m = max(m,ans);
	      rec();
	      ans -= 2;
	      
	      use[j] = false;
	      use[k] = false;
	      for(int l=0;l<n;l++)cov(l);
	    }
	  }
	}
      }
    }
  }
}



int main(){
  while(1){
    cin >> n;
    if(!n)break;

    for(int i=0;i<n;i++)cin >> x[i] >> y[i] >> r[i] >> c[i];

    for(int i=0;i<n;i++)cov(i);
    
    for(int i=0;i<n;i++)use[i] = false;

    m = 0;
    ans = 0;
    rec();

    cout << m << endl;
  }
}

Measured memory_bytes: 868
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

using namespace std;

int main() {
   
    int n;
    long long a,b;
    cin >> n >> a >> b;
    static const int N = n;
    long long t[N];
    for (int i=0;i<N;i++){
        cin >> t[i];
    }
    for (int i=0;i<N;i++){
        if(t[i] >= a and t[i] < b){
            n -= 1;
        }
    }
    cout << n << endl;

}

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

public static class Bits
{
    public static int PopCount(int bits)
    {
        bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
        bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
        bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
        bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
        return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff);
    }
}

public struct Person
{
    public int Honests;
    public int Unkinds;

    public Person(int honests, int unkinds)
    {
        Honests = honests;
        Unkinds = unkinds;
    }
}

public class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var persons = new Person[N];
        for (int i = 0; i < N; i++)
        {
            var A = int.Parse(Console.ReadLine());
            var honests = 0;
            var unkinds = 0;
            for (int j = 0; j < A; j++)
            {
                var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                var x = vals[0];
                var y = vals[1];
                if (y == 1)
                {
                    honests |= 1 << (x - 1);
                }
                else
                {
                    unkinds |= 1 << (x - 1);
                }
            }
            persons[i] = new Person(honests, unkinds);
        }

        var max = 0;
        var mask = (1 << N) - 1;
        for (int pattern = 0; pattern < (1 << N); pattern++)
        {
            bool ok = true;
            for (int i = 0; i < N; i++)
            {
                if (((1 << i) & pattern) == 0)
                {
                    continue;
                }
                var person = persons[i];
                if ((person.Honests & pattern) != person.Honests)
                {
                    ok = false;
                    break;
                }
                if ((person.Unkinds & (mask ^ pattern)) != person.Unkinds)
                {
                    ok = false;
                    break;
                }
            }
            if (ok)
            {
                max = Math.Max(Bits.PopCount(pattern), max);
            }
        }

        Console.WriteLine(max);
    }
}


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

using namespace std;

template <class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')
    cerr<<*sdbg++;
  cerr<<"="<<h<<","; 
  _dbg(sdbg+1, a...);
}

template<class T> ostream & operator<<(ostream & os, vector<T> V){
  os<<"[";
  for(auto vv: V) os << vv <<",";
  return os << "]";
}
template<class L, class R> ostream & operator <<(ostream & os, pair<L,R> P){
  return os <<"("<<P.first <<","<<P.second <<")";
}

#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int N = 10000005;

int n;
int cnt[N];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        for (int j = i; j <= n; j += i) {
            cnt[j]++;
        }
    }
    
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
        ans += (long long)i * cnt[i];
    }
    
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 42872
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N;
    string S;
    cin >> N >> S;
    
    if (N%2 == 1) {
        cout << "No" << endl;
        return 0;
    }
    
    for (int n = 0; n < N/2; ++n) {
        if (S[n] != S[N/2+n]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
#include "stdio.h"

int main()
{
	int a,b,sol;
	char op;
	for(;;){
		scanf("%d %s %d", &a, &op, &b);
		if(op=='?'){break;}
		else if(op=='+'){printf("%d\n",a+b);}
		else if(op=='-'){printf("%d\n",a-b);}
		else if(op=='*'){printf("%d\n",a*b);}
		else if(op=='/'){printf("%d\n",a/b);}
		else {break;}
	}
	return 0;
}

Measured memory_bytes: 600
N = int(input())
x = list(map(int, input().split()))
mod = 10 ** 9 + 7

k = 0
ans = 1
for i in range(N):
    free = x[i] - (k * 2 + 1)
    if free >= 0:
        k += 1
    else:
        ans = (ans * (k + 1)) % mod
for i in range(1, k + 1):
    ans = (ans * i) % mod
print(ans)


Measured memory_bytes: 62704