akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ALL(a) begin(a),end(a)
#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v) {
  for (T& x: v) s >> x;
  return s;
}
inline void Yes(bool f=true){cout<<(f?"Yes":"No")<<endl;}
inline void YES(bool f=true){cout<<(f?"YES":"NO")<<endl;}
#define ANS(a) cout<<a<<endl

int digit_sum(int n) {
    int s = 0;
    while (n != 0) s+=n%10,n/=10;
    return s;
}

int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    //cout<<std::fixed<<std::setprecision(10);

    string s; cin>>s;
    string ans;
    for (auto c: s) {
        if (c=='B') {
            if (ans.size())
                ans.pop_back();
        } else {
            ans.push_back(c);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long int LLI;
int main()
{
	LLI n, a, b, save;
	cin >> n >> a >> b;
	
	LLI first, second, ans = 0;
	cin >> first >> second;
	save = ( second - first ) * a;
	if( save > b )
	    ans += b;
	else
	    ans += save;
	first = second;
	
	for(int i = 2; i < n; i++)
	{
		cin >> second;
	    save = ( second - first ) * a;
		if( save > b )
	    	ans += b;
	 	else
	    	ans += save;
		first = second;
	}
	cout << ans;
}

Measured memory_bytes: 3144
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>
#include <stack>
#include <bitset>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

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

const int MAX = 1000001;

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

// 二項係数計算
long long COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}




ll tmp[30];
map<string, ll> mp;

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

  
  int n;
  cin >> n;
  vector<string> s(n);  
  REP(i,n) cin >> s[i];
  
  
  
  /*
  int n = 100000;
  vector<string> s(n);
  REP(i,n) s[i] = "ab";  
  */
  ll ans = 0LL;
  
  COMinit();
  
  REP(i, n){
    ll tmp[30];
    REP(j, 30) tmp[j] = 0;
    
    REP(j, s[i].size()){
      tmp[s[i][j]-'a']++;      
    }
    string val = "";	
    REP(k, 27) val += to_string(tmp[k]);    
    mp[val]++;
    //cerr << val << endl;
  }
  
  for(auto &e: mp){
    //cerr << e.second << endl;
    if(e.second == 1) continue;
    
    if(e.second > 1e4) {
      if(e.second % 2 == 0){
	ll tmp = e.second/2;      
	ans += tmp*(e.second-1);
      }
      else {
	ll tmp = (e.second-1)/2;      
	ans += tmp*(e.second);	
      }
    }
    else {
      ans += COM(e.second, 2);
    
    }
  }
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 43264
def a1(li):
    if 100 in li: return 1
    else: return 0

def a2(li):
    if (li[0]+li[1])/2>=90: return 1
    else: return 0

def a3(li):
    if sum(li)/3>=80: return 1
    else: return 0

def isA(li):
    if a1(li) or a2(li) or a3(li): return 1
    else: 0

def b1(li):
    if sum(li)/3>=70: return 1
    else: return 0

def b2(li):
    if sum(li)/3>=50 and (li[0]>=80 or li[1]>=80):
        return 1
    else: return 0

def isB(li):
    if b1(li) or b2(li): return 1
    else: 0

def isX(li):
    if isA(li):
        return 'A'
    elif isB(li):
        return 'B'
    else:
        return 'C'

while True:
    N=int(input())
    if N==0: break
    for _ in range(N):
        l=list(map(int,input().split()))
        print(isX(l))


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

using namespace std;
#define INFS (1LL<<28)
#define INF (1LL<<60)
#define DEKAI 1000000007
#define lp(i,n) for(int i=0;i<n;i++)
#define int long long
#define double long double
#define all(n) n.begin(),n.end()



signed main(){
	int n;
	cin>>n;
	int ans=0;
	lp(z,1000){
		int i=z;
		if(i%10==0||i%10>n)continue;
		i/=10;
		if(i%10==0||i%10>n)continue;
		i/=10;
		if(i%10==0||i%10>n)continue;
		ans++;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
import sys

iT = int(input())
aR = [[int(x) for x in sLine.split()] for sLine in sys.stdin.readlines()]

def fGcd(iX,iY):
    while iY:
        iX,iY= iY,iX%iY
    return iX

#これものすごくわりきってるけど通るのか？

def fFunc(iA,iB,iC,iD):
    if iA < iB or iD < iB:
        return False
    elif iC >= iB :
        return True
    elif iC < iA % iB :
        return False
    elif iB -iC - 1 < fGcd(iB,iD) :
        return True
    else:
        return False

for eR in aR:
    if fFunc(*eR) :
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int n, k;
    cin >> n >> k;
    n -= k;
    int ans = 1;
    if (n <= 0) {
        cout << ans << endl;
        return 0;
    }
    ans += (n+k-1-1)/(k-1);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep_1(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define rep_2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

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

    int ans = 0;
    if( m == 1){
        ans += (n) * (n - 1) / 2;
    } else {
        ans += (n) * (n - 1) / 2 + (m) * (m - 1) / 2;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import math
a, b, h, m = list(map(int, input().split()))
PI = math.pi
# print(a*math.sin(2*PI*h/12 + 2*PI*m/12/60), a*math.cos(2*PI*h/12))
# print(b*math.sin(2*PI*m/60 + 2*PI*m/12/60), b*math.cos(2*PI*m/60))
dx = a*math.sin(2*PI*h/12 + 2*PI*m/12/60) - b*math.sin(2*PI*m/60)
dy = a*math.cos(2*PI*h/12 + 2*PI*m/12/60) - b*math.cos(2*PI*m/60)
print((dx**2 + dy**2)**(0.5))


Measured memory_bytes: 62272
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//const int mod = 1e9+7;
ll a, b, c, k;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

bool solve() {
    int mab = a / b + (a % b != 0);
    bool flag = false;
    if(b <= a) {
        for(int i = 1; i <= k; i ++) {
            if((1 << i) > mab || (1 << i) == mab && a % b != 0) {
                k -= i;
                b *= (1 << i);
                flag = true;
                if (k < 0) return false;
                break;
            }
        }
    } else flag = true;
    if(!flag) return false;
    flag = false;
    int mbc = b / c + (b % c != 0);
    //cout << b << " " << c <<" " <<mbc << endl;
    if(c <= b) {
        for(int i = 1; i <= k; i ++) {
            if((1 << i) > mbc || (1 << i) == mbc && b % c != 0) {
                k -= i;
                c *= (1 << i);
                flag = true;
                if (k < 0) return false;
                break;
            }
        }
    } else flag = true;
    
    return flag;
}

int main() {
    quickread();
    cin >> a >> b >> c >> k;
    if (solve()) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

int main(){
    int n,t,a;
    cin>>n>>t>>a;
    int h,ans=-1;
    double san=100000;
    rep(i,n){
        cin>>h;
        double tem=abs(t-h*0.006-a);
        if(san>tem){
            san=tem;
            ans=i;
        }
    }
    cout<<ans+1<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

const int mod = 1000000007;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if(!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if(t & 1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
mint fact(int n) {
  if(n == 1 || n == 0) return 1;
  mint res = n;
  return res * fact(n - 1);
}

int main() {
  ll n;
  cin >> n;
  vl a(n), b(n);
  rep(i, n) cin >> a[i] >> b[i];
  vector<map<P, ll>> mp(2);
  ll zero = 0;
  rep(i, n) {
    ll s;
    if(a[i] == 0 && b[i] == 0) {
      zero++;
      continue;
    } else if(a[i] == 0) {
      s = 0;
      b[i] = 1;
    } else if(b[i] == 0) {
      s = 0;
      a[i] = 1;
    } else {
      s = (a[i] / abs(a[i])) * (b[i] / abs(b[i]));
      a[i] = abs(a[i]);
      b[i] = abs(b[i]);
      ll g = gcd(a[i], b[i]);
      a[i] /= g;
      b[i] /= g;
      a[i] *= s;
    }
    if(a[i] > 0)
      mp[0][{a[i], b[i]}]++;
    else
      mp[1][{b[i], -a[i]}]++;
  }
  mint ans = 1;
  set<P> st;
  for(auto v : mp[0]) {
    P p = v.first;
    ll x = v.second;
    ll y = mp[1][p];
    ans *= mint(2).pow(x) + mint(2).pow(y) - 1;
    st.insert(p);
  }
  for(auto v : mp[1]) {
    P p = v.first;
    if(st.count(p)) continue;
    ll x = v.second;
    ll y = mp[0][p];
    ans *= mint(2).pow(x) + mint(2).pow(y) - 1;
  }
  ans += zero - 1;
  cout << ans << endl;
}

Measured memory_bytes: 37492
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include <iomanip>
using namespace std;
 
int main(){
    
    int N,M,L[100000]={},R[100000]={},maxL,minR,ans=0;
    cin >> N>>M;
    maxL=1;
    minR=N;

    for(int i=1;i<=M;i++){
        cin >> L[i]>>R[i];
        if(L[i]>maxL){
            maxL =L[i];
        }
        if(R[i]<minR){
            minR = R[i];
        }
    }

    for(int i=1;i<=N;i++){
        if(i>=maxL&&i<=minR){
            ans +=1;
        }
    }
    
    cout << ans <<endl;

    return 0;

}

Measured memory_bytes: 1024
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<stdbool.h>
#include<vector>
#include<algorithm>
#include<string>
typedef long long ll;
using namespace std;

int main(void) {
	char a, b;
	cin >> a >> b;
	if (a == 'H') {
		if (b == 'H')cout << 'H' << endl;
		else cout << 'D' << endl;
	}
	else {
		if (b == 'H')cout << 'D' << endl;
		else cout << 'H' << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String args[]){
    	Scanner sc=new Scanner(System.in);
      	String s=sc.next();
      	int i=0;
      	for(i=0;i<3;i++){
        	if(s.charAt(i)==s.charAt(i+1))
              break;
        }
      if(i==3)
        System.out.println("Good");
      else
        System.out.println("Bad");
    }
}

Measured memory_bytes: 21972
#include<bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
  using namespace std;
using namespace __gnu_pbds;
  #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define double long double
  #define all(v) v.begin(),v.end()
  #define rep(i,a,b) for(int i = a; i <=b; i++)
  #define rep2(i,a,b) for(int i = a; i>=b; i--)
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define db long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const double PI = acos(-1);
  const int N = 200005;
  int mod = 1e9 + 7;
     

    
int32_t main()
{
       

 



     int n;
     cin >> n;
     string ans;
     string s,t;
     cin >> s >> t;

     for(int i = 0;i < s.length(); i++)
     {
      ans.PB(s[i]);
      ans.PB(t[i]);
     }

     cout << ans;
   return 0;
}       

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

int main() {
  int n,m;
  cin >> n >> m;
  int all = (n + m) * (n+m-1) / 2;
  // int al = (m) * (m-1) / 2;
  cout << all - n*m << endl;
}

Measured memory_bytes: 256
import math

def judge_d(a,b):
    ans = 0
    for i, j in zip(a, b):
        ans += (i-j)**2

    if math.sqrt(ans).is_integer():
        return 1
    else:
        return 0



n,d = map(int, input().split())
x = [list(map(int,input().split())) for i in range(n)]
ans = 0

for i,v in enumerate(x):
    # print(i)
    if n-i >1:
        for j in range(i+1,n):
            # print(i,j)
            ans += judge_d(x[i],x[j])

print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define md 1000000007
#define ll long long 
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fastmap mp.reserve(1024);mp.max_load_factor(0.25);
#define fastset st.reserve(1024);st.max_load_factor(0.25);
ll int mpw(ll int a,ll int b,ll int m)
{
	ll int ans=1;
	if(a==0)return 0;
	if(a==1 || b==0)return 1;
	while(b)
	{
		if(b&1)
		{
			ans=(ans*a)%m;
		}
		a=(a*a)%m;
		b>>=1;
	}
	return ans;
}

ll int pw(ll int a,ll int b)
{
	ll int ans=1;
	if(a==0)return 0;
	if(a==1 || b==0)return 1;
	while(b)
	{
		if(b&1)
		{
			ans*=a;
		}
		a*=a;
		b>>=1;
	}
	return ans;
}

ll int mn(ll int a,ll int b)
{
	if(a<=b)
	{
		return a;
	}
	return b;
}

ll int mx(ll int a,ll int b)
{
	if(a>=b)
	{
		return a;
	}
	return b;
}
vector<vector<ll int>>D;
int main()
{
	fio
	int n,w;
	cin>>n>>w;
	vector<vector<ll int>>D(n,vector<ll int>(w+1,0));
	vector<pair<int,ll int>>nm(n);
	for(int i=0;i<n;++i)
	{
		cin>>nm[i].first>>nm[i].second;
	}
	for(int i=nm[0].first;i<=w;++i)
	{
		D[0][i]=nm[0].second;
	}
	for(int i=1;i<n;++i)
	{
		for(int j=1;j<=w;++j)
		{
			D[i][j]=D[i-1][j];
			if(j>=nm[i].first)
			{
				D[i][j]=mx(D[i][j],D[i-1][j-nm[i].first]+nm[i].second);
			}
		}
	}
	ll int ans=0;
	for(int i=0;i<=w;++i)
	{
		ans=mx(ans,D[n-1][i]);
	}
	cout<<ans<<"\n";
	return 0;
}

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

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

    int n;
    cin >> n;
    map<int, int> cnt;
    rep(i, n){
        int a;
        cin >> a;
        ++cnt[a];
    }

    int res = 0;
    for(auto e: cnt){
        if(e.second % 2 == 1) ++res;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 8224
#include<iostream>
using namespace std;
 
int main(){
  int l,r,d;
  cin >> l >> r >> d;

  int cnt = 0;
  for (int i = l; i <= r; ++i){
    if (i % d == 0){
      ++cnt;
    }  
  }
  
  cout << cnt << endl;

  return 0;		 
}

Measured memory_bytes: 3176
import java.util.*;

public class Main{
    
    static final int MOD = (int)1e9+7;
    static final int MAX = (int)1e5+5;
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        char[] s = sc.next().toCharArray();
        char t = (char)((int)s[0]+1);
        System.out.println(t);
    }
}


Measured memory_bytes: 21204
#include <iostream>
#include <vector>


int main() {

	int N, M;
	std::cin >> N >> M;

	int totalDays = 0;

	for (int i = 0; i < M; i++) {
		int buffer;
		std::cin >> buffer;
		totalDays+=buffer;
	}


	if (totalDays > N) {
		std::cout << "-1\n";
	} else {
		std::cout << N - totalDays << std::endl;
	}



}


Measured memory_bytes: 3204
s = input()
K = int(input())
N = len(s)
l = []
cnt = 0
for i in range(N):
	for j in range(i+1, min(i+K+1, N+1)):
		l.append(s[i:j])

l = list(set(l))
l.sort()
print(l[K-1])

Measured memory_bytes: 5052
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E17;

#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
//void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
///////////////////////////////////////

string dir="LRUD";
ll dx[4]={0,0,-1,1};
ll dy[4]={-1,1,0,0};


int main(){fastio
    ll h,w,n;cin>>h>>w>>n;
    ll sx,sy;cin>>sx>>sy;
    string a,b;cin>>a>>b;
    ll sa[n+1][4],sb[n+1][4];
    memset(sa,0,sizeof(sa));memset(sb,0,sizeof(sb));
    rep(i,0,n-1){
        rep(j,0,3){
            sa[i+1][j]=sa[i][j];
            sb[i+1][j]=sb[i][j];
            if(a[i]==dir[j])sa[i+1][j]++;
        }
        rep(j,0,3){
            if(b[i]==dir[j]){
                sb[i+1][j]++;
                if(j==0){
                    if(sy+sa[i+1][1]-sb[i+1][j]<=0)sb[i+1][j]--;
                }else if(j==1){
                    if(sy-sa[i+1][0]+sb[i+1][j]>=w+1)sb[i+1][j]--;
                }else if(j==2){
                    if(sx+sa[i+1][3]-sb[i+1][j]<=0)sb[i+1][j]--;
                }else{
                    if(sx-sa[i+1][2]+sb[i+1][j]>=h+1)sb[i+1][j]--;
                }
            }
        }
    }
    /*
    cout<<"sa"<<endl;
    rep(i,0,n){
        rep(j,0,3){
            cout<<sa[i][j]<<" ";
        }cout<<endl;
    }cout<<endl;
    cout<<"sb"<<endl;
    rep(i,0,n){
        rep(j,0,3){
            cout<<sb[i][j]<<" ";
        }cout<<endl;
    }cout<<endl;
    */
    
    rep(i,0,n-1){
        //cout<<i<<" ";
        if(sy+sb[i][1]-sa[i+1][0]<=0){
            cout<<"NO"<<endl;return 0;
        }
        if(sy-sb[i][0]+sa[i+1][1]>=w+1){
            cout<<"NO"<<endl;return 0;
        }
        if(sx+sb[i][3]-sa[i+1][2]<=0){
            cout<<"NO"<<endl;return 0;
        }
        if(sx-sb[i][2]+sa[i+1][3]>=h+1){
            cout<<"NO"<<endl;return 0;
        }
    }
    cout<<"YES"<<endl;
    
    return 0;
}



Measured memory_bytes: 13464
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#include <iomanip>
//cout << fixed << setprecision(20) << *** << endl;
#define rep(i,N) for(int i=0;i<(int)N;++i)
typedef long long ll;
using namespace std;
int main()
{
	string s="CODEFESTIVAL2016",S;
	ll ANS=0;
	cin>>S;
	rep(i,s.size()){
		if(s[i]!=S[i])ANS++;
	}
	cout<<ANS<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
int main()
{
	int n, i, j, k, c, d, x, a;
	char s[1025], r[76], t[10][6] = {".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> s;
		for (j = x = a = 0, d = 0; j < strlen(s); j++, d = c)
		{
			c = s[j] - '0';
			if (c == 0 && d != 0)
				r[a] = t[d-1][x%strlen(t[d-1])], a++;
			else if (d == c)
				x++;
			else
				x = 0;
		}
		r[a] = '\0';
		cout << r << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i, n) REP(i, 0, n)
#define REP(i, l, r) for (int i = l; i < r; ++i)
#define int long long
#ifdef DEBUG
#define dout cout
#else
std::stringstream dout;
#endif
using namespace std;
typedef pair<int, int> P;
struct edge {
	int to, cost;
};
// other libs
int gcd(int a, int b) {
	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}
int lcm(int a, int b) {
	return a * b / gcd(a, b);
}

class dijkstra {
  private:
	int V;
	int d[100002];
	priority_queue<P, vector<P>, greater<>> que;

  public:
	dijkstra(int v, int s, vector<edge> G[]) {
		V = v;
		update(s, G);
	}

	void update(int s, vector<edge> G[]) {
		fill(d, d + V + 1, 100000000000ll);
		d[s] = 0;
		que.push(make_pair(0, s));
		while (!que.empty()) {
			P p = que.top();
			que.pop();
			int v = p.second;
			if (d[v] < p.first)
				continue;
			rep(i, G[v].size()) {
				edge e = G[v][i];
				if (d[e.to] > d[v] + e.cost) {
					d[e.to] = d[v] + e.cost;
					que.push(make_pair(d[e.to], e.to));
				}
			}
		}
	}

	int find(int e) {
		return d[e];
	}
};
template<typename T>
class Union_Find {
  private:
	vector<T> t, s;

  public:
	Union_Find(T max_length) {
		rep(i, max_length + 1) {
			t.push_back(i);
			s.push_back(1);
		}
	}

	void Union(T x, T y) {
		if (same(x, y))
			return;
		T tx = Find(x), ty = Find(y);
		if (s[tx] < s[ty]) {
			s[ty] += s[tx];
			t[tx] = ty;
		}
		else if (s[tx] > s[ty]) {
			s[tx] += s[ty];
			t[ty] = tx;
		}
		else if (tx > ty) {
			t[tx] = ty;
			s[ty] += s[tx];
		}
		else {
			t[ty] = tx;
			s[tx] += s[ty];
		}
	}
	T Find(T n) {
		if (t[n] == n)
			return n;
		else
			return t[n] = Find(t[n]);
	}

	bool same(T x, T y) {
		return Find(x) == Find(y);
	}

	T get_Size(size_t a) {
		return s[a];
	}
};
bool ifPrime(int n) {
	if (n == 1)
		return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)
			return false;
	}
	return true;
}

set<int> prime_num_factor(int n){
    if(n<2)return set<int>();
    set<int> prime;
    prime.insert(2);
    for(int i=3;i<=n;i++){
        for(int it:prime){
            if(it*it>i){
                prime.insert(i);
                break;
            }
            if(i%it==0)break;
        }
    }
    return prime;
}
vector<int> makeDivisors(int n){
    vector<int> re;
    REP(i,1,sqrt(n)+1){
        if(n%i==0){
            re.push_back(i);
            if(i!=n/i)re.push_back(n/i);
        }
    }
    return re;
}
signed main(signed argc, char* argv[]) {
    bool b=false,b2=false;
    string s;
    int k,cnt=0,cnt2=0;
    cin>>s>>k;
    rep(i,s.size()*2-1){
        if(!b&&s[i%s.size()]==s[(i+1)%s.size()]){
            b=true;
            cnt++;
            if(i<s.size()-1)cnt2++;
            if(i==0)b2=true;
        }
        else if(b){
            b=false;
            if(s[i]==s[i+1]&&i==1)b2=false;
        }
    }
    int ans=cnt*(int)(k/2)+k%2*cnt2;
    if(!b&&!b2&&s[s.size()-1]==s[0])ans+=(k/2-1)*abs(cnt-cnt2*2);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
/*
 * Pawan Harendra Mishra
 */

#include <bits/stdc++.h>
using namespace std;

#define X first
#define Y second
typedef long long ll;
typedef pair<ll,ll> pll;

int n, q1, q2;
static int m = 25;
static int d = 27;

int main(int argc, char const *argv[])
{
    //ios::sync_with_stdio(false);
    //cin.tie(NULL);
    cin >> n;

    q2 = (n + 1) * m / d;
    q1 = (n) * m / d;

    vector<ll> ans;
    for (ll i=q1; i<=q2; i++) {
        if ((i * d) / m == n)
            ans.push_back(i);
    }

    if (ans.size()) cout << ans[0] << endl;
    else cout << ":(" << endl;
    return 0;
}

Measured memory_bytes: 256
use std::cmp::Ordering;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: i32 = read();
    let b: i32 = read();

    match a.cmp(&b) {
        Ordering::Less => println!("a < b"),
        Ordering::Greater => println!("a > b"),
        Ordering::Equal => println!("a == b"),
    };
}



Measured memory_bytes: 5016
#include <cstdio>
using namespace std;
 
int main()
{
    int a, b;
    bool first = true;
 
    while (scanf("%d%d", &a, &b), a){
        if (!first){
            printf("\n");
        }
 
        first = false;
 
        bool na = true;
        for (int i = a; i <= b; i++){
            if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)){
                printf("%d\n", i);
                na = false;
            }
        }
 
        if (na){
            printf("NA\n");
        }
    }
 
    return (0);
}

Measured memory_bytes: 1044
# https://atcoder.jp/contests/abc106/tasks/abc106_d

'''
N が小さいので、N^2 を考えると良いことが分かる。
'''

from collections import defaultdict

N, M, Q = map(int, input().split())        # N, M: リストの長さ

edges = [list(map(int, input().split())) for _ in range(M)]

data = defaultdict(int)                  # defaultdict は 初期化の際のに value の type を指定する必要あり

for i, j in edges:
    i -= 1
    j -= 1
    data[(i,j)] += 1

cum = [[0]*(N+1) for _ in range(N+1)]

for i in range(N):
    for j in range(N):
        cum[i+1][j+1] = cum[i][j+1] + cum[i+1][j] - cum[i][j] + data[(i,j)]

for _ in range(Q):
    p, q = map(int, input().split())
    if p < q:
        p, q = q, p
    q -= 1
    res = cum[p][p] - cum[p][q] - cum[q][p] + cum[q][q]
    print(res)







Measured memory_bytes: 153856
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> P;
int main(void){
    int n, m, s, t;
    vector<int> v[100000];
    int d[100000][3];
    queue<P> q;
    cin >> n >> m;
    for(int i=0;i<m;i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        v[a].push_back(b);
    }
    cin >> s >> t;
    s--;
    t--;
    for(int i=0;i<n;i++){
        d[i][0] = d[i][1] = d[i][2] = -1;
    }
    d[s][0] = 0;
    q.push(P(s, 0));
    while(!q.empty()){
        P p = q.front();
        q.pop();
        int x = p.first, y = p.second;
        for(int i=0;i<v[x].size();i++){
            int a = v[x][i], b = (y+1)%3;
            if(d[a][b] == -1){
                d[a][b] = d[x][y]+1;
                q.push(P(a, b));
            }
        }

    }
    if(d[t][0] == -1){
        cout << -1 << endl;
    }else{
        cout << d[t][0] / 3 << endl;
    }
    
}


Measured memory_bytes: 6912
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(A: str, B: str, C: str):
    ss = [A, B, C]
    indices = [0, 0, 0]
    tmp = 0
    while True:
        if indices[tmp] >= len(ss[tmp]):
            ret = chr(ord('A') + tmp)
            break
        nex = ss[tmp][indices[tmp]]
        indices[tmp] += 1
        tmp = ord(nex) - ord('a')
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S_A = next(tokens)  # type: str
    S_B = next(tokens)  # type: str
    S_C = next(tokens)  # type: str
    solve(S_A, S_B, S_C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#! python3
# insertion.py - 標準入出力を行う

N = int(input())
l = input().split(' ')
A = [int(i) for i in l]
# print(A)

def insertion(A, N): # N個の要素を含む0-オリジンの配列A
    flag = 1 # 逆の隣接要素が存在する
    i = 0 # 未ソート部分列の先頭インデックス
    counter = 0
    while flag == 1:
        flag = 0
        if i != N:
            for j in range(N-1, 0, -1):
                if A[j] < A[j-1]:
                    v = A[j]
                    A[j] = A[j-1]
                    A[j-1] = v
                    flag = 1
                    counter += 1
            i += 1
        map_list = map(str, A)
        a = ' '.join(map_list)
    print(a)
    print(counter)

insertion(A, N)


Measured memory_bytes: 5604
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
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);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int K = in.nextInt();
            String a = Integer.toString(N, K) + "";
            out.print(a.length());
        }

    }
}



Measured memory_bytes: 21972
#include<iostream>
using namespace std;
int main()
{
    int t,n,s,s1,s2;
    cin >> s;
    s2=s%100;
    s1=s/100;
    if((s1!=0 && s2!=0) && (s1<=12) && (s2<=12))
    {
        cout<<"AMBIGUOUS";
    }

    else  if((s1!=0) &&(s1<=12))
    {
        cout<<"MMYY";
    }
    else if((s2!=0)&&(s2<=12))
    {
        cout<<"YYMM";
    }

    else
    {
        cout<<"NA";
    }

}



Measured memory_bytes: 3572
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

char dif = 'A' - 'a';

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m;
    cin >> n >> m;
    if(n==1&&m==1)
        cout << 1 << endl;
        else if(n==1||m==1)
            cout << max(n, m) - 2 << endl;
            else{
                cout << (n - 2) * (m - 2) << endl;
            }
            return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;

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

    vector<double> p(n);

    rep(i,n){
        cin >> p[i];
    }

    double ans =0.0;
    double tmp =0.0;

    rep(i,k){
        ans += p[i];
    }

    tmp = ans;

    rep(i,n-k){
        tmp += p[i+k];
        tmp -= p[i];
        ans = max(ans,tmp);
    }

    ans += k;
    ans /= 2.0;

    cout << fixed << setprecision(10) << ans << endl; 
}



Measured memory_bytes: 1792
def coloring_colorfully(s):

    ans = 0
    color = {"0":"1", "1":"0"}

    for i in range(1, len(s)):
        if s[i-1] == s[i]:
            ans += 1
            s[i] = color[s[i]]

    return ans

def main():
    s = list(str(input()))
    print(coloring_colorfully(s))

if __name__ == '__main__':
    main()

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

using namespace std;

const int N = 1e5 + 5;
int p[N], a[N];
int find(int x) {
  return p[x] < 0 ? x : p[x] = find(p[x]);
}
int merge(int u, int v) {
  if ((u = find(u)) == (v = find(v)))
    return -1;
  if (-p[u] > -p[v])
    swap(u, v);
  p[v] += p[u];
  p[u] = v;
  return v;
}

vector<int> val[N];

int main() {
  int n, m;
  memset(p, -1, sizeof p);
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a+i);
  }
  int tot = n;
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    tot -= merge(u, v) != -1;
  }
  for (int i = 0; i < n; ++i)
    val[find(i)].push_back(a[i]);
  vector<int> all;
  long long ans = 0;
  if (tot <= 1) {
    puts("0");
    return 0;
  }
  for (int i = 0; i < n; ++i) if (find(i) == i) {
    sort(val[i].begin(), val[i].end());
    ans += val[i][0];
    for (int j = 1; j < min((int)val[i].size(), tot - 1); ++j)
      all.push_back(val[i][j]);
  }
  if ((int)all.size() < tot-2) {
    puts("Impossible");
    return 0;
  }
  sort(all.begin(), all.end());
  for (int i = 0; i < tot-2; ++i)
    ans += all[i];
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 6528
import copy
h,w,k = map(int,input().split())
c=[list(input()) for _ in range(h)]

ans = 0
for row in range(1<<h):
    for col in range(1<<w):
        d = copy.deepcopy(c)
        sum = 0
        for i in range(h):
            if row & (1<<i):
                for j in range(w):
                    d[i][j] = '.'
        for j in range(w):
            if col & (1<<j):
                for i in range(h):
                    d[i][j] = '.'

        for i in range(h):
            for j in range(w):
                if d[i][j] == '#':
                    sum+=1
        if sum == k:
            ans+=1
print(ans)    





Measured memory_bytes: 76884
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N;
char ans[15];

int Solve(int turn, int num){
  if (turn == N){
    printf("%s\n", ans);
    return 0;
  }

  for (int i = 0; i < num; i++){
    ans[turn] = 'a' + i;
    Solve(turn+1, num);
  }
  ans[turn] = 'a' + num;
  Solve(turn+1, num+1);

  return 0;
}

int main(){
  scanf("%d", &N);
  Solve(0, 0);

  return 0;
}


Measured memory_bytes: 3760
// Template
#include "bits/stdc++.h"
#include "atcoder/all"
#define rep_override(x, y, z, name, ...) name
#define rep2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep3(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define rep(...) rep_override(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define per(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using namespace atcoder;
using ll = long long;
constexpr int inf = 1001001001;
constexpr ll INF = 3003003003003003003LL;
template <typename T>
inline bool chmin(T &x, const T &y) {
    if (x > y) {
        x = y;
        return true;
    }
    return false;
}
template <typename T> 
inline bool chmax(T &x, const T &y) {
    if (x < y) {
        x = y;
        return true;
    }
    return false;
}
struct IOSET {
    IOSET() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
    }
} ioset;

