akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define mp make_pair
#define all(n) (n).begin(),(n).end()
#define fi first
#define se second
 
typedef pair<int, int> PII;
typedef long long ll;
 
const int MOD = 1e9+7;
ll gr[3001][3001];
ll dp[3001][3001][4];
int main() {
 
	ios::sync_with_stdio(0);
	cin.tie(0);
 
	int r,c,k;
	cin >> r >> c >> k;
	
	memset(gr,0,sizeof(gr));
	for (int i = 0; i < k; i++) {
		int a,b,v;
		cin >> a >> b >> v;
		gr[a][b]=v;
	}
	memset(dp,0,sizeof(dp));
	for (int i = 1; i <= r; i++) {
		for (int j = 1; j <= c; j++) {
			dp[i][j][0]=max(dp[i][j-1][0],dp[i-1][j][0]);
			for (int k = 1; k < 4; k++) {
				dp[i][j][k]=max(dp[i][j-1][k],dp[i][j-1][k-1]+gr[i][j]);
				dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][k]);
			}
			dp[i][j][1]=max(dp[i][j][1],dp[i][j][0]+gr[i][j]);
			// cout << dp[i][j][0] << " " << dp[i][j][1] << " " << dp[i][j][2] << " " << dp[i][j][3] << "\n";
		}
	}
	ll ans = 0;
	for (int i = 0; i < 4; i++) ans = max(ans,dp[r][c][i]);
	cout << ans << "\n";
}

Measured memory_bytes: 355456
package main

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

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}

type Segments [][]int
func (S Segments) Len() int { return len(S) }
func (S Segments) Less(i, j int) bool { return S[i][0] < S[j][0] }
func (S Segments) Swap(i, j int) { S[i], S[j] = S[j], S[i] }

func Solve() {
  var N, X, D int
  NextInt(&N, &X, &D)
  if D == 0 {
    ans := N + 1
    if X == 0 { ans = 1 }
    Write(ans)
    return
  }
  if D < 0 {
    X = -X
    D = -D
  }
  var A, B, C, k int
  M := make(map[int][][]int)
  for n := 0; n <= N; n++ {
    A = n * (n - 1) / 2
    B = (2 * N - n - 1) * n / 2
    C = n * X / D
    k = n * X % D
    _, ok := M[k]
    if !ok { M[k] = make([][]int, 0) }
    M[k] = append(M[k], []int{A + C, B + C})
  }
  ans := 0
  for _, v := range M {
    sort.Sort(Segments(v))
    cnt := 0
    T := v[0][0] - 1
    for _, S := range v {
      if T < S[0] {
        T = S[0]
        cnt++
      }
      cnt += MaxInt(S[1] - T, 0)
      T = MaxInt(S[1], T)
    }
    ans += cnt
  }
  Write(ans)
  return
}

func main() {
  Solve()
  Output()
}

Measured memory_bytes: 37376
import java.util.*;class Main{public static void main(String[]z){Scanner s=new Scanner(System.in);int a,b,n,t,i;for(t=s.nextInt();t-->0;System.out.println(n<1?"NO":"YES"),s.nextLine())for(a=b=n=i=0;i++<10;)if((n=s.nextInt())>a)a=n;else if(n>b)b=n;else{n=0;break;}}}

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

int main(){
    int h,w;
    cin>>h>>w;
    while(!(h==0)){
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(i%2==j%2){
                    cout<<"#";
                }
                else{
                    cout<<".";
                }
            }
            cout<<endl;
        }
        cout<<endl;
        cin>>h>>w;
    
        
    }
}


Measured memory_bytes: 3060
s=input()
a=0
for i in range (0,len(s)):
  if s[i]=="R"or"L":
    if i%2==0:
      if s[i]=="L":
        a=a+1
    else:
      if s[i]=="R":
        a=a+1
if a==0:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
import numpy as np

N = int(input())
A, B = [], []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
b_ = np.argsort(np.array(B))

t = 0
for i in b_:
    t += A[i]
    if t > B[i]:
        print('No')
        exit()
print('Yes')


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

