akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;}

ll h[101010];

class UnionFind {
public:
    vector <ll> par; // 各元の親を表す配列
    vector <ll> siz; // 素集合のサイズを表す配列(1 で初期化)
    vector <ll> pk;

    // Constructor
    UnionFind(ll sz_): par(sz_), siz(sz_, 1LL), pk(sz_) {
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
        for (ll i=0; i<sz_; i++) pk[i] = h[i];
    }
    void init(ll sz_) {
        par.resize(sz_);
        pk.resize(sz_);
        for (ll i=0; i<sz_; i++) pk[i] = h[i];
        siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x) { // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        // // 親に保持した最大値を更新する
        // pk[x] = max(h[x], h[y]);
        // pk[y] = max(h[x], h[y]);
        return true;
    }

    bool issame(ll x, ll y) { // 連結判定
        return root(x) == root(y);
    }

    ll get_peak(ll x){
        return pk[root(x)];
    }

    ll size(ll x) { // 素集合のサイズ
        return siz[root(x)];
    }
};

int al[101010];

vector<int> mp[101010];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>h[i];
    }
    rep(i,m){
        int a,b;cin>>a>>b;
        mp[a].push_back(b);
        mp[b].push_back(a);
    }
    int ans = 0;
    for(int i=1; i<=n; i++){
        int isok = true;
        map<P, int> t;
        for(auto a : mp[i]){
            if(t[make_pair(i, a)]==1) continue;
            t[make_pair(i, a)]=1;
            if(h[i] <= h[a]) isok = false;
        }
        if(isok) ans++;
    }
    cout<<ans<<endl;


}

Measured memory_bytes: 12432
#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(int argc, const char * argv[]) {



    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin>>n;
    int flag=0;
    while(n>0){
        if(n%7==0){
            flag=1;
            break;
        }
        n-=4;
    }
    if(flag==1||n==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class _C
{

	static int k(KeyValuePair<int,int>a,KeyValuePair<int,int>b)
	{
		return a.Key.CompareTo(b.Key);
	}

	void _()
	{
		var _n = _Ns();
		var N = _n[0];

		var L = _Ns();

		Array.Sort(L);
		int sum = 0;
		for (int i = 0; i < N*2; i += 2)
			sum+=L[i];


		Console.WriteLine(sum);			

	}

	static void Main(string[] args)
  {
    new _C()._();
  }

  #region

  string _S()
  {
    return Console.ReadLine();
  }

  string[] _Ss()
  {
    return Console.ReadLine().Split();
  }

  int[] _N(int n)
  {
    var x = new int[n];
    for (var i = 0; i < n; i++)
    {
      x[i] = int.Parse(Console.ReadLine());
    }
    return x;
  }

  int[] _Ns()
  {
    var ss = Console.ReadLine().Split();

    var x = new int[ss.Length];
    for (var i = 0; i < ss.Length; i++)
      x[i] = int.Parse(ss[i]);

    return x;
  }
  #endregion
}

Measured memory_bytes: 2648
#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl
 
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
gp_hash_table<int, int> mp;*/
using ll = long long;
using ld = long double;
const ll MOD = 998244353;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const double eps = -1e6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 200001;
vector<int> adj[mxN];
int n;
int ans[mxN];
queue<int> w;
queue<int> b;
void dfs(int u, int p, int col) {
    if(col)w.push(u);
    else b.push(u);
    for(int v: adj[u]) {
        if(v^p) {
            dfs(v, u, col^1);
        }
    }
}
int main()
{   
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    cin>>n;
    int aa, bb;
    owo(i, 0, n-1) {
        cin>>aa>>bb;
        aa--; bb--;
        adj[aa].senpai(bb);
        adj[bb].senpai(aa);
    }
    dfs(0, 0, 1);
    vector<int> two;
    vector<int> one;
    vector<int> zero;
    owo(i, 1, n+1) {
        if((i-2)%3==0)two.senpai(i);
        else if((i-1)%3==0)one.senpai(i);
        else zero.senpai(i);
    }
    if(w.size()>b.size()) swap(w, b);
    if(w.size()<two.size()) {
        int idx = 0;
        while(!w.empty()) {
            int u = w.front();
            w.pop();
            ans[u] = zero[idx++];
        }
        owo(i, idx, zero.size()) {
            int u = b.front();
            b.pop();
            ans[u] = zero[i];
        }
        for(int k: two) {
            int u = b.front();
            b.pop();
            ans[u] = k;
        }
        for(int k: one) {
            int u = b.front();
            b.pop();
            ans[u] = k;
        }
    }else {
        for(int k: two) {
            int u = w.front();
            w.pop();
            ans[u] = k;
        }
        int idx = 0;
        while(!w.empty()) {
            int u = w.front();
            w.pop();
            ans[u] = zero[idx++];
        }
        for(int k: one) {
            int u = b.front();
            b.pop();
            ans[u] = k;
        }
        while(!b.empty()) {
            int u = b.front();
            b.pop();
            ans[u] = zero[idx++];
        }
    }
    owo(i, 0, n) {
        cout<<ans[i]<<" ";
    }
    return 0;
}


Measured memory_bytes: 24304
import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int n=sc.nextInt(),m=sc.nextInt();
    int[] a=new int[m],b=new int[m],f=new int[n];
    for(int i=0;i<n;i++){
      f[i]=0;
    }
    for(int i=0;i<m;i++){
      a[i]=sc.nextInt();
      b[i]=sc.nextInt();
      f[a[i]-1]++;
      f[b[i]-1]++;
    }
    for(int i=0;i<n;i++){
      System.out.println(f[i]);
    }
  }
}


