akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define mp make_pair
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) 
#define rep2(i, n, m) for (ll i = n; i <= (ll)(m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (ll)(m); --i)

template<class T, class U> bool chmax(T &a, U b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> bool chmin(T &a, U b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007;

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);

  string s; cin >> s;
  rep(i, si(s)) if (i % 2 == 0) cout << s[i];
  cout << endl;

  return (0);
}


Measured memory_bytes: 3752
program candy
  implicit none
  integer::n, i, c, cmax
  integer,allocatable::a(:,:)

  read(*,*) n
  allocate(a(n,2))

  read(*,*) (a(i,1), i = 1, n)
  read(*,*) (a(i,2), i = 1, n)

  cmax = 0
  
  do i = 1, n
     c = sum(a(1:i,1:1))+sum(a(i:n,2:2))
     if ( c > cmax) then
        cmax = c
     end if
  end do
  
  write(*,*) cmax
  
  stop
end program candy


Measured memory_bytes: 384
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int K = Integer.parseInt(sc.get());
		long sum = 0;
		for (int a = 1; a <= K; a++) {
			for (int b = 1; b <= K; b++) {
				int ab = gcd(a, b);
				for (int c = 1; c <= K; c++) {
					sum += gcd(ab, c);
				}
			}
		}
		System.out.println(sum);
	}

	int gcd(int a, int b) {
	    return b == 0 ? a : gcd(b, a % b);
	}
}