int main(){
    string T;
    cin >> T;
    int score = 0;
    string ans = T;
    for(int i=0; i<T.size(); ++i){
        if(T[i] == '?'){
            ans.replace(i,1, "D");

        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3924
#include <bits/stdc++.h>
using namespace std;
// 298 round - 534 B
int main() {
	
	string s;
	cin>>s;
	
	if((s.find('A')==string::npos)||(s.find('B')==string::npos))
	    cout<<"No";
	else
	    cout<<"Yes";
	
	return 0;
}

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

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<(a+b+c+d)/60<<endl;
	cout<<(a+b+c+d)%60<<endl;
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;

double low_of_cosines(double a, double b, double arg) {
  return sqrt( pow(a, 2) + pow(b, 2) - 2 * a * b * cos( M_PI * arg / 180 ) );
}

int main(void) {
  double a, b, arg;
  cin >> a >> b >> arg;
  double h = b * sin(M_PI * arg / 180);
  double c = low_of_cosines(a, b, arg);

  printf("%.7f\n", a * h / 2);
  printf("%.7f\n", a + b + c);
  printf("%.7f\n", h);
  
}


Measured memory_bytes: 3512
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
#define ll long long int
int main(){
    ll k;
    cin>>k;
    ll ans = 0;
    queue<ll> q;
    for(int i = 1; i <= 9; i++) q.push(i);
    ll x = 0;
    while(k--){
        x = q.front(); q.pop();
        if(x % 10 != 0) q.push(10 * x + x%10 - 1);
        q.push(10 * x + x%10);
        if(x % 10 != 9) q.push(10 * x + x%10 + 1);
    }
    printf("%lld\n", x);
    return 0;
}

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

int main(){
	ios_base::sync_with_stdio(false); //Fast I/O
	cin.tie(NULL);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);	
	int a,b;
	cin >> a >> b;
	int res;
	res=a*b;
	
	if(res%2==0)
		cout << "Even" << endl;
	else
		cout << "Odd" << endl;
	
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int ab(int n){
    if (n < 0){
        n = -1 * n;
    }
    return n;
}

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

    vector <int> W(N);
    int sum = 0;

    for (int i = 0; i < N; i++){
        cin >> W[i];
        sum += W[i];
    }

    int ret = 0;
    int ans = sum;

    for (int i = 0; i < N; i++){
        sum -= W[i];
        ret += W[i];
        if (ab(sum - ret) < ans){
            ans = ab(sum - ret);
        }
    }
    
    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define All(a) a.begin(),a.end()
#define INF 1000000007
const int MOD = 1000000007;
//accumulate(vec.begin(), vec.end(), 0)
//std::sort(v.begin(), v.end(), std::greater<Type>());
//set_intersection(x, x+7, y, y+6, back_inserter(v));
//set_union(x, x+7, y, y+6, back_inserter(v));
//set_difference(x, x+7, y, y+6, back_inserter(v));

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

bool isPrime(int n){
  if(n < 2) return false;
  else if(n == 2) return true;
  else if(n%2==0) return false;

  for(int i=3;i<=sqrt(n);i++){
    if(n%i==0) return false;
  }
  return true;
}

int main(){
  string s;
  cin >> s;
  int n = s.size();
  int ans = 0;
  for(int i=0;i<n;i++){
    if(s[i]=='+') ans++;
    else ans--;
  }
  cout<< ans <<endl;
}


Measured memory_bytes: 256
use std::io::*;
mod disjoint_set {
    pub struct DisjointSet {
        parent: Vec<usize>,
        size: Vec<usize>,
    }
    impl DisjointSet {
        pub fn new(n: usize) -> DisjointSet {
            DisjointSet {
                parent: (0..n).collect(),
                size: vec![1; n],
            }
        }
        fn root(&mut self, x: usize) -> usize {
            if x == self.parent[x] {
                x
            } else {
                let tmp = self.parent[x];
                self.parent[x] = self.root(tmp);
                self.parent[x]
            }
        }
        pub fn merge(&mut self, x: usize, y: usize) {
            let x = self.root(x);
            let y = self.root(y);
            if x == y {
                return;
            }
            if self.size[x] > self.size[y] {
                self.size[x] += self.size[y];
                self.parent[y] = x;
            } else {
                self.size[y] += self.size[x];
                self.parent[x] = y;
            }
        }
        pub fn size(&mut self, x: usize) -> usize {
            let x = self.root(x);
            self.size[x]
        }
    }
}

fn main() {
    let mut s: String = String::new();
    stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let m: usize = itr.next().unwrap().parse().unwrap();
    let mut ds = disjoint_set::DisjointSet::new(n + m);
    // hito: [0, n)
    // lang: [n, n + m)

    let mut cnt = 0;
    let mut lang = vec![false; m];
    for i in 0..n {
        let k: usize = itr.next().unwrap().parse().unwrap();
        for _ in 0..k {
            let l: usize = itr.next().unwrap().parse::<usize>().unwrap() - 1;
            if !lang[l] {
                lang[l] = true;
                cnt += 1;
            }
            // n - l
            ds.merge(i, n + l);
        }
    }

    if ds.size(0) - cnt == n {
        println!("YES");
    } else {
        println!("NO");
    }
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
#define  rep(i,a,b)for(int i=a;i<b;++i)
#define  rrep(i,a,b)for(int i=a;i>=b;--i)
#define  yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
typedef long long ll;
const int INF=1000000000LL;
const ll r197=1000000007;
typedef pair<int,int>P;
typedef pair<int,P>Pa;

ll k=1;
int n;
int calc(int m,ll v,int *g){
	if(m==9){
		int r[8]={};
		rep(i,0,9){
			r[g[i]]++;
		}
		if(v<=n&&r[3]>0&&r[5]>0&&r[7]>0)return 1;
		return 0;
	}
	int res=0;
	int r[8]={};
	rep(i,0,m){
		r[g[i]]++;
	}
	if(v<=n&&r[3]>0&&r[5]>0&&r[7]>0)res++;
	v*=10;
	v+=3;
	g[m]=3;
	res+=calc(m+1,v,g);
	v+=2;
	g[m]=5;
	res+=calc(m+1,v,g);
	v+=2;
	g[m]=7;
	res+=calc(m+1,v,g);
	return res;
}
int main() {
	cin>>n;
	int a[10]={};
	cout<<calc(0,0,a)<<endl;
}


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

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define FOR(i,a,n) for(int i=a;i<n;i++)

typedef long long ll;
typedef pair<int, int> ii;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int n;
vector<vector<ll>> v;
vector<vector<ll>> dp;

ll solve(int pos, int last) {
	if(pos >= n) return 0;
	if(dp[pos][last] != -1) return dp[pos][last];

	ll res = -LINF;
	FOR(i,0,3) if(i != last) res = max(res, v[pos][i] + solve(pos+1, i));
	return dp[pos][last] = res;
}

int main() { _
	cin >> n;
	v.resize(n, vector<ll>(3));
	dp.resize(n, vector<ll>(4, -1));
	FOR(i,0,n) cin >> v[i][0] >> v[i][1] >> v[i][2];

	cout << solve(0,3) << endl;
	return 0;
}


Measured memory_bytes: 23528
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)m; i < (int)n; i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)m; i < (unsigned int)n; i++ )
#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( a, b )
#define fst first
#define snd second

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

		if ( n == 0 )
		{
			break;
		}

		vector<int> current;

		REP( i, 0, n )
		{
			int in;
			cin >> in;
			current.PB( in );
		}

		int count = 0;
		while ( true )
		{
			vector<int> next;
			map<int,int> dist;

			REP( i, 0, n )
			{
				dist[ current[i] ]++;
			}

			REP( i, 0, n )
			{
				next.PB( dist[ current[i] ] );
			}

			if ( current == next )
			{
				break;
			}
			else
			{
				count++;
				current = next;
			}
		}

		cout << count << endl;
		REP( i, 0, n )
		{
			cout << current[i] << ( i + 1 == n ? '\n' : ' ' );
		}
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
const ll mod=1000000007;
const ll INF=1e15;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define REP2(i,a,b) for(int i=a;i>=b;i--)
#define rep(i,n) REP(i,0,n)
#define pb push_back

ll dp[200001];
vec Col[200001];
ll Cdp[200001];

int main(){
    ll N; cin>>N;
    vec D(N);
    rep(i,N) cin>>D.at(i);
    vec C;
    C.pb(D.at(0));
    REP(i,1,N) if(D.at(i)!=D.at(i-1)) C.pb(D.at(i));
    ll M=C.size();
    rep(i,M) Col[C.at(i)].pb(i);
    dp[M]=1;
    REP2(i,M-1,0){
        ll x=C.at(i);
        dp[i]=(dp[i+1]+Cdp[x])%mod;
        Cdp[x]=dp[i];   
    }
    cout<<dp[0]<<endl;


}

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

int main(){
    int n;
    cin >> n;
    string s[n];
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }
    int ans = 0, a = 0, b = 0, ab = 0;
    for(int i = 0; i < n; i++){
        b += s[i][0]=='B';
        a += s[i][s[i].length()-1]=='A';
        ab += s[i][0]=='B'&&s[i][s[i].length()-1]=='A';
        for(int j = 0; j+1 < s[i].length(); j++){
            if(s[i][j]=='A' && s[i][j+1]=='B')  ans++;
        }
    }
    if(ab > 1){
        ans += ab-1, a -= ab, b -= ab;
        if(b)   ans++, b--;
        if(a)   ans++, a--;
    }else if(ab == 1){
        a--, b--;
        if(b)   ans++, b--;
        if(a)   ans++, a--;
    }
    ans += min(a, b);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 896
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		int ans = t.length();
		for (int i = 0; i < s.length() - t.length()+ 1; i++) {
			int cnt = 0;
			for (int j = 0; j < t.length(); j++) {
				if (s.charAt(i + j) != t.charAt(j)) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 35784
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N;
  cin >> N;
  int sum;

  for(int i = 0; i < N; i++) {
    int l,r;
    cin >> l >> r;
    sum += r - l + 1;
  }
  cout << sum << endl;

}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int n, y, a,b,c, h, temp;
	
	scanf("%d %d",&n,&y);

	for(c=0;c<=n;c++){
		h=n-c;
		for(a=0;a<=h;a++){
			b=n-a-c;
			temp = y - 1000*c - 10000*a;
			if(temp == b*5000){
				printf("%d %d %d",a,b,c);
				return 0;
			}
		}
	}
	
	printf("-1 -1 -1");
	
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <unordered_map>

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

using namespace std;

int main()
{
  string s;
  ll c = 0, result = 0;
  cin >> s;
  REP(i, s.length())
  {
    if (s[i] == 'B')
    {
      c++;
    }
    else
    {
      result += c;
    }
  }

  cout << result << endl;
}

Measured memory_bytes: 952
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

string S, T;

signed main(){
    cin >> S >> T;
    int ans = 0;
    rep(i, S.size()){
        if(S[i] != T[i]) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3872
#include<iostream>
using namespace std;
int main(){
	int n,a[4][13]={0},x;
	char y;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>y>>x;
		if(y=='S')a[0][x-1]=1;
		if(y=='H')a[1][x-1]=1;
		if(y=='C')a[2][x-1]=1;
		if(y=='D')a[3][x-1]=1;
	}
	for(int i=0;i<4;i++){
		for(int j=0;j<13;j++){
			if(a[i][j]!=1){
				if(i==0)cout<<"S "<<j+1<<endl;
				if(i==1)cout<<"H "<<j+1<<endl;
				if(i==2)cout<<"C "<<j+1<<endl;
				if(i==3)cout<<"D "<<j+1<<endl;
			}
		}
	}

	return 0;
}


Measured memory_bytes: 3076
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    for j in range(i,i+2):
        tmp = b[i]
        b[i] -= a[j]        
        if b[i]<=0:
            ans += tmp
            a[j] -= tmp
            break
        else:
            ans += a[j]
            a[j] = 0
            
print(ans)

Measured memory_bytes: 18624
#include<bits/stdc++.h>
using namespace std;
#define rep(i ,a, n) for (long long int i=a;i<=n;i++)
#define pb  push_back
#define mp make_pair
#define fp first
#define sp second
#define be(v) v.begin(),v.end()
typedef long long ll;
typedef vector<ll> vi ;
typedef vector<pair<ll , ll > >  vpi ;
const int ma1=1e5+5;
string no="NO",yes="YES";
#define MOD 1000000007
int max_char=26;

ll sol(vector<ll> &a,vector< vector<ll> > &dp, int s,int e)
{

    if(s+1==e)
        return max(a[s],a[e]);
        if(s==e)
            return a[s];
    if(dp[s][e]!=-1)
        return dp[s][e];
    return dp[s][e]=max(a[s]+min(sol(a,dp,s+2,e),sol(a,dp,s+1,e-1)),a[e]+min(sol(a,dp,s+1,e-1),sol(a,dp,s,e-2)));
}

int main()
{
      ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;

    while(t--)
    {

         ll n;
         cin>>n;
         ll sum=0;
        vector<ll> a(n);
        vector<vector<ll>> dp(n,vector<ll> (n,-1));
         for(int i=0;i<n;i++)
           {

            cin>>a[i];
            sum=sum+a[i];
        }
        ll x=sol(a,dp,0,n-1);
        ll y=sum-x;
        cout<<x-y;
    }
    return 0;
}
















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

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

using ll = long long;

using namespace std;

void solve(int N, int L){
	vector<pair<int, int>> dp(N); // dir, pos
	for(auto &a:dp){
		string s; cin >> s;
		int d;
		if(s == "R"){
			d = 1;
		}
		else{
			d = -1;
		}
		int p; cin >> p;
		a.first = d;
		a.second = p;
	}

	int t = 0;
	while(true){
		bool f = false;
		int last_ant = -1;
		rep(i, dp.size()){
			auto &a = dp[i];
			if(0 < a.second and a.second < L){
				f = true;
				break;
			}
			if(0 == a.second){
				last_ant = i;
			}
			if(last_ant == -1 and L == a.second){
				last_ant = i;
			}
		}
		if(not f){
			cout << t << " " << last_ant+1 << endl;
			break;
		}

		map<int, int> memo;
		rep(i,dp.size()){
			auto &a = dp[i];
			a.second += a.first;
			if(memo.count(a.second) == 0){
				memo[a.second] = i;
			}
			else{
				a.first *= -1;
				dp[memo[a.second]].first *= -1;
			}
		}
		++t;
	}
}

int main() {
	while(true){
		int N, L; cin >> N >> L;
		if(N == 0 and L == 0) break;
		solve(N, L);
	}
  return 0;
}



Measured memory_bytes: 2996
#include<iostream>
#include<cstdio>
#define MAX 500005
#define MMIINN -2000000200
using namespace std;

typedef long long ll;

class maxHeap{
 public:
  int index;
  ll maxHeapArray[MAX];

  maxHeap(){
    index = 0;
    for(int i=0;i<MAX;i++)maxHeapArray[i]=MMIINN;
  }

  void Insert(ll v){
    ++index;
    maxHeapArray[index]=v;
  }

  ll getLeft(int i){
    return 2*i;
  }

  ll getRight(int i){
    return 2*i+1;
  }

  ll getValue(int i){
    return maxHeapArray[i];
  }

  void buildMaxHeap(){
    for(int i=index/2;i>=1;i--){
      maxHeapify(i);
    }
  }


 private:

  void maxHeapify(int i){
    ll l = getLeft(i);
    ll r = getRight(i);
   ll largest;
    if(l <= index && maxHeapArray[l] > maxHeapArray[i])largest=l;
    else largest=i;
    if(r<=index && maxHeapArray[r] > maxHeapArray[largest])largest = r;
    if(largest != i){
      ll h;
      h = maxHeapArray[i];
      maxHeapArray[i] = maxHeapArray[largest];
      maxHeapArray[largest] = h;
      maxHeapify(largest);
    } 
  }




};

int main(){
  int n;
  ll val;
  maxHeap MH = maxHeap();
  scanf("%d",&n);
  for(int i=0;i<n;i++){scanf("%lld",&val); MH.Insert(val);
  }
      MH.buildMaxHeap();
  for(int i=1;i<=n;i++){
    printf(" %lld",MH.getValue(i));
  }
  printf("\n");

  return 0;
}



Measured memory_bytes: 7120
import math

def isPrime(n):
    if n < 2:
        return False
    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False
    return True

if __name__ == "__main__":
    import sys
    N = int(sys.stdin.readline().strip())
    ret = 0
    for i in range(N):
        if isPrime(int(sys.stdin.readline().strip())):
            ret += 1
    print ret

Measured memory_bytes: 5000
#include<bits/stdc++.h>
using namespace std;
int n,i,a[21],j,t[3];
int main(){
	cin>>n;int ans=0;
	for(i=0;i<n;i++)cin>>a[i];
	for(i=1;i<n-1;i++){
		for(j=i-1;j<=i+1;j++)t[j-i+1]=a[j];
		sort(t,t+3);
		if(t[1]==a[i]){
			ans++;
		}
	}
	cout<<ans;
	return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

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

    double x1 = reader.nextDouble();
    double y1 = reader.nextDouble();
    double x2 = reader.nextDouble();
    double y2 = reader.nextDouble();

    System.out.println(Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)));
  }
}