Measured memory_bytes: 22608
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String[] a= {"a","e","i","o","u"};
		String c=sc.next();
		String ans="consonant";
		for(int i=0;i<5;i++) {
			if(c.equals(a[i])) {
				ans="vowel";
				break;
			}
		}
		System.out.println(ans);
		sc.close();
	}
}


Measured memory_bytes: 21972
from itertools import*
n,m,R=map(int,input().split())
r=map(int,input().split())
d=[[10**18]*n for _ in range(n)]
for i in range(m):
    a,b,c=map(int,input().split())
    d[a-1][b-1]=c
    d[b-1][a-1]=c
for i in range(n):
    d[i][i]=0
for k in range(n):
    for i in range(n):
        for j in range(n):
            d[i][j]=min(d[i][j],d[i][k]+d[k][j])
m=10**18
for e in permutations(r):
    t=0
    for i,j in zip(e,e[1:]):
        t+=d[i-1][j-1]
    m=min(m,t)
print(m)

Measured memory_bytes: 46808
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR
#endif


#define PRINT(s) cout << (s);
#define PRINTLN(s) cout << (s) << endl;

typedef long long int ll;

using namespace std;

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

int main(){
    int r,g,b;
    cin >> r >> g >> b;
    if( (g * 10 + b) % 4 == 0 )cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int c[][]=new int[3][3];
  for(int i=0;i<3;i++){
  for(int j=0;j<3;j++){
  c[i][j]=sc.nextInt();
  }
  }
  for(int i=0;i<3;i++){
  for(int j=0;j<3;j++){
  c[i][2-j]-=c[i][0];
  }
  }
  if(c[0][1]==c[1][1]&&c[0][1]==c[2][1]&&c[0][2]==c[1][2]&&c[0][2]==c[2][2])
    System.out.println("Yes");
  else System.out.println("No");
}
}

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

int main() {
  int Ans = 1e9;  // 回答：

  int N,M,X;
  cin >> N >> M >> X;
  vector<int> C(N,0);
  vector<vector<int>> A(N,vector<int>(M,0));
  rep(i,N){
    cin >> C.at(i);
    rep(j,M){
      cin >> A.at(i).at(j);
    }
  }
  vector<int> R(M,0); // 理解度


  // 本の組み合わせ全てについて、購入時の最低理解度を求める。
  rep(i,(1<<N)){  // 全肉の焼き場所 N に関する全探索：N は 12 まで。
    bitset<12> b(i); // 全探索用ビットセット

    // 理解度配列の初期化
    rep(j,M){R.at(j)=0;}
    int K=0; // 購入費用初期化

    rep(j,N){   // 全探索
      if(b.test(j)) { // j 番目の書籍を購入
        K += C.at(j);
        rep(k,M){
          R.at(k) += A.at(j).at(k);
//          cout << i << "-" << j << " " << k << " " << R .at(k) << " " << K << endl;
        }
      }
    }
    bool L=true; //全て理解したか？
    rep(j,M){
//          cout << "A:" <<  i << "-" << j << " " << X << " " << R .at(j) << " " << K << endl;
      if ( R.at(j) < X ){
        L=false;
        break;
      }
//          cout << "B:" <<  i << "-" << j << " " << X << " " << R .at(j) << " " << K << " " << L << endl;
    }
    if (L){Ans = min(Ans,K);}
//    cout << L << " " << Ans << endl;
  }
  if ( Ans == 1e9 ) { Ans = -1;}
  cout << Ans << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef double db;
typedef pair<int,int> PII;
typedef vector<int> VI;

int a[100010];

int main() {
	int n,m;
	scanf("%d%d",&n,&m);
	db sum;
	rep(i,0,n) scanf("%d",&a[i]),sum+=a[i];
	sum/=4*m;
	int cnt=0;
	rep(i,0,n) cnt+=a[i]>=sum;
	puts(cnt>=m?"Yes":"No");
	return 0;
}

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

#define SZ(x) (((int)x.size()))
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;

using namespace std;

int n;
bool b;

int main()
{
	cin >> n;
	while (n)
	{
		if (n % 10 == 7)
		{
			cout << "Yes";
			return 0;
		}
		n /= 10;
	}
	cout << "No";
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <limits>
using namespace std;
#define int long long
#define REP(i, n) for (int i = -200; i < (int)(n); i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
typedef long double ld;
signed main(){
int x;
cin >> x;
REP(i,200){
    REP(j,200){
        if(pow(i,5)-pow(j,5)==x){
            cout << i << " " << j;
          return 0;
        }
    }   
 }
}

Measured memory_bytes: 4032
#include<bits/stdc++.h>
using namespace std;
#define l long
#define ll long long
#define nitro ios_base::sync_with_stdio(false);cin.tie(0);
#define vi vector<int>
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define PI 3.141592653589793238
#define endl '\n'
int main()
{
    nitro
    string s;cin>>s;
    int c=0;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='B') c++;
    }
    while(c>0)
    {
        if(s.find('B')==0) s.erase(s.find('B'),1);
        else s.erase(s.find('B')-1,2);
        c--;
    }
    cout<<s;
    return 0;
}


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