class Main {
	public static void main(String... args) {
		var reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<>() {
			private StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	}
}

Measured memory_bytes: 32752
#include <bits/stdc++.h>
typedef long long LL;
using namespace std;

int main() {
  int n;
  cin >> n;
  pair<LL, LL> p[n];
  for (int i = 0; i < n; i ++) cin >> p[i].first >> p[i].second;
  sort(p, p + n);

  LL cnt = 0;
  for (int i = 0; i < n; i ++) {
    for (int j = i + 1; j < n; j ++) {
      LL pv = p[i].first - p[j].first;
      LL qv = p[i].second - p[j].second;
      LL tmp = 1;
      for (int k = 0; k < n; k ++) {
        for (int l = 0; l < n; l ++) {
          if ((i == k && j == l) || (i == l && j == k) || (k == l)) continue;
          if (p[k].first == p[l].first - pv && p[k].second == p[l].second - qv) tmp ++;
        }
      }
      cnt = max(cnt, tmp);
    }
  }

  cout << n - cnt << endl;
}

Measured memory_bytes: 256
n = input()

a = n[0]

if len(n) > 1:
    b = n[1:]
    if (int(b)+1) % (10 ** len(b)) == 0:
        flag = True
    else:
        flag = False
else:
    b = ''
    flag = True

if flag:
    ans = int(a) + 9 * len(b)
else:
    ans = int(a) - 1 + 9 * len(b)

print(ans)

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

int main() {
    int A,B;
    cin >> A >> B;
    int count=0;
    int obj = 1;
    while(obj<B){
        obj--;
        obj+=A;
        count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>x>>y;
	cout<<x*y<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define int long long
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
		freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
const int mod = 1e9 + 7, inf = 1061109567;
const long long infll = 4557430888798830399;
const int DIGITS = 65;
int dig1[DIGITS], dig2[DIGITS], dp[DIGITS][DIGITS][2][2][2];
void add(int &x, int y) {
	x += y; if (x >= mod) x -= mod;
}
void rem(int &x, int y) {
	x -= y;
	if (x < 0) x += mod;
}
int mul(int x, int y) {
	return 1ll * x * y % mod;
}
int calc(int i, int j, bool strict2X, bool strictR1, bool strictR2) {
	if (i == 0) {
		return j ^ 1;
	}
	if (dp[i][j][strict2X][strictR1][strictR2] != -1) return dp[i][j][strict2X][strictR1][strictR2];
	int ans = 0;
	int n2x = strictR1 ? dig1[i] : 1, ny = strictR2 ? dig2[i] : 1;
	fw (curDigit, 0, n2x + 1) {
		//curDigit is current digit of 2X.
		int lowerBoundY = j, upperBoundY = ny;
		upperBoundY = min(upperBoundY, strict2X ? curDigit : 1);
		//lowerBoundY must be last digit so that X is a subset of Y.
		fw (yDigit, lowerBoundY, upperBoundY + 1) {
			add(ans, calc(i - 1, curDigit, strict2X && curDigit == yDigit, strictR1 && curDigit == dig1[i],
																		strictR2 && yDigit == dig2[i]));
		}
	}
	return dp[i][j][strict2X][strictR1][strictR2] = ans;
}
int solve(int r1, int r2) {
//	int tmpAns = 0;
//	fw (x, 0, r1 + 1) fw (y, x, r2 + 1) {
//		if (y <= 2 * x && ((y & x) == x)) {
//			tmpAns++;
//			cout << x << " " << y << "\n";
//		}
//	}
//	cout << "tmpAns = " << tmpAns << "\n";
	//Count pairs (x, y) with x <= r1, y <= r2.
	r1 <<= 1ll;
	memset(dig1, 0, sizeof dig1);
	int ptr1 = 0;
	while (r1) {
		dig1[++ptr1] = r1 & 1ll;
		r1 >>= 1ll;
	}
	memset(dig2, 0, sizeof dig2);
	int ptr2 = 0;
	while (r2) {
		dig2[++ptr2] = r2 & 1ll;
		r2 >>= 1ll;
	}
	//Count pairs (x, y) that x is a subset of y, y <= 2 * x. Build 2 * x.
	//dp(curBitOf2x, lastBitOf2x, strictYWith2X, strict2XWith2R1, strictYWithR2)
	memset(dp, -1, sizeof dp);
	int ans = calc(ptr1, 0, 1, 1, ptr1 >= ptr2);
//	cout << "real ans = " << ans << "\n";
	return ans;
}
signed main() {
	#ifdef BLU
	in("blu.inp");
	#endif
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int l, r;
	cin >> l >> r;
	int ans = solve(r, r);
	rem(ans, solve(l - 1, r));
	cout << ans;
//	cout << solve(l - 1, r) << "\n";
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
 
typedef long long ll;
typedef pair < int , int > ii;

int n,b[N],a[N],ans;

int main() 
{	
	cin >> n;
	for (int i = 0; i < n-1; ++i)
		cin >> b[i];

	a[0] = b[0];
	a[n-1] = b[n-2];
	ans += a[0] + a[n-1];

	for (int i = 1; i < n-1; ++i)
	{
		ans += min(b[i],b[i-1]);	
	}
	
	cout << ans;
	return 0;
}

Measured memory_bytes: 2304
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a = max(a)
b = min(b)
for z in range(x+1,y+1):
    if a < z <= b:
        print('No War')
        exit()
print('War')


Measured memory_bytes: 3060
# -*- coding: utf-8 -*-
import sys

def io_generator():
	while True:
		yield raw_input()

#+++++++++++++++++++

def cc(a,b,c):
	if a==b and a==c:
		return 0
	elif a==b or b == c or c == a:
		return 1
	return 2

def main(io):
	n = int(io.next())
	sa=io.next()
	sb=io.next()
	sc=io.next()
	ret=0
	for i in range(n):
		ret += cc(sa[i], sb[i],sc[i])
	return ret

#++++++++++++++++++++

if __name__ == "__main__":
	io=io_generator()
	print main(io)
	#print cc('a','b','c')


Measured memory_bytes: 2568
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll k, a, b;
  cin >> k >> a >> b;
  if (b - a <= 2) {
    cout << k + 1 << endl;
    return 0;
  }
  
  ll x = 1;
  while (k > 1) {
    if (x < a) {
      if (a - x <= k) {
        k -= a - x;
        x = a;
      }
      else {
        x += k;
        k = 0;
      }
    }
    else {
      ll time = k / 2;
      x += (b - a) * time;
      k -= 2 * time;
    }
  }
  
  if (k == 1) x++;
  
  cout << x << endl;
}

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

int main() {
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  if((A+B) > (C+D)) {
    cout << "Left" << endl;
  }
  else if((A+B) == (C+D)) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var s string
	if sc.Scan() {
		s = sc.Text()
	}

	sei := strings.Split(s, " ")

	a, _:= strconv.Atoi(sei[0])
	b, _:= strconv.Atoi(sei[1])

	plus := a + b
	minus := a - b
	multi := a * b

	nums := []int{plus, minus, multi}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}

	fmt.Println(res)
}

Measured memory_bytes: 640
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <list>
using namespace std;

int main()
{
  int64_t N, k, ans = 0;
  cin >> N;

  for (int64_t j = 1; j <= N; j++)
  {
    k = N / j;
    ans += j * k * (k + 1) / 2;
  }

  cout << ans << endl;
}


Measured memory_bytes: 3152
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
int main() {
  int N, i, ans;
  double T, A, dif[100001], tmp;
  scanf("%d", &N);
  scanf("%lf %lf", &T, &A);
  
  for(i = 0; i < N; i++) {
    scanf("%lf", &tmp);
  	dif[i] = fabs(A - (T - 0.006 * tmp));
  }
  
  ans = 0;
  for(i = 1; i < N; i++) {
    if(dif[ans] > dif[i])
      ans = i;
  }
  printf("%d\n", ans + 1);
  return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2

using namespace std;

int MOD = 1000000007;

signed main(){
    int x,y;
    string s;
    cin >> s >> x >> y;

    int size = s.size();
    int i = 0;
    while(s[i] == 'F'){
        i++;
    }
    vector<unordered_set<int>> xx(5000);
    vector<unordered_set<int>> yy(5000);

    xx[0].insert(i);
    yy[0].insert(0);
    int cnts = 1;
    int m = 1;
    for(;i < size;){
        int cntt = 0; 
        int cntf = 0;
        while(i < size && s[i] == 'T'){
            cntt++;
            i++;
        }
        while(i < size && s[i] == 'F'){
            cntf++;
            i++;
        }
        if(cntt%2 == 1)m *= -1;
        if(m == 1){
            for(auto u:xx[cnts-1]){
                xx[cnts].insert(u+cntf);
                xx[cnts].insert(u-cntf);
                //cerr << "x " << u+cntf << " " << u-cntf << endl;
            }
            yy[cnts].swap(yy[cnts-1]);
        }else{
            for(auto u:yy[cnts-1]){
                yy[cnts].insert(u+cntf);
                yy[cnts].insert(u-cntf);
                //cerr << "y " << u+cntf << " " << u-cntf << endl;
            }
            xx[cnts].swap(xx[cnts-1]);
            // for(auto u:xx[cnts-1]){
            //     xx[cnts].insert(u);
            //     //cerr << "x " << u+cntf << " " << u-cntf << endl;
            // }
        }
        // for(auto u:xx[cnts])cerr << u << " ";
        // cerr << endl;
        // for(auto u:yy[cnts])cerr << u << " ";
        // cerr << endl;
        //cerr << endl;
        cnts++;
    }

    if(xx[cnts-1].find(x) != xx[cnts-1].end() && yy[cnts-1].find(y) != yy[cnts-1].end()){
        cout << "Yes" << endl;
    }else{
        cout << "No" <<endl;
    }




    return 0;
}
// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl 

Measured memory_bytes: 173568
use proconio::input;
use std::cmp::min;

fn main() {
    input! {
        n: usize,
        m: usize,
        x: i32,
        c: [[i32; m + 1]; n],
    }
    let mut min_cost = i32::max_value();
    for s in 0..1 << n {
        let mut cost = 0;
        let mut und = vec![0; m];

        for i in 0..n {
            if s >> i & 1 == 1 {
                cost += c[i][0];
                for j in 0..m {
                    und[j] += c[i][j + 1];
                }
                if und.iter().all(|ga| ga >= &&x) {
                    min_cost = min(min_cost, cost);
                }
            }
        }
    }
    if min_cost != i32::max_value() {
        println!("{}", min_cost);
    } else {
        println!("-1");
    }
}


Measured memory_bytes: 2200
s = input()
t = input()

S = ''
T = ''

temps = sorted(s)
tempt = sorted(t, reverse=True)
for i in range(len(s)):
    S += temps[i]
for i in range(len(t)):
    T += tempt[i]

if S < T:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38384
#include<stdio.h>
int main(){
  int a[4];
  int n;
  scanf("%d",&n);
  a[0] = (n-n%1000)/1000;
  a[1] = (n-a[0]*1000-n%100)/100;
  a[2] = (n-a[0]*1000-a[1]*100)/10;
  a[3] = n%10;
  int m = a[0]*10+a[1];
  int l = a[2]*10+a[3];
  if(l>0 && l<=12 && m>0 && m <=12){
    printf("AMBIGUOUS");
  }else if(m <=12 && (l >12 || l==0) && m!= 0){
    printf("MMYY");
  }else if(l <=12 && (m >12 || m ==0) && l!= 0){
    printf("YYMM");
  }else{
    printf("NA");
  }
  return 0;
}

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

int main(){
	int n;
	cin >> n;
	int data[n];
	for(int i = 0; i < n; i++){
		cin >> data[i];
	}
	for(int i = 0; i < n; i++){
		int tmp = data[i];
		int j = i - 1;
		while( j >= 0 and data[j] > tmp){
			data[j+1] = data[j];
			j--;
		}
		data[j+1] = tmp;		
		for(int k = 0; k < n; k++){
			if(k !=0) cout << " ";
			cout << data[k];
		}
		cout << endl;
	}
	return 0;
}

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

inline char sym(char x){
  if(x=='(')return ')';
  if(x==')')return '(';
  return x;
}

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

  int num = 0;
  for(int i=0;i<(s.size()+1)/2;i++){
    if(s[i] != sym(s[s.size()-1-i]))num++;
  }
  cout << num << endl;
}

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

const ll INF = 1LL << 60;

ll A, B, K;
int main() {
    cin >> A >> B >> K;

    for (int i = 1; i <= K; i++) {
        if (i % 2 == 1) {
            // 高橋
            if (A % 2 == 1) {
                A--;
            }
            ll tmp = A / 2;
            B += tmp;
            A -= tmp;
        } else {
            // 青木
            if (B % 2 == 1) {
                B--;
            }
            ll tmp = B / 2;
            A += tmp;
            B -= tmp;
        }
    }

    cout << A << " " << B << endl;;
}

Measured memory_bytes: 256
//C
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807

int main(){
    
    int N;
    cin >> N;
    LL A[100000];
    for(int i=0; i<N; i++) cin >> A[i];
    sort(A, A+N);

    LL ans = 0;
    if(N % 2 == 0){
        for(int i=0; i<N/2; i++) ans -= A[i];
        for(int i=N/2; i<N; i++) ans += A[i];
        ans *= 2;
        ans -= A[N/2];
        ans += A[N/2-1];
    }
    else{
        for(int i=0; i<N/2; i++) ans -= A[i];
        for(int i=N/2; i<N; i++) ans += A[i];
        ans *= 2;
        ans -= A[N/2];//11中6番目(1オリジン)
        ans -= A[N/2+1];
        LL tmp = ans;

        ans = 0;
        for(int i=0; i<N/2+1; i++) ans -= A[i];
        for(int i=N/2+1; i<N; i++) ans += A[i];
        ans *= 2;
        ans += A[N/2];//11中6番目(1オリジン)
        ans += A[N/2-1];

        ans = max(tmp, ans);
    }
    cout << ans << endl;
    
    return 0;
}
/*
1 2 3 4 5 6 (7)
ans = 1-2 + 3-2 + 3-4+ 5-4 + 5-6 + (7-6)

3 1 4 1 5 9
4 1 5 1 9 3
 3 4 4 8 6  = 25

3 
*/

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

signed main(){
	int n, x,temp = 1, ans = 0;
	cin>>n;
	for(int i=0; i<n; i++){
	    cin>>x;
		if(x == temp)
			temp++;
		else
			ans++;
	}
	if(ans==n)
		cout<<-1;
	else
		cout<<ans;
}

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

// macros
#define M 1000000007
#define addmod(a,b,m) (a%m + b%m)%m
#define submod(a,b,m) (a%m - b%m)%m
#define mulmod(a,b,m) ((a%m)*(b%m))%m
#define F first
#define S second
#define APSUM(a,b,n) n*((a*.5)+(b*.5))
#define GPSUM(a,b,k) (b*k-a)/(k-1)
#define INFGP(a,k) a/(1-r)
#define CEIL(a,b) ceil(double(a)/double(b))
#define FLOOR(a,b) floor(double(a)/double(b))
#define T(t) while(t--)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define endl '\n'

using namespace std;

//typedefs
typedef long long int ll ;
typedef vector<ll> vi ;
typedef pair<ll,ll> pi ;
typedef map<ll,ll> mps;

ll power(ll base,ll val)
{
    ll res=1;
    while(val)
    {
        if(val&1)
    {
        res = (res*base)%M;
    }
     base = (base*base)%M;
     val/=2;
    }
    return res;
}
ll digit(ll n)
{
    double phi = (1 + sqrt(5))/2;
    ll value = round(pow(phi,n)/(sqrt(5)));
    ll count=0;
    while(value)
    {
        count++;
        value/=10;
    }
    return count;
}

int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
/*
when files are giving the inputs and outputs
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);

*/
 int arr[3][3];
 int n=3;
 for(int i=0;i<n;i++)
 {
     for(int j=0;j<n;j++)
        cin>>arr[i][j];
 }
 int ele;
 cin>>ele;
 for(int i=0;i<ele;i++)
 {
     int x;
     cin>>x;
     for(int j=0;j<n;j++)
     {
         for(int k=0;k<n;k++)
         {
             if(arr[j][k]==x)
             {
                 arr[j][k]=-1;
             }
         }
     }
 }
 bool ans=false;
 if(arr[0][0]==-1&&arr[1][1]==-1&&arr[2][2]==-1 || arr[0][2]==-1&&arr[1][1]==-1&&arr[2][0]==-1 )
 {
     ans=true;
 }
 else
 {
     for(int i=0;i<n;i++)
     {
         if(arr[i][0]==-1&&arr[i][1]==-1&&arr[i][2]==-1)
            {
                ans=true;
                break;
            }
     }
     if(!ans)
     {
         for(int i=0;i<n;i++)
         {
             if(arr[0][i]==-1&&arr[1][i]==-1&&arr[2][i]==-1)
             {
                 ans=true;
                 break;
             }
         }
     }

 }
 if(ans)
    cout<<"Yes\n";
 else
    cout<<"No\n";

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0; i<(int)(n);i++)

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(c >= a && c <= b) cout << "Yes";
  else cout << "No";
}