Measured memory_bytes: 27988
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_poizcy.hpp>
typedef long long   ll;
#define pb                push_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define mem(a,h)          memset(a, (h), sizeof(a))
#define fi first
#define se second
#define por(a,b) (((a%MOD) * (b%MOD))%MOD)
#define forg(i, b, e, c)    for (ll i = (ll)b; i < (ll)e; i+=c)
#define forr(i, b, e)    for (ll i = b; i < e; i++)
 
 
using namespace std;
//using namespace __gnu_pbds;
typedef double lldb;
typedef pair<ll, ll>  ii;
typedef pair<ll, ii>  iii;
typedef vector<ll>     vi;
typedef vector<vi>     vvi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll INF = 1e9;
const double PI = acos(-1);
#define offset 
const ll MOD= 1e9+7;
#define initseg ll new_nodo=(nodo*2),mid=(iz+der)/2;
 
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define tam 130000
ll fact[tam];
int  main()
{  
    fact[0] = 1;
    ios::sync_with_stdio(false);cin.tie(0);
    forr(i,1,tam)
    fact[i]=fact[i-1]*i,fact[i]%=MOD;
    int n,m;
    cin>>n>>m;
    if (abs(n-m)>1)
    {
        cout<<0<<endl;
        return 0;
    }
    ll ways=(fact[n]*fact[m])%MOD;
    ways=ways*((abs(n-m)==0)?2LL:1LL);
    ways%=MOD;
    cout<<ways<<endl;
}
// PLUS ULTRA!!