// Union-Find
class UnionFind {
    std::vector<int> par;
    int n_;
    public:
    UnionFind(int n) : par(n, -1), n_(n) {}
    int root(int x) {
        assert(x >= 0 && x < n_);
        if (par[x] < 0) return x;
        return par[x] = root(par[x]);
    }
    bool unite(int x, int y) {
        assert(x >= 0 && x < n_ && y >= 0 && y < n_);
        int rx = root(x), ry = root(y);
        if (rx == ry) return false;
        if (-par[rx] > -par[ry]) std::swap(rx, ry);
        par[ry] += par[rx];
        par[rx] = ry;
        return true;
    }
    bool same(int x, int y) {
        assert(x >= 0 && x < n_ && y >= 0 && y < n_);
        return root(x) == root(y);
    }
    int size(int x) {
        assert(x >= 0 && x < n_);
        return -par[root(x)];
    }
};


// Main
int main() {
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    while (m--) {
        int a, b;
        cin >> a >> b;
        uf.unite(a - 1, b - 1);
    }
    set<int> st;
    rep(i, n) st.insert(uf.root(i));
    cout << st.size() - 1 << "\n";
}

Measured memory_bytes: 7564
#include <cstdio>
#include <algorithm>
using namespace std;
#define fi first
#define se second
int main(){
	int n;
	scanf("%d", &n);
	pair<int, int> p[n];
	for (int i = 0; i < n; i++){
		scanf("%d", &p[i].fi);
		p[i].se = i + 1;
	}
	sort(p, p + n);
	for (int i = 0; i < n; i++) printf("%d ", p[i].se);
}

