akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

struct UnionFind{
    
    vector<int> par;
    vector<int> rank;
    vector<int> sz;
    int uf_size;

private:
    void init(int n = 1){
        par.resize(n);
        rank.resize(n);
        sz.resize(n);
        uf_size = n;
        for(int i=0; i<n; i++){
            par[i] = i;
            rank[i] = 0;
            sz[i] = 1;
        }
    }

public:
    UnionFind(int n = 1){
        init(n);
    }

    int find(int x){
        if(par[x] == x) return x;
        else return par[x] = find(par[x]);
    }
    
    bool same(int x, int y){
        return find(x) == find(y);
    }

    bool unite(int x, int y){
        x = find(x);
        y = find(y);
        if(x == y) return false;
        if(rank[x] < rank[y]) swap(x, y);
        if(rank[x] == rank[y]) rank[x]++;
        uf_size--;
        par[y] = x;
        sz[x] = sz[x] + sz[y];
        return true;
    }

    int size(int x){
        return sz[find(x)];
    }
};

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

    int n, k; cin>>n>>k;
    vector<int> p(n);
    for(int i=0; i<n; i++) cin>>p[i];

    UnionFind uf(n-k+1);

    // [i, i+K) が元々昇順になっている
    vector<int> v;
    for(int i=0; i<n; i++){
        int cur = -1;
        int cnt = 0;
        while(i < n && cur < p[i]){
            cur = p[i];
            cnt++;
            i++;

            if(k <= cnt){
                v.emplace_back(i - k);
            }
        }

        i--;
    }

    for(int i=0; i+1<v.size(); i++){
        uf.unite(v[i], v[i+1]);
    }

    set<int> num;
    for(int i=0; i<k; i++){
        num.emplace(p[i]);
    }

    for(int i=0; i+k<n; i++){
        int lb = i;
        int ub = i + k;

        num.emplace(p[ub]);

        auto minitr = num.begin();
        auto maxitr = num.end(); maxitr--;

        if(p[lb] == *minitr && p[ub] == *maxitr){
            uf.unite(i, i + 1);
        }

        num.erase(p[lb]);
    }

    cout << uf.uf_size << endl;

    return 0;
}

Measured memory_bytes: 10368
R = lambda: map(int, input().split())
n, k = R()
v = list(R())
ans = 0
for i in range(1, min(n, k) + 1):
    for j in range(i):
        t = v[:i - j] + v[n - j:]
        ans = max(ans, sum(t) - sum(sorted(x for x in t if x < 0)[: k - i]))
print(ans)


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <functional>
#include <cmath>
#include <array>

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI;
typedef pair<int,int> pii;
const int mod = (int)1e9+7;


int main()
{
	
	cin.tie(0); ios_base::sync_with_stdio(false);
	string s;
	cin >> s;
	int n=sz(s);
	if(n==2){
		if(s[0]==s[1]) puts("1 2");
		else puts("-1 -1");
		return 0;
	}
	
	rep(i,n-2){
		if(s[i] == s[i+1] || s[i] == s[i+2] || s[i+1]==s[i+2]){
			printf("%d %d",i+1, i+3);
			return 0;
		}
	}
	puts("-1 -1");
	return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=2e5+5;
vector<int>a;
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    ll n;
    scanf("%lld",&n);
    while(n){
        if(n%26==0){
            a.push_back(25);
            n/=26;
            n--;
        }
        else{
            a.push_back(n%26-1);
            n/=26;
        }
    }
    for(int i=a.size()-1;i>=0;i--){
        printf("%c",a[i]+'a');
    }
    return 0;
}


Measured memory_bytes: 3716
#include <iostream>

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    ll n, d;
    cin >> n >> d;
    int odp = 0;
    for (int i = 0; i < n; ++i)
    {
        ll x, y;
        cin >> x >> y;
        if (x * x + y * y <= d * d)
            ++odp;
    }
    cout << odp;
    return 0;
}


Measured memory_bytes: 3648
n = int(input())
count = [0] * 4

for i in range(n):
    result = input()
    if result == "AC":
        count[0] += 1
    elif result == "WA":
        count[1] += 1
    elif result == "TLE":
        count[2] += 1
    else:
        count[3] += 1

print("AC x " + str(count[0]))
print("WA x " + str(count[1]))
print("TLE x " + str(count[2]))
print("RE x " + str(count[3]))

Measured memory_bytes: 9212
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T>& a) {
  os << "{";
  for (size_t i = 0; i < a.size(); ++i) os << (i > 0 ? "," : "") << a[i];
  return os << "}";
}

[[maybe_unused]] constexpr ll MOD = 1000000007;
[[maybe_unused]] constexpr int INF = 0x3f3f3f3f;
[[maybe_unused]] constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;