Measured memory_bytes: 256
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

using QWORD = unsigned long long;
using SQWORD = long long;
using DWORD = unsigned int;
using SDWORD = int;
using WORD = unsigned short;
using SWORD = short;
using DOUBLE = double;
using FLOAT = float;

#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define ArrayLength(a)  (sizeof(a) / sizeof(a[0]))

static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }

#define BYTE_BITS   (8)
#define WORD_BITS   (16)
#define DWORD_BITS  (32)
#define QWORD_BITS  (64)

using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)

static void printMatrix(DWORD **p, DWORD dwSize)
{
    printf("---\n");
    for (DWORD i = 0; i < dwSize; i++) {
        for(DWORD j = 0; j < dwSize; j++) {
            printf("%5d", p[i*dwSize + j]);
        }
        cout << endl;
    }
    printf("---\n");
}

int main()
{
    DWORD dwInput_N, dwInput_M, dwInput_Q;
    char str[6000];

    cin.getline(str, sizeof(str));
    dwInput_N = atoi(strtok(str, " "));
    dwInput_M = atoi(strtok(NULL, " "));
    dwInput_Q = atoi(strtok(NULL, " "));

    /* input train */
    static DWORD aadwTrainMap[501][501];
    for (DWORD dwIdx = 0; dwIdx < dwInput_M; dwIdx++) {
        cin.getline(str, sizeof(str));
        WORD wCity_L, wCity_R;

        wCity_L = atoi(strtok(str, " "));
        wCity_R = atoi(strtok(NULL, " "));
        aadwTrainMap[wCity_L][wCity_R]++;
    }

    /* calc camsum(Row) */
    for (DWORD dwRow = 0; dwRow <= dwInput_N; dwRow++) {
        DWORD dwSum = 0;
        for (DWORD dwCol = 0; dwCol <= dwInput_N; dwCol++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum;
        }
    }

    /* calc camsum(col) */
    for (DWORD dwCol = 0; dwCol <= dwInput_N; dwCol++) {
        DWORD dwSum = 0;
        for (DWORD dwRow = 0; dwRow <= dwInput_N; dwRow++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum;
        }
    }

    /* input question */
    for (DWORD dwIdx = 0; dwIdx < dwInput_Q; dwIdx++) {
        DWORD dwAnswer;
        cin.getline(str, sizeof(str));
        WORD wBegin = atoi(strtok(str, " "));
        WORD wEnd   = atoi(strtok(NULL, " "));

        dwAnswer= (aadwTrainMap[wEnd][wEnd]
                    - aadwTrainMap[wBegin-1][wEnd]
                    - aadwTrainMap[wEnd][wBegin-1]
                    + aadwTrainMap[wBegin-1][wBegin-1]);
        printf("%d\n", dwAnswer);
    }

    return 0;

}


