akhauriyash/Code-Regression huggingface dataset:
s = list(input())
s_first = int("".join(s[:2])) 
s_second = int("".join(s[2:])) 

if 1 <= s_first <= 12 and 1 <= s_second <= 12:
	print("AMBIGUOUS")
elif (not 1 <= s_first <= 12 ) and 1 <= s_second <= 12:
	print("YYMM")
elif 1 <= s_first <= 12 and (not 1 <= s_second <= 12):
	print("MMYY")
elif (not 1 <= s_first <= 12) and (not 1 <= s_second <= 12):
	print("NA")

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

int main() {
    vector<int> menu(5);
    int sum = 0;
    int last = 10;
    for (int i = 0; i < 5; i++) {
        cin >> menu[i];
        int mod = menu[i] % 10;

        if (mod == 0) {
            sum += menu[i];
        } else {
            sum += menu[i] + (10 - mod);
        }
        if (mod != 0 && mod < last) {
            last = mod;
        }
    }
    cout << sum - (10 - last) << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <functional>

using namespace std;

int n, k;
char s[11];
int c[26];

int main(void) {
  scanf("%d%d", &n, &k);

  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    c[s[0]-'A'] += 1;
  }

  int res = 0;
  for (;;) {
    sort(c, c+26, greater<int>());
    int p = 0;
    for (int i = 0; i < 26 && p < k; i++) {
      if (c[i] > 0) {
        --c[i];
        ++p;
      }
    }
    if (p < k) {
      break;
    }
    ++res;
  }

  printf("%d\n", res);
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

#define MAX_N 100050
#define ll long long

int arr[MAX_N];
ll ans;
ll n,x;
int main(){
    while(~scanf("%lld %lld",&n,&x)){
        for (int i = 1;i <= n;i++)
            cin>>arr[i];
        ans=0;
        if (arr[1] > x){
            ans += arr[1]-x;
            arr[1] = x;
        }
        for (int i = 2;i <= n;i++){
            int k = arr[i] + arr[i-1] - x;
            if (k > 0){
                ans += k;
                arr[i] -= k;
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 640
#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;
  cin >> n;
  vector<int> a(n);
  rep(i,n) {
    int x;
    cin >> x;
    a[x-1]++;
  }
  sort(a.begin(),a.end());
  vector<int> s(n+1); // sum of [0,i)
  rep(i,n) s[i+1] = s[i]+a[i];
  int ans = n, i = n;
  for (int k = 1; k <= n; ++k) {
    while (1) {
      bool ok = [&](int c) {
        while (i >= 0 && a[i-1] >= c) --i;
        int sum = c*(n-i) + s[i];
        return (sum >= c*k);
      }(ans);
      if (ok) break;
      --ans;
    }
    printf("%d\n", ans);
  }
  return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

ll n,cnt,ans,a[ohara],b[ohara],c[ohara],d,tmp,tmpp,m,h,w,x,y,sum,pos,k,dp[ohara][5];
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

    cin>>n;
    rep(i,n)cin>>a[i]>>b[i]>>c[i];
    dp[0][0]=a[0];
    dp[0][1]=b[0];
    dp[0][2]=c[0];
    rrep(i,1,n){
        dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i];
        dp[i][1]=max(dp[i-1][2],dp[i-1][0])+b[i];
        dp[i][2]=max(dp[i-1][1],dp[i-1][0])+c[i];
    }
    Cout(max({dp[n-1][0],dp[n-1][1],dp[n-1][2]}));
    return 0;
}


Measured memory_bytes: 14592
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    int n;
    cin>>n;
    int cnt=0;
    for(int i=1;i<=n;i++){
        string s=to_string(i);
        if(1==s.length()%2){
            cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0,-1, 0, 1};
int dx[]={-1,0, 1, 0};
 
struct aaa{
    int maxi;
    int prime;
};
  
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
 
int hole[1000][1000],m,n;
bool isp[1000001];
aaa memo[1003][1000];
 
aaa search(int y,int x){
    if(memo[y][x].maxi >= 0)
        return memo[y][x];
 
    if((y > 999) || hole[y][x] > m){
        aaa ret;
        memo[y][x].maxi = memo[y][x].prime = 0;
        return memo[y][x];
    }
 
    aaa ret;ret.maxi = ret.prime = 0;
 
    for(int i = x - 1;i < x + 2;i++){
        if(i < 0 || i > 999)
            continue;
 
        aaa b = search(y + 1,i);
        if(b.maxi > ret.maxi || (b.maxi == ret.maxi && b.prime > ret.prime))
            ret = b;
    }
    if(ret.prime == 0 && isp[hole[y][x]])
        ret.prime = hole[y][x];
    ret.maxi += isp[hole[y][x]];
    return memo[y][x] = ret;
}
 
int main(){
    int d = 2;int x = 0;int y = 0;
    RFOR(i,1,1000001){
        hole[y][x] = i;
        if(x + dx[d] < 0 || x + dx[d] > 999  || y + dy[d] < 0 || y + dy[d] > 999 || hole[y + dy[d]][x + dx[d]] > 0){
            d = (d + 1) % 4;
        }
 
        x += dx[d]; y += dy[d];
    }
 
    memset(isp,true,sizeof(isp));isp[1] = false;
    FOR(i,2,10000){
        if(isp[i]){
            for(int j = i * 2;j < 1000001;j += i)
                isp[j] = false;
        }
    }
    while(1){
        scanf("%d%d",&m,&n);
        if(m == 0 && n == 0)
            break;
 
        aaa ans;
        REP(i,1003)
            REP(j,1000)
                memo[i][j].maxi = -1;
 
        REP(i,1000){
            REP(j,1000){
                if(hole[i][j] == n)
                    ans = search(i,j); 
            }
        }
        printf("%d %d\n",ans.maxi,ans.prime);
    }
    return 0;
}

Measured memory_bytes: 16012
#include <iostream>
#include <vector>
#include <utility>

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<pair<int, int>> W(N);
	for(auto &x: W) cin >> x.second >> x.first;
	sort(W.begin(), W.end());

	int t = 0;
	for(auto x: W) {
		t += x.second;
		if(t > x.first) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> H(N+1);
  for(int i=0;i<N;i++){
	  cin >> H[i];
  }
  H[N]=1000000000+7;
  int ans=0;
  for(int i=0;H[i+1]!='\0';i++){
    for(int k=0;H[i+k]!='\0';k++){
      if(H[i+k]>=H[i+k+1]){
        continue;
      }
      ans = max(ans,k);
      i=i+k;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from bisect import bisect_left,bisect_right
from math import sqrt,gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode
import sys
sys.setrecursionlimit(10 ** 6)

INF = float('inf')
mod = 10**9 + 7

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse=False):
    data.sort(key=lambda x:x[col],reverse=revese)
    return data

def mymax(data):
    M = -1*float('inf')
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float('inf')
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def mydictvaluesort(dictionary):
    return sorted( dictionary.items(), key=lambda x:x[1] )

def mydictkeysort(dictionary):
    return sorted( dictionary.items(), key=lambda x:x[0] )

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(' ')
        elif type(ls[0])==str:
            print(' '.join(ls))
        elif type(ls[0])==int:
            print(' '.join(map(str,ls)))
        else:
            print('Output Error')
    else:
        if len(ls)==0:
            print('')
        elif type(ls[0])==str:
            print(''.join(ls))
        elif type(ls[0])==int:
            print(''.join(map(str,ls)))
        else:
            print('Output Error')

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

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

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]

# ddict = defaultdict(lambda: 0)
# ddict = defaultdict(lambda: 1)
# ddict = defaultdict(lambda: int())
# ddict = defaultdict(lambda: list())
# ddict = defaultdict(lambda: float())


n = I()
a = RI()

s = sum(a)

ls = []
for i in range(n):
    s -= a[i]
    ls.append(s)
# print(ls)

ans = 0
for i in range(n):
    ans += a[i]*ls[i] % mod
print(ans%mod)

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

const int mod = 1e9 + 7;

int solve() {
    int n;
    cin >> n;

    vector<int> cnt(n);
    for (int i = 0; i < n; i++) {
        int a;
        scanf("%d", &a);
        cnt[a]++;
    }

    if (n % 2 == 1) {
        if (cnt[0] != 1) {
            return 0;
        }
    }

    int ans = 1;
    for (int i = n - 1; i >= 1; i -= 2) {
        if (cnt[i] != 2) {
            return 0;
        }
        ans *= 2;
        ans %= mod;
    }
    
    for (int i = n - 2; i >= 1; i -= 2) {
        if (cnt[i] != 0) {
            return 0;
        }
    }
    
    return ans;
}

int main() {
    cout << solve() << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<string>

int main(){
    int N, M, X, Y;
    std::cin >> N >> M >> X >> Y;
    int xMax = -100, yMin = 100;
    for(int i = 0; i < N; i++){
        int x;
        std::cin >> x;
        xMax = std::max(xMax, x);
    }
    for(int i = 0; i < M; i++){
        int y;
        std::cin >> y;
        yMin = std::min(yMin, y);
    }

    for(int Z = X + 1; Z <= Y; Z++){
        if(Z > xMax && Z <= yMin){
            std::cout << "No War" << std::endl;
            return 0;
        }
    }

    std::cout << "War" << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
using namespace std;

int n;
long ans;
string s;
map<string, long> a;

int main(){
	cin >> n;
	for (int i = 0; i < n; ++i){
		cin >> s;
		sort(s.begin(), s.end());
		if (a.find(s) != a.end()) a[s]++;
		else a.emplace(s, 1);
	}
	ans = 0;
	for (auto iter=a.begin(); iter!=a.end(); ++iter){
		ans += iter->second*(iter->second-1)/2;
	}
	cout << ans;
}

Measured memory_bytes: 11136
#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

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

  string s, t;
  cin >> s >> t;

  sort(s.begin(), s.end());
  sort(t.begin(), t.end(), greater<char>());

  if (s < t)
    cout << "Yes\n";
  else
    cout << "No\n";

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=2e5;
int gi() { int x;cin>>x;return x;}
int m,ans;
int head[N],nxt[N];
inline int dfs(int k) {
	int mx=0,i,t;
	for (i=head[k];i;i=nxt[i]) {
		t=dfs(i)+1;
		if (t==m) ans++;
		else mx=max(mx,t);
	}
	return mx;
}
int main()
{
	int n=gi(),i,k;m=gi();
	ans=gi()!=1;
	for (i=2;i<=n;i++) nxt[i]=head[k=gi()],head[k]=i;
	for (i=head[1];i;i=nxt[i]) dfs(i);
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 2688
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <limits.h>
#include <cmath>
#include <queue>
#include <map>
#include <iomanip>
#include <random>
#include <fstream>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265358979323846
#define MOD 1000000007
using namespace std;
using ll = long long;

const int MAX = 1000000;

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

ll gcd(ll a, ll b)
{
  ll r;
  while ((r = a % b))
  {
    a = b;
    b = r;
  }
  return b;
}

template <class T> struct cord{
  T x,y;
};

template <class T> double dist(cord<T> a, cord<T> b){
  T dx=a.x-b.x;
  T dy=a.y-b.y;
  return sqrt(dx*dx+dy*dy);
}

int main()
{

  //cout << fixed << setprecision(10);

  int r,g,b; cin >> r >> g >>b;
  if ((100*r+10*g+b)%4==0){cout << "YES";}
  else {cout << "NO";}

  return 0;
}


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

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

using namespace std;

int n;

int a, b;

int main() {
    cin >> a >> b;

    if(a==b)
        cout << "Yes";
    else
        cout << "No";

    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int k; cin >> k;
  for (int digit = 1; ; ++digit) {
    function<void(string, int)> solve = [&](string runrun, int d) {
      if (d == digit) {
        if (--k == 0) {
          cout << runrun << '\n';
          exit(0);
        }
        return;
      }
      int b = runrun.back() - '0';
      if (b > 0) solve(runrun + char('0' + b - 1), d + 1);
      solve(runrun + char('0' + b), d + 1);
      if (b + 1 < 10) solve(runrun + char('0' + b + 1), d + 1);
    };
    FOR(i, 1, 10) solve(to_string(i), 1);
  }
}


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

int main(){
  int n;
  int count=1;
  cin >> n;
  vector<int> height(n);
  
  for(int i=0; i<n; i++){
    cin >> height.at(i);
  }
  int max = height.at(0);
  
  for(int i=1; i<n; i++){
    if(max <= height.at(i)){
      count++;
      max = height.at(i);
    }
  }
  
  cout << count << endl;
  
    
}

Measured memory_bytes: 256
#include <cstdio>
typedef long long LL;
const LL EX = 5e15;

char S[110];
LL K;

LL fast_pow(LL bs, LL ex) {
	LL res = 1;
	for (; ex; ex >>= 1, bs *= bs) if (ex & 1) res *= bs;
	return res;
}

int main() {
	scanf("%s%lld", S, &K);
	for (int i = 0; S[i]; i++) {
		int n = S[i] ^ '0';
		if (n == 1) {
			if (K == 1) return puts("1"), 0;
			--K;
		}
		else {
			LL tot = fast_pow(n, EX);
			if (K <= tot || tot <= 0) return putchar(S[i]), 0;
			K -= tot;
		}
	}
	return 0;
}	

Measured memory_bytes: 256
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<bitset>
#include<string>
#include<cstdio>
#include<cctype>
#include<cassert>
#include<cstdlib>
#include<cstring>
#include<sstream>
#include<iostream>
#include<algorithm>

#define For(i,x,y) for (int i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define lf else if

#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> Vi;

int IN(){
	int c,f,x;
	while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0');
	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x;
}

const int N=15;
const int oo=(1<<30)-1;

int dp[N][1<<N];
int val[1<<N];
int A[N][N];
int n,m,x,y,z,sum;

void Upd(int &x,int y){
	if (y>x) x=y;
}

int main(){
	n=IN(),m=IN();
	For(i,0,m){
		x=IN()-1,y=IN()-1,z=IN();
		A[x][y]=A[y][x]=z;
		For(t,0,1<<n) if ((t>>x&1)&&(t>>y&1)) val[t]+=z;
		sum+=z;
	}
	For(i,0,N) For(j,0,1<<N) dp[i][j]=-oo;
	For(t,0,1<<n) if (t&1) dp[0][t]=val[t];
	For(t,0,1<<n) For(i,0,n) if (dp[i][t]>=0){
		for (int w=~t&(1<<n)-1,s=w;;s=(s-1)&w){
			For(j,0,n) if ((s>>j&1)&&A[i][j]){
				Upd(dp[j][s|t],dp[i][t]+val[s]+A[i][j]);
			}
			if (!s) break;
		}
	}
	printf("%d\n",sum-dp[n-1][(1<<n)-1]);
}

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

using namespace std;

int main()
{
   vector<char>v(26);
   for(char ch='A';ch<='Z';ch+=1){
    v[ch-'A']=ch;
   }
   int n;
   cin>>n;
   string s;
   cin>>s;
   for(int i=0;i<(int)s.length();i++){
      for(int j=0;j<26;j++){
        if(v[j]==s[i]){
           s[i]=v[(j+n)%26];
           break;
           }
      }
   }
    cout<<s<<endl;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
diff = [X[i + 1] - X[i] for i in range(M - 1)]
diff.sort(reverse=True)
ans = X[-1] - X[0] - sum(diff[:N - 1])
print(ans)


Measured memory_bytes: 13968
#include <bits/stdc++.h>
#include <algorithm>
#include <climits>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iostream>
#include <math.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define str string
#define deb_arr(arr,n) for(ll i=0;i<(n);i++){ cout << (arr)[i] << " ";}
#define in_arr0(arr,n) for(ll i=0;i<(n);i++){ cin >> (arr)[i]; }
#define in_arr1(arr,n) for(ll i=1;i<=(n);i++){ cin >> (arr)[i];}
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> pbds;
#define vll vector<ll> 
#define fr(n) for(i=0;i<(n);i++)
#define fr1(n) for(i=1;i<=(n);i++)
#define pll pair<ll,ll>
#define f first
#define s second
#define vpll vector<pll>
#define ump unordered_map
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define IN(a,b) ((a).find(b)!=(a).end())
#define pb push_back
#define mkp make_pair
#define PI M_PI
#define INF 1e18
#define deb(x) if(ON) cout << #x <<" : " << x << endl
#define fast ios_base::sync_with_stdio(false)
#define io cin.tie(NULL),cout.tie(NULL)
#define ON !false
ll dx[]={0,-1,0,1};
ll dy[]={1,0,-1,0};
const ll mod=1e9+7;
inline ll add(ll a,ll b){
    return  ((a%mod)+(b%mod)+mod)%mod;
}
inline ll mul(ll a,ll b){
    return ((a%mod)*(b%mod)+mod)%mod;
}
void pause(ll id){
    cout << "Waiting " << id << endl;
    cin >> id;
}

const int mxn=1e5+10;


void init(){

    return ;
}


signed main(){
    fast;
    io;
    if(!true){
        freopen("in.txt","r",stdin);
        freopen("out.txt","w",stdout);
    }
    init();
    ll i,j;
    ll n;
    cin >> n;
    ll ans=1;
    ll x=100;
    while(x < n){
        ans++;
        x=(ll)(x*1.01);
    }

    //deb((x*100));
    cout << ans-1 << endl;
   
    return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V){os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P){return os << "(" << P.first << "," << P.second << ")";}
#ifndef ONLINE_JUDGE
#define TRACE
#endif

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <typename Arg1>
	void __f(const char* name, Arg1&& arg1){ cout << name << " : " << arg1 << endl; }
	template <typename Arg1, typename... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...) 1
#endif
#define mp make_pair
#define pb push_back
#define endl '\n'
#define F first
#define S second
#define I insert
typedef long double ld;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
const int N = 1e5+5;
ll a[N][3], da[N][3];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<setprecision(25);
    ll n; cin>>n;
    for(int i=1;i<=n;i++) for(int j=0;j<3;j++) cin>>a[i][j];

    for(int i=1;i<=n;i++){
    	for(int j=0;j<3;j++){
    		for(int k=0;k<3;k++) if(k != j) da[i][j] = max(da[i][j], a[i][j]+da[i-1][k]);
    	}
    }
    ll ans = 0;
    for(int i=0;i<3;i++) ans = max(ans, da[n][i]);
    cout<<ans;
}

Measured memory_bytes: 4992
#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int x;
    cin >> x;
    cout << x / 3600 <<':'<< x % 3600 / 60  <<':'<< x % 60 << endl;
}

Measured memory_bytes: 1160
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * 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;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int L = in.Int();
            int R = in.Int();
            int d = in.Int();
            int ans = 0;
            for (int i = L; i <= R; i++) {
                if (i % d == 0) ans++;
            }
            out.println(ans);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 32680
a,b,h,m = map(int,input().split())

theta = abs((30*h + 0.5*m) - 6*m)
theta = min(theta,360-theta)

import math
c = (a**2 + b**2 -2*a*b*math.cos(math.radians(theta)))**0.5

print(c)


Measured memory_bytes: 9568
#include <stdio.h>
int main() {
  int N, i, ans;
  ans = 0;
  scanf("%d", &N);
  int B[N];
  for (i = 1; i < N + 1; ++i) {
    scanf("%d", &B[i]);
  }
  ans += B[1];
  for (i = 2; i < N; ++i) {
    if (B[i-1] < B[i]) {
      ans += B[i-1];
    } else {
      ans += B[i];
    }
  }
  ans += B[N-1];
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#define rep(i,n) for(int i = 0; i <(n); i++)
using namespace std;

int main(void) {
	int N, i, cnt = 0,tmp,m;
	vector<int> d;
	scanf("%d", &N);
	rep(i, N) {
		scanf("%d", &tmp);
		d.push_back(tmp);
	}
	sort(d.begin(), d.end());//降順ソート
	m = d.size() / 2;//中央値の左側　これ以上　これ未満
	tmp = d.at(m) - d.at(m - 1);
	printf("%d\n", abs(tmp));
	return 0;
}

Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  int n;
  cin>>n;
  vector<P> ab(n);
  rep(i,0,n){
    int a;
    int b;
    cin>>a>>b;
    ab[i]=mp(a,b);
  }
  ///////
  sort(all(ab));
  map<P,int> cnt;
  rep(i,0,n-1){
    rep(j,i+1,n){
      int x=(ab[i].first-ab[j].first);
      int y=(ab[i].second-ab[j].second);
      cnt[mp(x,y)]++;
    }
  }
  
  int ma=0;
  for(auto v:cnt){
   chmax(ma,v.second); 
  }
  cout<<n-ma<<endl;
}

Measured memory_bytes: 3588
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.StringTokenizer;

public class Main {

    public static void main(String args[]) {
    	
    	InputStreamReader isr = new InputStreamReader(System.in);
    	BufferedReader br = new BufferedReader(isr);
    	String buf;
    	int a,b,c,d,e,f;
    	double x,y,div;
    	
    	try{
    		while((buf = br.readLine())!=null)
    		{
    			StringTokenizer st = new StringTokenizer(buf);
    			a = Integer.parseInt(st.nextToken());
    			b = Integer.parseInt(st.nextToken());
    			c = Integer.parseInt(st.nextToken());
    			d = Integer.parseInt(st.nextToken());
    			e = Integer.parseInt(st.nextToken());
    			f = Integer.parseInt(st.nextToken());
    			div= (double)(a*e-b*d);
    			x = (double)(e*c-b*f);
    			y = (double)(-d*c+f*a);
    			
    			BigDecimal xVal = new BigDecimal(x/div);
    			BigDecimal yVal = new BigDecimal(y/div);
    			
    			xVal = xVal.setScale(3, BigDecimal.ROUND_HALF_UP);
    			yVal = yVal.setScale(3, BigDecimal.ROUND_HALF_UP);
    			
                System.out.println(xVal+" "+yVal);
    			
    		}
    	} catch (Exception err){
    		System.out.println("Exception");
    	}
    }
}

Measured memory_bytes: 24392
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

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

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

int main() {
	int k, n; scanf("%d%d", &k, &n); std::vector<int> a(n);
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);

	int ans = k - (a.front() + (k - a.back()));
	for(int i = 0; i < n - 1; i++) ans = std::min(ans, k - (a[i + 1] - a[i]));
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

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

int main(){
    int W, a, b;
    cin >> W >> a >> b;
    if ((a <= b&&b <= a + W) || (a <= b + W&&b + W <= a + W))cout << 0 << endl;
    else if (b + W < a) {
        cout << abs((b + W) - a) << endl;
    }
    else cout << b - (a + W) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cout << a[i] << " "; cout << "\n"; }
ll dbgt = 1; void err() { cout << "passed " << dbgt++ << "\n"; }
template<class H, class... T> void err(H&& h,T&&... t){ cout<< h << (sizeof...(t)?" ":"\n"); if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();
    ll N;
    cin >> N;
    ll cnt = 0;
    repe(i,1,N+1){
        if (i % 3 != 0 and i % 5 != 0) cnt+=i;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3640
#include <stdio.h>

int main(void) {

  int i, j, k=0, x[10000];

  for(i = 0; i < 10000; i++){
    scanf("%d", &x[i]);
    if( x[i] == 0){
      break;
    }
  }

  for(j = 0; j < i; j++){
    printf("Case %d: %d\n", j+1, x[k]);
    k++;
  }

  return 0;
}


Measured memory_bytes: 2044
#include <utility>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
  int N, M, v;
  pair<int,int> vote_area[110];
  while (cin >> N >> M && M >0) {
    //ペアの初期化
    for (int j = 0; j < M; ++j)
    {
      vote_area[j].first = 0;
      vote_area[j].second = j+1;/* code */
    }

    for (int i = 0; i < N; ++i)
    {
      for (int j = 0; j < M; ++j)
      {
        cin >> v;/* i人目の人が場所jに行きたいかどうか */  
        vote_area[j].first -= v;
        // cout << vote_area[j].first;
      }
      // cout << endl;
    }

//あるタイミングで整列する
    sort(vote_area, vote_area+M);
    // reverse(vote_area, vote_area+M);
    for (int i = 0; i < M; ++i)
    {
      cout << vote_area[i].second;
      if (i<M-1)
      {
        cout << " ";
      }
    }
    cout << endl;
  }
  return 0;
}

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

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

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll w,h;
ll n;
ll a[101010];

int main(){
  cin>>w>>h;
  cin>>n;
  rep(i,n)cin>>a[i];
  P p1=P(0,0),p2=P(1,0);
  int res=0;
  rep(i,n){
    if(!a[i]){
      if(p1.fi==0&&p1.se!=w-1){
        p1.se++;
      }else if(p1.se==w-1&&p1.fi!=h-1){
        p1.fi++;
      }else{
        p1.se--;
      }
    }else{
      if(p2.fi==1&&p2.se!=w-2){
        p2.se++;
      }else if(p2.se==w-2&&p2.fi!=h-2){
        p2.fi++;
      }else{
        p2.se--;
      }
    }
    if((p1.fi==p2.fi&&abs(p1.se-p2.se)<=1)||(p1.se==p2.se&&abs(p1.fi-p2.fi)<=1))res++;
  }
  cout<<res<<endl;
  return 0;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
#include <algorithm>
#include <queue>
using namespace std;
int main(){
	int N; 
	long long int W; 
	long long int w[110] = {}; 
	long long int v[110] = {}; 
	cin >> N >> W; 
 	for(int i = 1; i <= N; i++){
		cin >> w[i] >> v[i]; 
	}
	long long int dp[110][100010] = {}; // dp[i番目まで][重量j以下] = 価値のmax
	for(int i = 1; i <= N; i++){
		for(int j = 0; j <= W; j++){
			if(j >= w[i]){
				dp[i][j] = max(dp[i-1][j], dp[i-1][j-w[i]] + v[i]); 
			}
			else{
				dp[i][j] = dp[i-1][j]; 
			}
		}
	}
	cout << dp[N][W] << endl; 
}

Measured memory_bytes: 86144
k = int(input())
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(A[k-1])

Measured memory_bytes: 38384
#include <iostream>
#include <cstring>
using namespace std;
 
int main(){
	int mark[26]={0};
	string word;
	cin >> word;
	int len=word.size();
	for (int i=0; i<len; i++){
		mark[word[i]-'a']++;
	}
	for (int i=0; i<26; i++){
		if (mark[i]==0){
			cout << (char)(i+'a') << endl;
			return 0;
		}
	}
	cout << "None"<<endl;
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
using namespace std;
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define SUM(c) accumulate((c).begin(),(c).end(),0)
#define UNIQ(c) (c).erase(unique((c).begin(), (c).end()), (c).end());
#define Yn(b) puts(b?"Yes":"No")
#define YN(b) puts(b?"YES":"NO")

bool isprime(int p) {
  if (p==1) return false;
  FOR(i,2,p) {
    if (p%i==0) return false;
  }
  return true;
}

int main(){
  int c[9],l,m,n;
  REP(i,9){
    cin >> c[i];
  }
  REP(i,101){
    REP(j,101){
      REP(k,101){
        //l=c[0]-i;
        //m=c[1]-i;
        //n=c[2]-i;
        if (i<=c[0]) {l=c[0]-i;} else {k=101;}
        if (i<=c[1]) {m=c[1]-i;} else {k=101;}
        if (i<=c[2]) {n=c[2]-i;} else {k=101;}
        if (c[3]==j+l) {
          if (c[4]==j+m) {
            if (c[5]==j+n) {
              if (c[6]==k+l) {
                if (c[7]==k+m) {
                  if (c[8]==k+n) {
                    puts("Yes");
                    return 0;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  puts("No");
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define pb push_back
using namespace std;

int b_search(vector<int> &a, int n, int t)
{
	int low = 0, high = n;
	while(low<high)
	{
		int mid = low + (high - low )/2;
		if(a[mid]>t)
			high = mid;
		else low = mid+1;
	}
	return low;
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	vector<int> u(n),m(n),l(n);
	for(int i = 0; i<n; i++) cin>>u[i];
	for(int i = 0; i<n; i++) cin>>m[i];
	for(int i = 0; i<n; i++) cin>>l[i];
	sort(u.begin(),u.end());
	sort(m.begin(),m.end());
	sort(l.begin(),l.end());
	ll sel_b[n],sel_c[n];
	for(int i = 0; i<n; i++)
	{
		int y = b_search(m,n,u[i]);
		sel_b[i] = y;
	}
	for(int i = 0; i<n; i++)
	{
		int y = b_search(l,n,m[i]);
		sel_c[i] = y;
	}
	ll h[n+1]={0};
	for(int i = n-1; i>=0; i--)
		h[i] += h[i+1]+n-sel_c[i];
	ll ans = 0;
	for(int i = 0; i<n; i++)
		ans += h[sel_b[i]];
	cout<<ans<<endl;
	return 0;
}

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

int main(void){
    using namespace std;
    int n,c=1,count=0,m=0;
    cin>>n;
    int a[n],b[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        b[i]=0;
    }
    for(int i=n;i>0;i--){
        while(1){
            if(i*(c+1)<=n)c++;
            else break;
        }
        for(int j=c;j>1;j--) if(b[i*j-1]==1)count++;
        if(a[i-1]%2!=count%2){
            b[i-1]=1;
            m++;
        }
        count=0;
    }
    cout<<m<<endl;
    if(m!=0){
        for(int i=0;i<n;i++){
            if(b[i]==1){
                cout<<i+1<<" ";
            }
        }
    }
}

Measured memory_bytes: 2432
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vpi;
typedef long double ld;
#define pb emplace_back
#define emp emplace
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ALL(x) x.begin(), x.end()
#define SZ(x) (ll)x.size()
#define f first
#define s second
const ll MAXN = 200100;
const ll INF = 1e9;
const ll MOD = 1e9+7;

ll N,Q,a,b,c,d,e,M;

ll ask(ll A,ll B, ll N){
	return (A*N)/B-A*(N/B);
}

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>a>>b>>N;
	if(N>=b-1){cout<<ask(a,b,b-1);return 0;}
	cout<<ask(a,b,N);
}

Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <set>
#include <map>
#include <cassert>
#include <unordered_map>
#include <unordered_set>

using namespace std;

using ll = long long;
using ldb = long double;

#define forn(i, x, n) for (int i = x; i < (int)(n); ++i)
#define forcin(a, n) for (int i = 0; i < n; cin >> a[i], ++i)
#define forb(i, x, n) for (int i = (int)(x); i >= n; --i)
#define mmax(a, b, c) max(a, max(b, c))
#define mmin(a, b, c) min(a, min(b, c))
#define pb push_back
#define mp make_pair


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

    int ans = 0;
    forn(i, 0, a + 1) {
        forn(j, 0, b + 1) {
            forn(k, 0, c + 1) {
                if (i * 500 + j * 100 + k * 50 == x) {
                    ++ans;
                }
            }
        }
    }

    cout << ans;

}

Measured memory_bytes: 256
#include <ctype.h>
#include <stdio.h>
int main(void){
    char str[1200];
    int i;
    
    gets(str);
    
    for(i=0; i<1200; i++){
        if(islower(str[i])) str[i]=toupper(str[i]);
        else if(isupper(str[i])) str[i]=tolower(str[i]);
    }
    
    puts(str);
    
    return 0;
}

Measured memory_bytes: 524
import java.util.Scanner;

class Main{

 public static void main(String[] args){

 Scanner scan = new Scanner(System.in);

 int N = scan.nextInt();  
   if (N % 2 == 0){
  int O = N / 2;
     System.out.println(O);
   }
   
   else{
     int P = N / 2 + 1;
   System.out.println(P);
   
   }
   
   
 }
}


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

using namespace std;

//FILE *fi=freopen("1.txt","r",stdin);

int n,a[200005];
long long l=0,d[2];

void nhap()
{
    scanf("%d",&n);
    for (int i=n;i>0;--i)
    {
        char x;
        cin>>x;
        a[i]=(x=='1');
        l+=a[i];
    }
}

long long moe(long long a,long long b,long long c)
{
    if (b==0) return 1;
    if (b%2==0) return moe((a*a)%c,b/2,c);
    return (a*moe((a*a)%c,b/2,c))%c;
}

int solve(long long x)
{
    if (x==-1) return 0;
    int dem=1;
    while (x)
    {
        x%=__builtin_popcount(x);
        dem++;
    }
    return dem;
}

void process()
{
    for (int i=1;i<=n;++i)
    {
        if (l>1)
            d[0]=(d[0]+moe(1LL*2,i-1,l-1)*a[i])%(l-1);
        d[1]=(d[1]+moe(1LL*2,i-1,l+1)*a[i])%(l+1);
    }
    for (int i=n;i>0;--i)
    {
        long long x;
        if (a[i])
        {
            if (l>1)
                x=((l-1)*(l-1)-moe(1LL*2,i-1,l-1)+d[0])%(l-1);
            else x=-1;
        }
        else
        {
            x=(d[1]+moe(1LL*2,i-1,l+1))%(l+1);
        }
        cout<<solve(x)<<"\n";
    }
}

int main()
{
    nhap();
    process();
    return 0;
}


Measured memory_bytes: 4472
w = gets.to_i
arr = Array.new(w){|i| i+1}
n = gets.to_i
n.times{
  a, b = gets.split(",").map(&:to_i)
  arr[a-1], arr[b-1] = arr[b-1], arr[a-1]
}

w.times{|i|
  puts arr[i]
}

Measured memory_bytes: 8612
#include<bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long
#define mod 1000000007
#define M 1000000
using namespace std;


void answer(){
    ll n,ans=0,f=0,s=0;
    cin>>n;
    ll a[n+1],b[n+1],c[n+1];
    a[0] = 99999999, b[0]=-1;
    for(int i=1;i<=n;i++){
        cin>>c[i];
        a[i] = min(c[i],a[i-1]);
        b[i] = max(c[i],a[i-1]);
    }
    for(int i=1;i<=n;i++){
        if(a[i]==c[i]) ans++;
    }
    cout<<ans<<"\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q;
    //cin>>q ;while(q--)
        answer();
    return 0;
}


Measured memory_bytes: 4992
#include <stdio.h>

int main(){
	int N,flag=1;
	scanf("%d",&N);
	
	int a[N];
	for(int i=0;i<N;i++){
		scanf("%d",&a[i]);
		if( a[i]%2==0 && a[i]%3!=0 && a[i]%5!=0 ){
			flag = 0;
			break;
		}
	}
	
	if( flag ) printf("APPROVED");
	else printf("DENIED");
	
	return 0;
}

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

enum Direction{SOUTH,EAST};

int v[1001][1001],dp[1001][1001];
int main()
{
  int H,W,N;
  int y,x;
  while(cin>>H>>W>>N,H|W|N){
    for(int i=0;i<=H;i++)for(int j=0;j<=W;j++)v[i][j]=dp[i][j]=0;
    for(int i=1;i<=H;i++)for(int j=1;j<=W;j++)cin>>v[i][j];
    dp[1][1]=N-1;
    for(int i=1;i<=H;i++){
      for(int j=1;j<=W;j++){
	if(dp[i-1][j]&1){
	  if(v[i-1][j]==SOUTH)dp[i][j]+=(dp[i-1][j]+1)/2;
	  else dp[i][j]+=(dp[i-1][j]-1)/2;
	}else{
	  dp[i][j]+=dp[i-1][j]/2;
	}
	if(dp[i][j-1]&1){
	  if(v[i][j-1]==EAST)dp[i][j]+=(dp[i][j-1]+1)/2;
	  else dp[i][j]+=(dp[i][j-1]-1)/2;
	}else{
	  dp[i][j]+=dp[i][j-1]/2;
	}
      }
    }
    //for(int i=0;i<H;i++,puts(""))for(int j=0;j<W;j++)cout<<v[i][j]<<",";
    //puts("");
    //for(int i=0;i<=H;i++,puts(""))for(int j=0;j<=W;j++)cout<<dp[i][j]<<",";
    //puts("");
    //for(int i=0;i<H;i++,puts(""))for(int j=0;j<W;j++)cout<<((v[i][j]+dp[i][j])&1)<<",";
    //puts("");
    y=x=1;
    while(x<=W && y<=H){
      v[y][x]^=dp[y][x]&1;
      //cout<<y<<","<<x<<":"<<v[y][x]<<endl;
      if(v[y][x]==SOUTH)y++;
      else x++;
    }
    cout<<y<<" "<<x<<endl;
  }
}

Measured memory_bytes: 8692
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std ;

typedef long long ll ;
#define rep (i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	string s;
	
	cin >> s;
	int n = s.size();

	ll c = 0;

	for (int i = 0; i < (1 << (n-1)); i++)
	{
		ll num = s[0] - '0';
		for(int j = 0; j < n-1; j++)
		{
			if (i & (1<<j))
			{
				c+=num;
				num=0;
			}
			num = num * 10 + (s[j+1] - '0');
		}
		c+=num;
	}
	cout << c << endl;

	
	return 0;
}

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


int main(){
	
	int N,M;
	cin>>N>>M;
	int load[N]={0};
	for(int i=0;i<M;i++){
		int a,b;
		cin>>a>>b;
		load[a-1]++;
		load[b-1]++;
	}
	
	for(int i=0;i<N;i++){
		cout<<load[i]<<endl;
	}
	return 0;
}

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

int K,S;

int main()
{
    cin>>K>>S;

    int cnt = 0;
    for (int i = 0; i <= K; i++)
    {
        for (int j = 0; j <= K; j++)
        {
            int c = S-i-j;
            if(c>=0 && c<=K) cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

using namespace std;
typedef long long ll;
ll N_MAX = 100100;
using Graph = vector<vector<ll>>;
Graph G(N_MAX);
vector<ll> res(N_MAX), wt;
ll N;
vector<bool> used(N_MAX);
queue<ll> Q;

void bfs(ll u){
    while(!Q.empty()){
        ll v = Q.front();Q.pop();
        for(int i=0;i<wt.size();i++){
            if(used[v+wt[i]] || v+wt[i]>N) continue;
            used[v+wt[i]]=true;
            res[v+wt[i]]=min(res[v+wt[i]],res[v]+1);
            Q.push(v+wt[i]);
        }
    }
}

int main() {
    cin >> N;
    
    wt.push_back(1);
    ll tmp=6;
    while(tmp<=N){
        wt.push_back(tmp);
        tmp*=6;
    }
    tmp=9;
    while(tmp<=N){
        wt.push_back(tmp);
        tmp*=9;
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<wt.size();j++){
            if(i+wt[j]>N) continue;
            else{
                G[i].push_back(i+wt[j]);
            }
        }
    }
    for(int i=1;i<=N;i++){
        res[i] = 1<<30;
        used[i]=false;
    }
    Q.push(0);
    bfs(0);
    cout << res[N] << endl;
}

Measured memory_bytes: 17152
import java.util.*

fun main(args:Array<String>){
    val (n,k) = readLine()!!.split(" ").map{it.toInt()}
    val s = readLine()!!.toCharArray()
    s[k - 1] = (s[k - 1].toInt() - 'A'.toInt() + 'a'.toInt()).toChar()
    println(s)
}


Measured memory_bytes: 35984
#include<iostream>
#include<vector>
#include<math.h>
using namespace std;

int main() {
  int a;
  int dp[31] = {1};
  for(int i = 0; i < 31; i++) {
    for(int j = 1; j <= 3; j++) {
      dp[i + j] += dp[i];
    }
  }
  while(cin >> a) {
    if(a == 0) break;
    if(dp[a] % 3650 == 0) {
      cout << dp[a] / 3650 << endl;
    }else {
      cout << dp[a] / 3650 + 1 << endl;
    }
  }
}

Measured memory_bytes: 2924
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
template <class T>
inline bool chmin(T &a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;
using namespace atcoder;


template<typename T>
struct BIT{
  //0オリジンで与える
  vector<T>bit;
  int N;

  BIT(int n):N(n){
    bit.assign(++n,0);
  }

  T sum(int i){
    T s=0;
    ++i;//0オリジンに対応させる
    while(i>0){
      s+=bit[i];
      i-=i&-i;//iから最後の1のビットを減算
    }
    return s;
  }

  void add(int i,T x){
    ++i;//0オリジンに対応させる
    while(i<(int)bit.size()){
      bit[i]+=x;
      i+=i&-i;
    }
  }

  T Lower_bound(T k){
    if(k<=0)
      return 0;
    T x = 0;
    T mul = 1;
    while (mul<N){
      mul *= 2;
    }
    for (T i = mul; i > 0;i/=2){
      if(x+i<=N&&bit[x+i]<k){
        k -= bit[x + i];
        x += i;
      }
    }
    return x;
  }
};

void solve(){
  int n,q;
  cin>>n>>q;
  BIT<ll>bit(n);
  rep(i,n){
    ll a;
    cin>>a;
    bit.add(i,a);
  }
  while(q--){
    int que;
    ll x,y;
    cin>>que>>x>>y;
    if(que==0)bit.add(x,y);
    else {
			cout<<bit.sum(y-1)-bit.sum(x-1)<<"\n";
		}
  }
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 8248
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    ll N, M, X, Y;
    cin >> N >> M >> X >> Y;

    ll x[N];
    ll y[M];
    rep(i, N){
        cin >> x[i];
    }
    rep(i, M){
        cin >> y[i];
    }
    sort(x, x + N, greater<ll>());
    sort(y, y + M);

    if(x[0] < y[0] && X < y[0] && Y > x[0]){
        cout << "No War" << endl;
    }else{
        cout << "War" << endl;
    }

    return 0;
}

Measured memory_bytes: 3612