class game{
private:
  vector<vector<int> > map;
  int score;
  int size;
public:
  game(int s){
    size=s;
    map.resize(size);
    for(int i=0;i<size;i++){
      map[i].resize(5);
    }
    score=0;
  }

  void setnum(int num,int i,int j){
    map[i][j]=num;
  }

  void deleteline(){
    for(int i=0;i<size;i++){
      int c=1;
      int index = 0;
      int end = 0;
      int delnum=0;
      for(int j=0;j<4;j++){
	if(map[i][j]==map[i][j+1]) c++;
	else c=1;
	if(c>=3){
	  delnum=map[i][j];
	  index = j - c + 1;
	  end = j;
	}
      }
      for(int j=index;j<=end+1;j++){
	if(map[i][j]==delnum){map[i][j]=0;score+=delnum;}
      }
    }
  }

  void falldown(){
    for(int c=0;c<=size;c++){
      for(int i=size-2;i>=0;i--){
	for(int j=0;j<5;j++){
	  if(map[i+1][j]==0){ map[i+1][j]=map[i][j]; map[i][j]=0;} 
	}
      }
    }
  }

  int calc(){
    int bf = -1;
    while(bf != score){
      bf = score;
      deleteline();
      falldown();
      //        show();
    }
    return score;
  }
  /*
  void show(){
    cout<<endl;
    for(int i=0;i<size;i++){
      for(int j=0;j<5;j++){
	cout<<map[i][j]<<" ";
      }
      cout<<endl;
    }
    cout<<endl;
    }*/
  

};

int main(){
  int t=1;
  while(cin>>t){
    if(t == 0) break;
    game g(t);
    for(int i=0;i<t;i++){
      for(int j=0;j<5;j++){
	int num;
	cin>>num;
	g.setnum(num,i,j);
      }
    }
    cout<<g.calc()<<endl;

  }
  return 0;
}

Measured memory_bytes: 1204
// @ts-ignore
import * as fs from 'fs';

// メイン
function main(input: string[]) {
    const n: number = +input[0];
    const a: bigint[] = input[1].split(" ").map(x => BigInt(x));
    const m:bigint = BigInt(Math.pow(10, 9) + 7);
    var p:bigint = BigInt(0);
    var s:bigint = BigInt(0);
    for (var i = 0; i < a.length; i++) {
        console.debug("i=", i, "p=", p, "s=", s);
        p = (p + a[i] * s) % m;
        s = (s + a[i]) % m;
    }
    var x = Number(p);
    console.log(x);
}

// エントリポイント
// - OSによるパラメタの処理の違いを吸収
function entrypoint() {
    try {
        var input = fs.readFileSync("/dev/stdin", "utf8").split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        console.log("----");
        console.log("file='%s'", __filename.split("\\").slice(-1)[0]);
        console.log("----");
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            console.log("input=%o", input);
            console.time();
            console.log("----")
            main(input);
            console.log("----")
            console.timeEnd();
        });
    }
}
entrypoint();


Measured memory_bytes: 72536
<?php
$num = trim(fgets(STDIN));
$max = 0;
for($j = 0; $j < strlen($num) ; $j++){//9にする桁数
    $sum = $j * 9;
    for($i = 0; $i < strlen($num) - $j; $i++){
        $sum+=$num[$i];
    }
    if($j != 0){
        $sum -= 1;
    }
    $max = max($sum, $max);
}
echo $max;

Measured memory_bytes: 4728
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;

struct island{
    int a, b;
};
bool cmp_b(const island &x, const island &y){
    return x.b < y.b;
}