Measured memory_bytes: 1280
#include <stdio.h>
#include<math.h>
int main ()
{
    int a,b,c,d,e,f,g;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    if(a>b)
        e=a-b;
    else
        e=b-a;
    if(b>c)
        f=b-c;
    else
        f=c-b;
    if(c>a)
        g=c-a;
    else
        g=a-c;
    if((e<=d&&f<=d)||g<=d)
    printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

Measured memory_bytes: 2088
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

// GCD : greatest common divisor (GCD) via Euclidean algorithm
func GCD(a, b int) int {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)

	K := getInt()
	ans := 0
	for i := 1; i <= K; i++ {
		for j := 1; j <= K; j++ {
			for k := 1; k <= K; k++ {
				ans += GCD(i, GCD(j, k))
			}
		}
	}
	out(ans)
}


Measured memory_bytes: 1780
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n= sc.nextInt(),m=sc.nextInt(),X=sc.nextInt(),Y=sc.nextInt();
		Integer[] Amap=new Integer[n],Bmap=new Integer[m];

		for(int i=0;i<n;i++) {
			Amap[i]=sc.nextInt();
		}
		for(int i=0;i<m;i++) {
			Bmap[i]=sc.nextInt();
		}

		Arrays.sort(Amap,Collections.reverseOrder());
		Arrays.sort(Bmap);

		if(X<=Amap[0] && Amap[0]<Y) {
			if(X<Bmap[0] && Bmap[0]<=Y) {
				if(Amap[0]<Bmap[0]) {
					System.out.println("No War");
					return;
				}
			}
		}
		System.out.println("War");
	}
}