int main() {
  ll n;
  cin >> n;
  vector<ll> d(n + 1);
  rep(i, 1, n) {
    for (ll j = i; j < n; j += i) d[j]++;
  }

  ll ans = 0;
  rep(c, 1, n) ans += d[c];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 10792
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;
string phone(string cell_input);

int main(void){
	string cell_input;
	while(cin >> cell_input){
		cout << phone(cell_input) << endl;
	}
	return 0;
}

string phone(string cell_input){
	int temp_pos = 0;
	int last_pos = 0;
	int index;
	int len_max;
	string temp_word;
	string return_word = "";
	string input[9] = {"',.!?",    "abcABC", "defDEF",
			   "ghiGHI",   "jklJKL", "mnoMNO",
			   "pqrsPQRS", "tuvTUV", "wxyzWXYZ"};
	while(1){
		temp_word = cell_input[last_pos];
		temp_pos = cell_input.find_first_not_of( temp_word.c_str(), last_pos );
                index = atoi(temp_word.c_str())-1;
		len_max = input[index].length();
		if(temp_pos == string::npos){
			if(temp_word.compare("0") == 0){
                                return_word.append(cell_input.length()-last_pos, ' ');
			}else{
				return_word.append(1, input[index][(cell_input.length()-last_pos-1) % len_max]);
			}
			return return_word;
		}
		if(temp_word.compare("0") == 0){
			return_word.append(temp_pos-last_pos-1, ' ');
		}else{
			return_word.append(1, input[index][(temp_pos-last_pos-1) % len_max]);
		}
		last_pos = temp_pos;
	}		
}

Measured memory_bytes: 1208
#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
#include "bits/stdc++.h"
using namespace std;
#define int long long

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

	int s1 = stoi(s.substr(0,2));
	int s2 = stoi(s.substr(2,2));

	if (s1 >= 1 && s1 <= 12) {
		if (s2 >= 1 && s2 <= 12) {
			cout << "AMBIGUOUS" << endl;
		}
		else {
			cout << "MMYY" << endl;
		}
	}
	else if (s2 >= 1 && s2 <= 12) {
		cout << "YYMM" << endl;
	}
	else {
		cout << "NA" << endl;
	}


	

}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn main() {
    let nm: Vec<u64> = read_vec();
    let n = nm[0];
    let m = nm[1];
    if n == 2 || m == 2 {
        println!("0");
    } else if n == 1 && m == 1 {
        println!("1");
    } else if n == 1 {
        println!("{}", m - 2);
    } else if m == 1 {
        println!("{}", n - 2);
    } else {
        println!("{}", (n - 2) * (m - 2));
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n)   FOR(i,0,n)
#define RREP(i,n)   RFOR(i,0,n)
#define SORT(s) sort(s.begin(), s.end())
#define P pair<int, int>
#define mp make_pair
 
const double INF = 1e+09;
const int MOD = 1e9+7;
 
using namespace std;
 
template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {if (v.empty()) {ostr << "{ }"; return ostr;}
    ostr << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) {ostr << ", " << *itr;}
    ostr << "}";
    return ostr;}
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
int gcd(int a, int b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));}
 
int lcm(int a, int b)
{return a * b / gcd(a, b);}
 
vector<int> uniq(vector<int> vec){
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  return vec;}
 
vector<ll> divisor(ll n) {
vector<ll> ret;
for(int64_t i = 1; i * i <= n; i++) {
  if(n % i == 0) {
    ret.push_back(i);
    if(i * i != n) ret.push_back(n / i);
  }
}
  sort(begin(ret), end(ret));
  return (ret);
}
void permu(int n){
  vector<int> perm(n);
  REP(i, n) perm[i] = i;
do{
  cout << perm  << endl;
}
while (next_permutation(perm.begin(), perm.end()));
return;}
 
vector<pair<ll, int>> prime_div(ll n){
  vector<pair<ll, int>> res;
  for (ll i=2; i*i <= n;i++){
    if (n%i == 0){
      int a = 0;
      while(n%i == 0){
        n /= i;
        a++;
      }
      pair<ll, int> tmp;
      tmp.first = i;
      tmp.second = a;
      res.push_back(tmp);
    }
  }
  if (n != 1){
    pair<ll, int> now;
    now.first = n;
    now.second = 1;
    res.push_back(now);}
  return res;
}
 
 
// printf("%.10f\n" , ans);
int main(void){
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  REP(i, n) cin >> a[i];
  ll init = 1000;
  REP(i, n-1){
    if (a[i+1] > a[i]){
      ll kabu = init/a[i];
      ll amari = init % a[i];
      ll next = kabu * a[i+1] + amari;
      init = next;
    }
  }
  cout << init << endl;
  return 0;
}
 

Measured memory_bytes: 3640
import java.util.Scanner
fun main (args: Array<String>) {
  
  val reader = Scanner(System.`in`)
  val input = reader.next()
  
  var output = ""
  
  when(input){
    "A" -> output = "T"
    "T" -> output = "A"
    "C" -> output = "G"
    "G" -> output = "C"
    else -> output = ""
  }
  
  println(output)
}

Measured memory_bytes: 29472
import math

def Comb(n, r):
  if n < r:
    return 0
  else:
    return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))