Measured memory_bytes: 1536
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
const int INF = 1e9;
typedef vector<int> iv;

double G;
int N;
vector<int> u;

bool check(int n, iv &used, iv &w, iv &s){
  int sum = 0;
  REP(i, N) if(used[i] != -1) sum += w[i];
  return sum <= s[n];
}

void dfs(int sum, int cnt, iv &used, iv &w, iv &s, vector<string> &f){
  if(cnt <= 0){
    double a = 0, b = 0;
    REP(i, N){
      a += used[i] * w[i];
      b += w[i];
    }
    if(a / b < G){
      G = a / b;
      u = used;
    }
    return ;
  }
  REP(i, N){
    if(used[i] != -1 || !check(i, used, w, s)) continue;
    used[i] = cnt;
    dfs(sum + w[i], cnt - 1, used, w, s, f);
    used[i] = -1;
  }
}

int main() {
  while(cin >>N){
    G = INF;
    u = vector<int>(N, -1);
    vector<int> w(N), s(N), used(N, -1);
    vector<string> f(N);
    REP(i, N) cin >>f[i] >>w[i]>>s[i];
    dfs(0, N, used, w, s, f);
    FOR(i, 1, N + 1) REP(j, N) if(u[j] == i) cout <<f[j] <<endl;
  }
  return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
using namespace std;
int main() {
  int W,a,b;
  cin >> W >> a >> b;
  int ans = 0;
  if (abs(a - b) <= W) {
    ans = 0;
  } else {
    ans = abs(a - b) - W;
  }
  cout << ans << endl;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)

int A[100][100];
int B[100];

int main(){
    int N, M, C;
    cin >> N >> M >> C;
    REP(i,M){
        cin >> B[i];
    }
    REP(i,N){
        REP(j,M){
            cin >> A[i][j];
        }
    }

    int ans = 0;
    REP(i,N){
        int num = C;
        REP(j,M){
            num += A[i][j] * B[j];
        }
        if(num > 0) ans++;
    }

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int dx[]={0,1,1,1,0,-1,-1,-1};
int dy[]={-1,-1,0,1,1,1,0,-1};
char mp[100][100];
char ans[100][100];

int main(){
  int h,w;
  cin>>h>>w;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>mp[i][j];
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int cnt=0;
      if(mp[i][j]=='#')ans[i][j]='#';
      else{
	for(int k=0;k<8;k++){
	  int nx=j+dx[k];
	  int ny=i+dy[k];
	  if(0<=nx&&nx<w&&0<=ny&&ny<h&&mp[ny][nx]=='#')cnt++;
	}
	ans[i][j]=(char)('0'+cnt);
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout<<ans[i][j];
    }
    cout<<endl;
  }
  return(0);
}


Measured memory_bytes: 256
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

#ここから書き始める
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()
a = ""
for i in t:
    if i == "r":
        a += "p"
    elif i == "s":
        a += "r"
    else:
        a += "s"
ans = 0
for i in a:
    if i == "r":
        ans += r
    elif i == "s":
        ans += s
    else:
        ans += p
# print(ans)
for i in range(k, n):
    if a[i] == a[i - k]:
        if a[i] == "r":
            ans -= r
        elif a[i] == "s":
            ans -= s
        else:
            ans -= p
        a = a[:i] + "a" + a[i + 1:]
print(ans)


Measured memory_bytes: 5456
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

N, L, T_ = map(int, raw_input().split())

X1 = []
X2 = []
Xs = []
m = {}
mL = {}
mul = T_ / L

for i in range(N):
    X, W = map(int, raw_input().split())
    if W == 1:
        X1.append(X)
    else:
        X2.append(X)
    m[X] = 0
    mL[X] = 0
    Xs.append((X, W))
T = L
if len(X1) != 0 and len(X2) != 0:
    for loop in range(2):
        pos1 = 0
        pos2 = 0
        bias = 0
        sz = len(X2)
        X2 = [X2[-1] - L] + X2 + [X2[0] + L]
        for x in X1:
            while True:
                if X2[pos1 + 1] + bias - x <= 2 * T:
                    pos1 += 1
                else:
                    break
                if pos1 > sz:
                    bias += L
                    pos1 = 1
            while True:
                if X2[pos2 + 1] < x:
                    pos2 += 1
                else:
                    break
            if loop == 0:
                mL[x] = pos1 - pos2 + bias / L * sz
            else:
                mL[(L - x) * (x != 0)] = pos1 - pos2 + bias / L * sz
        X2 = X2[1:-1]
        for i in range(len(X1)):
            X1[i] = (L - X1[i]) * (X1[i] != 0)
        for i in range(len(X2)):
            X2[i] = (L - X2[i]) * (X2[i] != 0)
        X1, X2 = sorted(X2), sorted(X1)
T = T_ % L
if len(X1) != 0 and len(X2) != 0:
    for loop in range(2):
        pos1 = 0
        pos2 = 0
        bias = 0
        sz = len(X2)
        X2 = [X2[-1] - L] + X2 + [X2[0] + L]
        for x in X1:
            while True:
                if X2[pos1 + 1] + bias - x <= 2 * T:
                    pos1 += 1
                else:
                    break
                if pos1 > sz:
                    bias += L
                    pos1 = 1
            while True:
                if X2[pos2 + 1] < x:
                    pos2 += 1
                else:
                    break
            if loop == 0:
                m[x] = pos1 - pos2 + bias / L * sz
            else:
                m[(L - x) * (x != 0)] = pos1 - pos2 + bias / L * sz
        X2 = X2[1:-1]
        for i in range(len(X1)):
            X1[i] = (L - X1[i]) * (X1[i] != 0)
        for i in range(len(X2)):
            X2[i] = (L - X2[i]) * (X2[i] != 0)
        X1, X2 = sorted(X2), sorted(X1)
#print m
ans = [0] * N
for i in range(N):
    X, W = Xs[i]
    if W == 1:
        ans[(i + m[X] + mL[X] * mul) % N] = (X + T) % L
    else:
        ans[(i - m[X] - mL[X] * mul) % N] = (X - T) % L

for i in range(N):
    print ans[i]


Measured memory_bytes: 40784
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  N,C=LI()
  l=[[0]*100100 for _ in range(C)]

  for _ in range(N):
    s,t,c=LI()
    l[c-1][s]+=1
    l[c-1][t+1]-=1

  for i in range(C):
    for j in range(100000):
      l[i][j+1]+=l[i][j]

  for i in range(C):
    for j in range(100000):
      if l[i][j]==2:
        l[i][j]=1

  mx=0
  for i in range(100000):
    sm=0
    for j in range(C):
      sm+=l[j][i]
    mx=max(mx,sm)

  return mx

# main()
print(main())


Measured memory_bytes: 33932
#include <bits/stdc++.h>
#define int long long int
using namespace std;
void solve() {
	int a, b;
  	cin >> a >> b;
  	if((a+b)%2 == 0)
      cout << (a+b)/2 << '\n';
 	else
      cout << (a+b)/2 + 1 << '\n';
 	return ;
}
int32_t main() {
	ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
  	cout.tie(NULL);
  	solve();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;

    if (k < e - a) {
        cout << ":( " << endl;
    } else {
        cout << "Yay!" << endl;
    }
}

Measured memory_bytes: 256