int main(){
    int n, m;
    cin >> n >> m;
    vector<island> Island;
    for(int i=0;i<m;i++){
        int a, b;
        cin >> a >> b;
        island is;
        is.a = a;
        is.b = b;
        Island.push_back(is);
    }
    sort(Island.begin(), Island.end(), cmp_b);
    int ans = 1, b = Island[0].b;
    for(int i=1;i<m;i++){
        if(b <= Island[i].a){
            ans++;
            b = Island[i].b;
        }
    }

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

Measured memory_bytes: 1400
#include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include <cassert>
    #include <cmath>

    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

    using namespace std;
    using ll = long long;
    using Graph = vector<vector<int>>;
    using P = pair<int,int>;


    
    
    int main(){
        int n;cin>>n;
      int c = 0,d = 0;
        rep(i,n){
            int a;cin>>a;
            if(a%2!=0)continue;
            c++;
            if(a%3==0 || a%5==0)d++;
        }
        if(c==d)cout<<"APPROVED";
        else cout<<"DENIED";
    }
    


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

#define mod 1000000007

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

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
 
int main(void){
	
	ll N, K;
    cin >> N >> K;
    ll div = N / K;

    cout << min(abs(N - div * K), abs(N - (div + 1) * K)) << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
    int mat[3][3];

    for(int i=0; i<3 ; i++){
        for(int j=0; j<3 ; j++){
            scanf("%d",&mat[i][j]);
        }
    }

    int flag =0;

    if(mat[0][0]-mat[0][1] == mat[1][0]-mat[1][1] && mat[1][0]-mat[1][1]==mat[2][0]-mat[2][1]){
        flag=0;
    }
    else{flag=1; goto x;}

    if(mat[0][0]-mat[0][2] == mat[1][0]-mat[1][2] && mat[1][0]-mat[1][2]==mat[2][0]-mat[2][2]){
        flag=0;
    }
    else{flag=1; goto x;}

    if(mat[0][2]-mat[0][1] == mat[1][2]-mat[1][1] && mat[1][2]-mat[1][1]==mat[2][2]-mat[2][1]){
        flag=0;
    }
    else{flag=1; goto x;}




    if(mat[0][0]-mat[1][0] == mat[0][1]-mat[1][1] && mat[0][1]-mat[1][1]==mat[0][2]-mat[1][2]){
        flag=0;
    }
    else{flag=1; goto x;}

     if(mat[0][0]-mat[2][0] == mat[0][1]-mat[2][1] && mat[0][1]-mat[2][1]==mat[0][2]-mat[2][2]){
        flag=0;
    }
    else{flag=1; goto x;}

     if(mat[2][0]-mat[1][0] == mat[2][1]-mat[1][1] && mat[2][1]-mat[1][1]==mat[2][2]-mat[1][2]){
        flag=0;
    }
    else{flag=1; goto x;}





    if(mat[0][0]+mat[2][2] == mat[0][2]+mat[2][0]){
        flag=0;
    }
    else{flag=1; goto x;}


    x:
        if(flag==0){
            printf("Yes");
        }
        else{
            printf("No");
        }


}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N=0,M=0,a=0,ans=0,b=0,c=0;
    string str;
    vector<int> vec;

    cin>>N>>M>>a;

    if(N+M-1>=a&&N<=a){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define lint long long
#define inf 100000000000000000
#define mod 998244353
#define MAX 1000005
#define pb push_back
#define vit vector<int>::iterator
typedef pair<lint,lint> pii;
lint L[MAX],R[MAX],P[MAX],DP[MAX];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    lint n,k;
    cin>>n>>k;
    for(lint i=1;i<=k;i++) cin>>L[i]>>R[i];
    DP[n]=1;P[n]=1;
    for(lint i=n-1;i>=1;i--){
        for(lint j=1;j<=k;j++){
            DP[i]=(DP[i]+P[i+L[j]]-P[i+R[j]+1]+mod)%mod;
        }
        P[i]=(P[i+1]+DP[i])%mod;
    }
    cout<<DP[1];
    return 0;
}


Measured memory_bytes: 6732
def solve(ls):
    for i in range(1,h+1):
        for j in range(1, w+1):
            if ls[i][j] == "#" and ls[i][j+1] == "." and ls[i+1][j] == "." and ls[i][j-1] == "." and ls[i-1][j] == ".":
                return False
    return True

h, w = map(int, input().split())
ls = [["."] * (w+2)]
ls += [["."] + list(input()) + ["."] for i in range(h)]
ls.append(["."] * (w+2))

if solve(ls):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <array>
#include <list>
#include <stack>
#include <valarray>

using namespace std;

typedef unsigned uint;
typedef long long Int;
typedef unsigned long long UInt;

const int INF = 1001001001;
const Int INFLL = 1001001001001001001LL;

template<typename T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<typename T> void chmin(T& a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T& a, T b) { if (a < b) a = b; }
int in() { int x; scanf("%d", &x); return x; }
double fin() { double x; scanf("%lf", &x); return x; }
Int lin() { Int x; scanf("%lld", &x); return x; }

struct edge {
  int src, dst, sum;
  edge(int s, int d, int sum) : src(s), dst(d), sum(sum) { }
};
typedef vector<edge> edges;
typedef vector<edges> graph;

bool have[2][100050];
Int F[2][100050]; // F-x, F+x
bool fail;

void dfs(const graph& g, int u, int sgn) {
  for (const edge& e : g[u]) {
    if (have[1 - sgn][e.dst]) {
      fail |= F[1 - sgn][e.dst] != e.sum - F[sgn][u];
    } else {
      have[1 - sgn][e.dst] = true;
      F[1 - sgn][e.dst] = e.sum - F[sgn][u];
      dfs(g, e.dst, 1 - sgn);
    }
  }
}

int main() {
  int n = in();
  int m = in();
  graph g(n);
  for (int i = 0; i < m; ++i) {
    int u = in() - 1;
    int v = in() - 1;
    int s = in();
    g[u].emplace_back(u, v, s);
    g[v].emplace_back(v, u, s);
  }

  have[1][0] = true;
  F[1][0] = 0;
  fail = false;
  dfs(g, 0, 1);

  bool determined = false;
  Int dx;
  for (int i = 0; i < n; ++i) {
    cerr<<have[0][i]<<' '<<F[0][i]<<' '<<have[1][i]<<' '<<F[1][i]<<endl;
    if (have[0][i] && have[1][i]) {
      Int xx = (F[0][i] - F[1][i]);
      if (xx % 2 == 1) fail = true;
      xx /= 2;
      if (!determined) {
        dx = xx;
        determined = true;
      } else {
        fail |= dx != xx;
      }
    }
  }

  if (fail) {
    puts("0");
    return 0;
  }
  if (determined) {
    bool ok = true;
    for (int i = 0; i < n; ++i) {
      if (have[0][i]) ok &= F[0][i] - dx >= 1;
      if (have[1][i]) ok &= F[1][i] + dx >= 1;
    }
    puts(ok ? "1" : "0");
    return 0;
  }

  Int mx = INFLL, mn = 1;
  for (int i = 0; i < n; ++i) {
    if (have[0][i]) {
      chmin(mx, F[0][i] - 1);
    }
    if (have[1][i]) {
      chmax(mn, 1 - F[1][i]);
    }
  }

  printf("%lld\n", max(0LL, mx - mn + 1));

  return 0;
}


Measured memory_bytes: 19456
function calc(n)
{
  if(n % 2 === 0){
    return n / 2
  }else{
    return 3 * n + 1
  }
}

// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
  tmp = input[0].split(" ");
  var s = parseInt(tmp[0], 10)
  var arr = []

  arr.push(s)
  for(var i=1; i <= 1000000; i++)
  {
    arr.push(calc(arr[i-1]))
  }

  for(var m=1; m <= arr.length; m++)
  {
    for(var n=0; n < m; n++)
    {
      if(arr[m] === arr[n]){
        console.log(m+1)
        return;
      }
    }
  }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 51272
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define int long long
#define ll long long
using namespace std;
char s[114];
signed main() {
	int n;
	string a = "Three";
	cin >> n;
	for (int i = 0; i < n; i++)cin >> s[i];
	for (int i = 0; i < n; i++) {
		if (s[i] == 'Y')a = "Four";
	}
	cout << a << endl;
}

Measured memory_bytes: 256
# from pprint import pprint
# import math
# import collections

s = input()
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
# a = []
# for i in range(n):
#     a.append(int(input()))

if s == 'RRR':
    ans = 3
elif s in ('RRS', 'SRR'):
    ans = 2
elif s == 'SSS':
    ans = 0
else:
    ans = 1

print(ans)


Measured memory_bytes: 9088
def main():
    N, K = map( int, input().split())
    A = list( map( int, input().split()))
    cnt = 0
    l = 0
    r = 10**9+1
        
    ans = 0
    while r-l > 1:
        m = (l+r)//2
        k = 0
        # print(l,r)
        for a in A:
            k += ((a+m-1)//m)-1
        if k <= K:
            r = m
        else:
            l = m
    print(r)
if __name__ == '__main__':
    main()


Measured memory_bytes: 31032
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,sum=0,a=0;
	cin >> n;
	int x[n],y[n],b[n],p[n];
	for(int i=0;i<n;i++){
		a=0;
		cin >> x[i] >> y[i] >> b[i] >> p[i];
		sum=x[i]*b[i]+y[i]*p[i];
		if(b[i]>=5 && p[i]>=2){
			cout << sum-sum/5 << endl;
			a=1;
		}
		if(b[i]>=5 && p[i]<2){
			if(sum>(x[i]*b[i]+y[i]*2)*4/5){
				cout << (x[i]*b[i]+y[i]*2)*4/5 << endl;
				a=1;
			}
		}
		if(b[i]<5 && p[i]>=2){
			if(sum>(x[i]*5+y[i]*p[i])*4/5){
				cout << (x[i]*5+y[i]*p[i])*4/5 << endl;
				a=1;
			}
		}
		if(a!=1){
			cout << sum << endl;
		}
	}
} 


Measured memory_bytes: 3116
def main():
    import sys
    sys.setrecursionlimit(2*10**5)
    N, Q = map(int, input().split())
    E = [[] for i in range(N+1)]
    counter = [0] * (N+1)

    for i in range(N-1):
        a, b = map(int, input().split())
        E[a].append(b)
        E[b].append(a)

    for i in range(Q):
        # 頂点p を根とする部分木に含まれるカウンターにxを足す
        p, x = map(int, input().split())
        counter[p] += x

    queue = []

    parent = [1]
    def mktree(v, parent, E):
        children = E[v]
        children.remove(parent)
        for child in children:
            mktree(child, v, E)

    while parent:
        p = parent.pop()
        for child in E[p]:
            E[child].remove(p)
            parent.append(child)

    def get(v, children, counter):
        c = counter[v]
        for child in children[v]:
            counter[child] += c
            get(child, children, counter)

    parent = [1]
    while parent:
        p = parent.pop()
        c = counter[p]
        for child in E[p]:
            counter[child] += c
            parent.append(child)

    print(" ".join(str(x) for x in counter[1:]))

main()






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

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

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

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

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    string s;cin >> s;
    sort(s.begin(), s.end());
    string ans = "No";
    if(s == "abc") ans = "Yes";
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
	int n,s;
	int t = 0, m = 0;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> s;
		t += s;
		if (s > m)m = s;
	}
	cout << t - (m / 2) << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