Measured memory_bytes: 1920
from itertools import permutations

n = int(input())
*p, = map(int, input().split())

ans = 0
for j, k in enumerate(p[:-2]):
    a, b, c = k, p[j+1], p[j+2]
    if a < b < c or c < b < a:
        ans += 1

print(ans)

Measured memory_bytes: 3060
//Awwawa! Dis cold yis ratten buy tEMMIE!
#include <bits/stdc++.h>
#define ll long long
#define maxn 100005 /*rem*/
#define mod 998244353
#define db double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define fi first
#define se second

template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;}

using namespace std;
ll ksm(ll a, ll b) {
   if (!b) return 1;
   ll ns = ksm(a, b >> 1);
   ns = ns * ns % mod;
   if (b & 1) ns = ns * a % mod;
   return ns;
}
char tr[505];
int ts = 0;
char ac[505];
int l = 128;
int ask(vi r) {
	cout << "? ";
	for (auto v : r)
		cout << tr[v];
	cout << endl;
	fflush(stdout);
	int ans;
	cin >> ans;
	return ans;
}

const int N = 505;
int fn[N], ed[N];
int rc = 0;
pi cur[505];
int tot[505];
int s = 0;
bool cmp(int a, int b) {

	if (cur[a].fi == cur[b].fi) 
		return cur[a].se < cur[b].se;	
	s++;
	if (s > 850) exit(1);
	vi ur;
	for (int j = 0; j < cur[a].se; j++)
		ur.pb(cur[a].fi);
	for (int j = 0; j < tot[cur[b].fi] - cur[b].se + 1; j++)
		ur.pb(cur[b].fi);
	if (ask(ur) == l - (int)ur.size()) return 1;
	else return 0;
}
int main() {

	srand(time(0));
	for (int i = 0; i < 26; i++)
		tr[rc++] = 'A' + i;
	for (int i = 0; i < 26; i++)
		tr[rc++] = 'a' + i;
	for (int i = 0; i < 10; i++)
		tr[rc++] = '0' + i;
	vi q(1);
	q[0] = 0;
	int k = ask(q);
	if (k == 128) l = 128;
	else {
		q.resize(k + 1);
		for (int j = 0; j < k + 1; j++)
			q[j] = 0;
		int r = ask(q);
		if (r == k + 1) l = k;
		else l = k + 1;
	}
	int n = 0;
	int cnt = 0;
	for (int j = 0; j < rc; j++) {
		vi f(l);
		for (int k = 0; k < l; k++)
			f[k] = j;
		tot[j] = l - ask(f);
		cnt += tot[j];
		for (int t = 0; t < tot[j]; t++) {
			n++;
			cur[n] = mp(j, t + 1);
		}
	}
	s = 62;
	fn[0] = 1;
	for (int i = 2; i <= n; i++) {
		int l = 0, r = i - 1; // < pl
		while (l < r) {
			int mid = (l + r) >> 1;
			if (cmp(i, fn[mid])) r = mid;
			else l = mid + 1;
		}
		int cnt = 0;
		for (int j = 0; j < l; j++)
			ed[cnt++] = fn[j];
		ed[cnt++] = i;
		for (int j = l; j < i - 1; j++)
			ed[cnt++] = fn[j];
		for (int j = 0; j < i; j++)
			fn[j] = ed[j];
	}
	cout << "! ";
	for (int i = 0; i < n; i++)
		cout << tr[cur[fn[i]].fi];
	cout << endl;
	fflush(stdout);
	return 0;
}


