akhauriyash/Code-Regression huggingface dataset:
//
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
//
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

//
// solution 
//
//
const MOD: usize = 1_000_000_007;
#[allow(unused_mut)]
#[allow(non_snake_case)]
fn main() {
    input!{
        N: usize,
        M: usize,
    }

    if M < 2 {
        println!("1");
        return;
    }

    let mut counts = Vec::new();
    let mut divisor = 2;
    let mut num = M;
    while divisor * divisor <= M {
        if num % divisor != 0 {
            divisor += 1;
            continue;
        }

        let mut count = 0;
        while num % divisor == 0 {
            count += 1;
            num /= divisor;
        }
        counts.push(count);
        divisor += 1;
    }
    if num != 1 {
        counts.push(1);
    }

    println!("{}", counts.into_iter().fold(1, |acc, k| (acc * cb(N+k-1, k)) % MOD) );
}

fn cb(n: usize, k: usize) -> usize {
    let mut dp = vec![ vec![1; k+1]; n-k+1];
    for i in 1..(n-k+1) {
        for j in 1..k+1 {
            dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % MOD;
        }
    }
    dp[n-k][k]
}



Measured memory_bytes: 33020
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	h1, m1 := nextInt(), nextInt()
	h2, m2 := nextInt(), nextInt()
	k := nextInt()

	if m2 < k {
		h2--
		m2 = 60 + m2 - k
	} else {
		m2 -= k
	}
	h := h2 - h1
	m := 0
	if m2 < m1 {
		h--
		m = 60 + m2 -m1
	} else {
		m = m2 - m1
	}
	fmt.Println(h*60 + m)
}

func slicePrint(s []int) {
	for i, v := range s {
		if i != 0 {
			fmt.Printf(" ")
		}
		fmt.Printf("%v", v)
	}
	fmt.Println("")
}

func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}


Measured memory_bytes: 1760
var readline = require('readline')
var reader = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

var lines = [];
reader.on('line', function(line) {
  lines.push(line);
});

reader.on('close', function() {
  var words = lines[0].split(' ');
  var N = Number(words[0]), Y = Number(words[1]);

  OUT_OF_THE_LOOP:
  {
    for(var x=0; x <=N; ++x) for(var y=0; x+y<=N; ++y) {
      var z = N-x-y;
      if(10000*x+5000*y+1000*z==Y) {
        console.log(x+' '+y+' '+z);
        break OUT_OF_THE_LOOP;
      }
    }
    console.log('-1 -1 -1');
  }
});

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

int main(void){
  
  int N, A, B; cin >> N >> A >> B;
  
  int taxi = N * A;
    
    if(taxi > B){
      
      cout << B << endl;
      
    }else{
      
      cout << taxi << endl;
      
    }
  
  return 0;
  
}


Measured memory_bytes: 256
def f(n,m,k):
 for i in range(n+1):
  for j in range(m+1):
   if (i*m+j*n-2*i*j)==k:
    print("Yes")
    return
 print("No")
 return

a=input().split()
n=int(a[0])
m=int(a[1])
k=int(a[2])
f(n,m,k)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
string str[105];
bool cmp(string s1,string s2){
	return s1+s2<s2+s1;
}
int main(){
	int n;
	scanf("%d%*d",&n);
	for(int i=0;i<n;i++){
		cin >> str[i];
	}
	sort(str,str+n,cmp);
	for(int i=0;i<n;i++){
		cout << str[i];
	}
	cout << endl;
	return 0;
	
}

Measured memory_bytes: 256
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

import math

n = ni()


nn = 10**6+2
divs=[0]*nn
ans=0

for i in range(2,nn):
  while n%i==0:
    divs[i]+=1
    n//=i

# for i in range(nn):
#   if divs[i]>0:
#     print('{} {}'.format(i,divs[i]))


if n!=1:
  ans+=1

for i in range(nn):
  for j in range(1,nn):
    if divs[i]<j:
      break
    divs[i]-=j
    ans+=1


print(ans)



Measured memory_bytes: 72820
#include <stdio.h>
#include <string.h>

int main()
{
	int a, b, c, d, p;
	int cx, cy;
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &p);
	cx = a*p;
	cy = (p > c ? b + (p - c)*d : b);
	printf("%d\n", cx > cy ? cy : cx);
	return 0;
}

Measured memory_bytes: 596
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<set>
#include<functional>
#include<iomanip>

#define LLI long long int

using namespace std;

vector<vector<pair<int,int> > >G;
vector<vector<int> >W;
vector<int>ans;