N = input()
K = int(input())
ans = 0
for i in range(1, len(N)):
  if i < K:
    pass
  else:
    ans += 9 ** K * Comb(i-1, K-1)
ans += (int(N[0])-1) * Comb(len(N)-1, K-1) * 9 ** (K-1)
if K == 1:
  ans += 1
elif K == 2:
  for i in range(1, len(N)):
    if N[i] != '0':
      ans += int(N[i]) + 9 * (len(N) - i - 1)
      break
else:
  for i in range(1, len(N)):
    if N[i] != '0':
      if len(N) - i - 1 >= 2:
        ans += Comb(len(N) - i - 1, 2) * 9 ** 2
      if len(N) - i - 1 >= 1:
        ans += (int(N[i]) - 1) * 9 * (len(N) - i - 1)
      for j in range(i+1, len(N)):
        if N[j] != '0':
          ans += int(N[j]) + 9 * (len(N) - j - 1)
          break
      break
print(ans)


Measured memory_bytes: 3064
from typing import List


class DSU:
    def __init__(self, n: int) -> None:
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a <= self._n
        assert 0 <= b <= self._n
        x, y = self.leader(a), self.leader(b)
        if x == y:
            return x
        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x
        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x
        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a <= self._n
        assert 0 <= b <= self._n
        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n
        if self.parent_or_size[a] < 0:
            return a
        result = self.leader(self.parent_or_size[a])
        self.parent_or_size[a] = result
        return result

    def size(self, a: int) -> int:
        assert 0 <= a <= self._n
        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> List[List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]
        group_size = [0] * self._n
        for i in leader_buf:
            group_size[i] += 1
        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)
        result = [i for i in result if i]
        return result


import sys
input = sys.stdin.readline
n, q = map(int, input().split())
uf = DSU(n)
for i in range(q):
    t, u, v = map(int, input().split())
    if t:
        print(int(uf.same(u, v)))
    else:
        uf.merge(u, v)


Measured memory_bytes: 83344
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int maxn = 105;
char a[maxn][maxn];
char b[maxn];
int main()
{
	int n, l;
	cin >> n >> l;
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < l; j++)
		{
			cin >> a[i][j];
		}
	}
	for(int i = 0; i < n; i++)
	{
		for(int j = i; j < n; j++)
		{
			if(strcmp(a[i],a[j]) > 0)
			{
				strcpy(b,a[i]);
				strcpy(a[i],a[j]);
				strcpy(a[j],b);
			}
		}
	}
	for(int i = 0; i < n; i++)
	{
		cout << a[i];
	}
}

Measured memory_bytes: 256
import java.math.BigInteger;
import java.util.*;

public class Main {
	
	int a,d,n, MAX = 1000000;
	boolean [] isprime;
	private void doit(){
		Scanner sc = new Scanner(System.in);
		init();
		while(true){
			a = sc.nextInt();
			d = sc.nextInt();
			n = sc.nextInt();
			if((a|n|d) == 0) break;
			for(int i = a ; i <= MAX; i+= d){
				if(isprime[i]){
					n--;
					if(n == 0){
						System.out.println(i);
						break;
					}
				}
			}
		}
	}

	private void init() {
		isprime = new boolean[MAX + 1];
		Arrays.fill(isprime, true);
		isprime[0] = false;
		isprime[1] = false;
		for(int i = 0 ; i * i <= MAX; i++){
			if(isprime[i]){
				for(int j = i * 2; j <= MAX; j += i){
					isprime[j] = false;
				}
			}
		}
	}

	public static void main(String [] args){
		new Main().doit();
	}
}

Measured memory_bytes: 13000
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; }                            /* 1,2,3,4.. */
int des(const void *a, const void *b) { return *(int *)b - *(int *)a; }                            /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; }                     /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX 100001
#define MOD 1000000007
#define INF 1000000001

typedef long long int lli;

long long int Gcd(int x, int y)
{
  if (y == 0)
    return x;
  else
    return Gcd(y, x % y);
}

int main(void)
{
  int n, a[MAX];

  scanf("%d", &n);
  rep(i, n)
  {
    scanf("%d", &a[i]);
  }

  int dp[MAX];
  int first[MAX], second[MAX];
  first[0] = a[0];
  second[n - 1] = a[n - 1];
  for (int i = 1; i < n; i++)
  {
    first[i] = Gcd(first[i - 1], a[i]);
    second[n - 1 - i] = Gcd(second[n - i], a[n - 1 - i]);
  }

  int max = second[1];
  for (int i = 1; i < n - 1; i++)
    max = max(max, Gcd(first[i - 1], second[i + 1]));
  max = max(max, first[n - 2]);
  printf("%d\n", max);
  return 0;
}


Measured memory_bytes: 1280
n, k = map(int, input().split())
a = {}
d = 0
f1 = []
f2 = []
for i in range(k):
  d = int(input())
  f1 = list(map(int, input().split()))
  a[d] = f1
  for i in f1:
    if i not in f2:
      f2.append(i)
f1 = []
for i in range(1,n+1):
  if i not in f2:
    f1.append(i)