Measured memory_bytes: 21972
#include <stdio.h>

int N;
char inst[12];

class Node {
public:
    Node();
    int key;
    Node* p;
    Node* n;
};

Node::Node()
{
    p = NULL;
    n = NULL;
}

class LinkedList {
public:
    LinkedList();
    void insertKey(int key);
    void deleteKey(int key);
    void deleteFirst(void);
    void deleteLast(void);
    void print(void);
    Node* nil;
};

LinkedList::LinkedList()
{
    nil = new Node;
    nil->p = nil;
    nil->n = nil;
}

void LinkedList::insertKey(int key)
{
    Node* node = new Node;
    node->key = key;
    
    node->n = nil->n;
    nil->n->p = node;
    nil->n = node;
    node->p = nil;
}

void LinkedList::deleteKey(int key)
{
    Node* c = nil->n;
    bool is_found = false;
    while(c != nil) {
        if (key == c->key) {
            is_found = true;
            break;
        }
        c = c->n;
    }
    if (is_found) {
        c->n->p = c->p;
        c->p->n = c->n;
    }
}

void LinkedList::deleteFirst(void)
{
    Node* c = nil->n;
    c->n->p = c->p;
    c->p->n = c->n;
}

void LinkedList::deleteLast(void)
{
    Node* c = nil->p;
    c->n->p = c->p;
    c->p->n = c->n;
}

void LinkedList::print(void)
{
    Node* c = nil->n;
    while (c != nil) {
        printf("%d", c->key);
        c = c->n;
        if (c != nil) printf(" ");
    }
}

int main(void)
{
    LinkedList ll;
    //freopen("in.txt", "r", stdin);
    scanf("%d", &N);
    for (int i = 0; i < N; ++i) {
        scanf("%s", inst);
        int k;
        if (inst[0] == 'i') { // insert
            scanf("%d", &k);
            ll.insertKey(k);
        } else {
            if (inst[6] == 'F') { // deleteFirst
                ll.deleteFirst();
            } else if (inst[6] == 'L') { // deleteLast
                ll.deleteLast();
            } else { // delete
                scanf("%d", &k);
                ll.deleteKey(k);
            }
        }
    }
    ll.print();
    printf("\n");
    return 0;
}

Measured memory_bytes: 36968
#include<bits/stdc++.h>
using namespace std;
int main()
{long int  a[200000];
   long int n,i,sum=0;
   cin>>n;
   for(i=0;i<n;i++)
   {
       cin>>a[i];
   }
   for(i=1;i<n;i++)
   {
       if(a[i]<a[i-1])
       {
           sum+=(a[i-1]-a[i]);
           a[i]=a[i-1];
       }
       else
       sum+=0;
   }
   cout<<sum;
    return 0;
}

Measured memory_bytes: 5036
n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
a.sort()
for i in a:
    number = i//400
    if number >=8:
        color[8] += 1
    else:
        color[number] += 1
left = 8 - color[:8].count(0) #3200未満が何種類あるか
right = color[8]              #3200以上が何人いるか
if left == 0:
    print('{} {}'.format(1,right))