void dps(int p,int d=0){
	ans[p]=d%2;
	for(int i=0;i<G[p].size();i++){
		pair<int,int> q=G[p][i];
		if(ans[q.first]==-1){
			dps(q.first,(d+q.second)%2);
		}
	}
}
int main(){
	int N;cin>>N;
	G=vector<vector<pair<int,int> > >(N,vector<pair<int,int> >(0));
	for(int i=0;i<N-1;i++){
		int u,v,w;cin>>u>>v>>w;
		u--;v--;
		G[u].push_back(pair<int,int>(v,w));
		G[v].push_back(pair<int,int>(u,w));
	}
	ans=vector<int>(N,-1);
	dps(0);

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



Measured memory_bytes: 7424
#include <bits/stdc++.h> //万能头文件 
using namespace std;
int main(){
	int a, b, i, j, k;//定义变量，题目给的是a, b, k就最好也定义成一样的 
	scanf("%d%d%d", &k, &a, &b);//读入 
	for(int i = a; i<=b; i++){//查找 
		if(i % k == 0){//判断是否在范围中 ,寻找倍数 
			printf("OK");
			return 0;//结束循环 
		}
	}
	printf("NG");//如果没有，输出NG 
}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main(){
    ll m,k;cin>>m>>k;
    if(pow(2,m)<=k){
        cout<<-1<<endl;
        return 0;
    }
    
    if(m==0){
        if(k==0){
            cout<<"0 0"<<endl;
        }else{
            cout<<-1<<endl;
        }
        return 0;
    }else if(m==1){
        if(k==1){
            cout<<-1<<endl;
        }else if(k==0){
            cout<<"0 0 1 1"<<endl;
        }else{
            cout<<-1<<endl;
        }
        return 0;
    }
    
    ll a_num=pow(2,m+1);
    ll a[a_num];
    ll i=0;
    ll j=0;
    while(j<pow(2,m)){
        if(j==k){
            j++;
            continue;
        }else{
            a[i]=j;
            i++;
            j++;
            continue;
        }
    }
    a[i]=k;
    i++;
    j--;
    while(j>=0){
        if(j==k){
            j--;
            continue;
        }else{
            a[i]=j;
            i++;
            j--;
            continue;
        }
    }
    a[i]=k;
    cout<<a[0];
    rep(i,1,a_num-1){
        cout<<' '<<a[i];
    }
    cout<<endl;
    
    return 0;
}



Measured memory_bytes: 3840
import java.util.Scanner;

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

            int ll = 0;
            int rr = n;
            for (int i = 0; i < m; i++) {
                int li = sc.nextInt();
                int ri = sc.nextInt();
                if (li > ll) {
                    ll = li;
                }
                if (ri < rr) {
                    rr = ri;
                }
            }
            int ans = rr - ll + 1;
            if (ans < 0) {
                ans = 0;
            }
            System.out.println(ans);
        }
    }
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
#define ld long double
#define ll long long
#define mod 1000000007
#define IINF INT_MAX
#define INF 1LL << 30


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

    int cnt = 0;
    for(int i = 0; i < (int)s.size(); i++){
        if(s[i] != t[i]) cnt++;
    }
    cout << cnt << endl;

    return 0;
}


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

ll Pow(ll x, ll n){
  if(n == 0) return 1;
  if(n % 2 == 0) return Pow(x*x % mod, n/2);
  else return x * Pow(x,n-1) % mod;
}