print(len(f1))


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

int main() {
    int s;
    cin >> s;
    string ans;
    if (s < 100) {
        if (s <= 12 && s != 0)
            ans = "YYMM";
        else
            ans = "NA";
    }
    else {
        int up = (s-s%100)/100;
        int down = s%100;
        if (up > 0 && up <= 12 && (down == 0 || down > 12)) 
            ans = "MMYY";
        else if ((up == 0 || up > 12) && down > 0 && down <= 12)
            ans = "YYMM";
        else if (up > 0 && up <= 12 && down > 0 && down <= 12)
            ans = "AMBIGUOUS";
        else
            ans = "NA";
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

const long long linf = 1e18 + 7;
const int inf = 1e9 + 7;
const int N = 1e5 + 5;

typedef long long ll;

string s;

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


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char const *argv[])
{
	int a,b;
	scanf("%d %d",&a,&b);
	int n = 0;
	int count = 0;
	for(int i =1;i<=9;i++){
	      for(int j =0;j<=9;j++){
	      	for(int k = 0; k <= 9;k++){
	      		n = i*10001+j*1010+k*100;
	      		if(a<=n&&n<=b)count++;
	      	}
	      }
	}
	      			printf("%d\n",count);

	return 0;
}

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

int main() {

  array<string, 3> Arr = {
    "Sunny","Cloudy","Rainy"
  };
  string S;
  cin >> S;
  int i = std::distance(begin(Arr), std::find(begin(Arr), end(Arr), S));
  ++i; i %= 3;
  cout << Arr[i] << endl;

}


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

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
#define fileio freopen("template.in", "r", stdin), freopen("template.out", "w", stdout);
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const ll MOD = 1e9 + 7;

int main() {
    fastio;
    //fileio;
        
    int n, x, t;
    cin >> n >> x >> t;

    int num = n / x;
    num++;
    if (n % x == 0) {num--;}
    cout << num * t << "\n";
    return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

int main()
{
    fast;
     int n;
     cin>>n;
     int arr[n+1];
      for(int i=1;i<=n;i++)
       cin>>arr[i];
      int num=1,count=0;
      for(int i=1;i<=n;i++)
      {
          while((i<=n)&&arr[i]!=num)
           i++,count++;
           if(arr[i]==num)
            num++;
      }
      if(num==1)
       cout<<-1;
       else
        cout<<count;
         return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>

void insertion_sort(int*, int*);
void display(int*, int*);

int main(void) {
  int len, i, j;
  scanf("%d",&len);

  int data[len];

  for(i=0; i<len; i++) {
    scanf("%d", &data[i]);
  }
  display(data, &len);
  insertion_sort(data, &len);

  return 0;
}

void insertion_sort(int *data, int *len) {
  int i, j, v;

  for(i=1; i<*len; i++) {
    v = data[i];
    j = i-1;
    while(j>=0 && data[j]>v) {
      data[j+1] = data[j];
      j--;
    }
    data[j+1] = v;
    display(data, len);
  }
}

void display(int *data, int *len) {
  int i;
  for(i=0; i<*len; i++) {
    if(i!=0) printf(" ");
    printf("%d", data[i]);
  }
  printf("\n");
}

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

long long int w[101],v[101],DP[100001][101];
long long int knap(int W,int N)
{
	
	long long int k1,k2;
	if(W==0 || N==0)
	return 0;
	
	if(W-w[N]<0)
	{
		if(DP[W][N-1]==-1)
		return DP[W][N-1]=knap(W,N-1);
		else
		return DP[W][N-1];
	}
	
	if(DP[W-w[N]][N-1]==-1)
	k1=DP[W-w[N]][N-1]=knap(W-w[N],N-1);
	else
	k1=DP[W-w[N]][N-1];
	
	if(DP[W][N-1]==-1)
	k2=DP[W][N-1]=knap(W,N-1);
	else
	k2=DP[W][N-1];
	
	//cout<<k1<<" "<<k2<<endl;
	return max(k1+v[N],k2);
	
}




int main()
{
	int N,W,i,j;cin>>N>>W;
	
	for(i=1;i<=N;i++)
	cin>>w[i]>>v[i];
	
	for(i=0;i<=100000;i++)
	{
		for(j=0;j<=100;j++)
		DP[i][j]=-1;
	}
	cout<<knap(W,N);
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define rrep(i,n) for(int i=(int)n-1;i>=0;--i)
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T& a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U& u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U& u,const V... v){for(auto& e:u)fill_v<T>(e,v...);}

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

    int n;
    cin >> n;
    vector<string> s(n);
    rep(i, n) cin >> s[i];

    set<string> st;
    bool ans = true;
    rep(i, n) {
        if (i == 0) st.insert(s[i]);
        else {
            if (s[i-1].back() != s[i][0]) ans = false;
            if (st.count(s[i])) ans = false;
            st.insert(s[i]);
        }
    }
    cout << (ans ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3620
# -*- coding: utf-8 -*-
from math import factorial

N, M = map(int, input().split())
a = [int(input()) for x in range(M)]

def fibo(dan):
    tmp = [1, 1]
    for i in range(2, dan+1):
        tmp.append(tmp[i-1] + tmp[i-2])
    return tmp[dan]

routes = 1
prev = 0
for x in a:
    if x == prev:
        routes = 0
        break
    else:
        dan = (x-1) - prev
        routes = (routes * fibo(dan)) % 1000000007
        prev = x+1

routes = (routes * fibo(N-prev)) % 1000000007
print(int(routes))

Measured memory_bytes: 464036
import std.stdio;

int main(string[] args){
int n,k,max=0;
int val;
int sumArray[100003];

while(1){
scanf("%d %d",&n,&k);
if(n+k == 0)break;
for(int i=0;i<n;i++){
  scanf("%d",&val);
    if(i == 0)sumArray[i]=val;
    else sumArray[i]=sumArray[i-1]+val;
}

max = sumArray[k-1];
for(int i=k;i<n;i++){
  if(sumArray[i]-sumArray[i-k] > max)max=sumArray[i]-sumArray[i-k];
}

writeln(max);
}
return 0;
}

Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define ll long long
#define V vector<long long>
#define VV vector<vector<long long>>
#define VVV vector<vector<vector<long long>>>
#define rep(i,n) for(ll (i)=0;(i)<(n);++(i))
using namespace std;
 
V kai;
V ikai;
ll mod=1e9+7;
 
ll mpow(ll x, ll n){
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % mod;
        x = x*x % mod;
        n = n >> 1;
    }
    return ans;
}
 
ll comb(ll a,ll b){
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ikai[a-b]*ikai[b] % mod;
    return tmp * kai[a] % mod;
}
 
int main() {
    ll n;
    cin>>n;
    V a(n+1);
    vector<bool> used(n+1,false);
    ll num;
    rep(i,n+1){
        cin>>a[i];
        if(used[a[i]-1])num=a[i];
        used[a[i]-1]=true;
    }
    V pos;
    rep(i,n+1)if(a[i]==num)pos.push_back(i);
    kai.assign(1e6+1,0);
    ikai.assign(1e6+1, 0);
    kai[0]=1;
    ikai[0]=1;
    rep(i,1e6){
        kai[i+1]=kai[i]*(i+1);
        kai[i+1]%=mod;
        ikai[i+1]=ikai[i]*mpow(i+1, mod-2);
        ikai[i+1]%=mod;
    }
    for(ll k=1;k<=n+1;k++){
        ll res=comb(n+1,k);
        res-=comb(pos[0]+n-pos[1],k-1);
        res=(res+mod)%mod;
        cout<<res<<endl;
    }
}

Measured memory_bytes: 17664
#include<stdio.h>
int main(void){
  char s1[200000],s2[200000];
  int i,l;
  l=200000;
  int ans=0;
  for(i=0;i<l;i++){
    s1[i]='0';s2[i]='0';
  }
  scanf("%s",s1);
  scanf("%s",s2);
  for(i=0;i<l;i++){
    if(s1[i]!=s2[i]){ans++;};
  }
  printf("%d\n",ans);
        
  return 0;
  
}

Measured memory_bytes: 2096
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using P = pair<ll, ll>;

// chmin, chmax関数
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

//---------------------------

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << (a*b)/2 << endl;
    return 0;
}

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


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
a = prime_factorize(n)
b = list(set(a))
total = 0
for j in range(len(b)):
    c  = len([i for i, x in enumerate(a) if x == list(set(a))[j]])
    y = 1
    while c>0:
        c -= y
        y += 1
        if c>=0:
            total +=1
print(total)

Measured memory_bytes: 9236
n = int(input())
lst = []
for i in range(0,n):
  lst.append(int(input()))
  
sort_lst = lst[:]
sort_lst.sort(reverse=True)
m = sort_lst[0]
m_s = max = sort_lst[1]
for i in range(0,len(lst)):
  if not lst[i] == m:
    print(m)
  else:
    print(m_s)

Measured memory_bytes: 14112
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function () { return this.index < this.max },
        "next": function () { if (!this.hasNext()) { throw "ArrayIndexOutOfBoundsException"; } else { return this.list[this.index++]; } }
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let n = nextInt()
    let v = nextIntArray()
    let c = nextIntArray()
    let total = 0
    for (let i = 0; i < v.length; i++) {
        let val = v[i] - c[i]
        if (val > 0) total += val
    }
    console.log(total)
}
Main()


Measured memory_bytes: 29548
w,h,n=map(int,input().split())
d,l=0,0
for i in range(n):
  x,y,a=map(int,input().split())
  if a==1:
    l=max(l,x)
  elif a==2:
    w=min(w,x)
  elif a==3:
    d=max(y,d)
  else:
    h=min(h,y)
print(0 if (h<=d or w<=l) else (h-d)*(w-l))

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int H = sc.nextInt();
            int W = sc.nextInt();
            if(H == 0 && W == 0){
                break;
            }   
            for(int i=1; i<=H; i++){
                if(i % 2 == 1){
                    if(W % 2 ==0){
                        for(int j=1; j<=W/2; j++){
                            System.out.printf("#.");
                        }
                    System.out.println();
                    }else{
                        for(int j=1; j<=(W-1)/2; j++){
                            System.out.printf("#.");
                        }
                    System.out.println("#");
                    }
                }else{
                    if(W % 2 ==0){
                        for(int j=1; j<=W/2; j++){
                            System.out.printf(".#");
                        }
                        System.out.println();
                    }else{
                        for(int j=1; j<=(W-1)/2; j++){
                            System.out.printf(".#");
                        }
                    System.out.println(".");
                    }
                }
            }
            System.out.println();
        }
        sc.close();
    }
}


