akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define si size()
#define bk back()
#define popb pop_back()
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define ump unordered_map
#define forl(i,a,n) for(int i=a;i<n;i++)
#define rfor(i,n,a) for(int i=n;i>=a;i--)
#define fore(i,a,n) for(int i=a;i<=n;i++)
#define len length()
double doINF = 1.0/0.0 ;
ostream_iterator <int> outp(cout," ");
inline ll modadd(ll n,ll m,ll mod){
    ll sum = ((n+m)%mod+mod)%mod;
    return sum;
} 
inline ll modsub(ll n,ll m, ll mod){
    ll diff = ((n-m+mod)%mod+mod)%mod;
    return diff;
}
inline ll modpro(ll n,ll m,ll mod){
    ll pro = ((n*m)%mod+mod)%mod;
    return pro;
}
inline ll pow(int x,int y){
    ll res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}
inline ll powmod(ll x,ll y,ll mod){
    ll res = 1;
    while (y > 0) {
        if (y & 1)
            res = modpro(res , x,mod);
        y = y >> 1;
        x = modpro(x , x,mod);
    }
    return res;
}
//ll min(ll a, ll b){
//    if(a>b){
//        return b;
//    }
//    return a;
//}
// 
//ll max(ll a, ll b){
//    if(a>b){
//        return a;
//    }
//    return b;
//}
bool pairdec(const pair<int,int> &a,  
               const pair<int,int> &b) 
{ 		if(a.fi!=b.fi)
       	return (a.fi> b.fi);
		else return a.se>b.se;  
} 

ll power(ll x, ll y, ll mod) 
{ 
    ll res = 1; 
    x = x%mod; 
    while (y > 0) { 
        if (y & 1) 
            res = (res * x) % mod; 
  
        y = y >> 1;
        x = (x * x) % mod; 
    } 
    return res; 
} 
ll modInverse(ll a, ll mod) 
{ 
    return  powmod(a, mod - 2, mod); 
} 
ll modFact(ll n, ll mod) 
{ 
    if (n >=mod) 
        return 0; 
  
    ll result = 1; 
    for (ll i = 1; i <= n; i++) 
        result = (result * i) %mod; 
  
    return result; 
} 

set<ll> primeFactors(ll n)  
{  
    set<ll>s;
    while (n % 2 == 0)  
    {  
       s.insert(2);
        n = n/2;  
    }  
  
    for (int i = 3; i <= sqrt(n); i = i + 2)  
    {  
    
        while (n % i == 0)  
        {  
           s.insert(i); 
            n = n/i;  
        }  
    }  
    if (n > 2) s.insert(n);
    return s;
}  
//cout<<setprecision(9)<<fixed<<sum<<endl; --- precision for double numbers
//copy(v.beg,v.en,outp);
ll N=1e9+7;
int main()
{
	int n;
	cin>>n;
	int arr[n];
	forl(i,0,n) cin>>arr[i];
	int ch=1;
	forl(i,0,n)
	{
		if(arr[i]%2==0)
		{
			if(arr[i]%3!=0 && arr[i]%5!=0) ch=0;
		} 
	}
	if(ch) cout<<"APPROVED"<<endl;
	else cout<<"DENIED"<<endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
	int n,sum=0,sum1=0,sum2=0;
	int a[3002];
	while (cin >> n)
	{
		sum = sum1 = sum2 = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			sum = sum + a[i];
		}
		cout << sum-n<<endl;
		
	}
	return 0;
}

Measured memory_bytes: 256
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
count = 0
for i in range(N):
    total = 0
    A = list(map(int,input().split()))
    for j in range(M):
        total += B[j]*A[j]
    if total+C > 0:
        count += 1
print(count)


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