int main (void) {
    ios::sync_with_stdio(false);cin.tie(0);
    ll x,y,z; cin >> x >> y >> z;
    cout << z << ' ' << x << ' ' << y << '\n';
    return 0;
}



Measured memory_bytes: 256
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  ll n,a,b;
  cin >> n;
  vector<ll> p(n),q(n),v;
  for(int i=0;i<n;i++){
    cin >> p[i];
    v.push_back(i+1);
  }
  for(int i=0;i<n;i++){
    cin >> q[i];
  }
  ll cnt=0;
  do{
    bool is_a=true,is_b=true;
    for(int i=0;i<n;i++){
      if(p[i]!=v[i]) is_a = false;
      if(q[i]!=v[i]) is_b = false;
    }
    if(is_a) a = cnt;
    if(is_b) b = cnt;
    cnt++;
  }while(next_permutation(v.begin(),v.end()));
  cout << abs(a-b)<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
    cin >> n;
    vector<double> a(n, 0);
    double sum = 0.0;
    for(int i = 0; i < n; ++i) {
        cin >> a.at(i);
        sum += a.at(i);
    }

    double ave = sum/(double)n;
    double min = 1000.0;
    int minno = 0;
    for(int i = 0; i < n; ++i) {
        if(abs(a.at(i)-ave) < min) {
            min = abs(a.at(i)-ave);
            minno = i;
        }
    }

    cout << minno << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