Measured memory_bytes: 45928
#!/usr/bin/env python3
from copy import deepcopy
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for i in range(D)]

last = {}
for i in range(26):
    last[i] = -1

s = 0
Ret = []
for d in range(D):
    ret = 0
    sr = {}
    ll = {}
    for c in range(26):
        last_cp = deepcopy(last)
        s_cp = deepcopy(s)
        last_cp[c] = d
        s_cp += S[d][c]
        for i in range(26):
            s_cp -= C[i] * (d-last[i])
        sr[c] = s_cp
        ll[c] = last_cp
    sr = sorted(sr.items(), key=lambda x:x[1])
    ret = sr[-1][0]
    s += sr[-1][1]
    last = deepcopy(ll[ret])
    Ret.append(ret+1)

print(Ret[0], end='')
for i in range(1, D):
    print('\n' + str(Ret[i]), end='')


Measured memory_bytes: 73816
#include <stdio.h>
int Fib(int n){
  int i,a = 1,b = 1,c = 1;
  for(i=2; i<=n; i++){
    a = b + c;
    c = b;
    b = a;
  }
  return a;
}
int n;
int main(){
  scanf("%d",&n);
  printf("%d\n",Fib(n));
  return 0;
}

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

int main(){
	int a,b,c;	cin>>a>>b>>c;
	int ans=3;
	if(a==b)ans--;
	if(b==c)ans--;
	if(a==c)ans--;
	
	if(ans<1)ans=1;

	cout<<ans<<endl;

	return 0;
}


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

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

	int t;
	cin>>t;

	if(t>=30)
		cout<<"Yes";
	else
		cout<<"No";
}