public class Main {
  private static long solve(int n, int k, int[] hs) {
    Arrays.sort(hs);
    long sum = 0;
    for (int i = 0; i < n - k; i++) {
      sum += hs[i];
    }
    return sum;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int k = reader.nextInt();
    int[] hs = reader.nextInt(n);
    out.println(solve(n, k, hs));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


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

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;

int main() {
  ll N, M;
  cin >> N >> M;

  ll ans = 0;
  ll s = 0;
  map<ll, ll> m;
  m[0] = 1;
  for (int i = 0; i < N; i++) {
    ll temp;
    cin >> temp;
    s = (s + temp) % M;
    ans += m[s];
    m[s]++;
  }

  cout << ans << BR;
  return 0;
}

Measured memory_bytes: 4224
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int D;
    cin >> D;
    if(D==25) cout << "Christmas" << endl;
    else if(D==24) cout << "Christmas Eve" << endl;
    else if(D==23) cout << "Christmas Eve Eve" << endl;
    else if(D==22) cout << "Christmas Eve Eve Eve" << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  
  double P=0;
  rep(i, N) P+=A[i];
  
  int p = P/N;
  P /= N;
  if(P < p+0.5) P=p;
  else P=p+1;
    
  int Sum=0;
  rep(i, N) Sum+=(A[i]-P)*(A[i]-P);
  
  cout << Sum << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {

	int N;
	cin >> N;

	int a, b;

	 a = N / 4;
	 b = N / 7;

	int total;
	bool count = false;

	for (int i = 0; i <= a; ++i) {
		for (int j = 0; j <= b; ++j) {

			total = 4 * i + 7 * j;

			if (total == N)
				count = true;
		}
	}

	if (count==true)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;






}

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

#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>

using namespace std;

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

int main()
{
    int N,Q;
    //各テストケースについて
    while ( cin >> N >> Q )
    {
        if ( N == 0 && Q == 0) { break; }
        vector< vector<int> > members;
        int max_day=0;
        //各メンバーの情報について
        rep(n, N)
        {
            int m;
            cin >> m;
            vector<int> days;
            //各日にちに対して
            rep(i, m) 
            { 
                int tmp; 
                cin >> tmp; 
                days.push_back(tmp); 
                if( max_day < tmp ) { max_day = tmp; }
            }
            members.push_back(days);
        }

        vector<int> attend;
        attend.resize(max_day+1, 0);
        int index = 0;
        rep(i, max_day+1)
        {
            rep(j, N)
            {
                rep(h, members[j].size() )
                {
                    if( members[j][h] == i) { attend[i]++; }
                    if( attend[i] > attend[index] ) { index = i; }
                }
            }
        }
        //cout << "atend[]" << endl;
        //rep(i, attend.size() ) { cout << attend[i] << " "; }
        //cout << " " << endl; 

        sort(attend.rbegin(), attend.rend() );

        if ( attend[0] < Q) { index = 0; }
        cout <<  index << endl;
    }
    return 0;
}

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

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

void sort_s(vector<int>& w, vector<int>& s, vector<int>& v) {
	int n = w.size();
	vector<tuple<int, int, int>> swv;
	for (int i = 0; i < n; i++) {
		swv.emplace_back(s[i] + w[i], -v[i], w[i]);
	}
	sort(swv.begin(), swv.end());
	for (int i = 0; i < n; i++) {
		tie(s[i], v[i], w[i]) = swv[i];
		v[i] *= -1;
		s[i] -= w[i];
	}
}

const int MAX = 1e4;

int main()
{
	int N;
	cin >> N;
	vector<int> w(N), s(N), v(N);
	for (int i = 0; i < N; i++) {
		cin >> w[i] >> s[i] >> v[i];
	}
	sort_s(w, s, v);
	vector<ll> dp(MAX + 1);
	ll res = 0;
	for (int i = 0; i < N; i++) {
		for (int j = s[i]; j >= 0; j--) {
			res = max(res, dp[j] + v[i]);
			if (j + w[i] <= MAX) dp[j + w[i]] = max(dp[j + w[i]], dp[j] + v[i]);
		}
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>

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

	int n, w;
	cin >> n >> w;
	int value_max = n*1000+1;
	int n_max = n + 1;
	int dd[n_max][value_max];

	// initialize
	for (int nn = 0; nn < n_max; nn++) {
	  for (int v = 0; v < value_max; v++) {
	    dd[nn][v] = -1;
	  }
	}

	for (int nn = 0; nn <= n; nn++) {
	  dd[nn][0] = 0;
	}
	for (int nn = 1; nn < n_max; nn++) {
	  int www, nu;
	  cin >> www >> nu;
	  for (int v = 1; v < value_max; v++) {
	    // don't use item nn-1
	    int cur = -1;
	    if (dd[nn-1][v] != -1) {
	      cur = dd[nn-1][v];
	    }

	    // use item nn-1
	    if (nu <= v) {
	      int rem_v = v - nu;
	      if (dd[nn-1][rem_v] != -1) {
		int cand = dd[nn-1][rem_v] + www;
		if (cand <= w && (cur == -1 || cand < cur)) {
		  cur = cand;
		}
	      }
	    }

	    if (cur != -1) {
	      dd[nn][v] = cur;
	    }
	  }
	}
	bool done = false;
	for (int v = value_max-1; v >= 0; v--) {
	  if (done) {
	    break;
	  }
	  for (int nn = 0; nn < n_max; nn++) {
	    if (dd[nn][v] != -1) {
	      cout << v << '\n';
	      done = true;
	      break;
	    }
	  }
	}

	if (!done) {
	  cout << 0 << '\n';
	}
	return 0;
}


Measured memory_bytes: 39680
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{   
    string s; cin>>s;
    int ans=0;
    REP(i,s.size()){
        ans+=s[i]-'0';
    }
    if(ans==1) ans+=9;
    cout<<ans<<endl;
}


Measured memory_bytes: 256
// 23
#include <bits/stdc++.h>
using namespace std;
#define coutc "\033[48;5;196m\033[38;5;15m"
#define endc "\033[0m"
#define endl '\n'
#define M(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) \
  M(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rep4(_, x, n, s) \
  for (int _ = x; (s < 0) ? _ > n : _ < n; _ += s)
#define rep3(_, x, n) rep4(_, x, n, (x < n ? 1 : -1))
#define rep2(_, n) rep3(_, 0, n)
#define rep1(n) rep2(i, n)
#define fi first
#define se second
#define pb push_back
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define len(x) int(x.size())
#define lli __int128_t
#define li long long int
#define ld long double
#ifdef DEBUG
// 3
ostream &operator<<(ostream &o, pair<auto, auto> p) {
  return o << "(" << p.fi << ", " << p.se << ")";
}
// 4
ostream &operator<<(ostream &o, vector<auto> v) {
  rep(i, len(v)) o << setw(7) << right << v[i];
  return o << endc << endl << coutc;
}
// 4
ostream &operator<<(ostream &o, map<auto, auto> m) {
  for (auto &kv : m) o << kv;
  return o;
}
// 7
void debug(const auto &e, const auto &... r) {
  cerr << coutc << e;
  ((cerr << " " << r), ..., (cerr << endc << endl));
}
#else
#define debug(...)
#endif
// 3
void _main(int tc) {
  int n, k;
  cin >> n >> k;
  set<int> st;
  rep(n) {
    st.insert(i + 1);
  }
  rep(k) {
    int d;
    cin >> d;
    rep(j, d) {
      int a;
      cin >> a;
      st.erase(a);
    }
  }
  cout << len(st) << endl;
}
// 7
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0), exit(0);
  int tc;
  cin >> tc;
  rep(i, tc) _main(i + 1);
}

Measured memory_bytes: 3672
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        string s = sc.Next();

        string answer = s.Contains("a") && s.Contains("b") && s.Contains("c") ? "Yes" : "No";

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(auto i = (N) - 1; i >= 0; i -= 1)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define vrep(v,it) for(auto it = v.begin(); it != v.end(); it++)
#define vrepr(v,it) for(auto it = v.rbegin(); it != v.rend(); it++)
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define rand mtrand
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cout << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,...) do { cout << #v << " = "; array_out(v , ##__VA_ARGS__);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = 0x1FFFFFFFFFFFFFFFLL;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}

random_device seed_gen; mt19937_64 mtrand(seed_gen());
constexpr int MOD = 1000000007;
//////////////////////////////////////////

int main(){
  ini(N,x);
  vi a(N); in(a);

  sort(all(a));
  int ans = 0 , cur = 0;
  rep(i,N){
    cur += a[i];
    if(cur > x) break;
    ans++;
  }
  out(ans - (ans == N && cur!=x));
}

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

#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()





int main(){
  int A, B, C;
  cin >> A >> B >> C;

  bool flag = false;
  if(A == B || B == C || C == A){
    flag = true;
  }

  if(A == B && B == C){
    flag = false;
  }

  if (flag)
  {
    cout << "Yes" << endl;
  }else
  {
    cout << "No" << endl;
  }
  
  
}


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

int main() {
  int N,x=1,sum=0;
  cin>>N;
  vector<int> a(N);
  for(int i=0;i<N;i++)
    cin>>a[i];
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  for(int i=0;i<N;i++){
    sum+=a[i]*x;
    x*=-1;
  }
  cout<<sum<<endl;
}

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

int main(){
  long long x,k,d;
  cin >> x >> k >> d;
  x = abs(x);

  long long s = min(k,abs(x/d));
  k = -1*s+k;
  x = -1*s*d+x;
  if(k%2 > 0){
    cout << abs(x-d) << endl;
  } else {
    cout << x << endl;
  }
}

Measured memory_bytes: 3620
using System;

namespace abc148
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            var ab = Console.ReadLine().Split();
            var a = long.Parse(ab[0]);
            var b = long.Parse(ab[1]);

            var ans = a * b / gcd(a, b);
            Console.WriteLine(ans);
        }

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


Measured memory_bytes: 11092
#include <cstring>
#include <cstdint>
#include <iostream>
#include <string>
#include <memory>
#include <queue>
#include <limits>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <sstream>
#include <random>
#include <functional>
#include<algorithm>
using namespace std;

int main() {
	size_t N;
	int A;
	long long M = 1;
	long long m = 1;
	cin >> N;
	for (size_t i = 0; i< N; i++)
	{
		cin >> A;
		M *= 3;
		if ((A & 0x1) == 0x0) m *= 2;
	}
	cout << M - m;
	return 0;
}

Measured memory_bytes: 256
/* #                          */

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <deque>
#include <map>
#include <iomanip>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstring>
//#pragma warning(disable:4996)

using namespace std;


/** Type Define **/
typedef long long int           ll;
typedef pair<int, int>          pii;
typedef pair<ll, ll>            pll;
typedef vector<string>          vs;
typedef vector<bool>            vb;
typedef vector<int>             vi;
typedef vector<long long>		vl;
typedef vector<vi>              vvi;
typedef vector<vl>				vvl;
typedef vector<char>            vch;
#define		it(x)  x.begin() 
#define		all(x)  x.begin(), x.end()
#define		pb(x)   push_back(x)
constexpr int           inf = 0x3f3f3f3f;
constexpr long long 	INF = 9123456789123456789;
constexpr long long     MOD = 1000000007LL;
/*************************************************/
struct OptimizedDisjointSet {
    vector<int> parent, rank;
    OptimizedDisjointSet(int n) : parent(n), rank(n, 1) {
        for (int i = 0; i < n; ++i)
            parent[i] = i;
    }

