akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long int ll;


int main(void){
    int x;
    cin >> x;
    if(x==3||x==5||x==7){
        cout << "YES";
    }
    else{
        cout << "NO";
    }
    
    return 0;
}










































Measured memory_bytes: 256
K, N = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
A_diff = []
for i in range(N-1):
  A_diff.append(A[i+1] - A[i])
A_diff.append(K-A[-1]+A[0])
print(sum(A_diff)-max(A_diff))

Measured memory_bytes: 26444
s=input()
#左に>が続く個数、右に<が続く個数
l=[0]
r=[0]
l_,r_=0,0
for i in range(len(s)):
    if s[i]=='<':
        l_+=1
    else:
        l_=0
    l.append(l_)
    if s[-1-i]=='>':
        r_+=1
    else:
        r_=0
    r.append(r_)
r.reverse()
ans=0
for i in range(len(s)+1):
    ans+=max(l[i],r[i])
print(ans)


Measured memory_bytes: 29828
#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
 
vector<pair<pi, int> > ed;

signed main() {
	IOS;
	#ifdef LOCAL
		freopen("input.txt","r", stdin);
		freopen("output.txt","w",stdout);
	#endif
	int l;	cin >> l;
	int n = log2(1.0*l) + 1;
	for(int i = 1; i < n; i++){
		ed.push_back({{i, i+1}, 0});
		ed.push_back({{i, i+1}, pow(2, n-i-1)});
	}	
	int cur = pow(2, n-1);
	l -= cur;
	while(l > 0){
		int x = log2(1.0*l);
		ed.push_back({{1, n-x}, cur});
		l -= pow(2, x);
		cur += pow(2, x);
	}
	cout << n << " " << ed.size() << endl;
	for(auto i: ed)
		cout << i.fi.fi << " " << i.fi.se << " " << i.se << endl;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <map>
#include <string>

using namespace std;

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

int wl[10][10];
int n, m;

map<string, int> update(int i, int j, string state,
        map<string, int> nmap, int num) {
    if (state[i]-'0'>=1 && state[n+j]-'0'>=1) {
        string nstate = state;
        nstate[i] = to_string(state[i]-'0'-1)[0];
        nstate[n+j] = to_string(state[n+j]-'0'-1)[0];

        auto iter = nmap.find(nstate);
        if (iter != nmap.end()) {
            nmap[nstate] += num;
        } else {
            nmap[nstate] = num;
        }
    }
    return nmap;
}

int main() {
    while (true) {
        cin >> n >> m;

        if (n==0) break;

        REP(i, n) {
            REP(j, n) {
                wl[i][j] = 0;
            }
        }

        string initn = to_string((n-1)/2);
        string inits = string(n * 2, initn[0]);
        // 1 - (n-1)/2 : win
        // n - (n-1) : lose

        REP(i, m) {
            int x, y;
            cin >> x >> y;
            wl[x-1][y-1] = 1;
            wl[y-1][x-1] = -1;

            int xwin = inits[x-1] - '0';
            inits[x-1] = to_string(xwin - 1)[0];

            int ylose = inits[n + (y-1)] - '0';
            inits[n + (y-1)] = to_string(ylose - 1)[0];
        }

        map<string, int> prevm;
        prevm[inits] = 1;
        REP(i, n-1) {
            for (int j=i+1; j<n; j++) {
                if (wl[i][j] == 0) {
                    map<string, int> nextm;
                    for(auto& kv: prevm) {
                        string state = kv.first;
                        int num = kv.second;

                        nextm = update(i, j, state, nextm, num);
                        nextm = update(j, i, state, nextm, num);
                    }
                    prevm = nextm;
                }
            }
        }

        string ends = string(n*2, '0');
        cout << prevm[ends] << endl;
    }
}



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

#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main() {
  int A, B;
  cin >> A >> B;
  if (A <= 8 && B <= 8) cout << "Yay!" << endl;
  else cout << ":(" << endl;
}


Measured memory_bytes: 256
// Try AtCoder
// author: Leonardone @ NEETSDKASU

fn main() {
	let mut stdin = String::new();
    std::io::Read::read_to_string(
    	&mut std::io::stdin(),
        &mut stdin).unwrap();
	let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
    	() => (get().parse::<i64>().unwrap());
    }
    
    let x = get!();
    let y = get!();
    
    if x % y == 0 {
    	println!("-1");
    } else {
    	println!("{}", x);
    }
}

Measured memory_bytes: 4352
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> day(M);
  int sum = 0;
  
  for(int i = 0; i < M; i++){
    cin >> day[i];
    sum += day[i];
  }
  
  int ans = N - sum;
  
  if(ans < 0)
    cout << "-1" << endl;
  else
    cout << ans << endl;
  
  return 0;
  
}

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

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

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

  int sum = 0;
  for (int i=1; i<=K; i++) {
    for (int j=1; j<=K; j++) {
      for (int k=1; k<=K; k++) {
        sum += gcd(gcd(i, j), k);
      }
    }
  }
  cout << sum << endl;

  //cout << gcd(12, 8) << endl;
}

Measured memory_bytes: 3632
#include <iostream>