Measured memory_bytes: 3608
import sys
input = sys.stdin.readline

N=int(input())
ST=[input().split() for i in range(N)]

for i in range(N):
    ST[i][1]=int(ST[i][1])

ST.sort()

ST2=[]
for i in range(N):
    if i>0 and ST[i][0]==ST[i-1][0]:
        continue
    ST2.append((ST[i][0],ST[i][1]))
ST=ST2


FDICT=dict()
BDICT=dict()

for s,i in ST:
    FDICT[s[::-1]]=i
    BDICT[s[::-1]]=i

    for j in range(1,len(s)):
        if not(s[:j][::-1] in BDICT):
            BDICT[s[:j][::-1]]=1<<60
        if not(s[-j:][::-1] in FDICT):
            FDICT[s[-j:][::-1]]=1<<60

ANS=1<<60
flag=0
for rep in range(1<<60):
    flag=0
    for f in FDICT:
        lf=len(f)
        for s,i in ST:
            ls=len(s)

            if lf == ls:
                if s==f:
                    ANS=min(ANS,FDICT[f]+i)
            elif ls>lf:
                if s[-lf:]==f and BDICT[s[:-lf][::-1]]>FDICT[f]+i:
                    BDICT[s[:-lf][::-1]]=FDICT[f]+i
                    flag=1
            else:
                if f[-ls:]==s and FDICT[f[:-ls]]>FDICT[f]+i:
                    FDICT[f[:-ls]]=FDICT[f]+i
                    flag=1
                    

    for b in BDICT:
        lb=len(b)
        for s,i in ST:
            ls=len(s)

            if lb == ls:
                if s==b:
                    ANS=min(ANS,BDICT[b]+i)
            elif ls>lb:
                if s[:lb]==b and FDICT[s[lb:][::-1]]>BDICT[b]+i:
                    FDICT[s[lb:][::-1]]=BDICT[b]+i
                    flag=1
                    
            else:
                if b[:ls]==s and BDICT[b[ls:]]>BDICT[b]+i:
                    BDICT[b[ls:]]=BDICT[b]+i
                    flag=1
    if flag==0:
        break
                    

for f in FDICT:
    if f==f[::-1]:
        ANS=min(ANS,FDICT[f])

for b in BDICT:
    if b==b[::-1]:
        ANS=min(ANS,BDICT[b])

if ANS==1<<60:
    print(-1)
else:
    print(ANS)