Measured memory_bytes: 3736
#include <bits/stdc++.h>
#define int long long
#define double long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define ms(v,x) memset(v,x,sizeof(v))
#define pii pair<int,int>
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define rep(i,j,k) for(int i=j;i<k;i++)
#define td(v) v.begin(),v.end()
#define inf 1000000000 // 1e9
#define M   1000000007 // 1e9 + 7
using namespace std;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int exp(int a,int b,int m){
    if(b==0) return 1LL;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}
main(){
    fastio;
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(n%2){
        cout << "No" << endl;
        return 0;
    }
    string x = s.substr(0,n/2);
    string y = s.substr(n/2,n/2);
    if(x==y){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
 
}

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

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

int main(void){
    int n, k;
    long mod = 1e9+7;
    cin >> n >> k;
    vector<vector<long long>> c(n+1, vector<long long>(n+1));
    c.at(0).at(0) = 1;
    for(int i = 1; i <= n; i++){
        for(int j = 0; j <= i; j++){
            if(j-1 >= 0) c.at(i).at(j) = (c.at(i-1).at(j-1) + c.at(i-1).at(j))%mod;
            else c.at(i).at(j) = c.at(i-1).at(j);
        }
    }
    
    for(int i = 1; i <= k; i++){
        long long ret = (c.at(n-k+1).at(i) * c.at(k-1).at(i-1))%mod;
        cout << ret << endl;
    }
    return 0;
}


Measured memory_bytes: 31616
import java.util.Scanner;


public class Main {
	static String[] a = new String[] {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
	static String[] b = new String[] {"D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C"};
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String tmp = stdIn.next();
		for(int i = 0;i < tmp.length(); i++) {
			for(int j = 0; j < a.length; j++) {
				if(tmp.charAt(i) == b[j].charAt(0)) {
					System.out.print(a[j]);
					break;
				}
			}
		}
		System.out.println();
	}
	
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll, ll> pair_t;
using Graph = vector<vector<ll>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
/****** define constant end ********/
/****** define variable start ******/
ll n, k;
/******* define variable end *******/
int solve() {
	cin >> n >> k;
	vl ma(n+5);
	vl mi(n+5);
	ll ans = 0;
	for(ll i = k; i <= n+1; i++){
		mi[i] = i*(i-1) / 2;
		ma[i] = n*(n+1)/2 - (n+1-i)*(n-i)/2;
		ans += ma[i]-mi[i]+1;
		ans %= MOD;
	}
	cout << ans % MOD << endl;
	return 0;
}

int main() {
	// clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


Measured memory_bytes: 6348
#include<iostream>
#include<vector>
#include<string>
#include<sstream>


//敗因
//getline()の第一引数がstream型しか受け付けないことを見逃していた　　std::stringでは無理なので一旦std::stringstream ss(str)に代入した
//この見落としていたため、なんのためにstd::stringstream ss(str)に代入したのかわからず混乱し無意味（ではない(めちゃくちゃ脱線してなんか知らんけど有益な情報を得た)）時間を浪費した
//しかもこれコンストラクタだったんですね(コピペコードだからわからない)
//あと個人的にstd::vector<std::string> vを初めて見て　v[0]=文字列　v[1]=文字列　v[2]=文字列　…　という事の理解に時間がかかった
//あとちょっとsplitの第一引数がconstなのか少し疑問であるが、たぶんsplit関数に渡したら変更できないようにとかだと思う（適当）
//相変わらずrange_base for文の第一引数がどこから出てきているかわからず混乱したが、前に一度やっていたので記事をみたらわかった
//が相変わらずrange_base forの第一引数は第二引数のコンテナクラスとどういう関連があるのかわからない
//よく普通のfor文からrange_base forに書き換える例の時にrange_base for の第一引数に当たる文字が普通のforに現れないためである
//ちなみにgetline初めて使いました(完)




//コピペ関数(split)
//頑張ってコピペをコメントで説明して生きたい
//文字列を指定の文字で区切る　入力　「100,200,300」→カンマで区切る→　出力　「100」　「200」　「300」

std::vector<std::string> split(const std::string &str, char sep) {  //(文字列の先頭のポインタ,区切り文字)を引数に持ち、std::vector<std::string>型を返す splitと言う関数　
	std::vector<std::string> v;     //戻り値を格納するvector
	std::stringstream ss(str);      //ストリームの初期化　（ストリームって何、ただの初期化ならstrそのまま使えばよいのでは…？）
	std::string buffer;				//バッファ（文字列型）

	while (std::getline(ss, buffer, sep)) { //第一引数は文字列の抽出元となる入力ストリーム　第二引数は入力ストリームから抽出した文字の読み込み先となる文字列　第三引数行の区切り記号
		v.push_back(buffer);                //std::vector<std::string>  v[0]=文字列　v[1]=文字列　V[2]=文字列　というvector 
	}

	return v;
}

int main() {
	std::string str1;	//空の文字列
	std::cin >> str1;   //文字列の入力
	for (const std::string &s : split(str1, ',')) {   //range_base for   ( ただ出力文字列の型を変数宣言しているだけって思ってます　：　split関数はstd::vector<std::string>型なのでvectorとしてrange_base for が使える )
		std::cout << s << std::endl;
	}

	return 0;
}


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

using namespace std;

int a[111];

int main() {
    int n;
    cin >> n;
    int s = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        for (int j = 0; j < i; j++) {
            s += a[i] * a[j];
        }
    }
    cout << s << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int A(int A,int B)
{
    int p,o=-1;
    if(A<=9&&B<=9)
    {
        p=A*B;
    }
    else
    {
        p=o;
    }
    return p;
}
int main()
{
    int x,y,l;
    cin >> x >> y;
    l=A(x,y);
    cout << l <<endl;
    return 0;
}


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

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

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

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

const string yes = "Yay!";
const string no = ":(";

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

    int n;
    ll a[212345];

    cin >> n;
    ll all = 0;
    REP(i, n)
    {
        cin >> a[i];
        all += a[i];
    }

    ll sum = 0;

    ll res = 1e18;

    for (int i = 0; i < n - 1; i++)
    {
        sum += a[i];
        ll noko = all - sum;

        res = min(res, abs(sum - noko));
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
char c[55][55];
int n,m;
const int dir[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
int judge(int x,int y)
{
    for (int i=0;i<4;i++)
    {
        int x1,y1;
        x1=x+dir[i][0];
        y1=y+dir[i][1];
        if (x>=0&&x<n&&y>=0&&y<m)
        {
            if (c[x1][y1]=='#') return 1;
        }
    }
    return 0;
}
int main()
{


    scanf("%d%d",&n,&m);
    for (int i=0;i<m;i++) scanf("%s",c[i]);
    int flag=1;
    for (int i=0;i<n;i++)
        for (int j=0;j<m;j++)
        if (c[i][j]=='#')
        {
            if (judge(i,j)==0)
            {
                flag=0;
                break;
            }
        }
    if (flag==1) printf("Yes\n");
    else printf("No\n");
    return 0;
}


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

int main(){

    string s;
    cin>>s;

    int ans=0;
    for(int i=0;i<s.size()/2;i++)
        if(s[i]!=s[s.size()-i-1])
            ans++;

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
#define ll long long int
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f
#define show(x) cerr<<#x<<" : "<<x<<'\n';
#define yogeshk972() cerr<<"\nTime Taken : "<<(float)(clock()-time_p)/CLOCKS_PER_SEC<<"\n";
clock_t time_p=clock();
 
using namespace std;
const int N=2e3+1, mod= 1e9+7;

int main(){
	ios_base::sync_with_stdio(0);	cin.tie(0);
	
	ll n;
	cin>>n;
	
	ll moves=1e18;
	
	for(ll i=1e6;i>=1;i--){
		if( n%i==0 ){
			moves=min(moves, i+n/i-2 );
		}
	}
	cout<<moves;
    yogeshk972();
}


Measured memory_bytes: 256
n, k, s = list(map(int, input().split()))

ans = [0] * n
for i in range(n):
    if i < k:
        ans[i] = s
    else:
        if s != 10 ** 9:
            ans[i] = 10 ** 9
        else:
            ans[i] = 1
print(*ans)

Measured memory_bytes: 46652
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(n); i++)
#define REPR(i,n) for(int i=n; i>=0; i--)
#define FOR(i,m,n) for(int i=m; i<(n); i++)
#define ALL(v) v.begin(),v.end()
#define INF 2e9
using namespace std;
typedef long long ll;
 
 
int main()
{

    int A, B, C;
    cin >> A >> B >> C;

    if (A*C <= B)
    {
        cout << C << endl;
    }else
    {

        cout << B/A << endl;


    }
    
    
    return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.ArrayList;

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

    static class PrimeFactorize {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            ArrayList<Integer> primes = Prime.eratosthenes(100000);

            int n = in.nextInt();
            out.print(n + ": ");
            for (int p : primes) {
                while (n % p == 0) {
                    out.print(p);
                    n /= p;
                    if (n != 1) out.print(" ");
                }
            }
            if (n != 1) out.print(n);
            out.println();

        }

    }

    static class Prime {
        public static ArrayList<Integer> eratosthenes(int n) {
            // n以下の素数をすべて列挙する(計算量は O(N log(log N)))
            // ただし10^5が耐用限界っぽい感じはする

            ArrayList<Integer> res = new ArrayList<>();
            ArrayList<Integer> primes = new ArrayList<>();
            for (int i = 2; i <= n; i++) {
                res.add(i);
            }
            while (res.size() > 0) {
                primes.add(res.get(0));
                res.removeIf(a -> a % res.get(0) == 0);
            }
            return primes;
        }

    }
}




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

int main() {
  int N,Q;
  scanf("%d %d", &N,&Q);
  string x;
  cin >> x;

  int a[Q],b[Q];
  for (int i = 0; i < Q; ++i) {
    scanf("%d %d", &a[i],&b[i]);
  }

  int ans[N];
  int countA = 0;

  for(int i=0;i<N-1;++i){
    if(x[i]=='A' && x[i+1]=='C'){
      ++countA;
      ans[i] = countA;
    }
    else ans[i]=countA;
  }

  ans[N-1] = countA;

  for(int i=0;i<Q;++i){
    int numa = a[i];
    int numb = b[i];
    int count;
    if(numa!=0 && numa!=1) count = ans[numb-2] - ans[numa-2];
    else count = ans[numb-2];
    //cout << ans[numa-1] << endl;
    cout << count << endl;
  }


  

}

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

#define MN 1000001
bool pr[MN] = {0};

int main()
{
	for(int i=2; i<MN; i++) { pr[i] = 1; }
	for(int i=2; i*i<MN; i++)
	{
		if(pr[i])
		for(int j=i*2; j<MN; j+=i)
		{
			pr[j] = 0;
		}
	}

	int n,c;
	while(cin >> n, n)
	{
		c = 0;
		for(int i=3; i<n/2+1; i++)
		{
			if(pr[i] && pr[n-i]) c++;
		}
		cout << c << endl;
	}
}

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

// Template START
#define endl "\n"
#define async ios_base::sync_with_stdio(false); cin.tie(NULL);
#define int long long int
#define all(y) y.begin(), y.end()
#define present( x, y ) (x.find( y ) != x.end())
const int mod = (int)1e9 + 7 ;
#define vv(T) vector<vector<T>>
#define vvv(T) vector<vector<vector<T>>>
template<class T>
auto matrix( int r, int c, T v ){
    return vector<vector<T>>( r, vector<T>( c, v ) ) ;
}
template<class T>
auto matrix( int o1, int o2, int o3, T v ){ 
    return vector<vector<vector<T>>>( o1, vector<vector<T>>( o2, vector<T>( o3, v ) ) ) ;
}
// Template END

int power( int x, int n ){
    if( n == 0 ) return 1 ;
    else if( n & 1 ) return ( x * power( (x*x) % mod, n / 2 ) ) % mod ;
    return power( (x*x) % mod, n / 2 ) % mod ;
}
void absorb( int &x, int n ){
    x = ( x * n ) % mod ;
    if( x < 0 ) x += mod ;
}



signed main(){
    int n ; cin >> n ;
    cout << (  1 - n ) ;
    return 0 ;   
}


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

typedef unsigned long long ULL;
typedef long long LL;

const int PI = 3.1415926535;
const int inf = 1000111222;
const int mod = 1000000007;
const int N = 100007;


int main() {
	
	ios_base :: sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	int x; cin >> x;
	int gcd = x * 360 / __gcd(x, 360);
	cout << gcd / x << endl;
	return 0;
}


Measured memory_bytes: 3652
N = int(input())
S = input()
x = [0]*N

if S[0] == 'I':
        x[0] += 1
else:
    x[0] -= 1

for i in range(1,N):
    if S[i] == 'I':
        x[i] = x[i-1] + 1
    else:
        x[i] = x[i-1] - 1

print(max(x) if max(x) > 0 else 0)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;

int main() {
int D;
cin >> D;
if (D == 25) cout << "Christmas" << endl;
else if (D == 24) cout << "Christmas Eve" << endl;
else if (D == 23) cout << "Christmas Eve Eve" << endl;
else if (D == 22) cout << "Christmas Eve Eve Eve" << endl;


return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
template<class T> void chmin(T& x, T y){if(x < y) x = y;}
template<class T> void chmax(T& x, T y){if(x > y) x = y;}
int N;
int S;
const ll mod = 998244353;
int A[3010];
ll dp[3010][3010];

int main(){
    cin >> N >> S;
    for(int i = 1; i <= N; i++){
        cin >> A[i];
        dp[i][0] += 1;
    }
    for(int i = 1; i <= N; i++){
        for(int j = 0; j < S; j++){
            int to = j + A[i];
            if(to <= S){
                dp[i + 1][to] += dp[i][j];
                dp[i + 1][to] %= mod;
            }
            dp[i + 1][j] += dp[i][j];
            dp[i + 1][j] %= mod;
        }
    }
    ll ans = 0;
    for(int i = 1; i <= N + 1; i++){
        ans += dp[i][S] * (ll)(N - i + 2);
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 70784
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
  double a,b,c,d,e,f;
  while(  cin >> a >> b >> c >> d >> e >> f ){
    double y = (a*f - c*d)/(a*e - b*d);
    double x = (c - b*y)/a;
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

Measured memory_bytes: 1240
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))

gl=[0]*n
gl[0]=a[0]
gr=[0]*n
gr[-1]=a[-1]
for i in range(1,n):
    gl[i]=gcd(gl[i-1],a[i])
    gr[-i-1]=gcd(gr[-i],a[-i-1])
ans=0
for i in range(n):
    if i==0:
        ans=gr[1]
    elif i==n-1:
        ans=max(ans,gl[i-1])
    else:
        ans=max(ans,gcd(gl[i-1],gr[i+1]))
print(ans)


Measured memory_bytes: 89580
#include<iostream>
using namespace std;
#include<map>
#include<vector>
#include<cmath>
#include<set>
#include<unordered_set>
#include<algorithm>
#define int long long int
#define mod 1000000007
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int x;
	cin>>x;
	if(x>=400&&x<=599)
	{
		cout<<8<<endl;
	}
	else if(x>=600&&x<=799)
	{
		cout<<7<<endl;
	}
	else if(x>=800&&x<=999)
	{
		cout<<6<<endl;
	}
	else if(x>=1000&&x<=1199)
	{
		cout<<5<<endl;
	}
	else if(x>=1200&&x<=1399)
	{
		cout<<4<<endl;
	}
	else if(x>=1400&&x<=1599)
	{
		cout<<3<<endl;
	}
	else if(x>=1600&&x<=1799)
	{
		cout<<2<<endl;
	}
	else
	   cout<<1<<endl;
}


Measured memory_bytes: 3644
N = int(input())
a = [int(i) for i in input().split()]
hai,cha,mid,miz,ao,ki,dai,aka,zen = 0,0,0,0,0,0,0,0,0
for i in range(N):
    if a[i] < 400:
        hai = 1
    elif a[i] < 800:
        cha = 1
    elif a[i] < 1200:
        mid = 1
    elif a[i] < 1600:
        miz = 1
    elif a[i] < 2000:
        ao = 1
    elif a[i] < 2400:
        ki = 1
    elif a[i] < 2800:
        dai = 1
    elif a[i] < 3200:
        aka = 1
    else:
        zen += 1
Min = hai+cha+mid+miz+ao+ki+dai+aka
Max = Min+zen
if Min == 0:
    Min = 1
print(Min,Max)


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#include <complex>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef complex<double> P;

// 点 a を中心に arg だけ回転する単位ベクトルを加算
P rot (P a, double arg )
{
	P r = P (cos(arg ), sin(arg ) );
	P res = a*r;
	res /= abs(res);

	return res + a;
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.TH2", "r", stdin );

	while (1 ){
		P p = P(1., 0. );
		int n;
		scanf ("%d", &n );
		if (n == -1 ) break;

		while (--n ) p = rot (p, M_PI/2. );

		printf ("%.2lf\n%.2lf\n", p.real(), p.imag() );
	} // end loop
	
	return 0;
}

Measured memory_bytes: 1244
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 100011

int n, m, i, x, y;
int cnt[maxN];

int main()
{
    //freopen("test.in","r",stdin);

    cin >> n >> m;
    for (i = 1; i <= m; i++) {
        cin >> x >> y;
        cnt[x]++; cnt[y]++;
    }

    for (i = 1; i <= n; i++) {
        if (cnt[i] & 1) {
            cout << "NO";
            return 0;
        }
    }

    cout << "YES";


    return 0;
}


Measured memory_bytes: 640
from fractions import gcd

N,K = map(int,input().split())
A = list(map(int,input().split()))

if K > max(A):
  print('IMPOSSIBLE')
  exit()

d = A[0]
for a in A:
  d = gcd(d,a)

if K % d == 0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

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

using namespace std;

typedef long long ll;

ll dp[3000][3000][4];
int a[3000][3000];

void solve() {
    int r, c, k; cin >> r >> c >> k;
    for (int i = 0; i < k; i++) {
        int x, y, v; cin >> x >> y >> v; x--, y--; a[x][y] = v;
    }
    for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
            for (int cnt = 0; cnt <= 3; cnt++) {
                if (i + 1 < r) {
                    dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][cnt]);
                    if (cnt != 3) {
                        dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][cnt] + a[i][j]);
                    }
                }
                if (j + 1 < c) {
                    dp[i][j + 1][cnt] = max(dp[i][j + 1][cnt], dp[i][j][cnt]);
                    if (cnt != 3) {
                        dp[i][j + 1][cnt + 1] = max(dp[i][j + 1][cnt + 1], dp[i][j][cnt] + a[i][j]);
                    }
                }
            }
        }
    }
    cout << max(*max_element(dp[r - 1][c - 1], dp[r - 1][c - 1] + 3) + a[r - 1][c - 1], dp[r - 1][c - 1][3]);
}

int main() {
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(20);
    solve();
}


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

using namespace std;

int main() {
	
	string A;
	int x, y;
	
	while( cin >> A ) {
	
	int n;
	cin >> n;
	
	string Action;
	
	for(int i=0;i<n;i++) {
		
		cin >> Action;
		if( Action == "replace") {
			
			string replaces;
			
			cin >> x >> y >> replaces;
			A.replace(x, y - x + 1 , replaces);
			
		}
		else if( Action == "reverse") {
						
			cin >> x >> y ;
			reverse(A.begin()+x,A.begin()+y+1);
		
		}
		else {
			
			cin >> x >> y;	
			cout << A.substr(x, y - x + 1) << "\n";
			
		}
	}
	
}
	return 0;
}


Measured memory_bytes: 3196