    int find(int u) {
        if (u == parent[u]) return u;

        // 경로 압축 (path compression)
        // parent 를 찾아낸 루트로 아예 바꿔 버리면
        // find 연산 수행시 중복되는 연산을 줄여준다.
        // ( 다음번 동일한 find 연산 수행시 경로를 따라 올라갈 필요 없이 바로 
        // 루트를 찾을 수 있게 된다. )
        // 재귀적인 구현 덕분에 u 에서 루트까지 올라가는 경로 상에 있는
        // 모든 노드들에게도 경로 압축 최적화가 자동으로 수행된다. 
        return parent[u] = find(parent[u]);
    }

    void merge(int u, int v) {
        u = find(u); v = find(v);

        if (u == v) return;

        if (rank[u] > rank[v]) swap(u, v);
        parent[u] = v;
        //두 트리의 높이가 같은 경우에는 결과 트리의 rank 를 1 높혀준다.
        if (rank[u] == rank[v]) ++rank[v];
    }
};

int n, m, k;
vi ans, chk;
vi W;
void sol() {

}

int main() {
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cin.tie(nullptr);
    cin >> n >> m >> k;
    W.assign(n + 1, 0);
    chk.assign(n + 1, 0);
    ans.assign(n + 1, 0);
    OptimizedDisjointSet uf(n + 1);

    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        uf.merge(a, b);
        W[a]++, W[b]++;
    }