Measured memory_bytes: 9452
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    int n;
    cin >> n;
    vector<ll>a(n);
    rep(i,n)cin >> a[i];
    sort(all(a));
    reverse(all(a));
    ll longest = 0;
    ll longest2 = 0;
    rep(i,n-1){
        if(a[i]==a[i+1] && longest==0){
            longest = a[i];
            i++;
        }else if(a[i]==a[i+1] && longest2==0){
            longest2 = a[i];
            i++;
        }
    }
    cout << longest*longest2 << endl;
    //cout << longest << " " << longest2 << endl;
    return 0;
}

Measured memory_bytes: 4048
import sys
input = sys.stdin.readline
def nibun_right(a, x):
 lo, hi = 0, len(a)
 while lo < hi:
  mid = (lo+hi)//2
  if x < a[mid]: hi = mid
  else: lo = mid+1
 return lo
def nibun_left(a, x):
 lo, hi = 0, len(a)
 while lo < hi:
  mid = (lo+hi)//2
  if a[mid] < x: lo = mid+1
  else: hi = mid
 return lo
N=int(input())
ans=[1]*N
for i in range(N):
 x=int(input())
 c=nibun_right(ans, -x)
 ans[c]=-x
c=nibun_left(ans, 1)
print(c)

Measured memory_bytes: 42716
n = int(input())
l = [int(i) for i in input().split()]
l.sort()

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        a = l[i] + l[j]

        mi = 0
        ma = n - 1
        while mi != ma:
            m = (mi + ma) // 2 + 1
            if l[m] < a:
                mi = m
            else:
                ma = m - 1
        ans += max(0, mi - j)
print(ans)


Measured memory_bytes: 42604
#include <iostream>
#include<bits/stdc++.h>
#include<unordered_map>
#define ll long long

using namespace std;
int main(){
  
    ll n;
    cin>>n;
    unordered_map<int,int>mp;
    while (n % 2 == 0) 
	{ 
		 
     
      mp[2]++;
		n = n/2; 
	} 
	for (ll i = 3; i <= sqrt(n); i = i + 2) 
	{ 
	
		while (n % i == 0) 
		{ 
			
         
          mp[i]++;
			n = n/i; 
		} 
	} 
	
	if (n > 2) 
		
     mp[n]++;
     ll sum=0;
     for(auto &it:mp)
     {
         ll t=-1+sqrt(1+8*it.second);
         t=t/2;
         sum+=t;
     }
     cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3728
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int num = 0;
  int max = 100000000;
  for (int i = 0;i<n;i++){
    num =0;
    int j;
    cin >> j;
    while(j%2 ==0){
      j/=2;
      num++;
    }
    if(num<max){
      max = num;
    }
  }
  cout << max << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    int n;
    cin >> n;

    map<int, int> mp;

    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        mp[a[i]]++;
    }
    sort(a.begin(), a.end());

    int r = 0;
    for (int i = n - 1; i >= 0; i--) {
        if (!mp[a[i]]) continue;
        if (a[i] == 1) {
            r += mp[a[i]] / 2;
            break;
        }
        int k = 1;
        while (a[i] >= k) k *= 2;
        k -= a[i];
        //cout << k << endl;
        int x = mp[k];
        if (x && !(k == a[i] && x < 2)) {
            r++;
            mp[k]--;
            mp[a[i]]--;
        }
    }

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 19840
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define For(i, s, e) for(ll i = s;i <= e;i++)
#define Sort(v, n) sort(v, v+n);
#define VSort(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define cY cout<<"Yes";
#define cN cout<<"No";
#define cA(a) cout<<a;
const ll MOD = 1000000007;


int main() {//n 冊数　m アルゴリズム数
    int n,m,x;
    cin>>n>>m>>x;
    int c[n];
    int a[n][m];
    rep(i,n) {
        cin>>c[i];
        rep(j,m) {
            cin>>a[i][j];
        }
    }
    int ans = -1;
    for(int bit = 0;bit < (1<<n);++bit) {
        int sum[m];//経験
        int mon = 0;
        rep(i,m) sum[i] = 0;
        for(int i = 0;i<n;i++) {//i冊目

            if(bit & (1<<i)) {
                mon += c[i];
                rep(j,m) {
                    sum[j] += a[i][j];
                }
            }
        }
        bool f = 1;
        rep(i,m) {
            if(sum[i] < x) f = 0;
        }
        if(f&&ans == -1){
            ans = mon;
        }else if(f) {
            ans = min(ans,mon);
        }
    }
    cout << ans;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define vv(T) vector<vector<T>>
#define coa cout << ans << endl; return 0;
using namespace std;
using ll = long long;
template<typename T>
using vec = vector<T>;
template<typename T>
using vvec = vector<vector<T>>;
using qint = queue<int>;
using sint = stack<int>;
using pii = pair<int, int>;


int main(){
    int n, m;
    cin >> n >> m;
    vvec<int> street(n);
    rep(i, m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        street[a].push_back(b);
        street[b].push_back(a);
    }

    for(auto city : street){
        cout << city.size() << endl;
    }

    return 0;
}


Measured memory_bytes: 3612
#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
//#include "bits/stdc++.h"
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);++i)


#define huge 1000000007
typedef long long ll;