int main(){
  string s;
  cin >> s;
  int n = s.length();
  vector<ll> v(n+1,0);
  vector<ll> num(2019,0);
  ll ans = 0;
  num[0]++;
  for(int i = n-1; i >= 0; i--) {
    v[i] = ((ll)(s[i]-'0') * Pow(10,n-1-i) + v[i+1]) % mod;
    ans += num[v[i]];
    num[v[i]]++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5172
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>

using namespace std;

long fun(int a) {
    switch (a) {
        case 1:
            return 2;
        case 2:
            return 3;
        case 3:
            return 5;
        case 4:
            return 8;
        case 5:
            return 13;
        case 6:
            return 21;
        default:
            return 1;
    }
}

int main() {
    int H, W, K;
    cin >> H >> W >> K;

    long MOD = 1'000'000'007;

    long dp[101][8] = {};
    dp[0][0] = 1;

    for (int h = 2; h <= H + 1; h++) {
        for (int w = 1; w <= W; w++) {
            long step = 0;

            // from left
            if (w > 1) step += ( ( fun(w - 3) * fun(W - w - 1) ) % MOD ) * dp[h - 1 - 1][w - 1 - 1];

            // from right
            if (w < W) step += ( ( fun(w - 2) * fun(W - w - 2) ) % MOD ) * dp[h - 1 - 1][w - 1 + 1];

            // straight
                       step += ( ( fun(w - 2) * fun(W - w - 1) ) % MOD ) * dp[h - 1 - 1][w - 1    ];

            dp[h - 1][w - 1] = step % MOD;
        }
    }

    cout << dp[H + 1 - 1][K - 1] << endl;


    return 0;
}


Measured memory_bytes: 384
use std::io::*;
use std::str::FromStr;

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

fn main(){
    let n: u32 = read();
    let a: u32 = read();
    let b: u32 = read();
    let ans = (1..n+1)
        .filter(|x| {
            let sum = x.to_string()
                .chars()
                .map(|c| (c as u8 - b'0') as u32)
                .sum::<u32>();
            a <= sum && sum <= b
        })
        .sum::<u32>();
    println!("{}", ans);
}

Measured memory_bytes: 4352
use std::cmp::min;
use std::io;
use std::io::prelude::*;
use std::iter::repeat;

struct MinSegTree {
    n: usize,
    nodes: Vec<i32>,
    lazy_nodes: Vec<Option<i32>>,
}

impl MinSegTree {
    fn new(n: usize) -> MinSegTree {
        let n = 1 << f64::log2(n as f64).ceil() as usize;
        MinSegTree {
            n,
            nodes: repeat(std::i32::MAX).take(2 * n - 1).collect(),
            lazy_nodes: repeat(None).take(2 * n - 1).collect(),
        }
    }

    fn update(&mut self, s: usize, t: usize, x: i32, ni: usize, l: usize, r: usize) {
        self.eval(ni);
        if r <= s || t <= l {
            return;
        }
        if s <= l && r <= t {
            self.lazy_nodes[ni] = Some(x);
            self.eval(ni);
            return;
        }
        let m = (l + r) / 2;
        self.update(s, t, x, 2 * ni + 1, l, m);
        self.update(s, t, x, 2 * ni + 2, m, r);
        self.nodes[ni] = min(self.nodes[2 * ni + 1], self.nodes[2 * ni + 2]);
    }

    fn eval(&mut self, ni: usize) -> i32 {
        match self.lazy_nodes[ni].take() {
            Some(x) => {
                self.nodes[ni] = x;
                if ni < self.n - 1 {
                    self.lazy_nodes[2 * ni + 1] = Some(x);
                    self.lazy_nodes[2 * ni + 2] = Some(x);
                }
            }
            None => {}
        }
        self.nodes[ni]
    }

    fn find(&mut self, s: usize, t: usize, ni: usize, l: usize, r: usize) -> i32 {
        self.eval(ni);
        if s <= l && r <= t {
            self.nodes[ni]
        } else if r <= s || t <= l {
            std::i32::MAX
        } else {
            let m = (l + r) / 2;
            min(
                self.find(s, t, 2 * ni + 1, l, m),
                self.find(s, t, 2 * ni + 2, m, r),
            )
        }
    }
}

fn main() {
    let stdin = io::stdin();
    let mut lines = stdin.lock().lines();

    let line0 = lines.next().unwrap().unwrap();
    let n = line0.split_whitespace().next().unwrap().parse().unwrap();

    let mut mst = MinSegTree::new(n);

    for l in lines.map(Result::unwrap) {
        let mut words = l.split_whitespace();
        let com = words.next().unwrap().parse().unwrap();
        let s: usize = words.next().unwrap().parse().unwrap();
        let t: usize = words.next().unwrap().parse().unwrap();
        let n = mst.n;
        match com {
            0 => {
                let x = words.next().unwrap().parse().unwrap();
                mst.update(s, t + 1, x, 0, 0, n);
            }
            1 => println!("{}", mst.find(s, t + 1, 0, 0, n)),
            _ => (),
        }
    }
}



Measured memory_bytes: 7188
N = int(input())
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
ans = 0
for i in range(N):
    tmp = 0
    for j in range(N):
        if i > j:
            tmp += A1[j]
        elif i == j:
            tmp += A1[j]
            tmp += A2[j]
        else:
            tmp += A2[j]
        #print(tmp)
    if tmp > ans:
        ans = tmp
print(ans)

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

vector<pair<ll,ll>> v;

int main(){
  ll a,b,c;
  cin >> a >> b >> c;
  
  if(c>=a+b+1)
    cout << a + 2 * b + 1 << endl;
  else
    cout << b + c << endl; 
}

Measured memory_bytes: 256
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

pc = pc[::-1]
#print(pc)
ans = float('inf')
for i in range(2**d):
  total = 0
  cnt = 0
  for j in range(d):
    if (i>>j) & 1:
      total += 100*(d-j)*pc[j][0] + pc[j][1]
      cnt += pc[j][0]
    if total >= g:
      ans = min(ans, cnt)
      continue
  for j in range(d):
    if (i>>j) & 1 == False:
      for k in range(pc[j][0]):
        total += 100*(d-j)
        cnt += 1
        if total >= g:
          ans = min(ans, cnt)
          break
      break
      
print(ans)

Measured memory_bytes: 9224
#include<stdio.h>

int main()
{
	int a,b,c,d;
	scanf("%d %d %d",&a,&b,&c);
	if(a > b)
	{
		d = a;
		a = b;
		b = d;
	}	
	if(b > c)
	{
		d = b;
		b = c;
		c = d;
	}
	if(a > b)
	{
		d = a;
		a = b;
		b = d;
	}
		printf("%d %d %d\n",a,b,c);
		
		
 	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(long long (i)=0, i_bound = (long long)(n); (i)<i_bound; ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
signed main(){
    int N, K, Q; cin>>N>>K>>Q;
    vector<ll> A(Q);
    REP(i, Q) cin>>A[i];
    vector<ll> S(N, K-Q);
    REP(i, Q){
        S[A[i]-1]+=1;
    }
    REP(i, N){
        if(S[i]>0){
            cout<< "Yes" << endl;
        }
        else cout << "No" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 2176
#define LOCAL

#undef _GLIBCXX_DEBUG

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

#define IOS ios::sync_with_stdio(false);cin.tie(0)
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define MOD 1000000007LL
#define LLINF 100000000000000005LL
#define INF (int)1e9+1

// Copied from Gennady-Korotkevich's template

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
	return '"' + s + '"';
}

string to_string(const char* s) {
	return to_string((string)s);
}

string to_string(bool b) {
	return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
	bool first = true;
	string res = "{";
	for (int i = 0; i < static_cast<int>(v.size()); i++) {
		if (!first) {
			res += ", ";
		}
		first = false;
		res += to_string(v[i]);
	}
	res += "}\n";
	return res;
}

template <size_t N>
string to_string(bitset<N> v) {
	string res = "";
	for (size_t i = 0; i < N; i++) {
		res += static_cast<char>('0' + v[i]);
	}
	return res;
}

template <typename A>
string to_string(A v) {
	bool first = true;
	string res = "{";
	for (const auto& x : v) {
		if (!first) {
			res += ", ";
		}
		first = false;
		res += to_string(x);
	}
	res += "}\n";
	return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
	return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
	return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
	return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

template <typename A, typename B, typename C, typename D, typename E>
string to_string(tuple<A, B, C, D, E> p) {
	return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + "," + to_string(get<4>(p)) + ")";
}

void debug_out() {
	cerr << endl;
}

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "\n[" << #__VA_ARGS__ << "]:\n", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

// End of Gennady-Korotkevich's template 

using llong = long long;
using PII = pair<int, int>;

int main() {
	IOS;
	int n; cin >> n;
	string s, t;
	cin >> s >> t;
	string ans = "";
	for (int i = 0; i < s.length() * 2; i++) {
		if (i % 2) ans += t[i/2];
		else ans += s[i/2];
	}
	cout << ans;
}

Measured memory_bytes: 3584
s = input()
ans = False
if s[0] == s[1] :
    if s[0] != s[2] and s[2] == s[3] :
        ans = True
elif s[0] == s[2] :
    if s[0] != s[1] and s[1] == s[3] :
        ans = True
elif s[0] == s[3] :
    if s[0] != s[1] and s[1] == s[2] :
        ans = True
if ans:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
   ll n , w;
   cin>>n>>w;
   ll wt[n],val[n];
   for(ll i=0;i<n;i++) cin>>wt[i]>>val[i];
  ll dp[n+1][w+1];
   for(ll i =0;i<=n;i++)
   {
   	 for(ll j =0;j<=w;j++)
   	 {
   	 	if(i==0 || j==0)
   	 	{
   	 		dp[i][j]=0;
		}
		else if(wt[i-1]<=j)
		{
			dp[i][j]=max(dp[i-1][j-wt[i-1]]+val[i-1],dp[i-1][j]);
		}
		else{
			dp[i][j]=dp[i-1][j];
		}
		}
	} 
	cout<<dp[n][w]<<"\n";   	
}

Measured memory_bytes: 82448
package main

import (
    "fmt"
)

func main() {
    var A,B int
  
    fmt.Scan(&A)
    fmt.Scan(&B)
  
    var tmp int
  
    if A < B {
        tmp = A
        A = B
        B = tmp
    }
    var n int
    n=A*B
    fmt.Print(n/gcd(A,B))
}

func gcd(A int, B int) int{
    if A%B==0{
        return B
    } else {
        return gcd(B,A%B)
    }
}

Measured memory_bytes: 512
#include <iostream>
#include <sstream>
#include <stdio.h>
//#define _USE_MATH_DEFINES
#include <math.h>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <bitset>
#include <stack>
#include <queue>
#include <ctype.h>

typedef long long int lli;
#define rep(i,s,N) for(int i=s;i<N;i++)
#define MOD 1000000007
#define more(a,b) (((a)>(b))?(a):(b))
#define less(a,b) (((a)<(b))?(a):(b))

using namespace std;


int main(void)
{
	int A, B, C; cin >> A >> B >> C;
	lli K; cin >> K;
	if (K % 2 == 1)cout << (B - A) << endl;
	else cout << (A - B) << endl;

	return 0;
}


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

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main()
{
	int n, k;
	cin >> n >> k;
	int h[n];
	for(int i=0;i<n;i++)
		cin >> h[i];
	int dp[n];
	dp[0] = 0;
	dp[1] = abs(h[0] - h[1]);
	for(int i=2;i<n;i++)
	{
		int temp = 1e9;
		for(int j=1;j<=k;j++)
		{
			if(i-j < 0) break;
			temp = min(temp, dp[i-j] + abs(h[i] - h[i-j]));
		}
		dp[i] = temp;
	}
	cout << dp[n-1] << "\n";

	return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // ABC158A - Station and Bus

        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        System.out.println((s.equals("AAA") || s.equals("BBB")) ? "No" : "Yes");
    }
}

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

namespace MyProgram
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string S = Console.ReadLine();
            string T = Console.ReadLine();
            
            char[] Sc = new char[26];
            char[] Tc = new char[26];
            
            int si , ti;
    
            for(int i = 0 ; i < S.Length ; i++)
            {
                si = (int)(S[i] - 'a');
                ti = (int)(T[i] - 'a');
                Sc[si]++;
                Tc[ti]++;
            }
            
            Array.Sort(Sc);
            Array.Sort(Tc);
            
            bool can = true;
            for(int i = 0 ; i < Sc.Length; i++)
            {
                if(Sc[i] != Tc[i]) can = false;
            }
            
            if(can) Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 12640
#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using LD = long double;
using T = int;
const T INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, p;
    cin >> n >> p;
    int j = 0, o = 0;
    for (int i = 0; i < n; i++) {
        int k;
        cin >> k;
        if (k % 2) j++;
        else o++;
    }
    if (p == 1 && j == 0) cout << "0\n";
    else {
        LL ans = 1;
        for (int i = 0; i < n - 1; i++) ans *= 2;
        if (j == 0) ans *= 2;
        cout << ans << '\n';
    }
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
class Program
{
    static void Main()
    {
        //入力
        //int n = 100;
        /*
        long n = long.Parse(Console.ReadLine());
        long[] input = new long[5];
        for(int a = 0; a < 5; a++)
        {
            input[a]=long.Parse(Console.ReadLine());
        }
        */
        int[] input = Console.ReadLine().Split().Select(i =>int.Parse(i)).ToArray();
        Console.WriteLine(input[2]-input[1]<=0? "delicious":input[2]-input[1]<=input[0]?"safe":"dangerous");
        

        /*
        //処理速度計測
        var sw = new System.Diagnostics.Stopwatch();
        sw.Start();
        //解法

        //処理速度表示
        sw.Stop();
        TimeSpan ts = sw.Elapsed;
        Console.WriteLine((int)(Math.Floor((ts).TotalMilliseconds))+"ms");
        */
        Console.ReadLine();
        
    }
}

Measured memory_bytes: 11348
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
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; }

int main() {
    int n; cin >> n;
    vector<int> b(n);
    rep(i, n) cin >> b[i];

    stack<int> st;
    while (!b.empty()) {
        bool ok = false;
        for (int i = b.size()-1; i >= 0; i--) {
            if (b[i] == i + 1) {
                st.push(b[i]);
                b.erase(b.begin() + i);
                ok = true;
                break;
            }
        }
        if (!ok) {
            cout << -1 << endl;
            return 0;
        }
    }

    while (!st.empty()) {
        cout << st.top() << endl;
        st.pop();
    }

}


Measured memory_bytes: 256
res = []

while True :
    Str = input()

    if Str == '-' : break

    res.append(Str)

    for mak in range(int(input()))  :
        shu = int(input())
        res[len(res)-1] = res[len(res)-1][shu:] + res[len(res)-1][:shu]

for mak in res : print(mak)

Measured memory_bytes: 7588
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    print(N*800-(N//15*200))
if __name__ == '__main__':
    main()

Measured memory_bytes: 64876
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define Ans(f, y, n) if(f) cout << y << endl; else cout << n << endl;
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i, v.size()){ cout << v[i] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

template<typename T> void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};

int mod = 1000000007;
//int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod
#define AddMult(x, y, z) x = (x + (y) * (z)) % mod

struct edge{int to, cost;};

class Graph
{
public:
    int N;
    vector<vector<edge>> G;
    bools win;
    vec A;

    Graph(int N, vec A): N(N), A(A){
        G = vector<vector<edge>>(N, vector<edge>(0));
        win = bools(N, false);
    }

    void add_edge(int from, int to, int cost = 0){
        G[from].push_back(edge({to, cost}));
    }

    void add_edge2(int v1, int v2, int cost = 0){
        add_edge(v1, v2, cost);
        add_edge(v2, v1, cost);
    }

    void update(int v){
        for(auto e: G[v]) if(A[e.to] < A[v] && !win[e.to]) win[v] = true;
    }

    void show(){
        REP(i, N) if(win[i]) cout << i + 1 << " ";
        cout << endl;
    }

};

signed main(){

    int N; cin >> N;
    vec A(N); readv(A);
    Graph G(N, A);
    int a, b;
    REP(i, N - 1){
        cin >> a >> b;
        G.add_edge2(a - 1, b - 1);
    }
    pairs p(N);
    REP(i, N) p[i] = Pii(A[i], i);
    Sort(p);

    REP(i, N) G.update(p[i].s);
    G.show();

    return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  string s;
  cin>>s;
  char st[] ={'C','F'};
  int n = 0;
  for(int i = 0;i<s.size();i++){
    if(st[n] == s[i])
      n++;
  }
  if(n==2)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;

  return 0;
}


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

int main() {
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
        for (int j = i + 1; j < s.size(); j++)
        if (s[i] == 'C' && s[j] == 'F') {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 256
h = int(input())
w = int(input())
n = int(input())

num = n//max(h,w) if (n//max(h,w)+1)==n else (n//max(h,w)+1)

if (n%max(h,w)==0):
  print((n//max(h,w)))
else:
  print((n//max(h,w)+1))

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(long long i=(l);i<(r);i++)
#define dec(i, l, r)   for(long long i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    std::ios::sync_with_stdio(false);
    int x, a, b;cin >> x >> a >> b;
    cout << (x-a)%b << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define drng(i,a,b) for(int i=int(a);i>int(b);i--)
typedef long long LL;
 

int main() {
    fastio
    int n;
    cin>>n;
    int a[n],b[n],c[n];
    rng(i,0,n){
        cin>>a[i]>>b[i]>>c[i];
    }
    int dp[n][3];
    dp[0][0] = a[0];
    dp[0][1] = b[0];
    dp[0][2] = c[0];
    rng(i,1,n){
        dp[i][0] = a[i] + max(dp[i-1][1], dp[i-1][2]);
        dp[i][1] = b[i] + max(dp[i-1][0], dp[i-1][2]);
        dp[i][2] = c[i] + max(dp[i-1][1], dp[i-1][0]);
    }
    cout<<max({dp[n-1][0], dp[n-1][1], dp[n-1][2]})<<endl;
    
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using ll = long long;
using P = pair<ll,ll>;
using vec = vector<ll>;
using vecp = vector<P>;
using mat = vector<vec>;
using matp = vector<vecp>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define all(v) v.begin(), v.end()



int main(){
  ll N,M;
  cin >> N >> M;
  vector<string> S(N);
  rep(i,N) cin >> S.at(i);
  ll s=N*M,t=N*M+1;
  mf_graph<ll> g(N*M+2);
  rep(i,N){
    rep(j,M){
      if(S.at(i).at(j)=='.'){
        if((i+j)%2==0){
          g.add_edge(s,i*M+j,1);
        }else{
          g.add_edge(i*M+j,t,1);
        }
      }
    }
  }
  rep(i,N){
    rep(j,M){
      if((i+j)%2==0&&S.at(i).at(j)=='.'){
        if(i!=0&&S.at(i-1).at(j)=='.'){
          g.add_edge(i*M+j,(i-1)*M+j,1);
        }
        if(i!=N-1&&S.at(i+1).at(j)=='.'){
          g.add_edge(i*M+j,(i+1)*M+j,1);
        }
        if(j!=0&&S.at(i).at(j-1)=='.'){
          g.add_edge(i*M+j,i*M+j-1,1);
        }
        if(j!=M-1&&S.at(i).at(j+1)=='.'){
          g.add_edge(i*M+j,i*M+j+1,1);
        }
      }
    }
  }
  cout << g.flow(s,t) << endl;
  for(auto e:g.edges()){
    if(e.from==s||e.to==t||e.flow==0){
      continue;
    }
    ll i0=e.from/M,j0=e.from%M,i1=e.to/M,j1=e.to%M;
    if(i0==i1+1){
      S.at(i0).at(j0)='^';
      S.at(i1).at(j1)='v';
    }else if(i0+1==i1){
      S.at(i0).at(j0)='v';
      S.at(i1).at(j1)='^';
    }else if(j0==j1+1){
      S.at(i0).at(j0)='<';
      S.at(i1).at(j1)='>';
    }else{
      S.at(i0).at(j0)='>';
      S.at(i1).at(j1)='<';
    }
  }
  rep(i,N){
    cout << S.at(i) << endl;
  }
        
   
}

Measured memory_bytes: 6284
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, m, n) for (int i = m; i < n; ++i)
const int MOD = 1000000007;

int main() {
  int N; cin >> N;
  cout << 180 * (N-2) << endl;
  return 0;
}


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

int main(){
  string f,a,b;
  int n,i,yubiwa = 0;
  cin >> f;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a;
    b = a + a;
    if(b.find(f) != string::npos){
      yubiwa++;
    }
  }
  cout << yubiwa << endl;
  return 0;
}

Measured memory_bytes: 3184
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long
#define pii pair<int,int>
#define pll pair<LL,LL>

using namespace std;

int main(){
    int N,A,B,C,D;
    string s;cin>>s;

    cout<<s.substr(0,s.size()-8)<<endl;





    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    string T;
    cin >> T;
    long long int N = T.length();
    for (long long int i = 0; i < N; ++i) {
       if (T[i] == '?') T[i] = 'D';
    }
    cout << T << endl;
}


Measured memory_bytes: 3724
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();

        if (line.length() == 2) {
            System.out.println(line);
        } else {
            for (int i = 2; i >= 0; i--) {
                System.out.print(line.charAt(i));
            }
            System.out.print("\n");
        }
    }
}


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

using namespace std;

int N, M, minA, minB, mars[2][20009], a[20009], b[20009], p[20009];

void Move (int lin, int st, int dr, int val)
{
    if (st > dr) return;
    mars[lin][st] += val, mars[lin][dr + 1] -= val;
}

void DoMars ()
{
    for (int i=0; i<2; i++)
        for (int j=1; j<=N; j++)
            mars[i][j] += mars[i][j - 1];
}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d", &N);
for (int i=1; i<=N; i++)
    a[i] = i, b[i] = N + 1 - i;
for (int i=1; i<=N; i++)
    scanf ("%d", &p[i]);
for (int i=1; i<=N; i++)
{
    Move (0, 1, p[i] - 1, -i);
    Move (1, p[i] + 1, N, -i);
}
DoMars ();
for (int i=1; i<=N; i++)
{
    a[i] += mars[0][i], b[i] += mars[1][i];
    if (i == 1) minA = a[i];
    else
    if (a[i] < minA) minA = a[i];
    if (i == 1) minB = b[i];
    else
    if (b[i] < minB) minB = b[i];
}
//minA = minB = 1;
for (int i=1; i<=N; i++)
    printf ("%d ", a[i] - minA + 1);
printf ("\n");
for (int i=1; i<=N; i++)
    printf ("%d ", b[i] - minB + 1);
printf ("\n");
return 0;
}


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

using Int = __int128_t;
Int abs128(Int val){return val<0?-val:val;}

ostream &operator<<(ostream &os,Int val){
  if(ostream::sentry(os)){
    __uint128_t tmp=abs128(val);
    char buf[64];
    char *d=end(buf);
    do{
      --d;
      *d=char(tmp%10+'0');
      tmp/=10;
    }while(tmp);
    if(val<0) *--d='-';
    Int len=end(buf)-d;
    if(os.rdbuf()->sputn(d,len)!=len){
      os.setstate(ios_base::badbit);
    }
  }
  return os;
}

istream &operator>>(istream &is,Int &val){
  string s;
  is>>s;
  val=0;
  for(Int i=0;i<(Int)s.size();i++)
    if(isdigit(s[i])) val=val*10+s[i]-'0';
  if(s[0]=='-') val*=-1;
  return is;
}



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

//INSERT ABOVE HERE
signed main(){
  Int n,a;
  cin>>n>>a;
 
  
  Int ans=n;
  for(Int i=1;i<100;i++){
    auto calc2=[&](Int x){
      vector<Int> v(i,x/i);
      for(Int j=0;j<x%i;j++) v[j]++;
      Int s=1;
      for(Int j=0;j<i;j++){
	if(s<(n+v[j]-1)/v[j]) s*=v[j];
	else s=n;
	if(s>=n) break;
      }
      return (n+s-1)/s;
    };
    
    auto calc=[&](Int x){
      if(x<0) return ans;
      return i*a+x+calc2(x);
    };
    
    auto best=[&](Int x){
      if(x<0) return x;
      Int l=0,r=x-2*i+1;
      Int v=calc2(x);
      while(l+1<r){
	Int m=(l+r)>>1;
	if(v==calc2(x-m)) l=m;
	else r=m;
      }
      return x-l;
    };
    
    auto next=[&](Int x)->Int{
      if(x<0) return x;
      Int l=0,r=1e18;
      Int v=calc2(x);
      if(v==calc2(x+r)) return -1;
      while(l+1<r){
	Int m=(l+r)>>1;
	if(v==calc2(x+m)) l=m;
	else r=m;
      }
      //assert(best(x+r)==x+r);
      return x+r;
    };
    
    Int l=i*2,r=1e18;    
    while((l+1<r)&&(calc2(r)+1<calc2(l))){
      //cout<<l<<" "<<calc(l)<<endl;
      //cout<<r<<" "<<calc(r)<<endl;
      l=best(l);
      r=best(r);
      chmin(ans,calc(l));
      chmin(ans,calc(r));
      Int m=best((l+r)>>1);
      Int t=next(m);
      chmin(ans,calc(m));
      chmin(ans,calc(t));
      if(calc2(t)+(t-m)==calc2(m))
	for(Int j=m+1;calc2(j)<calc2(j-1);j++) chmin(ans,calc(j));
      
      //cout<<i<<":"<<m<<" "<<t<<":";
      //cout<<calc2(t)<<" "<<calc2(m)<<":"<<calc(m)<<" "<<calc(t)<<endl;    
      if(calc2(t)+(t-m)<calc2(m)) l=m;
      else r=m;
    }
    l=best(l);
    r=best(r);
    chmin(ans,calc(l));
    chmin(ans,calc(r));

    const Int MAX = 0;
    
    Int pl=l,pr=r;
    for(Int j=0;j<MAX;j++){
      if(l==i*2) break;
      l=best(l-1);
      chmin(ans,calc(l));
    }
    for(Int j=0;j<MAX;j++){
      if(r==i*2) break;
      r=best(r-1);
      chmin(ans,calc(r));
    }
    
    l=pl;r=pr;
    for(Int j=0;j<MAX;j++){
      l=next(l);
      if(l<0) break; 
      chmin(ans,calc(l));      
    }
    for(Int j=0;j<MAX;j++){
      r=next(r);
      if(r<0) break; 
      chmin(ans,calc(r));      
    }
    
    l=i*2;
    for(Int j=0;j<MAX;j++){
      l=next(l);
      if(l<0) break; 
      chmin(ans,calc(l));      
    }
  }

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


Measured memory_bytes: 256
#include <set>
#include <numeric>
#include <iostream>
#include <cstdio>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

inline int getInt(){ int s; scanf("%d", &s); return s; }

using namespace std;

int main(){
  while(true){
    int w = getInt();
    int d = getInt();

    if(w + d == 0) break;

    multiset<int> hw;
    multiset<int> hd;

    REP(i,w) hw.insert(getInt());
    REP(i,d){
      int t = getInt();
      hd.insert(t);
      if(hw.count(t) > 0){
        hw.erase(hw.find(t));
      }
    }

    printf("%d\n", accumulate(hw.begin(), hw.end(), 0) +
           accumulate(hd.begin(), hd.end(), 0));
  }
  return 0;
}

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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair

/*
int main() {
  ll n, p;
  cin >> n >> p;
  map<ll, ll> cnt;
  for (ll i = 2; i*i <= p; i++) {
    while (p % i == 0) {
      cnt[i]++;
      p /= i;
    }
  }
  cnt[p]++;
  ll ans = 1;
  for (auto itr = cnt.begin(); itr != cnt.end(); itr++) {
    DEBUG(*itr);
    if (itr->second < n) continue;
    ans *= (itr->second / n) * itr->first;
  }
  cout << ans << endl;
}
*/
int main() {
  int n;
  cin >> n;
  vl a(n);
  rep (i, n) {
    cin >> a[i];
  }
  bool flag = false;
  rep (i, n) {
    if (a[i] % 2) {
      flag = true;
    }
  }
  if (flag) {
    cout << "first" << endl;
  }
  else {
    cout << "second" << endl;
  }
}


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

#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++)

bitset<10> is_open[100];
li p[100][11];

li calc(li n, li x) {
    bitset<10> joisino(x);
    li res = 0;
    rep(i, n) {
        res += p[i][(joisino & is_open[i]).count()];
    }
    return res;
}

int main(void)
{
    li n;
    cin >> n;
    rep(i, n) {
        rep(j, 10) {
            li x;
            cin >> x;
            is_open[i].set(j, x);
        }
    }
    rep(i, n) {
        rep(j, 11) {
            cin >> p[i][j];
        }
    }
    li res = -(1ll << 60);
    repp(i, 1, 1 << 10) {
        res = max(res, calc(n, i));
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>pi;
const int MAXN=200005;
const int MOD=1000000007;
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define DEC(i,a,b) for(int i=(a);i>=(b);i--)
#define fst first
#define snd second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define db(x) cerr<<#x<<" = "<<x<<"\n"
#define LOW(v,x) (lower_bound(all(v),(x))-(v).begin())

int N;
int A[MAXN];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>N;FOR(i,1,N)cin>>A[i];
	int cnt=0;
	FOR(i,2,N-1){
		if(max({A[i-1],A[i],A[i+1]})!=A[i]&&min({A[i-1],A[i],A[i+1]})!=A[i])cnt++;
	}
	cout<<cnt<<"\n";
}
/*
*/


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

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 dx[] = {0, 0, 1, -1};
constexpr int dy[] = {1, -1, 0, 0};

ll div_up(ll a, ll b)
{
    return (a + b - 1) / b;
}

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

    int n;
    ll a[112345], b[112345];
    ll res = 0;
    cin >> n;
    REP(i, n)
    cin >> a[i] >> b[i];

    for (int i = n - 1; i >= 0; i--)
    {

        a[i] += res;

        ll tmp;
        if (a[i] == 0)
            tmp = 0;
        else if (a[i] > b[i])
            tmp = div_up(a[i], b[i]) * b[i] - a[i];
        else
            tmp = b[i] - a[i];

        res += tmp;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define int long long int
#define gif(a,b) (a/b +(a%b?1:0))
#define watch(x) cout<<(#x)<<" is "<<(x)<<"\n";
using namespace std;

int32_t main()
{   
    cin.tie(NULL);
    std::ios::sync_with_stdio(false);
    int a , b;
    cin >> a >> b;

    cout << a*b;

    return 0;
}


Measured memory_bytes: 3644