else:
    sum_color = left + right
    print('{} {}'.format(left,sum_color))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)(b); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    ll n;
    cin >> n;
    int l = 1;
    ll p = 26;
    while (p < n) {
        n -= p;
        p *= 26;
        l++;
    }
    string ans = "";
    n--;
    rep(i, 0, l) {
        ans = char('a' + n % 26) + ans;
        n /= 26;
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int64_t ans = 0, s = 0;
  constexpr int mod = 1e9 + 7;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ans = (ans + x * s) % mod;
    s = (s + x) % mod;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

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

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

#define SUM(vec) accumulate(all(vec),0LL) // 配列の中身を全部足す
template<typename T>void print(T&& x){cout<<x<<endl;}// 改行付き出力
ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
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 ctoi(char c){return c-'0';}


// TODO: write
int main() {
  int n;cin>>n;
  int x,y;cin>>x>>y;--x;--y;
  vector<int> a(n+1,0);
  rep(i,n){
    for(int j = i+1;j < n;++j){
      int m;
      m = min(abs(j-i),min(abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x)));
      a[m]++;
    }
  }

  rep(i,n-1){
    print(a[i+1]);
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    vector<int>x={a,b,c};
    sort(x.begin(),x.end());
    int m=x.at(2);
    int n=x.at(1);
    int o=x.at(0);
    cout<<10*m+n+o<<endl;
    return 0;}
    

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2020;
using arr = array<int, maxn>;
int n, k, res = 1<<30, sz[maxn];
vector<int> g[maxn];

arr dfs(int v, int p) {
	sz[v] = 1;
	arr dp;
	fill(begin(dp), end(dp), 1);
	for(auto i : g[v]) if(i != p) {
		arr t = dfs(i, v);
		for(int i = k; i; i--) t[i] = t[i-1];t[0] = 0;
		arr ndp = dp;
		for(int a = 0; a <= sz[v]; a++)
			for(int b = 0; b <= sz[i] && a+b <= k; b++) {
				ndp[max(a, b)] = max(ndp[max(a, b)], dp[a] + t[b]);
			}
		dp = ndp;
		for(int i = 1; i <= k; i++) dp[i] = max({t[i], dp[i], dp[i-1]});
		sz[v] += sz[i];
	}
	res = min(res, n - dp[k]);
	return dp;
}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> n >> k;
	for(int f, t, i = 1; i < n; i++) {
		cin >> f >> t;
		g[f].push_back(t);
		g[t].push_back(f);
	}
	dfs(1, 1);
	cout << res;
}


Measured memory_bytes: 25344
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N, num = 0;
    cin >> N;

    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            for(int k = 0; k < N; k++) num++;
        }
    }   
    cout << num << endl;
}


Measured memory_bytes: 256
#n = gets.to_s.to_i
d,n = gets.to_s.split.map{|i|i.to_i}
#cts = Array.new(n){ gets.to_s.split.map{|i|i.to_i} }

t = 1
t = 100 if 1 == d
t = 10000 if 2 == d

cnt = 0
ans = n * t

ans += t if n == 100

puts ans

Measured memory_bytes: 1788
A,B,C = map(int, input().split())
K = int(input())

n = 0

while (A >= B):
  B = 2*B
  n +=1
  
while B>=C:
  C = 2*C
  n += 1
  
#print(A,B,C,n)

