akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
import java.util.*;

 class Main {

	public static void main(String[] args) {
		Scanner in  = new Scanner(System.in);
		String s[] = in.nextLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int x = Integer.parseInt(s[2]);
		if(a+b >= x && a<=x ) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

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

#define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;

template<typename T,typename U>bool chmin(T& a,const U& b){return a>b?(a=b,1):0;}
template<typename T,typename U>bool chmax(T& a,const U& b){return a<b?(a=b,1):0;}

void print_vars(ostream&){}
template<typename Car,typename... Cdr>
void print_vars(ostream& os,const Car& car,const Cdr&... cdr){
	print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...);
}

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}

template<int I,typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<int I,typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	os<<get<I>(t)<<(sizeof...(Cdr)?",":"");
	print_tuple<I+1,Cdr...>(os,t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<0,Args...>(os<<'(',t);
	return os<<')';
}

template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

int main()
{
	#ifndef _GLIBCXX_DEBUG
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	constexpr char endl='\n';
	#endif

	for(int a,b;cin>>a>>b;){
		int x=a+b,y=a-b,z=a*b;
		cout<<max({x,y,z})<<endl;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FOR(i,l,r) for(int i=l;i<=r;i++)
#define ll long long
using namespace std;

const ll mod = 1e9+7;

ll n;int k;
ll S[110][202000],B[110][202000];

int main(){
    cin>>n>>k;
    ll d=sqrt(n);
    ll ans=0;
    S[0][1]=1;
    FOR(i,1,k){
        FOR(j,1,d)S[i-1][j]=(S[i-1][j]+S[i-1][j-1])%mod;
        FOR(j,1,d)B[i-1][j]=(B[i-1][j]+B[i-1][j-1])%mod;
        FOR(j,1,d){
            S[i][j]=(S[i-1][d]+B[i-1][d]-B[i-1][j-1]+mod)%mod;
            B[i][j]=(n/j-n/(j+1))*S[i-1][j]%mod;
            if(j==n/j)B[i][j]=0;//SжагаСЫ
        }
    }
    FOR(i,1,d)ans=(ans+S[k][i]+B[k][i])%mod;
    cout<<ans<<endl;
}


Measured memory_bytes: 318208
x = int(input())

if x%100 == 0 or x%101 == 0 or x%102 == 0 or x%103 == 0 or x%104 == 0 or x%105 == 0:
    print (1)
else:
    for i in range(100000):
        if 100*i <= x <= 105*i:
            print (1)
            exit ()
    else:
        print (0)


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

int main()
{
    ll N;
    cin >> N;
    ll ans = 0;
    rep(i, N) if (to_string(i + 1).length() % 2 == 1) ans++;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define reall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){
    
    ll N, L;
    cin >> N >> L;
    vector<ll> A(N);
    for(ll i = 0; i < N; i++)cin >> A[i];
    bool flag = false;
    ll pos = -1;
    for(ll i = 0; i < N - 1; i++){
        if(A[i] + A[i + 1] >= L){
            flag = true;
            pos = i + 1;
            break;
        }
    }
    if(flag){
        cout << "Possible" << endl;
        for(int i = 1; i != pos; i++)cout << i << endl;
        for(int i = N - 1; i != pos; i--)cout << i << endl;
        cout << pos << endl;
    }
    else cout << "Impossible" << endl;

    return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
constexpr int INF = 1000000000000000000LL;
template<typename A, typename B> void cmax(A &a, const B &b) {
  if (a < b) a = b;
}
template<typename A, typename B> void cmin(A &a, const B &b) {
  if (a > b) a = b;
}

int MAX_V;

int N, W;
int v[50], w[50], m[50];

int solve() {
  int X = 2, S = N * X * MAX_V;

  vector<int> dp(S + 1, INF);
  dp[0] = 0;
  rep(i, N) {
    int t = min(m[i], X);
    m[i] -= t;
    for (int k = 0; t; k++) {
      int c = min(t, 1LL << k);
      t -= c;
      for (int j = S; j - v[i] * c >= 0; j--) cmin(dp[j], dp[j - v[i] * c] + w[i] * c);
    }
  }

  vector<int> ord(N);
  iota(all(ord), 0);
  sort(all(ord), [&](int i, int j) { return v[i] * w[j] > v[j] * w[i]; });
  int ans = 0;
  for (int j = 0; j <= S; j++) {
    if (W < dp[j]) continue;
    int lim = W - dp[j];
    int s = j;
    rep(i, N) {
      int k = ord[i];
      int c = min(m[k], lim / w[k]);
      lim -= w[k] * c;
      s += v[k] * c;
    }
    cmax(ans, s);
  }
  return ans;
}

main() {
  cin >> N >> W;
  rep(i, N) cin >> v[i] >> w[i] >> m[i];
  MAX_V = *max_element(v, v + N);
  cout << solve() << endl;
}



Measured memory_bytes: 3184
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto n = readln.chomp.to!int;
  auto d = readln.chomp.split.to!(int[]);
  int sum;
  foreach (i; 0..n-1) {
    foreach (j; i+1..n) {
      sum += d[i] * d[j];
    }
  }
  sum.writeln;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define cer(x) cerr << x <<endl
#define ALL(a) (a).begin(),(a).end()
#define MOD 1e9+7
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main()
{
	int n; cin >> n;
	string s; cin >> s;
	int ans = 0;
	rep(i, 1000)
	{
		stringstream ss_now;
		ss_now << setw(3) << setfill('0') << i;
		string s_now = ss_now.str();
		int k = 0;
		rep(j, n)
		{
			if (s[j] == s_now[k])k++;
			if (k == 3)
			{
				ans++;
				break;
			}
		}
	}
	co(ans);
	return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main(){
	int n,S,H,C,D,i,j,x,y,p;
	char w;
	bool cards[4][13]={false};
	cin>>n;
	for(i=0;i<n;i++){
		cin>>w>>y;
		if(w=='S'){
		cards[0][y-1]=true;
		}
		else if(w=='H'){
		cards[1][y-1]=true;
		}
		else if(w=='C'){
		cards[2][y-1]=true;
		}
		else if(w=='D'){
		cards[3][y-1]=true;
		}
	}
	for(j=0;j<4;j++){
		for(p=0;p<13;p++){
			if(cards[j][p]==false){
			switch(j){
			case 0:cout<<"S "<<p+1<<endl;break;
			case 1:cout<<"H "<<p+1<<endl;break;
			case 2:cout<<"C "<<p+1<<endl;break;
			case 3:cout<<"D "<<p+1<<endl;break;
			}
			}
		}
	}
return 0;
}

Measured memory_bytes: 3024
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
int main(void){
    int n;
    cin>>n;
    vector<ll> v(n);
    rep(i, n) cin>>v[i];
    int ans = 0;
    rep(i, n){
        while(v[i]%2 == 0){
            v[i] /= 2;
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

class Main {
    public static void main(String [] args){
        Scanner scan      = new Scanner(System.in);
        String mark       = "SHCD";
        boolean [][] card = new boolean[4][13];
        
        int n = scan.nextInt();
        
        for(int i = 0; i < n; ++i){
            char c = scan.next().charAt(0);
            int  t = scan.nextInt();
            
            card[mark.indexOf(c)][t - 1] = true;
        }
        
        for(int i = 0; i < 4; ++i){
            for(int j = 0; j < 13; ++j){
                if(!card[i][j]){
                    System.out.println(mark.charAt(i) + " " + (j + 1));
                }
            }
        }
    }
}


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

typedef long long ll;

int main() {
    int H, W;
    cin >> H >> W;
    vector<vector<int>> c(10, vector<int>(10)), A(H, vector<int> (W));
    rep(i, 10) {
        rep(j, 10) {
            cin >> c[i][j];
        }
    }
    rep(i, H) {
        rep(j, W) {
            cin >> A[i][j];
        }
    }
    rep(k, 10) {
        rep(i, 10) {
            rep(j, 10) {
                c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
            }
        }
    }
    ll ans = 0;
    rep(i, H) {
        rep(j, W) {
            if (A[i][j] == -1) continue;
            ans += c[A[i][j]][1];
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (n); i++)
long long C[10][10] = {};
int main(){
    int N;
    cin >> N;
    for(int i=1;i<=N;i++){
        string S = to_string(i);
        int a = S[0] - '0';
        int b = S[S.length()-1] - '0';
        if(b == 0) continue;
        C[b][a]++;
    }
    long long count = 0;
    rep(i,10){
        rep(j,10){
            count += C[i][j] * C[j][i];
        }
    }
    cout << count << endl;
    return 0;
}

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

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

    string s; cin >> s;
    int n = s.size();

    int ans = 0;
    for(int i = 0;i < n-1;i ++){
        if(s.at(i) != s.at(i+1)) ans ++;
    }

    cout << ans << endl;
}

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

string resolve(int a, int b){
  string result;
  int count = 0;
  while(count < b){
    result += to_string(a);
    count++;
  }
  return result;
}

int main() {
  int A, B;
  cin >> A >> B;
  
  if (A > B){
    cout << resolve(B, A) << endl;
  } else {
    cout << resolve(A, B) << endl;  
  }
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <memory.h>
#include <set>
#include <cmath>
#define fio ios::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
typedef long long ll;
int n, m;
vector<int> gph[100'005];
int ck[100'005];
void dfs(int x) {
	ck[x] = true;
	for (int nx : gph[x]) {
		if (!ck[nx]) dfs(nx);
	}
}
int main(void) {
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		int a, b, c; scanf("%d %d %d", &a, &b, &c);
		gph[a].push_back(b);
		gph[b].push_back(a);
	}
	int ans = 0;
	for(int i = 1; i <= n; i++){
		if (!ck[i]) {
			dfs(i);
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}

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

int main(void) {
    int N;
    cin >> N;
    if (N % 1000 == 0) {
        printf("0\n");
    } else {
        printf("%d\n", 1000 - (N - (N / 1000) * 1000));
    }
    return 0;
}


Measured memory_bytes: 3688
#include <stdio.h>
int main(void){
    int a, b;
    
    scanf("%d",&a);
    scanf("%d",&b);
    
    if(a < b)
        printf("a < b\n");
    else if(a > b)
        printf("a > b\n");
    else
        printf("a == b\n");
    
    return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1LL<<60;
const int inf = 1e5;
//typedef long double ld;
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 dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
map<ll,ll> ma;
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int main(){
  ll D,G; cin >> D >> G;
  ll ma = INF;
  vector<P> v(D);
  rep(i,0,D){
    int x,y,z;  cin >> x >> y;
    v[i] = mp(x,y);
  }
  for(ll bit=0 ; bit<(1<<D) ; bit++){
    ll sum = 0, num = 0;
    rep(i,0,D){
      if(bit & (1<<i)){
        sum += (i+1)*100*v[i].fi+v[i].se, num += v[i].fi;
      }
    }
    if(G>sum){
      for(ll i=D-1 ; i>=0 ; i--){
        if(bit & (1<<i)) continue;
        bool ok=true;
        rep(j,0,v[i].fi){
          if(sum<G){
            sum += (i+1)*100;
            num++;
          }else{
            ok = false;
            break;
          }
        }
        if(ok){
          sum += v[i].se;
        }
      }
    }
    if(sum>=G) chmin(ma, num);
  }
  cout << ma << endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        int n = sc.nextInt();
        int k = sc.nextInt();
        boolean[] sunukes = new boolean[n];

        for (int i = 0; i < k; i++) {
            int d = sc.nextInt();
            for (int j = 0; j < d; j++) {
                int a = sc.nextInt();
                sunukes[a-1] = true;
            }
        }

        int cnt = 0;
        for (boolean i : sunukes) {
            if (!i)
                cnt++;
        }

        System.out.println(cnt);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 26736
#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n)                           \
  cerr << __LINE__ << ": " << #x << " = {";        \
  for (long long hoge = 0; (hoge) < (n); ++(hoge)) \
    cerr << ((hoge) ? "," : "") << x[hoge];        \
  cerr << "}" << endl
#else
#define debug(x) (void(0))
#define debugArray(x, n) (void(0))
#endif

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M, X;
  cin >> N >> M >> X;
  int C[N];
  int A[N][M];
  for (int i = 0; i < N; i++) {
    cin >> C[i];
    for (int j = 0; j < M; j++) cin >> A[i][j];
  }
  int ans = INT_MAX;
  for (int s = 0; s < (1 << N); s++) {
    int cost = 0;
    for (int i = 0; i < N; i++)
      if ((s >> i) & 1) cost += C[i];
    int skill[M];
    fill(skill, skill + M, 0);
    for (int i = 0; i < N; i++)
      if ((s >> i) & 1) {
        for (int j = 0; j < M; j++) skill[j] += A[i][j];
      }
    bool isok = true;
    for (int j = 0; j < M; j++) isok &= skill[j] >= X;
    if (isok) ans = min(ans, cost);
  }
  if (ans == INT_MAX) ans = -1;
  cout << ans << endl;
  return 0;
}


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

int N;
int X[100];

int tairyoku(int x, int p) { return (x-p) * (x-p); }

signed main() {
  cin >> N;
  for(int i=0; i<N; i++) cin >> X[i];

  int ans = 1<<30;
  for(int p=1; p<=100; p++) {
    int sum = 0;
    for(int i=0; i<N; i++) sum += tairyoku(X[i], p);
    ans = min(sum,ans);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
n , k = map(int, input().split())
data = []
for i in range(n):
    data.append(list(map(int, input().split())))
data.sort()
total = 0
for i in data:
    if total < k <= total + i[1]:
        print(i[0])
        exit()
    else:
        total += i[1]

Measured memory_bytes: 27872
#include<iostream>
using namespace std;
int main(){
   
    int a[5],i;
    for(i=1;i<=5;i++){
        cin>>a[i];
    } 
    for(i=1;i<=5;i++){
     if(a[i]==0){
            cout<<i;
        }
   }
     return 0;   
}
 
 

Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
#define all(cont) cont.begin(), cont.end()
#define unique(a)  sort(all(a)) , (a).erase(unique((a).begin(), (a).end()),(a).end())
#define rall(cont) cont.rbegin(), cont.rend()
#define sz(x) (int)(x).size()
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define f first
#define s second
#define mset(m,v) memset(m,v,sizeof(m))
#define mod 1000000007
const int N = 2e5 + 5;
#define PI acos(-1.0)
long double EPS = 1e-9;
typedef long long ll;
#define int long long
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;
#define pqll_max priority_queue<ll> // max heap. push(),pop(),top(),size(),empty()
#define pqll_min priority_queue<ll,vector<ll>,greater<ll> >
#define lb(v,val)   lower_bound(v.begin(),v.end(),val) //first equal to or lower than [------------
#define ub(v,val)   upper_bound(v.begin(),v.end(),val) //first greater than ------------)
#define bs(v,x) binary_search(v.begin(),v.end(),x)
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x; }
inline ll sub(ll a, ll b) { if (a < b)swap(a, b); return (((a%mod) - (b%mod) + mod) % mod); }
inline ll mul(ll x, ll y) { return (x%mod * 1ll * y%mod) % mod; }
inline ll pwr(ll a, ll b) { ll x = 1 % mod; while (b) { if (b & 1) x = mul(x, a); a = mul(a, a); b >>= 1; }return x % mod; }
inline ll inv(ll a) { return pwr(a, mod - 2) % mod; }
ll gcd(ll a, ll b) { if (!a)return b % mod; return gcd(b%a, a) % mod; }
#define debug(x) cout << #x << " = " << x << endl;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#define in(container) for (auto &it : container) cin>>it;
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
void pre() {
}
void solve() {
	int n;
	cin >> n;
	vi v(n);
	in(v);
	vi v1 = v;
	for (int i = 0; i < n; i++) {
		
		for (int j = 0; j < n; j++) {
			v = v1;
			swap(v[i], v[j]);
			vi v3 = v;
			sort(all(v));
			if (v3 == v) {
				cout << "YES" << endl;
				return;
			}

		}
	}
	cout << "NO" << endl;

}
signed main()
{
	fastio;
	//cout<<fixed<<setprecision(15);
	//clock_t begin = clock();
	//pre();
	int tc;
	tc = 1;
	//cin >> tc;
	while (tc--) {
		solve();
	}
	//clock_t end = clock();double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;cerr << elapsed_secs;
}


Measured memory_bytes: 256
import math

A,B,H,M=map(int,input().split())

w1=2*(math.pi)/(12*60)
w2=2*(math.pi)/60
delta=abs(w1*(60*H+M)-w2*M)

r=(A**2+B**2-2*A*B*(math.cos(delta)))**0.5

print('%.20f' %(r))
  


Measured memory_bytes: 9392
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

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

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    long a = sc.nextLong();
    long v = sc.nextLong();
    long b = sc.nextLong();
    long w = sc.nextLong();
    long t = sc.nextLong();
    String result = "NO";
    if (a <= b && a + t * v >= b + t * w) result = "YES";
    else if (a >= b && a - t * v <= b - t * w) result = "YES";
    System.out.println(result);
  }
}

Measured memory_bytes: 32820
package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"os"
	"strconv"
)

func main() {
	N, M := nextInt(), nextInt()
	As := nextInts(N)
	h := (*Heap)(&As)
	heap.Init(h)
	for i := 0; i < M; i++ {
		a := heap.Pop(h).(int)
		heap.Push(h, a/2)
	}
	fmt.Println(Sum(*h...))
}

func Sum(slice ...int) int {
	sum := 0
	for _, v := range slice {
		sum += v
	}
	return sum
}

type Heap []int

func (h Heap) Less(i, j int) bool    { return h[i] > h[j] }
func (h Heap) Len() int              { return len(h) }
func (h Heap) Swap(i, j int)         { h[i], h[j] = h[j], h[i] }
func (h *Heap) Push(x interface{})   { *h = append(*h, x.(int)) }
func (h *Heap) Pop() (x interface{}) { *h, x = (*h)[:len(*h)-1], (*h)[len(*h)-1]; return }

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}


Measured memory_bytes: 4736
package main

import "fmt"

func main() {
	var n, m int
	
	fmt.Scan(&n)
	fmt.Scan(&m)
	
	h := make([]int, n, n)
	b := make(map[int][]int)
	for i := 0; i < n; i++ {
		var tmp int
		fmt.Scan(&tmp)
		h[i] = tmp
	}
	for i := 0; i < m; i++ {
		var tmp1,tmp2 int
		fmt.Scan(&tmp1)
		fmt.Scan(&tmp2)
		tmp1--
		tmp2--
		_, ok1 := b[tmp1]
		if ok1 {
			b[tmp1] = append(b[tmp1], tmp2)
		} else {
			b[tmp1] = []int{tmp2}
		}
		_, ok2 := b[tmp2]
		if ok2 {
			b[tmp2] = append(b[tmp2], tmp1)
		} else {
			b[tmp2] = []int{tmp1}
		}
	}

	answer := 0
	for i := 0; i < n; i++ {
		ok := true
		l := len(b[i])
		if l > 0 {
			for j := 0; j < l; j++ {
				if h[b[i][j]] >= h[i] {
					ok = false
				}
			}
		}
		if ok {
			answer++
		}
	}

	fmt.Println(answer)
}

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

#define el '\n'

typedef long long ll;

const int NMAX = 200005;

ll dp[NMAX]; // dp[i] max beauty if last taken flower is height i
ll seg[2*NMAX];

void update(int l, int r, int pos, int idx, ll val){
  if(l==r && l==idx){
    seg[pos] = val;
    return;
  }

  if(l <= idx && idx <= r){ 
    int mid = (l+r)/2;
    update(l, mid, 2*pos+1, idx, val);
    update(mid+1, r, 2*pos+2, idx, val);
    seg[pos] = max(seg[2*pos+1], seg[2*pos+2]);
  }
}

ll ambil(int ql, int qr, int l, int r, int pos){
  if(ql <= l && r <= qr){
    return seg[pos];
  }
  if(r < ql || qr < l){
    return 0;
  }

  int mid = (l+r)/2;
  return max(ambil(ql,qr,l,mid,2*pos+1), ambil(ql,qr,mid+1,r,2*pos+2));
}

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

  int n;
  cin >> n;
  vector<int> h(n), a(n);;
  for(int i = 0; i < n; i++){
    cin >> h[i];
  }

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

  for(int i = 0; i < n; i++){
    int ql = 0, qr = h[i]-1;
    ll maxi = ambil(ql,qr,0, n, 0);
    dp[h[i]] = maxi + a[i];
    update(0, n, 0, h[i], dp[h[i]]);
  }

  ll ans = 0;
  for(int i = 0; i <= n; i++){
    ans = max(ans, dp[i]);
  }
  cout << ans << el;
  
  return 0;
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vp;
typedef pair<int,int> pii;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
const int MAX = 10000000;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
/*--------------------------------------------*/

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

    ll A,B,K;
    cin >> A >> B >> K;

    if(A > K){
        cout << A-K << ' ' << B << endl;
    }else if(B > (K - A)){
        cout << 0 << ' ' << B - (K - A) << endl;
    }else{
        cout << 0 << ' ' << 0 << endl;
    }

}


Measured memory_bytes: 256
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N, M = iim()
    it = map(int, sys.stdin.read().split())

    dp = [-1] * N

    def find(x):
        if dp[x] < 0:
            return  x

        ans = dp[x] = find(dp[x])
        return ans

    def union(x, y):
        x1 = find(x)
        y1 = find(y)

        if x1 == y1:
            return

        xr = dp[x1]
        yr = dp[y1]
        if xr <= yr:
            dp[y1] = x1
            dp[x1] += yr
        else:
            dp[x1] = y1
            dp[y1] += xr

    for ai, bi in zip(it, it):
        union(ai-1, bi-1)

    d1 = [0]*N
    for i in range(N):
        d1[find(i)] += 1
    print(max(d1))

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 109300
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
   
//#include <x86intrin.h>
#include <bits/stdc++.h>   
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
     
#define F first
#define S second           
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define al 0x3F3F3F3F
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)3e5 + 123;
const ll inf = (ll)1e18 + 1;

const double pi = acos (-1.0);
const double eps = 1e-7;                  
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

int n, k, pref[N], ans, a[N];
map <int, int> cnt;

inline void boost () {                    
   ios_base :: sync_with_stdio (NULL);
   cin.tie (NULL), cout.tie (NULL);          
}                                                     

inline void Solve () {
   cin >> n >> k;
   for (int i = 1; i <= n; i ++) {
      int x;
      cin >> x;
      pref[i] = pref[i - 1] + x;
      a[i] = pref[i] - i;
      a[i] %= k;
      if (a[i] < 0) a[i] = (a[i] + k) % k;
   }
   cnt[0] ++;
   for (int i = 1; i <= n; i ++) {
      if (i >= k) cnt[a[i - k]] --;
      ans += cnt[a[i]];
      cnt[a[i]] ++;
   }
   cout << ans;
}

main () {                                       
// freopen (".in", "r", stdin);    
// freopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
   //cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}
                          

Measured memory_bytes: 16384
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()

if N%2 == 1:
    print(0)
else:
    ans = 0
    div = 10
    while div <= N:
        ans += N//div
        div *= 5
    print(ans)


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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
int main() {
  ll n;cin>>n;
  ll max=numeric_limits<ll>::min();
  ll min=numeric_limits<ll>::max();
  REP(i,n){
    int a;cin>>a;
    if(a>max){
      max=a;
    }
    if(a<min){
      min=a;
    }
  }
  cout << (max-min) << endl;
}


Measured memory_bytes: 256
let print_list l =
  List.map string_of_int l |> String.concat " " |> print_endline;;

let insertion_sort a n g count=
  let ct = (ref count) in
  for i = g to n-1 do
    let v = a.(i) in
    let rec loop j =
      if j < 0 || a.(j) <= v then (j+g)
      else
        begin
          a.(j+g) <- a.(j);incr ct;loop (j-g)
        end
    in a.(loop (i-g)) <-v;
  done;
  !ct
;;

let () =
  let n = read_int () in
  let n' = float_of_int n in
  let rec gen g b =
    let b2 = b *. 2.25 +. 1. in
    if b2 > n' then g
    else gen ((int_of_float (ceil b2))::g) b2
  in
  let a = Array.init n (fun x -> read_int ()) and
      g = gen [] 0. in
  let m = List.length g in
  let rec loop ct = function
      [] -> print_int m;print_newline ();
            print_list g;
            print_int ct;print_newline ();
            Array.iter (fun x -> Printf.printf "%d\n" x) a
    | h::t -> loop (insertion_sort a n h ct) t
  in loop 0 g
;;

Measured memory_bytes: 12484
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
    int n;
    cin >> n;
    vector< pair<string, int> >pairs1(n), pairs2(n);
    for(int i=0; i<n; i++){
        string s;
        int tmp;
        cin >> s >> tmp;
        pairs1[i]=make_pair(s, -tmp);
        pairs2[i]=make_pair(s, -tmp);
    }
    
    sort(pairs1.begin(), pairs1.end());
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(pairs1[i]==pairs2[j]){
                cout << j+1 << endl;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MAX 4000
#define MOD 998244353
using namespace std;

long long ways[MAX][MAX];
int A[MAX];
long long n, s;

long long solve( int idx, int sum ){
    if(idx == 0)
        return (sum == 0);
    long long& ref = ways[idx][sum];
    if(ref != -1)
        return ref;
    ref = 2LL * solve(idx - 1, sum);
    if( sum >= A[idx] )
        ref += solve(idx - 1, sum - A[idx]);
    ref %= MOD;
    return ref;
}

int main()
{
    memset(ways, -1, sizeof ways);
    cin >> n >> s;
    long long res = 0;
    for( int i = 1; i <= n; i++ ){
        cin >> A[i];
    }
    cout << solve(n, s) << endl;
    return 0;
}

Measured memory_bytes: 128836
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << '\n'
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
const unsigned long long h = 1e9+7;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MAX = 100010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m,a,b;
    cin >> n >> m;
    vector<P> island;
    rep(i,m){
        cin >> a >> b;
        island.push_back(P(b,a));
    }
    SORT(island);
    int now = 1,c = 0;
    rep(i,m){
        tie(b,a) = island[i];
        if (now <= a){
            c++;
            now = b;
        }
    }
    PRINT(c);
}    


Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  // alphabetごとにsetで管理、lower_bound
  int N, Q;
  string S;
  cin >> N >> S >> Q;
  vector<set<int>> alpha(26);
  rep(i, N) alpha[S[i]-'a'].insert(i);
  rep(_, Q) {
    int q;
    cin >> q;
    if (q == 1) {
      int i;
      char c;
      cin >> i >> c;
      --i;
      if (S[i] == c) continue;
      alpha[S[i]-'a'].erase(i);
      alpha[c-'a'].insert(i);
      S[i] = c;
    } else {
      int l, r;
      cin >> l >> r;
      --l;
      int cnt = 0;
      rep(j, 26) {
        auto itr = alpha[j].lower_bound(l);
        if (itr != alpha[j].end() && *itr < r) cnt++;
      }
      printf("%d\n", cnt);
    }
  }
  return 0;
}

Measured memory_bytes: 27228
use std::cmp::{min, max};
use std::io::*;
use std::str::FromStr;

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

fn main() {
    let s:String = read();
    let c:Vec<char> = s.chars().collect();
    let mut ans = s.len();
    for i in c.iter() {
        let i = *i;
        let mut tmp = 0;
        for mut j in 0..s.len() {
            let mut k = j;
            while k < s.len() && c[k] != i {
                k += 1;
            }
            if c[j] != i {
                tmp = max(tmp, k - j);
            }
            j = k;
        }
        ans = min(ans, tmp);
    }
    println!("{}", ans);
}

Measured memory_bytes: 2136
#include<cstdio>
int main(){
	int n;
	scanf("%d",&n);
	int sum1=0;
	for(int i=1;i<=n;i=i+2){
		int sum=0;
		for(int j=1;j<=i;j++)
		   if(i%j==0)sum++;
		if(sum==8)sum1++;   
	}
	printf("%d\n",sum1);
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a[] = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextInt();
		}
		int work, idx;
		for(int i = 0; i < n; i++) {
			idx = i;
			for(int k = i + 1; k < n; k++) {
				if(a[idx] < a[k]) {
					idx = k;
				}
			}
			work = a[i];
			a[i] = a[idx];
			a[idx] = work;
		}
		int Alice = 0, Bob = 0;
		for(int i = 0; i < n; i++) {
			if(i % 2 == 0) {
				Alice += a[i];
			} else {
				Bob += a[i];
			}
		}
		System.out.println(Alice - Bob);
	}
}


Measured memory_bytes: 21716
#include<iostream>
#include<cstdio>
#include<cstring>
const int N=105;
char s[N];
int dp[N][26];
long long g[26][26],t[26][26],ans[26][26];
int main() {
    scanf("%s",s);
    int n=strlen(s);
    int k;
    scanf("%d",&k);
    if(n==1) {
        printf("%d\n",k>>1);
        return 0;
    }
    for(int i=0;i<26;i++) {
        char head=i+'a';
        for(int j=0;j<n;j++) for(int k=0;k<26;k++) dp[j][k]=N;
        dp[0][i]=(s[0]!=head);
        for(int i=1;i<n;i++) for(int j=0;j<26;j++) {
            char now=j+'a';
            int w=0;
            if(now!=s[i]) w++;
            for(int p=0;p<26;p++) {
                if(p!=j) dp[i][j]=std::min(dp[i][j],dp[i-1][p]+w);
            }
        }
        for(int j=0;j<26;j++) ans[i][j]=g[i][j]=dp[n-1][j];
    }
    auto mul=[&](const long long L[26][26],const long long R[26][26]) {
        for(int i=0;i<26;i++) for(int j=0;j<26;j++) {
            t[i][j]=1e18;
            for(int x=0;x<26;x++) for(int y=0;y<26;y++) if(x!=y) t[i][j]=std::min(t[i][j],L[i][x]+R[y][j]);
        }
    };
    --k;
    while(k) {
        if(k&1)  {
            mul(ans,g);
            for(int i=0;i<26;i++) for(int j=0;j<26;j++) ans[i][j]=t[i][j];
        }
        mul(g,g);
        k>>=1;
        for(int i=0;i<26;i++) for(int j=0;j<26;j++) g[i][j]=t[i][j];
    }
    long long res=1e18;
    for(int i=0;i<26;i++) for(int j=0;j<26;j++) res=std::min(res,ans[i][j]);
    printf("%lld\n",res);
    return 0;
}


Measured memory_bytes: 256
package main

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

func main() {
	fmt.Printf("%.10f\n", resolve(parseProblem(os.Stdin)))
}

func parseProblem(r io.Reader) (int, int, int, int) {
	const (
		initialBufSize = 100000
		maxBufSize     = 1000000
	)
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	a, b, h, m := scanInt(sc), scanInt(sc), scanInt(sc), scanInt(sc)
	return a, b, h, m
}

func resolve(a, b, h, m int) float64 {
	aR := 2 * math.Pi * (float64(h)/12.0 + float64(m)/(60.0*12))
	bR := 2 * math.Pi * (float64(m) / 60.0)
	dR := aR - bR
	dx := float64(b) - float64(a)*math.Cos(dR)
	dy := float64(a) * math.Sin(dR)
	return math.Sqrt(dx*dx + dy*dy)
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


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

using namespace std;

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

	vector<int> P(N);
	for (int i = 0; i < N; i++) {
		cin >> P.at(i);
	}

	int res = 1;
	int min = P.at(0);
	for (int i = 1; i < N; i++) {
		if (P.at(i) < min) {
			min = P.at(i);
			res += 1;
		}
	}

	cout << res << endl;
}


Measured memory_bytes: 1024
public class Hello
{
    public static void Main()
    {
        string [] inputs = System.Console.ReadLine().Split(' ');
        int a = int.Parse(inputs[0]);
        int b = int.Parse(inputs[1]);
        int c = (a * b);
        int d = (a + b) * 2;
        System.Console.WriteLine(c + " " + d);
    }
}


Measured memory_bytes: 9112
#include <stdio.h>

int main()
{
 char S[3];
 int i;
 
 
 scanf("%s", S);
 
 if(S[0]==S[1] && S[1]==S[2] && S[2]==S[0]){
 	printf("No\n");
 }else{
 	printf("Yes\n");
 }
 
 return 0;
}

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

using namespace std;
typedef long long ll;
const int maxn=2e5+5;
char s[maxn];
int main()
{
    scanf("%s",s);
    ll n=strlen(s);
    ll ans1=0,ans2=0;
    ll flag=0,flag2=0;
    ll sum=0;
    for(int i=0; i<n; i++)
    {
        ans1=0,ans2=0,flag=0,flag2=0;
        while(s[i]=='A')
        {
            flag=1;
            ans1++;
            i++;
        }
        if(flag)
        {
            while(s[i]=='B' && s[i+1]=='C')
            {
                ans2++;
                i+=2;
                flag2=1;
            }
            if(flag2)
            {
                sum+=ans1*ans2;
                while(ans1--)
                {
                    i--;
                    s[i]='A';
                }
                i--;
            }

        }
    }
    printf("%lld\n",sum);
    return 0;
}



Measured memory_bytes: 384
a_list = []
temp_min = 10
temp_sum = 0
[a_list.append(int(input())) for i in range(5)]
for i in a_list:
    if i%10 != 0:
        temp_min = min(i%10,temp_min)
        temp_sum += 10 - i%10
print(sum(a_list)+temp_sum - 10 + temp_min)

Measured memory_bytes: 2940
#include<stdio.h>
#define N 10000

int main(){

    int a,b,i,j,key,cnt = 0,S[N],T[N];

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

    scanf("%d",&b);
    for(i = 0;i < b;i++){
        scanf("%d",&T[i]);
    }
    for(i = 0;i < b;i++){
        key = T[i];
        for(j = 0;j < a;j++){
            if(key == S[j]){
                cnt++;
                break;
            }
        }
    }
    printf("%d\n",cnt);
    return 0;
}


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

typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<LL> vl;
typedef vector<vl> vvl;

double EPS = 1e-9;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};

#ifdef TESTING
  #define DEBUG fprintf(stderr,"====TESTING====\n")
  #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl
  #define debug(...) fprintf(stderr, __VA_ARGS__)
#else
  #define DEBUG 
  #define VALUE(x)
  #define debug(...)
#endif

#define FOR(a,b,c) for (int (a)=(b);(a)<(c);++(a))
#define FORN(a,b,c) for (int (a)=(b);(a)<=(c);++(a))
#define FORD(a,b,c) for (int (a)=(b);(a)>=(c);--(a))
#define FORSQ(a,b,c) for (int (a)=(b);(a)*(a)<=(c);++(a))
#define FORC(a,b,c) for (char (a)=(b);(a)<=(c);++(a))
#define FOREACH(a,b) for (auto &(a) : (b))
#define REP(i,n) FOR(i,0,n)
#define REPN(i,n) FORN(i,1,n)
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ALL(v) v.begin(),v.end()
#define ALLA(arr,sz) arr,arr+sz
#define SIZE(v) (int)v.size()
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr,sz) sort(ALLA(arr,sz))
#define REVERSEA(arr,sz) reverse(ALLA(arr,sz))
#define PERMUTE next_permutation
#define TC(t) while(t--)

inline string IntToString(LL a){
  char x[100];
  sprintf(x,"%lld",a); string s = x;
  return s;
}

inline LL StringToInt(string a){
  char x[100]; LL res;
  strcpy(x,a.c_str()); sscanf(x,"%lld",&res);
  return res;
}

inline string GetString(void){
  char x[1000005];
  scanf("%s",x); string s = x;
  return s;
}

inline string uppercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A';
  return s;
}

inline string lowercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a';
  return s;
}

inline void OPEN (string s) {
  #ifndef TESTING
  freopen ((s + ".in").c_str (), "r", stdin);
  freopen ((s + ".out").c_str (), "w", stdout);
  #endif
}

int main() 
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s; 
  cin >> s;
  if(s=="SUN")printf("7\n");
  if(s=="MON")printf("6\n");
  if(s=="TUE")printf("5\n");
  if(s=="WED")printf("4\n");
  if(s=="THU")printf("3\n");
  if(s=="FRI")printf("2\n");
  if(s=="SAT")printf("1\n");
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int ct[3][4005];
int main(){
    int n;
    scanf("%d",&n);
    string s;
    cin >> s;
    for (int i = 0; i < n; i++){
        if (s[i] == 'R') ct[0][i]++;
        if (s[i] == 'G') ct[1][i]++;
        if (s[i] == 'B') ct[2][i]++;
    }
    for (int i = n-1; i >= 0; i--){
        ct[0][i] += ct[0][i+1];
        ct[1][i] += ct[1][i+1];
        ct[2][i] += ct[2][i+1];
    }
    long long ans = 0;
    for (int i = 0; i < n; i++){
        for (int j = i+1; j < n; j++){
            if (s[i] != s[j]){
                char last = 'R'+'G'+'B'-s[i]-s[j];
                int id;
                if (last == 'R') id = 0;
                else if (last == 'G') id = 1;
                else if (last == 'B') id = 2;
                int forbidden = 2*j-i;
                ans += ct[id][j+1];
                if (s[forbidden] == last) ans--;
            }
        }
    }
    printf("%lld",ans);

}


Measured memory_bytes: 3808
char*w,*p;main(t,W){for(;scanf("%s%s",W,&t),t-'X';puts(""))for(w=W;*w;w+=*w==95){for(p=w;*++p&&*p-95&&*p&32;);putchar(t&1?*w++&~32:t&8?w-W?*w++&~32:*w++|32:w-W?95:*w++|32);for(;w<p;w++)putchar(*w|32);}exit(0);}

Measured memory_bytes: 0
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define INF 1e9
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

char C;

bool flag = false;

char bowels[5] = {'a','i','u','e','o'};

void solve(){
    for(int i = 0; i < 5; i++){
        if(C == bowels[i])
            flag = true;     
    }

    if(flag)
        cout << "vowel" << endl;
    else
        cout << "consonant" << endl;
}

int main(){
    cin >> C;

    solve();
}


Measured memory_bytes: 256