    for (int i = 1; i <= n; i++)
        chk[uf.find(i)]++;

    for (int i = 1; i <= n; i++)
        ans[i] = chk[uf.find(i)] - W[i] - 1;
        
    for (int i = 0; i < k; i++) {
        int c, d; cin >> c >> d;
        if (uf.find(c) == uf.find(d)) {

            ans[c]--; ans[d]--;
        }
    }

    for (int i = 1; i <= n; i++)
        cout << ans[i] << " ";
    cout << endl;

    return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lower_bound lowb
#define upper_bound upb
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
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;};



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

	int n, m;
	cin >> n >> m;
	cout << gcd(n, m) << endl;
	return 0;
}


Measured memory_bytes: 3100
#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n,x;
  cin>>n>>x;
  vll l(n);
  rep(i,n) cin>>l[i];
  ll ans=1;
  ll cu=0;
  rep(i,n){
    cu+=l[i];
    if(cu<=x) ans++;
  }
  COUT(ans);
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
using namespace std;
const long long MAXN = 2e5+5;
const long long F = (2e5) * (1e9);
int main()
{
    long long n;
	cin >> n;
	long long a[MAXN];
	long long sum[MAXN];
    sum[0] = 0;
    long long tot = 0;
    for(int i = 0;i < n;i++)
    {
        cin >> a[i];
        tot += a[i];
    }
    for(int i = 1;i < n;i++)
        sum[i] = sum[i - 1] + a[i - 1];
    long long Min = F;
    for(int i = 1;i < n;i++)
    {
        if(Min > abs(2 * sum[i] - tot))
            Min = abs(2 * sum[i] - tot);
    }
    cout << Min << endl;
    return 0;
}


Measured memory_bytes: 3328
n=int(input())
list_=[[[0 for x in range(10)] for y in range(3)] for z in range(4)]
for i in range(n):
    b,f,r,v=map(int,input().split())
    list_[b-1][f-1][r-1]+=v
count=0
for a in list_:
    for c in a:
        print(" ",end="")
        #join()はstr型にしないといけない
        print(" ".join(map(str,c)))
    if count!=3:
        print("####################")
    count+=1