if n <= K:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 9164
#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;
    ll sum = 0;
    for(int i = 1;i <= n;i++){
        if(i % 3 != 0 && i % 5 != 0)sum += i;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3620
#pragma GCC optimize("O3")
#define first x
#define second y
#include <bits/stdc++.h>

using namespace std;

enum {MOD0 = 1000000000, MOD7 = 1000000007, MOD9 = 1000000009};
typedef unsigned short ushort;typedef unsigned int uint;typedef long long ll;typedef unsigned long long ull;
#ifndef CrafterKolyan
#define endl '\n'
#endif

int main() {
#ifndef CrafterKolyan
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    int n;
    cin >> n;
    int prev = 0;
    int cur;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        cin >> cur;
        if (cur == prev) {
            ++ans;
            prev = -1;
        } else {
            prev = cur;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int f(int n);

int main() {
	int i, j, s, a[100000];
	int count1 = 0, count2 = 0, count4 = 0;

	scanf("%d", &s);

	a[0] = s;

	if (a[0] == 1) count1++;
	if (a[0] == 2) count2++;
	if (a[0] == 4) count4++;
	for (i = 1; i < 100000; i++) {
		a[i] = f(a[i - 1]);
		if (a[i] == 1) count1++;
		if (a[i] == 2) count2++;
		if (a[i] == 4) count4++;
		if (count1 == 2 || count2 == 2 || count4 == 2)break;
	}

	printf("%d\n", i + 1);

	return 0;
}

int f(int n) {
	int ans;

	if (n % 2 == 0) ans = n / 2;
	else ans = n * 3 + 1;

	return ans;
}

Measured memory_bytes: 128
#include<stdio.h>

int main(void)
{
	int i, len;
	char str[21], rev[21];

	scanf("%s", str );

	for( i = 0; str[i] != '\0'; i++ ){}

	len = i - 1;

	for( i = 0; len >= 0; i++, len-- ){
		rev[i] = str[len];
	}

	rev[i] = '\0';

	printf("%s\n",rev );

	return 0;
}

Measured memory_bytes: 944
//Table Tennis Training

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
template<class T>inline bool chmin(T& a,T b,bool f){
if(f==1){if(a>b){a=b;return true;}return false;}
else if(f==0){if(a<b){a=b;return true;}return false;}return false;}
typedef pair<int,string> p;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

int main (){
    ll n,a,b;cin>>n>>a>>b;
    if((b-a)%2==0){
        cout<<(b-a)/2<<nnn;
        return 0;
    }else{
        cout<<min((a+b-1)/2,(n+n-a-b+1)/2)<<nnn;
    }
    return 0;
}

Measured memory_bytes: 256
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

A,B,C,K = input_int()

sums=0
if A<K:
    K-=A
    sums = A
    if B<K:
        K-=B
        if C<K:
            sums -= C
        else:
            sums -= K
    else:
        pass

else:
    sums += K


print(sums)

Measured memory_bytes: 9088
local mod = 1000000007
local mfl = math.floor

local function bmul(x, y)
  local x0, y0 = x % 31623, y % 31623
  local x1, y1 = mfl(x / 31623), mfl(y / 31623)
  return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end

local function badd(x, y)
  return (x + y) % mod
end

local function bsub(x, y)
  return x < y and x - y + mod or x - y
end

local function modpow(src, pow)
  local res = 1
  while 0 < pow do
    if pow % 2 == 1 then
      res = bmul(res, src)
      pow = pow - 1
    end
    src = bmul(src, src)
    pow = mfl(pow / 2)
  end
  return res
end

local function modinv(src)
  return modpow(src, mod - 2)
end

local function getComb(n, k)
  local ret = 1
  for i = 1, k do
    ret = bmul(ret, n + 1 - i)
    ret = bmul(ret, modinv(i))
  end
  return ret
end

local n = io.read("*n")
local pow2 = {1}
for i = 2, n + 3 do
  pow2[i] = (pow2[i - 1] * 2) % mod
end

local t = {}
for i = 1, n do t[i] = io.read("*n") end
table.sort(t)
local ret = 0
for i = 1, n do
  local c = t[i]
  c = bmul(c, pow2[i])
  -- rem = r
  -- 1*rC0 + 2*rC1 + ... + r*rCr = (r+2) / 2 * 2^r
  local rem = n - i
  local p = i == n and 500000004 or pow2[rem]
  local mul = bmul(rem + 2, p)
  c = bmul(c, mul)
  ret = badd(ret, c)
end
ret = bmul(ret, pow2[n + 1])
print(ret)


Measured memory_bytes: 4352
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		if (a < 0 || c > 100) {
			System.out.println("１つ目の値には１以上、3つ目の値には100以下の数字を入力してください。");
		} else if (a < b && b < c) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}



Measured memory_bytes: 25992
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <cmath>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =1001001001;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}



//階乗　20くらいが限界
ll factorial(ll n){
  ll a=1;ll b=n;
  for(int i=0;i<n;i++){
    a*=b;
    b--;
  }
  return a;
}

//組み合わせ　nCr
ll comb(ll a,ll b){
  ll c;
  c=factorial(a)/(factorial(a-b)*factorial(b));
  return c; 
}




/*10億7。　　　100000007
2*2行列 H*W
vector<vector<int>> vec(H,vector<int>(W));
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
cin>>vec[i][j];
  }
}

文字列→数列
string S;int A=atoi(S.c_str());
数列→文字列
int A;string S=to_string(A);
数字判定　isdigit(a)
pair宣言　pair<int,int> p(5,7);
ソート　sort(vec.begin(),vec.end());
キュー　queue<int> q;
   q.push(7);　//７が入る
   cout << q.front() << endl;  // 先頭の値を出力
   q.pop();  // 先頭の値を削除
*/



int main(void){
cout<<fixed<<setprecision(14);
//cin.tie(0); ios::sync_with_stdio(false);

ll X;
  cin>>X;
  if(X>=30){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }

}




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

using i64 = long long;
using P = pair<i64, i64>;

#define overload3(_1, _2, _3, name, ...) name
#define rep1(i, n) for(i64 i = 0LL; i < (n); ++i)
#define rep2(i, a, b) for(i64 i = (a); i < (b); ++i)
#define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#define all(v) v.begin(), v.end()

struct edge{
    i64 src, to, cost;
    edge(i64 to, i64 cost) : src(-1), to(to), cost(cost) {}
    edge(i64 src, i64 to, i64 cost) : src(src), to(to), cost(cost) {}
    bool operator <(const edge &u){
        return this->cost < u.cost;
    };
};

using Graph = vector<vector<edge>>;
const i64 INF = numeric_limits<i64>::max();

void solve(long long N, long long M, std::vector<long long> H, std::vector<long long> A, std::vector<long long> B){
    Graph G(N);
    rep(i, M){
        A[i]--; B[i]--;
        G[A[i]].push_back(edge(B[i], 0));
        G[B[i]].push_back(edge(A[i], 0));
    }
    i64 ans = 0;
    rep(i, N){
        bool flag = true;
        for(auto e: G[i]){
            if(H[i] <= H[e.to]) flag = false;
        }
        if(flag) ++ans;
    }
    cout << ans << endl;
}

struct IoSetup {
    IoSetup() {
        // cin.tie(nullptr);
        // ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> H(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    std::vector<long long> A(M);
    std::vector<long long> B(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&A[i]);
        scanf("%lld",&B[i]);
    }
    solve(N, M, std::move(H), std::move(A), std::move(B));
    return 0;
}


Measured memory_bytes: 14884
arr = Array.new(1_000_001, nil)
for x in 0..1000
    for y in 0..1000
        break if x + y ** 2 >= 1_000_001
        for z in 0..1000
            e = x + y ** 2 + z ** 3
            break if e >= 1_000_001
            arr[e] = x + y + z if arr[e].nil? || arr[e] > x + y + z
        end
    end
end

while true
    e = gets.to_i
    break if e == 0
    puts arr[e]
end


Measured memory_bytes: 14664
#include<stdio.h>
#include<math.h>
 
int main(void)
{
	double x, y, r;
 	double x1, x2, x3, y1, y2, y3;
	double ecm[2][3]; //enlarged coefficient matrix:拡大係数行列
	double a, b, A;
	int i;
	int n;

	scanf("%d", &n);
	for(i = 0; i < n; i++)
	{
 		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);

		ecm[0][0] = x1 - x2;
		ecm[0][1] = y1 - y2;
		ecm[0][2] = (x2 * x2 + y2 * y2) - (x1 * x1 + y1 * y1);
		ecm[1][0] = x1 - x3;
		ecm[1][1] = y1 - y3;
		ecm[1][2] = (x3 * x3 + y3 * y3) - (x1 * x1 + y1 * y1);

		A = (ecm[0][0] * ecm[1][1]) - (ecm[0][1] * ecm[1][0]); 

		a = ((ecm[0][2] * ecm[1][1]) - (ecm[0][1] * ecm[1][2])) / A + 0;
		b = ((ecm[0][0] * ecm[1][2]) - (ecm[0][2] * ecm[1][0])) / A + 0;

		x = (a / -2.0);
		y = (b / -2.0);
		r = sqrt(pow(x1 - x, 2) + pow(y1 - y, 2));

		printf("%.3f %.3f %.3f\n", x, y, r); //四捨五入は自動的にされる
	}
	return 0;
}

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