int main(void) {
	
	ll N = 0;
	ll A = 0;
	ll K = 0;
	ll Y = 0;
	ll x[100000] = {};
	//string w;
	int count = 0;
	int sum = 0;
	
	cin >> N >> K;
	rep(i, 0, N) {
		cin >> x[i];
	}

	//N -= 1;
	Y = N - K;
	sum++;
	K -= 1;

	if(Y%K == 0)
	sum += Y / K;
	else
		sum += Y / K+1;

	cout << sum << endl;

	return 0;
	
}


Measured memory_bytes: 1024
import java.awt.*;
import java.awt.geom.*;
import java.io.*;
import java.util.*;

public class Main{
  public static void main(String args[]) {
    Scanner in = new Scanner(System.in);
    String str;
    int num[] = new int[26];
    while(in.hasNextLine()){
      str = in.nextLine();
      char [] cin = str.toCharArray();
      for(int i=0;i<cin.length;++i){
        cin[i]=Character.toLowerCase(cin[i]);
        for(int j = 0; j < 27; j++){
          if(cin[i] == j+97){
            num[j]++;
          }
        }
      }
    }
    for(int k = 0; k < 26; k++){
      char c = (char)(k + 97);
      System.out.println(c + " " + ":" + " " +num[k]);
    }
  }
}



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

#define rng(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define urng(i, a, b) for(int i = int(b) - 1; i >= int(a); i--)
#define urep(i, b) urng(i, 0, b)
#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed

int main() {
  int x, a, b, ans = 0;
  //string s, t;
  cin >> x;
  //vector<int> v(n), c(n);
  if(x >= 99992) {
    cout << "100003\n";
    return 0;
  }
  for (int i = x; i <= x + 500; i++){
		a = 0;
		for (int j = 1; j <= i; j++) if (i%j == 0) a++;
		if (a == 2 && x <= i){
          ans = i;
          break;
		}
	}
  //for(int i = 0; i < n; i++){}
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<queue>
#include<algorithm>
#define MAXN 300006
using namespace std;
int n;
struct node
{
	int x,id;
}a[MAXN];
int ans;
bool cmp(node a,node b)
{
	return a.x<b.x;
}
int main()
{
	//freopen("sort.in","r",stdin);
	//freopen("sort.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i].x);
		a[i].id=i;
	}
	sort(a+1,a+1+n,cmp);
	for(int i=1;i<=n;i++)
		if((i-a[i].id)%2) ans++;
	printf("%d",ans/2);
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>//..1..2..3:Correct:Solved by F2tekkz:)
#define ll long long
#define str string
#define sonic ios_base::sync_with_stdio(0)
using namespace std;
ll n , m , k , i , j , t , q , cnt , cnt1 , cnt2 , cnt3;
ll cnt4 , cnt5 , ans , ans1 , ans2 , ans3 , sum , sum1 , sum2;
ll mini = 1e9 , maxi = -999;
int main(){
	sonic;
	cin >> n;
	ll a[n];
	for(i = 0 ; i < n ; i ++){
		cin >> a[i];
	}
	sort(a , a + n);
	for(i = 0 ; i < n - 1; i ++){
		if(a[i] == a[i + 1]){
			cout << "NO";
			return 0;
		}
	}
	cout << "YES";
}
//     *    *  *  ****    *    *   *
//    *	*   * *   *      * *   *   *
//   *****  **    ****  *****  *****
//   *   *  * *      *  *   *      *
//   *   *  *  *  ****  *   *  *****

//   *  *  *****  *
//   * *     *    *
//   **      *    *
//   * *     *    *
//   *  *    *    ****

//   ****  ****  *       *
//   *      **   *      * *
//   ****   **   *     *****
//      *   **   *     *   *
//   ****  ****  ****  *   *



Measured memory_bytes: 1792
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;
#define MOD 1000000007;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif



lli N;
lli A;
vector<lli> sum;
int cntm;
lli ans;

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

	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> A;
		if(A<0){
			A *= -1;
			cntm++;
		}
		sum.push_back(A);
		ans += A;
	}
	if(cntm % 2 == 0){
		cout << ans;
	}else{
		sort(sum.begin(), sum.end());
		cout << ans - sum[0]*2;
	}

	return 0;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
#define ll long long
#define all(v) v.begin(),v.end()
#define PB push_back
#define PI 3.1415926535897932384626433832795
#define what(x) cout<<#x<<" is "<<x<<endl;
using namespace std;


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 += "}";
  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 += "}";
  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)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifndef ONLINE_JUDGE
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

ll powmod(ll a,ll b,ll mod) {
    ll res=1;a%=mod;
    //assert(b>=0);
    for(;b;b>>=1){
        if(b&1)res=res*a%mod;a=a*a%mod;
    }
    return res;
}

void solve(){
	ll d,t,s;
	cin>>d>>t>>s;
	if(s*t>=d){
		cout<<"Yes\n";
	}else{
		cout<<"No\n";
	}
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tc=1;
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	#endif
	// cin>>tc;
    while(tc--)solve();
}


Measured memory_bytes: 3612