Measured memory_bytes: 5608
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s,t;
  cin >> s >> t;
  
  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  reverse(t.begin(),t.end());
  
  cout << (s < t ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
string n;
int k;
ll dp[110][4][2];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	cin>>k;
	dp[0][0][1]=1;
	for(int i=0;i<n.length();i++){
		for(int j=0;j<=k;j++){
			if(n[i]=='0'){
				dp[i+1][j][1]+=dp[i][j][1];
			}else{
				dp[i+1][j][0]+=dp[i][j][1];
			}
			dp[i+1][j][0]+=dp[i][j][0];
			for(int l=1;l<10;l++){
				if(j>0){
					dp[i+1][j][0]+=dp[i][j-1][0];
					if(l<(n[i]-'0')){
						dp[i+1][j][0]+=dp[i][j-1][1];
					}else if(l==(n[i]-'0')){
						dp[i+1][j][1]+=dp[i][j-1][1];
					}
				}
			}
		}
	}
	cout<<dp[n.length()][k][0]+dp[n.length()][k][1]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define Nope {puts("No");continue;}
#define  Yep {puts("Yes");continue;}
using namespace std;
ll T,A,B,C,D;
ll exgcd(ll a,ll b,ll&x,ll&y) {
    if(b==0) {
        x=1,y=0;
        return a;
    }
    ll t=x,ret=exgcd(b,a%b,y,x);
    x=y,y=t-a/b*y;
    return ret;
}
int main() {
    scanf("%lld",&T);
    while(T--) {
        scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
        if(A<B) Nope;
        if(D<B) Nope;
        if(C+1>=B) Yep;
        /**
        此时有：A>=B D>=B C+1<B
        A-Bx+Dy==T（补完货还没有来买时）
        Bx-Dy=A-T
        A-C>Bx-Dy>A-B
        有C<T
        为什么T>C?
        如果有一天T<C,假设这是T<C的第一天（一定存在）
        那么前一天TT（补完货还没有来买时）一定大于C
        那么有C<TT<=TT-B+D(D>=B)=T<C,产生了矛盾
        而此时如果有B>T,那么一定会有第二天一早买不了的情况发生
        为什么一定会有
        */
        ll x,y,gcd;
        //gcd=exgcd(B,D,x,y);
        gcd=__gcd(B,D);
        //cout<<gcd<<endl;
        if((A-C-1)/gcd-(A-B)/gcd>0) Nope
        else Yep


    }
    return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::{cmp::Reverse, collections::*};

#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Chars, Usize1},
};

#[allow(unused_imports)]
use itertools::Itertools;

#[allow(unused_imports)]
use num::Integer;

#[fastout]
pub fn main() {
    input! {
        s: Chars,
    }
    let mut set = HashSet::new();
    set.insert('a');
    set.insert('b');
    set.insert('c');
    set.insert('d');
    set.insert('e');
    set.insert('f');
    set.insert('g');
    set.insert('h');
    set.insert('i');
    set.insert('j');
    set.insert('k');
    set.insert('l');
    set.insert('m');
    set.insert('n');
    set.insert('o');
    set.insert('p');
    set.insert('q');
    set.insert('r');
    set.insert('s');
    set.insert('t');
    set.insert('u');
    set.insert('v');
    set.insert('w');
    set.insert('x');
    set.insert('y');
    set.insert('z');
    for c in s {
        set.remove(&c);
    }
    println!(
        "{}",
        set.iter()
            .sorted()
            .next()
            .map(|c| c.to_string())
            .unwrap_or("None".to_string())
    );
}


Measured memory_bytes: 2612
moji = list(input())
length = len(moji)
count = 0
m = n = 0

for i in range(int(length/2-1)):
    if moji[i] != moji[length-i-1]:
        count += 1
k = (length-1)//2-1
for i in range(int((length-1)/2-1)):
    if moji[i] != moji[k-n]:
        count += 1
    n += 1
n = (length+3-1)/2 
for n in range(int(length-1)):
    if moji[n] != moji[length-1-m]:
        count += 1
    m += 1
if count == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
from collections import deque
import math
h, w, k = [int(item) for item in input().split()]
field = ["O" * (w+2)]
for i in range(h):
    line = "O" + input().rstrip() + "O"
    field.append(line)
    if "S" in line:
        start = [i+1, line.index("S"), 0]
field.append("O" * (w+2))

dq = deque()
dq.append(start)
visited = [[0] * (w+2) for _ in range(h+2)]
visited[start[0]][start[1]] = 1
closest = 10**3 
while dq:
    x, y, d = dq.popleft()
    closest = min(closest, min(x-1, y-1, h-x, w-y))
    if closest == 0:
        break
    d += 1
    for dx, dy in [[1,0], [0,1], [-1,0], [0,-1]]:
        if field[x+dx][y+dy] == "." and visited[x+dx][y+dy] == 0 and d <= k:
            dq.append([x+dx, y+dy, d])
            visited[x+dx][y+dy] = 1
print(1 + int(math.ceil(closest / k)))

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

int main() {
  string S;
  cin >> S;
  
  reverse(S.begin(), S.end());
  string T;
  vector<string> div = {"dream", "dreamer", "erase", "eraser"};
  
  for(int i = 0; i < 4; i++){
   reverse(div.at(i).begin(), div.at(i).end());
  }
  
  bool can = true;
  for(int i = 0; i < S.size();){
    bool ok = false;
    for(int j = 0; j < 4; j++){
      string a = div.at(j);
      if(S.substr(i, a.size()) == a){
        ok = true;
        i += a.size();
      }
    }
    
    if(!ok){
      can = false;
      break;
    }
  }
  
  if(can) cout << "YES" << endl;
  else cout << "NO" << endl;
  
  
}

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

int main(){
  long a, b;
  cin >> a >> b;
  if(a*b<=0)cout << "Zero\n";
  else if(a>0)cout << "Positive\n";
  else if((b-a+1)%2==0)cout << "Positive\n";
  else cout << "Negative\n";
  return 0;
}

Measured memory_bytes: 256
n = int(input())
lis = list(map(int, input().split()))
search_target = 1
founded = 0
for li in lis:
    #search_target = 1
    if li == search_target:
        search_target += 1
        founded = li
        continue
    else:
        continue
if founded == 0:
    print(-1)
else:
    print(n-founded)

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

int main(){
  string a;
  cin >>a;
  
  if(a[0] != 'A'){
    cout << "WA" << endl;
    
    return 0;
  }
  int d;
  d = 0;
 
  
  
  for(int i =1; i<a.size();i++){
    if(isupper(a[i])){
      
    if( i==1||i==a.size()-1||a[i] !='C'){
      cout << "WA" <<endl;
      
      return 0;
    }
    d++;
  }
  }
    if(d !=1){
      cout << "WA" << endl;
      
      return 0;
    
       }
     cout << "AC" <<endl;
       }


Measured memory_bytes: 256
s = input()

result = 10 ** 9
# 0始まりで揃える場合
tmp = 0
for i, c in enumerate(s):
  if i & 1:
    if c == '0':
      tmp += 1
  else:
    if c == '1':
      tmp += 1
      
result = min(result, tmp)
tmp = 0

# 1始まりで揃える場合
for i, c in enumerate(s):
  if i & 1:
    if c == '1':
      tmp += 1
  else:
    if c == '0':
      tmp += 1
      
result = min(result, tmp)
print(result)

Measured memory_bytes: 9196
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int main()
{
	long long int n, k;
	cin >> n >> k;
	long long int a[100001], b[100001];
	for(int i = 0; i < n; i++){
		cin >> a[i] >> b[i];
	}
	long long int maxketa = 30;
	while(k < (long long int)(1 << maxketa)){
		maxketa--;
	}
	long long int nownum = (long long int)(1 << (maxketa + 1)) - 1;
	long long int ans = 0;
	for(int i = 0; i < n; i++){
		if((k | a[i]) == k) ans += b[i];
	}
	for(int i = maxketa; i >= 0; i--){
		nownum -= (long long int)(1 << i);
		// cout << i << " " << nownum << endl;
		if((k & (long long int)(1 << i)) == 0 && i > 0) continue;
		long long int result = 0;
		for(int j = 0; j < n; j++){
			if((a[j] | nownum) == nownum) result += b[j];
		}
		// cout << result << endl;
		ans = max(ans, result);
		nownum += (long long int)(1 << i);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define NMAX 1001
#define MOD 1000000007

using namespace std;

int n, m;
int cost[NMAX][NMAX];
string s[NMAX];

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

    cost[0][0] = 1;
    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < m ; j++){
            if(s[i][j] == '.'){
                if(i >= 1){
                    cost[i][j] = (cost[i][j] + cost[i - 1][j]) % MOD;
                }
                if(j >= 1){
                    cost[i][j] = (cost[i][j] + cost[i][j - 1]) % MOD;
                }
            }
        }
    }
    cout<<cost[n - 1][m - 1];
    return 0;
}


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