int main(){
    ll i,n;
    cin >> n;
    ll a[n];
    for(i = 0; i < n; i++){
        cin >> a[i];
    }
    sort(a,a+n);
    ll left,right;
    left = n/2;
    right = n/2 + 1;
    ll ans;
    ans = a[right - 1] - a[left-1];
    cout << ans << endl;
}

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


int main() {
	int k; cin >> k;
	string s; cin >> s;
	int n = s.size();
	if (n <= k) {
		cout << s << endl;
	}
	else {
		cout << s.substr(0, k) << "..." << endl;
	}
	return 0;
}

Measured memory_bytes: 3600
N, M, K = map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a = [0]
b = [0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

j=M
ans = 0
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K -a[i]:
        j -= 1
    ans = max(ans, i+j)

print(ans)


Measured memory_bytes: 47688
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <cstring>
#include <math.h>
#include <bitset>
#include <time.h>
#include <set>
#include <algorithm>
#define MODD 1000000007
#define ll long long
using namespace std;


ll dp[70][2][2][2];
ll Solve(int pos, int reqd_carry, bool uless, bool vless, ll N) {
    
    
    if (pos==-1) {
        //printf("%lld %lld\n",a,b);
        return 1;
    }
    
    
    int max_ncarry = (pos==0 ? 0 : 1);
    
    if (dp[pos][reqd_carry][uless][vless]!=-1)
        return dp[pos][reqd_carry][uless][vless];
    
    
    ll answer = 0;
    for(int ncarry=0;ncarry<=max_ncarry;ncarry++) {
        bool done[2][2];
        done[0][0]=done[0][1]=done[1][0]=done[1][1]=false;
        
        for(int ab=0;ab<=1;ab++)
            for(int bb=0;bb<=1;bb++) {
            
                if ((ncarry+ab+bb)/2 != reqd_carry)
                    continue;
                
                int ub = (ab^bb);
                int vb = (ab+bb+ncarry)%2;
                
                if (done[ub][vb])
                    continue;
                
                done[ub][vb]=true;
                
                if (!uless && ub==1 && !((N>>pos)&1))
                    continue;
                
                
                if (!vless && vb==1 && !((N>>pos)&1))
                    continue;
                
                
                //printf("pos=%d :: %d,%d\n",pos,ab,bb);
                
                bool nuless=uless;
                bool nvless=vless;
                
                nuless|=(ub==0 && ((N>>pos)&1));
                nvless|=(vb==0 && ((N>>pos)&1));

                answer += Solve(pos-1, ncarry, nuless, nvless, N);
                
                if (answer >= MODD)
                    answer -= MODD;
            }
    }
    return dp[pos][reqd_carry][uless][vless]=answer;
    
}



int main() {
    ll N;
    cin>>N;
    for(int b=65;b>=0;b--)
        for(int i=0;i<=2;i++)
            for(int j=0;j<=2;j++)
                for(int k=0;k<=2;k++)
                        dp[b][i][j][k]=-1;
    cout << Solve(61, 0, false, false, N) << endl;
    
    
    
    
    
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int n;
const long long mod=1e9+7;
long long dp[105][4][4][4];
int main()
{
    scanf("%d",&n);
    for(int i=0;i<4;i++)
        for(int j=0;j<4;j++)
            for(int k=0;k<4;k++)
        {
            if(i==0&&j==2&&k==1||i==0&&j==1&&k==2||i==2&&j==0&&k==1) continue;
            dp[3][i][j][k]=1;
        }
    for(int t=4;t<=n;t++)
    {
        for(int i=0;i<4;i++)
            for(int j=0;j<4;j++)
                for(int k=0;k<4;k++)
                    for(int h=0;h<4;h++)
        {
            if(i==0&&j==2&&k==1||i==0&&j==1&&k==2||i==2&&j==0&&k==1||j==0&&k==2&&h==1||j==0&&k==1&&h==2||j==2&&k==0&&h==1)  continue;
            if(i==0&&j==2&&h==1||i==0&&k==2&&h==1) continue;
            dp[t][j][k][h]=(dp[t][j][k][h]+dp[t-1][i][j][k])%mod;
        }
    }
    long long ans=0;
    for(int i=0;i<4;i++)
        for(int j=0;j<4;j++)
            for(int k=0;k<4;k++)
            ans+=dp[n][i][j][k];
    printf("%lld\n",ans%mod);
}
//A:0 C:1 G:2 T:3


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string str1,a,b,c,d;
  int y=0;
  cin >> str1;
  a=str1.at(0);
  b=str1.at(1);
  c=str1.at(2);
  d=str1.at(3);
  if(a==b && c==d)
  {
    y=1;
  }
  if(a==d && b==c)
  {
    y=1;
  }
  if(a==c && b==d)
  {
    y=1;
  }
  if(a==b&&a==c&&a==d){
    y=0;
  }
  if(y==1){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256