#define PI 3.141592653589793
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}
int gcd(int a, int b){//ユークリッドの互除法
  if (a < b) gcd(b,a); //aの方がbよりでかいのが前提
  if (b == 0) return a; //aをbで割り切れたらreturn
  else gcd(b, a % b);
}
int lcm(int a, int b){
  return a / gcd(a,b) * b;
}
const int INF = 1<<30;
const int MOD = 1000000007;
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};

int main(){
  int h,a; cin >> h >> a;
  cout << (h+a-1)/a << endl;
  return 0;
}

Measured memory_bytes: 256
def main():
    #a,b = list(map(int, input().split()))
        
    #print(int(a + (b/2)))
    n = int(input())
    if n == 25:
        print('Christmas')
    if n == 24:
        print('Christmas Eve')
    if n == 23:
        print('Christmas Eve Eve')
    if n == 22:
        print('Christmas Eve Eve Eve')

if __name__ == '__main__':

    main()


Measured memory_bytes: 2940
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int A = sc.nextInt();
		int B = sc.nextInt();
		System.out.println((A-1) * (B-1));
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 21204
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5+7;
const ll mod = 1e9 + 7;
#define afdafafafdafaf y1;
int ar[maxn], n, m, k;


int main()
{
    double a,b,x, pi = acos(-1);
    scanf("%lf%lf%lf", &a, &b, &x);
    if(a * a * b / 2 >= x){
        double p = x * 2 / a / b;

        double ans = atan(b / p) / pi * 180;
        printf("%.10lf\n", ans);
    }
    else{
        double p = b - (2 * x - a * a * b) / a / a;
        double ans = atan(p / a) / pi * 180;
        printf("%.10lf\n", ans);
    }
 
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#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 (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
vector<int>G[100001];
LL MOD=1e9+7;
typedef pair<LL,LL>P;
P dfs(int x,int pp){
	P p=P(0,0);
	if(G[x].size()==1)return P(1,1);
	vector<P>v;
	REP(i,G[x].size()){
		if(G[x][i]!=pp){
			v.push_back(dfs(G[x][i],x));
		}
	}
	LL a=1;
	LL b=1;
	REP(i,v.size()){
		a*=(v[i].first+v[i].second);
		a%=MOD;
		b*=(v[i].first);
		b%=MOD;
	}
	//cout<<x<<a<<b<<endl;
	return P(a,b);
}

int main(){
	cin>>N;
	REP(i,N-1){
		int a,b;
		cin>>a>>b;
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	if(N==1){
		cout<<2<<endl;
	}else if(N==2){
		cout<<3<<endl;
	}else{
		LL now=0;
		REP(i,N){
			if(G[i].size()>=2)now=i;
		}
		P p=dfs(now,-1);
		cout<<(p.first+p.second)%MOD<<endl;
	}
}

Measured memory_bytes: 11392
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
    ll n,h;
    cin>>n>>h;
    vector<ll>B;
    ll ma=0;

    rep(i,n){
        ll a,b;
        cin>>a>>b;
        ma= max(ma,a);
        B.push_back(b);
    }
    sort(been(B),greater<ll>());
    ll ans =0;
    rep(i,n){
        if(B[i]<ma)break;
        h-=B[i];
        ans++;
        if(h<=0)break;
    }

    if(h>0)ans+=ceil((double)h/(double)ma);

    cout<<ans<<endl;
    
    }

Measured memory_bytes: 1400
#include <bits/stdc++.h>
#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 REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(RALL(x))
#define SUM(x) accumulate(ALL(x),0)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const ll mod = 1e9+7;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

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; }

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

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

  int odd = n - n/2;
  double ans = (double)odd/n;
  printf("%.10f\n", ans);
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int cost(int y, int m, int d){
  return (365*y + y/4 - y/100 + y/400 + 306*(m+1)/10 + d - 428);
}