int main()
{
	int A;
	int B;

	cin >> A >> B;

	int Max;

	Max = max(2 * A - 1, 2 * B - 1);

	Max = max(Max, A + B);

	cout << Max << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int h,w;
int num[50];
int main()
{
    string a;
    cin>>a;
    memset(num,0,sizeof(num));
    for(int i=0;i<a.size();i++)
    {
        num[a[i]-'a'+1]++;
    }
    bool flag=1;
    for(int i=1;i<=26;i++)
    {
        if(num[i]>=2)
            flag=0;
    }
    if(flag)
        cout << "yes" <<endl;
    else
        cout << "no" <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 X, N;
  std::cin >> X >> N;
  std::unordered_set<i64> p;
  std::copy_n(std::istream_iterator<i64>(std::cin), N, std::inserter(p, p.end()));

  i64 answer;
  i64 min_diff = std::numeric_limits<i64>::max();
  for (i64 i = 0; i <= 101; ++i) {
    if (p.find(i) == p.end() && std::abs(i - X) < min_diff) {
      answer = i;
      min_diff = std::abs(i - X);
    }
  }

  std::cout << answer << std::endl;
  return 0;
}

Measured memory_bytes: 3632
using System;
using System.Linq;

namespace ProblemC
{
    class Program
    {
        static void Main()
        {
            var temp = Console.ReadLine().Split(' ').ToArray();
            long A = long.Parse(temp[0]);
            double B = double.Parse(temp[1]);
            long LB = (long)(B * 100.000001);
            long ans = LB * A ;
            Console.WriteLine(ans / 100);
        }
    }
}


Measured memory_bytes: 28000
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double  ld;
#define pii pair<ll,ll> 
#define vi vector< ll > 
#define vvi vector< vi > 
#define vpi vector< pii > 
#define vvpi vector< vpi > 
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define test(t) ll t;cin>>t;while(t--)
#define mem(a,b) memset(a,b,sizeof(a))
#define inn freopen("input.txt", "r", stdin)
#define outt freopen("output.txt", "w", stdout)
#define all(arr) arr.begin(),arr.end()
#define fr(i,n) for(ll i=0;i<(n);++i)
#define rep(i,a,b) for(ll i=a;i<=b;++i)
#define per(i,a,b) for(ll i=a;i>=b;i--)
#define remin(a,b) (a=min((a),(b)))
#define remax(a,b) (a=max((a),(b)))
ll power(ll x,ll y){ll res = 1;while(y){if(y&1) res = (res*x)%mod;y=y/2,x=(x*x)%mod;}return res%mod;}
signed main()
{
    fast;
    ll n,k;
    cin>>n>>k;
    ll arr[n];
    ll i,j;
    for(i=0;i<n;i++)
        cin>>arr[i];
    ll ans = 0;
    ll p = (k*(k-1))/2;
    p = p%mod;
    for(i=0;i<n;i++)
    {
        ll x = 0,y = 0;
        for(j=i+1;j<n;j++)
        {
            if(arr[i]>arr[j])
                x++;
        }
        for(j=0;j<n;j++)
        {
            if(arr[i]>arr[j])
                y++;
        }
        ans = ans + k*x%mod+p*y%mod;
        ans%=mod;
    }
    cout<<ans;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc157/tasks/abc157_b

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ll size = 3;

  VVL as(size, VL(size));
  rep(h, size) rep(w, size) cin >> as[h][w];

  ll N;
  cin >> N;

  V<V<bool>> done(size, V<bool>(size));

  rep(i, N) {
    ll b;
    cin >> b;

    rep(h, size) rep(w, size) {
      if (as[h][w] == b) done[h][w] = true;
    }
  }

  string Yes = "Yes";
  string No = "No";

  rep(h, size) {
    ll ok = true;

    rep(w, size) if (!done[h][w]) ok = false;

    if (ok) drop(Yes);
  }

  rep(w, size) {
    ll ok = true;

    rep(h, size) if (!done[h][w]) ok = false;

    if (ok) drop(Yes);
  }

  {
    ll ok = true;

    rep(i, size) if (!done[i][i]) ok = false;

    if (ok) drop(Yes);
  }

  {
    ll ok = true;

    rep(i, size) if (!done[i][size - 1 - i]) ok = false;

    if (ok) drop(Yes);
  }

  cout << No << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


Measured memory_bytes: 256
// 0010
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
    int n;
    double x, y, x1, x2, x3, y1, y2, y3, a1, a2, b1, b2, c1, c2;
    scanf("%d", &n);
    for( ; n > 0; n--) {
	scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3);
	a1=2*(x2-x1),b1=2*(y2-y1);
	c1=x1*x1-x2*x2+y1*y1-y2*y2;
	a2=2*(x3-x1),b2=2*(y3-y1);
	c2=x1*x1-x3*x3+y1*y1-y3*y3;
	x=(b1*c2-b2*c1)/(a1*b2-a2*b1);
	y=(c1*a2-c2*a1)/(a1*b2-a2*b1);
	printf("%.3lf %.3lf %.3lf\n", x, y, hypot(x - x1, y - y1));
    }

    return 0;
}