int main()
{
    int rate;
    std::cin >> rate;

    if (rate < 1200) {
        std::cout << "ABC" << std::endl;
    } else if (rate < 2800) {
        std::cout << "ARC" << std::endl;
    } else {
        std::cout << "AGC" << std::endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000

int main(){
	
	string s;
	cin>>s;
	
	int ans = 0;
	
	for(int i=0;i<6;i++){
		if(s[i]=='1')ans++;
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fori(j,n) for(ll i=j;i<n;i++)
#define forb(n,j) for(ll i=n-1;i>=0;i--)
#define endl "\n"
#define pb push_back
#define ll long long
#define mp make_pair
#define ff first
#define ss second
#define vec vector<ll>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

void wldd()
{
	double n, x, t;
	cin >> n >> x >> t;
	ll ans = ceil(n / x) * t;
	cout << ans << endl;
}
int32_t main()
{
	IOS;
	/*ll t;
	cin >> t;
	while (t--)*/ wldd();
	return 0;
}

Measured memory_bytes: 3728
#include <cstdio>
#include <algorithm>
#define maxn 200005
#define INF 999999999
using  namespace std;
int n, m, pos[maxn];

int main() 
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) 
	{
		scanf("%d", &m);
		pos[m] = i;
	}
	int len = 1, ans = INF;
	for (int i = 1; i < n; i++) 
	{
		if (pos[i + 1] > pos[i]) len++; 
		else 
		{
			ans = min(ans, n - len);
			len = 1;
		}
	}
	ans = min(ans, n - len);
	printf("%d", ans);
	return 0;
}


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

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t,i,flag;
	string s;
	t = 1;
	while(t--) {
          flag = 0;
	      cin >> s;
	      int arr[26] = {0};
          for(i = 0; i < 4; i++) {
           arr[s[i] - 65]++;
          }
          for(i = 0; i < 26; i++) {
           if(arr[i] > 0 && arr[i] != 2) {
           	flag = 1;
           	break;
		   }
          }
          if(flag == 0)
           cout << "Yes" << endl;
          else
           cout << "No" << endl;
	}
	return 0;
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<par<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n;
    cin>>n;
    vector<pair<pair<string,int>,int>> v(n);
    rep(i,n){
        int p;
        cin>>v[i].fi.fi>>p;
        v[i].fi.se=-p;
        v[i].se=i+1;
    }
    SORT(v);
    rep(i,n)cout<<v[i].se<<endl;
}

Measured memory_bytes: 256
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
#import numpy as np
# sympy as syp(素因数分解とか)
Mod = 1000000007
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1] 
for i in range(2, 10**5 + 1):
    fact.append((fact[-1] * i) % Mod)
    inv.append((-inv[Mod % i] * (Mod // i)) % Mod)
    factinv.append((factinv[-1] * inv[-1]) % Mod)
    
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p
    
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)
import string
def main():  #startline-------------------------------------------
    l, r, d = map(int, input().split())
    ans = 0
    for i in range(l, r + 1):
        if i % d == 0:
            ans += 1

    print(ans)
if __name__ == "__main__":
    main() #endline===============================================

Measured memory_bytes: 21940
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
X = int(input())

while True:
  if len(prime_factorize(X)) == 1:
    print(X)
    break
  
  X += 1

Measured memory_bytes: 3060
N = int(input())
rest = {}
cities = []
for i in range(N):
    k,s = input().split()
    if k not in rest:
        rest[k] = []
        cities.append(k)
    rest[k].append([int(s),i+1])
cities.sort()
for k in cities:
    rest[k].sort(reverse = True)
    for i in rest[k]:
        print(i[1])

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

typedef long long ll;

int main(void){
    ll k,a,b;
    cin>>k>>a>>b;
    if(a>=k){
        cout<<1<<endl;
    }else if(a<=b){
        cout<<-1<<endl;
    }else{
        ll x = (k-a)/(a-b);
        if(x*(a-b)>=k)cout<<x*2<<endl;
        else if(x*(a-b)+a>=k)cout<<x*2+1<<endl;
        else cout<<x*2+3<<endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define rep(i,n) for(int i=0; (i)<(n); i++)
#define normal (20*5+19*5)
#define mod3 (20*10)
#define all (333*(mod3)+666*(normal))
int main(void){
    int n;
    int y,m,d,ans;
    scanf("%d",&n);
    rep(i,n){
        scanf("%d%d%d",&y,&m,&d);
        if(y%3==0){
            ans=d-1+(m-1)*20;
        }
        else{
            ans=d-1;
            for(int i=1;i<m;i++){
                if(i%2==1) ans+=20;
                else ans+=19;
            }
        }
        y=y-1;
        int tmp=y/3;
        ans+=tmp*mod3;
        ans+=(y-tmp)*normal;
        printf("%d\n",all-ans);
    }
}



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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

int main()
{
    rep(i,5){
        int xi; cin >> xi;
        if(xi == 0){
            cout << i+1 << endl;
            return 0;
        }
    }
}

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

int main(){
  int n, s[100];
  int sam = 0, ave[100];
  int min, max;
  int kmin = 0, kmax = 0;
  int k = 0;
  
  while(true){
    cin >> n;
    if(n == 0) break;
    sam = 0;
    
    for(int i = 0; i < n; ++i){
      cin >> s[i];
      sam += s[i];

      if(i == 0){
	min = s[i];
	max = s[i];
      }
      
      if(min > s[i]) min = s[i];
      if(max < s[i]) max = s[i];

      if(min == s[i] && kmin == 0) ++kmin;
      if(max == s[i] && kmax == 0) ++kmax;
    }
    ave[k] = (sam - min - max) / (n - kmin - kmax);
    ++k;
  }

  for(int f = 0; f < k; ++f){
    cout << ave[f] << endl;
  }
  
    
  return 0;
}



Measured memory_bytes: 3076
using System;

namespace A_Airplane
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Console.ReadLine().Split(' ');
            var p = int.Parse(a[0]);
            var q = int.Parse(a[1]);
            var r = int.Parse(a[2]);
            var c=Math.Max(p, q);
            c = Math.Max(c, r);
            var b = (p + q + r) - c;
            Console.WriteLine(b);
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
//const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
    int n;
    cin>>n;
    V<string> s(n);
    for(int i=0;i<n;i++)cin>>s[i];
    sort(all(s));
    s.erase(unique(all(s)),s.end());
    cout<<s.size()<<"\n";
}

Measured memory_bytes: 9540
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int t = sc.nextInt();
		int[][] array=new int[n][2];

		for(int i=0;i<n;i++) {
			array[i][0]=sc.nextInt();
			array[i][1]=sc.nextInt();
		}
		Arrays.sort(array, (a, b) -> Integer.compare(a[0], b[0]));

		for(int i=0;i<n;i++) {
			if(array[i][1]<=t) {
				System.out.println(array[i][0]);
				System.exit(0);
			}
		}
		System.out.println("TLE");
	}
}

//Arrays.sort(array, (a, b) -> Integer.compare(a[0], b[0]));




Measured memory_bytes: 26964
#include<stdio.h>

int main(void) {
	int H, W;
	int i;
	char C[101];
	scanf("%d %d", &H, &W);
	for (i = 0; i < H; i++) {
		scanf("%s", C);
		printf("%s\n", C);
		printf("%s\n", C);
	}
	return 0;
}

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


// ref : http://kuno4n.hateblo.jp/entry/2013/12/14/140104#count9
const int MOD = 1000000007;
long long C[2010][2010];

void make_C(){
    memset(C, 0, (int)sizeof(C));    
    for(int i = 0; i < 2010; i++){
        C[i][0] = C[i][i] = 1;
        for(int j = 1; j < i; j++) C[i][j] = (C[i-1][j-1] + C[i-1][j]) % MOD;
    }
}

int count9_1(int n, int m){
    return C[n+m-1][m-1];
}

int main(){
  int N, B;
  cin >> N >> B;
  int R = N - B;
  make_C();
  for(int ii=1; ii<=B; ii++){
    int num_pos_B = ii;
    int num_pos_R = ii+1;
    int B2 = B - ii;
    int R2 = R - (ii - 1);
    if(B2<0 || R2<0){
      cout << 0 << endl;
      continue;
    }
    long long int ans_B = count9_1(B2, num_pos_B);
    long long int ans_R = count9_1(R2, num_pos_R);
    cout << ans_B * ans_R  % MOD << endl;
  }
  return 0;
}


Measured memory_bytes: 31872
package main

import (
  "bufio"
  "fmt"
  "os"
  "strconv"
  "strings"
)

func main() {
  input := Input{bufio.NewReaderSize(os.Stdin,100)}
  n := input.NextInt()
  dp := make([][]int,n+1)
  dp[0] = make([]int,3)
  for i:=1;i<n+1;i++ {
    a,b,c := input.NextInts()
    dp[i] = make([]int,3)
    dp[i][0] = max(dp[i-1][1],dp[i-1][2])+a
    dp[i][1] = max(dp[i-1][2],dp[i-1][0])+b
    dp[i][2] = max(dp[i-1][0],dp[i-1][1])+c
  }
  fmt.Println(max(max(dp[n][0],dp[n][1]),dp[n][2]))
}
func max(n,m int) int {
  if n > m { return n }
  return m
}

type Input struct { reader *bufio.Reader }
func(i *Input) NextLine() string {
  var buffer []byte
  for {
    line,isPrefix,err := i.reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer,line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func(i *Input) NextInt() int {
  n,_ := strconv.Atoi(i.NextLine())
  return n
}
func(i *Input) NextInts() (int,int,int) {
  s := strings.Split(i.NextLine()," ")
  a,_ := strconv.Atoi(s[0])
  b,_ := strconv.Atoi(s[1])
  c,_ := strconv.Atoi(s[2])
  return a,b,c
}

Measured memory_bytes: 8832
#include<bits/stdc++.h>
#define INF 9223372036854775807LL
#define inf 1000000007
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
lol a,b,c,d;
int i[100010];
bool dp[100010];
bool vi[100010];
bool ka(int x){
    if(vi[x]) return dp[x];
    bool ca=false;
    vi[x]=true;
    for(int n=0;n<a;n++){
	if(x-i[n]>=0&&!ka(x-i[n])) ca=true;
    }
    return dp[x]=ca;
}
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >>a>>b;
    for(int n=0;n<a;n++) cin >>i[n];

  for(int n=1;n<=b;n++){
  for(int m=0;m<a;m++){
  if(n-i[m]>=0&&!dp[n-i[m]]) dp[n]=true;
  }
  }
  if(dp[b]) cout <<"First\n";
  else cout <<"Second\n";
/*
    if(ka(b)) cout <<"First\n";
    else cout <<"Second\n";
*/
    return (0);
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

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

   cout << min(a * n, b) << endl;

   return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>


#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)

using namespace std;

struct stu
{
  int no;
  int count;
};

int main()
{
  int n;
  cin >>n;
  vector<stu> a;
  rep(i,n)
  {
    int l;
    cin >>l;
    stu aa;
    aa.no =i+1;
    aa.count =l;
    a.push_back(aa);
  }
  sort(all(a), [](const stu &x, const stu &y) { return x.count< y.count; });
  string ret = "";
  rep(i,n)
  {
    cout << a[i].no;
    cout << " ";
  }
	return 0;
}


Measured memory_bytes: 1780
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LONG_LONG_MAX
int main(){
    long long x;
    cin>>x;
    long long ans=100;
    long long tp=0;
    while(ans<x){
        ans=1.01*ans;
        tp++;
     
    }
    cout<<tp<<endl;
    
    return 0;
}

Measured memory_bytes: 3636
//Robs Code

/***********HEADER***************/
#include <iostream>
#include <bitset>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <list>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <iomanip>

/***********MACROS***************/
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define endl "\n"
#define pb push_back
#define _1 first
#define _2 second
#define pii pair<int,int>

using namespace std;

const int N = 1e5 + 1;
int n,m,i,j,k,l,x,y,z,cnt[3],sum[3];

/***********MAIN**************/
const int M = 998244353;
int power(int x, int y){
    x %= M;
    int ans = 1;
    while(y){
        if(y & 1)
            ans = (ans * x) % M;
        y >>= 1LL;
        x = (x * x) % M;
    }
    return ans;
}
int add(int a, int b){
    return((a % M + b % M) % M);
}
int sub(int a, int b){
    return((a % M - b % M + M) % M);
}
int mul(int a, int b){
    return(((a % M) * (b % M)) % M);
}
int divi(int a, int b){
    return(mul(a, power(b, M - 2)) % M);
}
int a[3001];
int dp[3001][3001];
int brute(int i,int s){
	if(s < 0){
		return 0;
	}
	if(s == 0){
		return power(2,n - i + 1);
	}
	if(i == n){
		return 0;
	}
	if(dp[i][s] != -1){
		return dp[i][s];
	}
	dp[i][s] = (2 * brute(i + 1,s) + brute(i + 1,s - a[i])) % M;
	return dp[i][s];
}
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	cin >> n >> m;
	for(int i = 0;i < n;i++){
		cin >> a[i];
	}
	memset(dp,-1,sizeof dp);
	cout << divi(brute(0,m) , 2);
}
//.........

Measured memory_bytes: 74212
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    w = list(map(int, input().split()))
    res = 10**10
    for t in range(1,n):
        a = sum(w[:t])
        b = sum(w)-a
        res = min(res, abs(a-b))
    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
template <class T> bool maxi(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool mini(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
#define dame {cout<< "-1" <<"\n"; return;}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
#define PI (acos(-1))
using namespace std;
using ll = long long;
using ld = long double;
using P  = pair<ll,ll>;
//--GLOBAL---------------------------------

//--MAIN-----------------------------------
void Main() {
    ll A,B; cin>>A>>B;
    if(A!=1 and B!=1) cout<< 1 <<"\n";
    else if(A!=2 and B!=2) cout<< 2 <<"\n";
    else cout<< 3 <<"\n";

    
}

//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------


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

using namespace std;

typedef long long ll;
typedef long double Double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

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

void solve(std::string S) {
    vector<string> t = {"Sunny", "Cloudy", "Rainy", "Sunny"};
    cout << *++find(t.begin(), t.end(), S) << endl;
}

int main() {
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

using namespace std;
const int MOD = 1000000007,MAX = 510000;
long int pow107 = (int)pow(10, 9) + 7,llimit = LONG_MAX,fac[MAX], finv[MAX], inv[MAX];
int ilimit = INT_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 int COM(long int n,long int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

bool comp(pair<int, int> a, pair<int, int> b){
    if(a.first != b.first) return a.first > b.first;
    else return a.second < b.second;
}

long int jou(long int x, long int y){
    long int f = 1;
    for(int i = 0; i < y; ++i){
        f = f * x % pow107;
    }
    return f;
}

bool pn(long int x){
    if(x != 2 && x % 2 == 0)
        return false;
    for(int i = 3; i < x; ++i){
        if(x != i && x % i == 0)
            return false;
    }
    return true;
}

long int factorial(long int n){
    long int f = 1;
    for(long int i = 1; i <= n; ++i){
        f = f * i % pow107;
    }
    return f;
}

long int Func2(long int n,long int m){
    long int s2 = 1,
        r = 1;
    for(long int i = 1; i <= m; ++i){
        s2 = (s2*(n - (i - 1))/i) % (pow107);
    }
    return s2;
}

bool secsort(pair<int, int> a, pair<int, int> b){
    if(a.second == b.second)return a.first > b.first;
    else return a.second > b.second;
}

//long intの最大llimit
//intの最大ilimit
//10^9+7    pow107
//素数pn
//n乗jou
//階乗factorial
//コンビネーションFunc2
//コンビネーションCOMinit(),COM(n,m)

int main(){
    string s;
    cin >> s;
    cout << s[0] << s.size() - 2 << s[s.size() - 1] << endl;

}

Measured memory_bytes: 256
#include"stdio.h"
#include"stdlib.h"
int main()
{
  int n;
  int i,j;
  int *A;
  int min;
  int buf;
  int count=0;
  scanf("%d",&n);
  A=(int*)malloc(sizeof(int)*n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&A[i]);
    }

  for(i=0;i<n;i++)
    {
      min=i;
      for(j=i;j<n;j++)
        {
          if(A[j]<A[min])
            {
              min=j;
            }
        }
      if(i!=min)
        {
          buf=A[i];
          A[i]=A[min];
          A[min]=buf;
          count++;
        }
    }

  printf("%d",A[0]);
  for(i=1;i<n;i++)
    {
      printf(" %d",A[i]);
    }
  printf("\n%d\n",count);
  return 0;
}


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

int main()
{
    char a[4],b[4];
    int i,n=0;
    cin>>a>>b;
    for(i=0;i<3;i++)
        if(a[i]==b[i]) n++;
    cout<<n;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repR(i, n) for(ll i = n; i >= 0; ++i)
#define FDS(i, n) for(ll i = 0; i < n; ++i)
#define FDSR(i, n) for(ll i = n; i >= 0; ++i)
#define FOR(i, m, n) for(ll i = m; i < n; ++i)
#define FORR(i, m, n) for(ll i = m;i >= n;--i)
#define VSORT(v) sort(v.begin(), v.end());
#define VREV(v) reverse(v.begin(), v.end());
#define INF 999999999
#define itn ll
#define ednl endl
using namespace std;
typedef long long ll;template<typename Typell>Typell G_C_D(Typell a, Typell b){if (a < 0) a = -a;if (b < 0) b = -b;while (b != 0) {a %= b;if (a == 0) return b;b %= a;}return a;}template<typename Typell>
Typell G_C_D(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = G_C_D(a, list[i]);}return a;}template<typename Typell>Typell L_C_M(Typell a, Typell b) {if( a == 0 && b == 0)return 0;return a / G_C_D(a, b) * b;}
template<typename Typell>Typell L_C_M(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = L_C_M(a, list[i]);}return a;}

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vector<ll> a(N);
	FDS(i,N){
		cin>>a[i];
	}
	if(N==2){
	    cout<<abs(a[0]-a[1])<<endl;
	    return 0;
	}
	ll sunuke=a[0];
	ll arai=a[N-1];
	vector<ll> ruiseki(N-2);
	ruiseki[0]=a[1];
	FDS(i,N-3){
		ruiseki[i+1]=ruiseki[i]+a[i+2];
	}
	
	ll ans=INF;
	FDS(i,N-2){
		ans=min(ans,abs(sunuke+ruiseki[i]-(arai+ruiseki[N-3]-ruiseki[i])));
	}
	ans=min(ans,abs(sunuke-(ruiseki[N-3]+arai)));
	cout<<ans<<endl;
}

Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(obj)   (obj).begin(),(obj).end()

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

void Main() {
	int N; cin >> N;
	vi A(N);
	REP(i, N) cin >> A[i];
	vector<pair<int, int>> p_v;
	REP(i, N) {
		p_v.push_back(make_pair(A[i], i));
	}
	sort(ALL(p_v));
	map<int, int> mp;
	REP(i, N) {
		mp[p_v[i].first] = i;
	}
	vi idx_v;
	REP(i, N) {
		idx_v.push_back(mp[A[i]]);
		idx_v[i] = mp[A[i]];
	}
	int res = 0;
	REP(i, N) {
		if (abs(i - idx_v[i]) % 2 != 0) res += 1;
	}
	cout << res / 2 << endl;
}

int main() {
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 7028
#include<stdio.h>
int main(){
  int m,f,r;
  while(scanf("%d %d %d",&m,&f,&r)){
    if(m==-1 && f==-1 && r==-1)break;
    if(m==-1 || f==-1)printf("F\n");
    else if(m+f>=80)printf("A\n");
    else if(m+f<80 && m+f>=65)printf("B\n");
    else if(m+f<65 && m+f>=50)printf("C\n");
    else if(m+f<50 && m+f>=30){
      if(r>=50)printf("C\n");
      else printf("D\n");
    }
    else printf("F\n");
  }
  return(0);
}

Measured memory_bytes: 584
#include <cmath>
#include <iostream>
#include <functional>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;

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

  for(int i=0;i<3;i++){
    if(S[i] == S[i+1]){
      cout << "Bad" << endl;
      return 0;
    }
  }
  
  cout << "Good" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <complex>
#include <ctype.h>

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

using namespace std;

#define NUMBER     ( 128 )
#define LIMIT      ( 10000 )

struct token_t
{
	int type;
	int ival;
};

complex<int> parse_expr(); // prototype

string src;
int p;
token_t token;
bool overflowed;

bool overflow(const complex<int> &c)
{
	return c.real() < -LIMIT || LIMIT < c.real() || c.imag() < -LIMIT || LIMIT < c.imag();
}

void check_of(const complex<int> &c)
{
	overflowed = overflowed || overflow(c);
}

bool end() { return p >= src.length(); }
char peek() { return src[p]; }
void succ() { if (!end()) ++p; }

void lex_number()
{
	token.type = NUMBER;
	token.ival = 0;
	char c = peek();
	do
	{
		token.ival = 10 * token.ival + (c - '0');
		if (LIMIT < token.ival) overflowed = true;
		succ();
	}
	while (!end() && isdigit(c = peek()));
}

void next()
{
	token.type = 0;

	if (end()) return;

	char c = peek();
	if (isdigit(c))
	{
		lex_number();
	}
	else
	{
		succ();
		token.type = (int)c;
	}
}

complex<int> parse_primary()
{
	complex<int> c;

	switch (token.type)
	{
	case NUMBER:
		c = complex<int>(token.ival, 0);
		next();
		break;
	case 'i':
		c = complex<int>(0, 1);
		next();
		break;
	case '+':
		next();
		c = parse_primary();
		break;
	case '-':
		next();
		c = -parse_primary();
		break;
	case '(':
		next();
		c = parse_expr();
		if (token.type == ')') next();
		break;
	}
	check_of(c);
	return c;
}

complex<int> parse_term()
{
	complex<int> c = parse_primary();
	while (!end() && token.type == '*')
	{
		next();
		c = c * parse_primary();
		check_of(c);
	}
	return c;
}

complex<int> parse_expr()
{
	complex<int> c = parse_term();
	while (!end() && (token.type == '+' || token.type == '-'))
	{
		int op = token.type;
		next();
		complex<int> d = parse_term();
		c = (op == '+' ? c + d : c - d);
		check_of(c);
	}
	return c;
}

complex<int> parse()
{
	overflowed = false;
	p = 0;
	next();

	return parse_expr();
}

void print_complex(complex<int> c)
{
	if (c.real() == 0)
	{
		if (c.imag() == 0)
			cout << "0";
		else
			cout << c.imag() << "i";
	}
	else
	{
		cout << c.real();
		if (c.imag() != 0)
			cout << showpos << c.imag() << noshowpos << "i";
	}
	cout << endl;
}

int main()
{
	while (cin>>src)
	{
		complex<int> result = parse();
		if (overflowed)
			cout << "overflow" << endl;
		else
			print_complex(result);
	}
	return 0;
}

Measured memory_bytes: 0
import heapq

N = int(input())
arr = list(map(int,input().split()))
hq_l = arr[:N]
hq_r = list(map(lambda x:x*(-1),arr[-N:]))
heapq.heapify(hq_l)
heapq.heapify(hq_r)

l_sum = [0]*(N+1)
l_sum[0] = sum(hq_l)
r_sum = [0]*(N+1)
r_sum[-1] = -sum(hq_r)

for i in range(1,N + 1):
    heapq.heappush(hq_l,arr[N-1+i])
    a = heapq.heappop(hq_l)
    l_sum[i] = l_sum[i-1] + arr[N-1+i] - a
    heapq.heappush(hq_r,-arr[2*N-i])
    a = -heapq.heappop(hq_r)
    r_sum[-1-i] = r_sum[-i] + arr[2*N-i] - a

ans = -float('inf')
for l,r in zip(l_sum,r_sum):
    ans = max((l-r),ans)
print(ans)

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

int main() {
 int n,d; cin >> n >> d;
 int a=2*d+1; //ひとりが見れる範囲
 int ans=n/a;
 if(n%a==0)cout << ans << endl;
 else cout << ans+1 << endl;
}


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

using ll = long long;
template<class T>
using V = vector<T>;
template<class T>
using VV = V<V<T> >;

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

int head(int n){
    if(n / 10 == 0) return n;
    else return head(n / 10);
}

int tail(int n){
    return n % 10;
}

int main(){
    int N;
    cin  >> N;
    
    VV<int> c(10, V<int>(10, 0));
    rep2(i, 1, N+1) c.at(head(i)).at(tail(i))++;
    
    ll sum = 0;
    rep(i, 10){
        rep(j, 10)  sum += (ll)c.at(i).at(j) * c.at(j).at(i);
    }

    cout << sum << endl;
}

Measured memory_bytes: 3632
import java.util.*;
import java.io.*;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        int N = Integer.parseInt(br.readLine());
        String[] strH = br.readLine().split(" ");
        int[] H = Stream.of(strH).mapToInt(Integer::parseInt).toArray();
        int[] dp = new int[N]; 
        dp[0] = 0;
        
        int maxValue = 0;
        
        for(int i = 1; i < N; i++){
            if(H[i-1] >= H[i]){
                dp[i] = dp[i-1] + 1;
                maxValue = Math.max(maxValue, dp[i]);
            } else {
                dp[i] = 0;
            }
        }
        
        System.out.println(maxValue);
    }
}


Measured memory_bytes: 46604
a,b,c=map(int,input().split())
x=[a,b,c]
cnt=0
if a%2==0 and b%2==0 and c%2==1:
    a+=1
    b+=1
    cnt+=1
elif a%2==0 and b%2==1 and c%2==0:
    a+=1
    c+=1
    cnt+=1
elif a%2==1 and b%2==0 and c%2==0:
    b+=1
    c+=1
    cnt+=1
elif a%2==1 and b%2==0 and c%2==1:
    a+=1
    c+=1
    cnt+=1
elif a%2==1 and b%2==1 and c%2==0:
    a+=1
    b+=1
    cnt+=1
elif a%2==0 and b%2==1 and c%2==1:
    b+=1
    c+=1
    cnt+=1
x=[a,b,c]
print(cnt+(3*max(x)-sum(x))//2)

Measured memory_bytes: 3064
// "include" {{{
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <tuple>
// }}}
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define int long long
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1000000007;

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin >> a >> b;
    cout << (a-1) * (b-1) << '\n';
    return 0;
}


Measured memory_bytes: 256
<?php
$len = trim(fgets(STDIN)) + 0;
$str = trim(fgets(STDIN));
for($i = 0; $i < $len; $i++){
  $s = $str[$i];
  if(isset($map[$s])){
	  $map[$s]++;
  }else{
	  $map[$s]=2;
  }
}
$p = 1;
foreach($map as $num){
  $p *= $num;
  $p = $p  % (1000000000+7);
}
echo $p - 1;

Measured memory_bytes: 4728
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>

using namespace std;
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const long long INF = 1LL << 60;

int MOD = 1000000007;

template <class T>
std::vector<std::vector<T>> imos_2d(const std::vector<std::vector<T>>& a) {
    int h = a.size(), w = a[0].size();
    std::vector<std::vector<T>> s(h + 1, std::vector<T>(w + 1, 0));
    rep(i, h) rep(j, w) s[i + 1][j + 1] = a[i][j];
    rep(i, h + 1) rep(j, w) s[i][j + 1] += s[i][j];
    rep(i, h) rep(j, w + 1) s[i + 1][j] += s[i][j];
    
    //std::cout << "array s is like following:" << std::endl;
    
    // for (int i = 0; i < h+1; i++) {
    //     for (int j = 0; j < w+1; j++) {
    //         if (j!=w) {
    //             std::cout << s[i][j] << ", ";
    //         } else {
    //             std::cout << s[i][j];
    //         }
    //     }
    //     std::cout << "" << std::endl;
    // }
    
    return s;
}

template <class T>
int sum(const std::vector<std::vector<T>>& s, int i, int j, int h, int w) {
    return s[i + h][j + w] - s[i][j + w] + s[i][j] - s[i + h][j];
}

int main(){
    std::ios_base::sync_with_stdio(false);

    int n,k; cin >> n >> k;

    std::vector<std::vector<int>> grid(2*k, std::vector<int>(2*k));

    rep(i,n){
        ll x,y; char c; cin >> x >> y >> c;
        if(c=='W') grid[x%(2*k)][(y+k)%(2*k)]++;
        else grid[x%(2*k)][y%(2*k)]++;
    }

    auto s = imos_2d(grid);

    //cout << sum(s,0,0,2*k,2*k) << '\n';

    int ans = 0;

    rep(i,k+1) rep(j,k+1){
        //cout << i << " " << j << endl;
        int x = sum(s,0,0,i,j)+sum(s,i,j,k,k)+sum(s,i+k,0,k-i,j)+sum(s,i+k,j+k,k-i,k-j)+sum(s,0,j+k,i,k-j);
        ans = max(ans, x);
        ans = max(ans, n-x);
    }
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 31744
#include <iostream>
#include <bits/stdc++.h>
#include<math.h>
#define ll long long int
#define MX 10000

using namespace std;

/*bool sortBySec(pair <ll, ll> &a, pair <ll,ll> &b){
    return a.second<b.second;
}
ll binarySearch(vector<ll> v, ll ele){
    ll low=0, high=v.size()-1;
    ll mid;
    while(low<high){
        mid=low + (high-low)/2;
        if(v[mid]>=ele){
            high=mid;
        }
        else{
            low=mid+1;
        }
    }
    return low;
}*/

void solve(){

}


int main() {
    std::ios_base::sync_with_stdio(false);
    int x;
    cin>>x;
    if(x) cout<<0;
    else cout<<1;
}




/*

5 to 3
1 2 3 4 5

*/


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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod=1000000007;
//head
const int nax = 1e5+2;
int dp[nax];
int in[nax];
bool vis[nax];
vi adj[nax];

void dfs(int u) {
    assert(!vis[u]);
    vis[u] = true;
    for(int v : adj[u]) {
        dp[v] = max(dp[u] + 1, dp[v]);
        in[v]--;
        if(in[v] == 0) {
            dfs(v);
        }
    }
}
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n, m;
    cin >> n >> m;
    for(int i = 0; i <= n; i++) {
        dp[i] = 0;
    }
    memset(in,0,sizeof(in));
    memset(vis,false,sizeof(vis));
    for(int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        in[v]++;
    }
    for(int i = 1; i <= n; i++) {
        if(!vis[i] && in[i] == 0) {
            dfs(i);
        }
    }
    
    int maxi = 0;
    for(int i = 1; i <= n; i++) {
        maxi = max(dp[i],maxi);
    }
    cout << maxi << endl;
    return 0;
}


Measured memory_bytes: 9728
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,m;
P a[100001],b[100001];
int ans[100001],ame[100001];
bool cmp(P a,P b){
    if(a.first==b.first) return a.second<b.second;
    else return a.first<b.first;
}
int find(int start,int end,P b){
    if(start==end&&a[start]!=b) return -1;
    else if(a[(start+end)/2]==b) return (start+end)/2;
    else if(b>a[(start+end)/2]) return find((start+end)/2+1,end,b);
    else if(b<a[(start+end)/2]) return find(start,(start+end)/2-1,b);
}
void Solve(){
    fill(ans,ans+m,1);
    memset(ame,0,sizeof(ame));
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>a[i].first>>a[i].second;
        b[i]=a[i];
    }
    sort(a,a+m,cmp);
    //for(int i=0;i<m;i++) cout<<a[i].first<<" "<<a[i].second<<endl;
    ans[0]=1;
    for(int i=1;i<m;i++){
        if(a[i].first!=a[i-1].first) ans[i]=1;
        else if(a[i].first==a[i-1].first) ans[i]=ans[i-1]+1;
    }
    //for(int i=0;i<m;i++) cout<<ans[i]<<" ";
    for(int i=0;i<m;i++){
        int pos=find(0,m-1,b[i]);
        ame[i]=ans[pos];
    }
    //for(int i=0;i<m;i++) cout<<ame[i]<<" ";
    //cout<<"\n";
    for(int i=0;i<m;i++){
        printf("%06d",b[i].first);
        printf("%06d\n",ame[i]);
    }

}
int main(){
    Solve();
    return 0;
}

Measured memory_bytes: 3840
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
    for k in range(b+1):
        for j in range(c+1):
            if 500*i+100*k+50*j==x:
                ans+=1
print(ans)

Measured memory_bytes: 3060
/*
Problem : https://atcoder.jp/contests/abc127/tasks/abc127_f
Algorithm : ¶Ô¶¥¶Ñ 
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#define int long long
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;

int Q,ans;
priority_queue<int> p;
priority_queue<int,vector<int>,greater<int> > q;

signed main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%lld",&Q);
	while(Q--){
		int op,a,b;
		scanf("%lld",&op);
		if(op == 1){
			scanf("%lld%lld",&a,&b);
			ans += b;
			p.push(a);
			q.push(a);
			if(p.top() > q.top()){
				int x = p.top();
				p.pop();
				int y = q.top();
				q.pop();
				ans += abs(x - y);
				p.push(y);
				q.push(x);
			}
		}else if(op == 2)
		    printf("%lld %lld\n",p.top(),ans);
	}
	return 0;
}


Measured memory_bytes: 4588
#include <bits/stdc++.h>
using namespace std;
 
int main(){
 
  int N,M,x,y;
  cin >> N>>M>>x>>y;
  int X[110],Y[110];
  for(int i=0; i<N; i++) cin >> X[i];
  for(int i=0; i<M; i++) cin >> Y[i];
  
  int maxx=-100,miny=100;
  for(int i=0; i<N; i++){
  	maxx=max(maxx,X[i]);
  }
  for(int i=0; i<M; i++){
  	miny=min(miny,Y[i]);
  }
  maxx=max(maxx,x); miny=min(miny,y);
 
  if(maxx < miny) cout << "No War" << endl;
  else cout << "War" << endl;
  
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
    int a=700, i;
    char S;

    for(i=0;i<3;i++){
        scanf("%c", &S);
        if(S == 'o'){
            a+=100;
        }
    }
    
    printf("%d\n", a);

    return 0;
}

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

vector<int> a;

int dp(int b) {
	if (a[b] != -1) return a[b];
	int c = INT_MAX;
	if (0 < b) c = dp(b - 1);
	for (int i = 6; i <= b; i *= 6) c = min(dp(b - i), c);
	for (int i = 9; i <= b; i *= 9) c = min(dp(b - i), c);
	a[b] = c + 1;
	return a[b];
}

int main() {
	int N;
	cin >> N;
	a.resize(N + 1, -1);
	a[0] = 0;
	cout << dp(N);
}

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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

//vector<vector<ll>> comb(ll n) {
//  vector<vector<ll>> v(n+1, vector<ll>(n+1, 0));
//  for (ll i = 0; i < v.size(); i++) {
//    v[i][0] = 1;
//    v[i][i] = 1;
//  }
//  for (ll j = 1; j < v.size(); j++) {
//    for (ll k = 1; k < j; k++) {
//      v[j][k] = (v[j-1][k-1] + v[j-1][k]);
//    }
//  }
//  return v; // v[n][r];
//}

int main() {
  ll n, p;
  cin >> n >> p;

  vector<ll> a(n);
  for (ll i = 0; i < n; ++i) {
    cin >> a[i];
  }

  //vector<vector<ll>> cb = comb(n);

  ll ki = 0;
  ll gu = 0;
  for (ll i = 0; i < n; ++i) {
    if (a[i]%2 == 0) gu++;
    else ki++;
  }

  //ll ans = 0;
  //if (p == 0) {
  //  for (ll i = 0; i <= ki; i+=2) {
  //    ans += cb[ki][i] * (1LL<<gu);
  //  }
  //} else {
  //  for (ll i = 1; i <= ki; i+=2) {
  //    ans += cb[ki][i] * (1LL<<gu);
  //  }
  //}
  
  ll ans = 0;
  if (ki == 0) {
    ans = (p == 1) ? 0 : 1LL << n;
  } else {
    ans = 1LL << (n-1);
  }

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


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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

string x;

int main(void) {
  // Here your code !
  cin >> x;

  stack<char> stk;

  for (auto &e : x) {
    if (stk.empty()) {
      stk.push(e);
      continue;
    }

    if (e == 'T' && stk.top() == 'S') {
      stk.pop();
      continue;
    }

    stk.push(e);
  }

  int ans = 0;

  while (!stk.empty()) {
    ans += 1;
    stk.pop();
  }

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

  return 0;
}


Measured memory_bytes: 644