int main(int argc,char* argv[]){
  for(;;){
    int y1,m1,d1,y2,m2,d2;

    scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);

    if(y1 == -1 || m1 == -1 || d1 == -1 || y2 == -1 || m2 == -1 || d2 == -1){
      break;
    }

    if(m1 <= 2){
      y1--;
      m1 += 12;
    }

    if(m2 <= 2){
      y2--;
      m2 += 12;
    }

    printf("%d\n",cost(y2,m2,d2)-cost(y1,m1,d1));

  }
  
  return 0;
  
}

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

using namespace std;

typedef long long int ll;

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

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

  sort(a.begin(), a.end());

  ll ans = 0;
  for(int i = 1; i <= n / 2; i++) ans += (a[i] - a[i - 1]) * i;
  for(int i = n - 2; i >= n / 2; i--) ans += (a[i + 1] - a[i]) * (n - i - 1);

  cout << ans << '\n';
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
#include <numeric>
#include <map>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define fi first
#define se second


int main()
{
    ll l, r;
    cin >> l >> r;

    if (r - l > 2019)
    {
        cout << 0 << endl;
    }
    else
    {
        ll ans = LINF;
        rep(i, l, r + 1)
        {
            rep(j, i + 1, r + 1)
            {
                // if (ans > ((i * j) % 2019))ans = (i * j) % 2019;
				ans = min(ans,i*j%2019);
            }
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        double d=sc.nextInt();
        double t=sc.nextInt();
        double s=sc.nextInt();
        double ans=d/s;
        if(ans<=t){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }

    }
}


Measured memory_bytes: 35700
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = LLONG_MAX;

int main()
{
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    if (k < e - a)
        cout << ":(" << endl;
    else
        cout << "Yay!" << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        if(a<b && b<c){
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 26144
#include <iostream>
using namespace std;
 
long long solve(int N, int B){
  if(B < 0) return 0;
  if(N == 1) return (B == 0) ? 1 : 0;
  else{
    return (long long)(N - 2) * B + 1;
  }
}
 
int main(){
  int N, A, B;
  cin >> N >> A >> B;
  cout << solve(N, B - A) << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
from operator import itemgetter
# gcd
from fractions import gcd
# 切り上げ，切り捨て
from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
from collections import Counter
import math
from functools import reduce
sys.setrecursionlimit(200000)
# input関係の定義
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(x): print("debug: ", x, file=sys.stderr)
# template


# fin = open('in_1.txt', 'r')
# sys.stdin = fin
# # local only


def solve(N: int, A: int, B: int):
    if N * A >= B:
        print(B)
    else:
        print(N*A)
    return


def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


def main():
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(N, A, B)


if __name__ == '__main__':
    main()


Measured memory_bytes: 66156
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template<class T>
vector<T> divisor(T n){
    vector<T> ret;
    for(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);
}

int main() {
    ll n;
    cin >> n;
    ll ans = INF<ll>;
    auto x = divisor(n);
    for (auto &&i : x) {
        ans = min(ans, (i-1)+(n/i-1));
    }
    cout << ans << "\n";
    return 0;
}

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

int main() {
  int N; //駐車時間
  int A; //駐車料金A
  int B; //駐車料金B
  cin >> N >> A >> B;
  int a = N*A;
  int b = B;
  int x;
  if(a >= b){
    x = b;
  }
  else{
    x = a;
  }
  cout << x << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int main(){
  int n,m;
  scanf("%d %d",&n,&m);
  char a[n][n];
  char b[m][m];
  int p,q,r,s;
  int flag=1;
  for(p=0;p<n;p++){
    for(q=0;q<n;q++){
      scanf(" %c",&a[p][q]);}
  }
  for(p=0;p<m;p++){
    for(q=0;q<m;q++){
      scanf(" %c",&b[p][q]);}
  }
  for(r=0;r<=n-m+1;r++){
    for(s=0;s<=n-m+1;s++){
      int o=1;
      for(p=r;p<r+m;p++){
	for(q=s;q<s+m;q++){
	  if(a[p][q]!=b[p-r][q-s]){
	    o=0;}
	}
      }
      if(o==1){
	flag=0;}
    }
  }
  
  if(flag==0){
    printf("Yes");}
  else{printf("No");}
  return 0;
}
  
    


Measured memory_bytes: 128
import java.util.*;

public class Main {

    private static long dfs(List<Long> list, int k) {
        int n = list.size() / 2;
        long sum = 0L;
        for (int i = 0; i < n; i++) sum += list.get(i);
        long ans = Long.MIN_VALUE;
        int kk = k;
        for (k = 1; k <= n && k <= kk; k++){
            long mm = Long.MIN_VALUE;
            long cnt = 0;
            for (int i = 0; i < k - 1; i++) cnt += list.get(i);
            for (int i = k - 1; i < k - 1 + n; i++) {
                cnt += list.get(i);
                mm = Math.max(mm, cnt);
                cnt -= list.get(i - k + 1);
            }
            long tmp = Math.max(0, (kk - k) / n * sum);
            ans = Math.max(ans, tmp + mm);
        }
        return ans;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        int[] a = new int[n + 1];
        for (int i = 1; i <= n; i++) { a[i] = scan.nextInt(); }
        long[] c = new long[n + 1];
        for (int i = 1; i <= n; i++) { c[i] = scan.nextLong(); }

        long ans = Long.MIN_VALUE;
        int[] vis = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            if (vis[i] == 1) continue;
            vis[i] = 1;
            List<Long> list = new ArrayList();
            list.add(c[i]);
            int x = a[i];
            while (vis[x] == 0) {
                vis[x] = 1;
                list.add(c[x]);
                x = a[x];
            }
            int size = list.size();
            for (int j = 0; j < size; j++) list.add(list.get(j));
            ans = Math.max(ans, dfs(list, k));
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 48424
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    int n;
    cin >> n;
    long long t[n],a[n];
    rep(i,n){
        cin >> t[i];
    }
    rep(i,n){
        cin >> a[i];
    }
    bool flt[n],fla[n];
    flt[0] = true;
    fla[n-1] = true;
    for(int i = 1;i<n;i++){
        if(t[i-1]==t[i]) flt[i] = false;
        else flt[i] = true;
    }
    for(int i = n-2;i>=0;i--){
        if(a[i]==a[i+1]) fla[i] = false;
        else fla[i] = true;
    }
    long long ans = 1;
    for(int i = 0;i<n;i++){
        if(flt[i]){
            if(t[i]>a[i]){
                cout << 0 << endl;
                return 0;
            }
        }
        else{
            if(fla[i]){
                if(t[i]<a[i]){
                    cout << 0 << endl;
                    return 0;
                }
            }
            else{
                ans*=min(a[i],t[i]);
                ans%=MOD;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 2048
import java.util.*;

public class Main {
	public static void main(String[] args) {
		// practice contest

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if (n % 2 == 0) {
			System.out.println(n);
		} else {
			System.out.println(n * 2);
		}
	}
}

Measured memory_bytes: 23248