Measured memory_bytes: 1096
#include <bits/stdc++.h>
#define ll long long
using namespace std;
map<int,int>seen;
int main()
{
    int a,b,c;cin>>a>>b>>c;
    seen[a]++;
    seen[b]++;
    seen[c]++;
    if(seen[a]==1)cout<<a<<endl;
    else if(seen[b]==1)cout<<b<<endl;
    else cout<<c<<endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i,n)        for(int i=0; i<(int)(n); i++)
int main() {
  int a,c;cin>>a>>c;
  vector<string>b(a);
  rep(i,a)cin>>b[i];
  	sort(b.begin(), b.end());
  rep(i,a){
    cout<<b[i];
  }
}

Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int v=sc.nextInt(), e=sc.nextInt();
        Node[] nodes=new Node[v];
        for(int i=0;i<v;i++) nodes[i]=new Node(i);
        for(int i=0;i<e;i++){
            addEdge(sc.nextInt(), sc.nextInt(), sc.nextLong(), nodes);
        }
        sc.close();
        long ans=fordFulkerson(0, v-1, v, nodes);
        System.out.println(ans); 
    }

    static void addEdge(int fr, int to, long cap, Node[] nodes) {
        nodes[fr].edges.add(new Edge(to, cap, nodes[to].edges.size()));
        nodes[to].edges.add(new Edge(fr, 0, nodes[fr].edges.size() - 1));
    }

    static long fordFulkerson(int s, int t, int n, Node[] nodes) {
        long flow = 0;
        boolean[] used;
        while (true) {
            used = new boolean[n];
            long f = dfs(s, t, nodes, Long.MAX_VALUE, used);
            flow+=f;
            if(f<=0) break;
        }
        return flow;
    }

    private static long dfs(int now, int t, Node[] nodes, long f, boolean[] used) {
        if (now == t) return f;
        used[now]=true;
        for (int i = 0; i < nodes[now].edges.size(); i++) {
            Edge e = nodes[now].edges.get(i);
            if (!used[e.to] && e.cap > 0) {
                long d = dfs(e.to, t, nodes, Math.min(f, e.cap), used);
                if (d > 0) {
                    e.cap -= d;
                    nodes[e.to].edges.get(e.rev).cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

    static class Node {
        int id;
        ArrayList<Edge> edges;

        Node(int id) {
            this.id = id;
            edges = new ArrayList<>();
        }

        @Override
        public boolean equals(Object o) {
            if (!(o instanceof Node))
                return false;
            Node n = (Node) o;
            if (n.id == id)
                return true;
            else
                return false;
        }

        @Override
        public int hashCode() {
            return id;
        }
    }

    static class Edge {
        int to;
        long cap;
        int rev;

        Edge(int to, long cap, int rev) {
            this.to = to;
            this.cap = cap;
            this.rev = rev;
        }
    }
}




Measured memory_bytes: 35392
no = list(map(int, input().split()))
no.sort()
a = no[0]
b = no[1] 
c = no[2]
cnt = 0
if a == b:
    print(int(c-a))
elif a%2 != b%2 and a%2 == c%2:
    print(int(1+(c-b)+(b+1-a)/2))
elif a%2 != b%2 and a%2 != c%2:
    print(int(1+(c-b)/2+(c+1-a)/2))
elif a%2 == b%2 and b%2 == c%2:
    print(int((c-b)/2+(c-a)/2))
elif a%2 == b%2 and b%2 != c%2:
    print(int(c-b+(c-(a+c-b))/2))

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1; 
    for(int T = 0; T < t ; T++){
        ll n, ans = 0;
        cin >> n;
        ll a[n];
        int  b[1000001] = {0};
        for(int i = 0 ; i < n ; i++){
            cin >> a[i];
        }
        sort(a, a + n);
        for(int i = 1; i < n; i++){
            if(a[i] == a[i- 1])
                b[a[i]] = 1;
        }
        for(int i =0; i < n; i++){
            if(b[a[i]] != 1)
                ans++;
            if(a[i] != a[i - 1]){
                for(int j = 2*a[i]; j <= 1000000; j += a[i]){
                    if(b[j] == 0)
                        b[j] = 1;
                }
            }
        }
        std::cout << ans << std::endl;
    }
    return 0;
}

Measured memory_bytes: 9096
#include<stdio.h>

int main()
{
	int n;
	int i;
	int loan=100000;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		loan+=(loan/20);
		if((loan%1000)>0){
			loan+=(1000-loan%1000);
		}
	}
	printf("%d\n",loan);
	return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
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; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

const int MOD = 1000000007;

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

signed main() {
    SS(ll,a,b,c,k)
    k%2==0?p(a-b):p(b-a);
}

Measured memory_bytes: 256