akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//https://www.creativ.xyz/dump-cpp-652/
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
 
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

#ifdef DEBUG_
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif

signed main(void) { cin.tie(0); ios::sync_with_stdio(false);
    int n; cin>>n;
    vector <int> a(n);
    rep(i,n) cin>>a[i]; 
    int now = INF;
    int ans = 0;

    rep(i,n){
        if(chmin(now, a[i])){
ans++;
        }
    }
    cout<<ans<<endl;
}

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

using u64 = std::uint64_t;
constexpr u64 inf = std::numeric_limits<u64>::max();

#define REP(i, n) for (u64 i = 0; i < (n); ++i)

namespace io {
  constexpr int is = 1 << 17;
  char ib[is], *ip = ib + is, it;
  inline char getc() {
    if (ip == ib + is) { read(STDIN_FILENO, ib, is); ip = ib; }
    return *ip++;
  }
  inline u64 scan() {
    u64 r = 0;
    if (ip + 16 > ib + is) while ((it = getc()) & 16) r = r * 10 + it - '0';
    else while ((it = *ip++) & 16) r = r * 10 + it - '0';
    return r;
  }
  constexpr int os = 1 << 17;
  char ob[os], *op = ob, ot;
  inline void putc(const char c) {
    *op++ = c;
    if (op == ob + os) { write(STDOUT_FILENO, ob, os); op = ob; }
  }
  /* x shoud be greater than or equal to zero */
  inline void print(u64 x) {
    char d[20];
    int i = 0;
    while (true) {
      d[i] = x % 10 + 48;
      x /= 10;
      ++i;
      if (x <= 0) break;
    }
    while (i--) {
      putc(d[i]);
    }
  }
  inline void flush() {
    write(STDOUT_FILENO, ob, op - ob);
  }
}

using P = pair<u64, u64>;

u64 collect(const vector<vector<u64>> &G, const vector<u64> &H, u64 u, u64 v, u64 p) {
  if (u == v) return 0;
  for (auto e : G[u]) {
    u64 t = H[e] ^ u;
    if (t == p) continue;
    u64 s = collect(G, H, t, v, u);
    if (s != inf) {
      return s | (1ULL << e);
    }
  }
  return inf;
}

signed main() {
  u64 n = io::scan();
  auto G = vector<vector<u64>>(n);
  auto H = vector<u64>(n);
  REP(i, n - 1) {
    u64 a = io::scan() - 1;
    u64 b = io::scan() - 1;
    G[a].push_back(i);
    G[b].push_back(i);
    H[i] = a ^ b;
  }
  u64 m = io::scan();
  auto mask = vector<u64>(1ULL << m);
  REP(j, m) {
    u64 u = io::scan() - 1;
    u64 v = io::scan() - 1;
    mask[1ULL << j] = collect(G, H, u, v, -1);
  }
  u64 ans = 1ULL << (n - 1);
  for (u64 s = 1; s < (1ULL << m); ++s) {
    u64 d = s & -s;
    mask[s] = mask[s ^ d] | mask[d];
    if (__builtin_parityll(s)) {
      ans -= 1ULL << (n - 1 - __builtin_popcountll(mask[s]));
    } else {
      ans += 1ULL << (n - 1 - __builtin_popcountll(mask[s]));
    }
  }
  io::print(ans);
  io::flush();
}


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

signed main(void)
{
	string w;
	map<char, int> mp;
	cin >> w;
	rep(i, w.size())
	{
		mp[w[i]]++;
	}
	for (auto p : mp)
	{
		if (p.second % 2 != 0)
		{
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}


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


#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

const int N = 1e6 + 10;

int n;
string s;

int ar[N];
int ada[3];
int ans = 0;

int fac[N];

int comb(int n, int k){
    int atas = fac[n];
    int bawah = fac[k] + fac[n - k];

    return (atas <= bawah);
}

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

    cin >> n;
    cin >> s;

    fac[0] = 0;
    for (int i=1;i<=n;i++){
        int p = 0;
        int tm = i;
        while (tm % 2 == 0){
            tm /= 2;
            p++;
        }
        fac[i] = fac[i - 1] + p;
    }

    for (int i=1;i<=n;i++){
        ar[i] = s[i - 1] - '1';
        ada[ar[i]]++;
    }

    if (ada[1] && ada[2] && !ada[0]){
        for (int i=1;i<=n;i++){
            ar[i]--;
        }
        ada[0] = 1;
        ada[1] = 1;
        ada[2] = 0;
    }

    if (ada[0] && ada[1] && ada[2]){
        for (int i=1;i<=n;i++){
            ans += ar[i] * comb(n - 1, i - 1);
        }
        ans %= 2;
    } else if (ada[0] && ada[2]){
        for (int i=1;i<=n;i++){
            ar[i] /= 2;
            ans += ar[i] * comb(n - 1, i - 1);
        }
        ans %= 2;
        if (ans) ans = 2;
    } else if (ada[0] && ada[1]){
        for (int i=1;i<=n;i++){
            ans += ar[i] * comb(n - 1, i - 1);
        }
        ans %= 2;
    } else ans = 0;

    cout << ans << el;

    return 0;
}

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

int main() {
	int n, cou = 1;
	char str[100001];
	cin >> n >> str;

	for (int i = 0; i < n - 1; ++i)
		if (str[i] != str[i + 1])
			cou++;

	cout << cou << endl;
	return 0;
}

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

using namespace std;

#define REP(var, n)  for (decltype(n) var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<decltype(var)>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

#define all(c) begin(c),end(c)

template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}


auto solve() {
    int N, L;
    cin >> N >> L;
    vi a(N);
    int prev = 0;
    bool ok = false;
    int pos = -1;
    REP(i, N) {
        cin >> a[i];
        if (i != 0 && a[i] + prev >= L) {
            ok = true;
            pos = i;
        }
        prev = a[i];
    }

    if (ok) {
        cout << "Possible" << endl;
        FOR(i, 1, pos) {
            cout << i << endl;
        }
        RFOR(i, pos-1, N) {
            cout << i << endl;
        }
    } else {
        cout << "Impossible" << endl;
    }

}

int main() {
//    cout << solve() << endl;
    solve();
    return 0;
}


Measured memory_bytes: 1280
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
//#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int INF = 1e8;

int H, W;
vector<string>field;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
int cnt;
void dfs(int x, int y) {
	field[x][y] = '.';
	cnt++;
	for (int i = 0; i < 4; i++) {
		int nx = x + dx[i];
		int ny = y + dy[i];
		if (0 <= nx && nx < H && 0 <= ny && ny < W && field[nx][ny] == '#')dfs(nx, ny);
	}
	return;
}

signed main() {
	cin >> H >> W;
	rep(i, H) {
		string S;
		cin >> S;
		field.push_back(S);
	}
	rep(i, H)rep(j, W) {
		cnt = 0;
		if (field[i][j] == '.')continue;
		dfs(i, j);
		if (cnt == 1) {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int x = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		
		if(a >= b) {
			System.out.println("delicious");
		}
		else if(a < b && a + x >= b) {
			System.out.println("safe");
		}
		else {
			System.out.println("dangerous");
		}

	}

}


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

const long long m = 1e12;

int main() {
    long long n, ans;
    cin >> n;
    for(int i = sqrt(n); i > 0; --i)
        if(n % i == 0) {
            cout << (i + (n / i) - 2) << endl;
            break;
        }
    return 0;
}

Measured memory_bytes: 3648
M, D = map(int, input().split())

ans = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        d_10 = d // 10
        d_1 = d % 10
        if d_10 < 2 or d_1 < 2:
            continue
        if d_10 * d_1 == m:
            ans += 1

print(ans)


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

int main(){
    int n;
    long long l[2];
    cin >> n;
    vector<long long> A(n);
    for (int i = 0; i < n; i++) {
        cin >> A[i];
    }
    sort(A.rbegin(), A.rend());
    for (int i = 0; i < 2; i++) {
        auto itr = adjacent_find(A.begin(), A.end());
        if(itr == A.end()){
            cout << 0 << endl;
            return 0;
        }
        else {
            int index = distance(A.begin(), itr);
            l[i] = A[index];
            for (int _ = 0; _ < 2; _++) {
                A.erase(A.begin() + index);
            }
        }
    }
    cout << l[0] * l[1] << endl;
    return 0;
}


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

int gcd(int a, int b)
{
  if (b == 0)
  {
    return a;
  }

  return gcd(b, a % b);
}

int main()
{

  int N, X;
  cin >> N >> X;
  int x[N];
  // vector<int> x;

  int code = 0;
  int diff[N];

  for (int i = 0; i < N; i++)
  {
    cin >> x[i];
    diff[i] = abs(X - x[i]);
  }

  if (N == 1)
  {
    cout << diff[0];
    return 0;
  }

  int step = 0;
  for (int i = 0; i < N - 1; i++)
  {
    if (step == 0)
    {
      step = gcd(diff[i], diff[i + 1]);
    }
    else
    {
      step = gcd(step, diff[i + 1]);
    }
  }

  cout << step;

  return 0;
}

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

using namespace std;
using ll = long long int;

int main()
{
    ll a, b;
    cin >> a >> b;
    if(a < b)
    {
        ll k = (b + a) / 2;
        if((b + a) % 2 != 0)
        {
            cout << "IMPOSSIBLE" << endl;
        }else{
            cout << k << endl;
        }
    }else{
        ll k = (a + b) / 2;
        if((a + b) % 2 != 0)
        {
            cout << "IMPOSSIBLE" << endl;
        }else{
            cout << k << endl;
        }
    }
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main()
{
  string s;
  cin>>s;
  int n=s.size();
  string ans="yes";
  REP(i,n)
  {
      for(int j=i+1; j<n; j++)
      {
          if(s[i]==s[j]) ans="no";
      }
  }
  cout<<ans<<endl;
}


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

using namespace std;

#define debug(x) cout << #x << "::" << x << endl;
#define debug2(x, y) cout << #x << "::" << x << " " << #y << "::" << y << endl;
#define debug3(x, y, z) cout << #x << "::" << x << " " << #y << "::" << y <<" "<< #z << "::" << z << endl;

#define For(i, a, b) for (int i = a; i < b; i++)

typedef long long ll;
const ll mod = 1e9 + 7;
const int MAX = 5 * 1e3 + 5;
typedef pair<int, int> pii;

void add(ll &a, ll b)
{
    a = (a + b) % mod;
    if (a < 0) a += mod;
}

int main() {

    string s1,s2;
    cin>>s1>>s2;

    int n1 = s1.length();
    int n2 = s2.length();

    vector<vector<int>> dp(n1+1,vector<int>(n2+1));

    For(i,1,n1+1){
        For(j,1,n2+1){
            if(s1[i-1] == s2[j-1]) dp[i][j] = 1 + dp[i-1][j-1];
            else dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
        }
    }

    string ans = "";

    while(n1 >= 1 && n2 >= 1) {
        if(s1[n1-1] == s2[n2 - 1]){
            ans+=s1[n1-1];
            n1--;
            n2--;
        }else if(dp[n1-1][n2] >= dp[n1][n2-1]) {
            n1--;
        }else {
            n2--;
        }
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<endl;

    return 0;

}


Measured memory_bytes: 35584
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mInt = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000



int main(){
	
	string S;
	cin>>S;
	
	vector<int> SA = suffix_array(S);
	vector<int> LA = lcp_array(S,SA);
	
	long long ans = 0LL;
	ans += S.size()-SA[0];
	rep(i,LA.size()){
		ans += S.size()-SA[i+1]-LA[i];
	}
	
	cout<<ans<<endl;
	
    return 0;
}

Measured memory_bytes: 15588
//includes
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#include<assert.h>
#include<cstring>
#include<unordered_map>
#include<bitset>

//macros and consts
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define FORE(i,a) for(auto &i : a)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define accm accumulate
#define Fi first
#define Se second
#define INF 1e9
#define llINF (1LL<<60)
#define mINF -1e9
#define mllINF -(1LL<<60)
#define endl "\n"
#define CONT continue
#define BRK break
#define modulo(n, m) (((n)%(m)+(m))%m)

//shorter types
using namespace std;
using ll = long long;
using vi = std::vector<int>;
using vc = std::vector<char>;
using vll = std::vector<long long>;
using vs = std::vector<string>;
using Mi = map<int,int>;
using Mll = map<ll,ll>;
using UMi = unordered_map<int,int>;
using UMll = unordered_map<ll,ll>;
using Pi = pair<int,int>;
using Pll = pair<ll,ll>;
using vPi = vector<Pi>;
using vPll = vector<Pll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pqgi = priority_queue<int,vector<int>,greater<int>>;
using pqsi = priority_queue<int,vector<int>,less<int>>;
using pqgll = priority_queue<int,vector<int>,greater<int>>;
using pssll = priority_queue<int,vector<int>,less<int>>;
template<class T>
using vec = vector<T>;
#define int long long


int gcd(int a, int b){
	if(a == 0){
		return b;
	}
	return gcd(b % a,a);
}

int findlcm(vector<int> arr, int n){
	int ans = arr[0];
	for(int i = 1 ; i < n ; i++){
		ans = (arr[i] * ans) / gcd(arr[i],ans);
	}
	return ans;
}
//here begins your code
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  vector<int> arr;
  arr.resize(2);
  cin >> arr[0] >> arr[1];

  cout << findlcm(arr,2) << endl;

  //check types
  //do not eb if you resize
  //resize before you access by idx
  return 0;
} 

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

#define fi first
#define se second
#define inf 0x3f3f3f3f
#define llinf 0x3f3f3f3f3f3f3f3f

using namespace std;
using ll = long long;
using pi = pair<int, int>;
using pll = pair<ll, ll>;

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

	int n, m;
	cin>>n>>m;
	vector<ll> h(n+1);
	for (int i = 1; i <= n; ++i)
		cin>>h[i];
	vector<vector<int>> con(n+1);
	for (int i = 1; i <= m; ++i)
	{
		int a, b;
		cin>>a>>b;
		con[a].push_back(b);
		con[b].push_back(a);
	}

	int good = 0;
	for (int i = 1; i <= n; ++i)
	{
		bool isgood = true;
		for (auto j : con[i])
			if (h[j] >= h[i])
				isgood = false;
		if (isgood)
			++good;
	}
	cout<<good<<'\n';

	return 0;
}


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

int main() {
	int a,b;
	cin >>a>>b;
	string ans;
	if (a == b) {

		ans = "Draw";
	}
	else if(a==1)	
	{
		ans = "Alice";
	}
	
		else	if ( b==1) {
			ans = "Bob";
		}
		else if (a < b) {
		ans = "Bob";
	}
		else {
		ans = "Alice";
	}
	
	cout << ans << endl;
}

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

int main() {
  std::string s; std::cin >> s;
  int l = s.size();
  std::string rs(s.rbegin(), s.rend());
  bool is_palindrome = true;
  if (s != rs) is_palindrome = false;
  
  std::string sub_s1 = s.substr(0, (l-1)/2);
  std::string sub_rs1 = rs.substr((l+1)/2, (l-1)/2);
  if (sub_s1 != sub_rs1) is_palindrome = false;
  
  std::string sub_s2 = s.substr((l+1)/2, (l-1)/2);
  std::string sub_rs2 = rs.substr(0, (l-1)/2);
  if (sub_s2 != sub_rs2) is_palindrome = false;
  
  if (is_palindrome) std::cout << "Yes" << std::endl;
  else std::cout << "No" << std::endl;
  return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>  // clang-format off
using namespace std;
using Int = long long;
#define REP2(i, n) for (Int i = 0, max_i = (n); i < max_i; i++)
#define REP3(i, a, b) for (Int i = (a), max_i = (b); i < max_i; i++)
#define OVERLOAD2(_1, _2, _3, name, ...) name
#define REP(...) OVERLOAD2(__VA_ARGS__, REP3, REP2)(__VA_ARGS__)
struct SetupIO { SetupIO() { cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(13); } } setup_io;
#ifndef _MY_DEBUG
#define dump(...)
#endif  // clang-format on

/**
 *    author:  knshnb
 *    created: Mon Feb 10 22:50:13 JST 2020
 **/

template <class T> inline bool chmin(T& a, const T& b) {
    if (a <= b) return false;
    a = b;
    return true;
}
template <class T> inline bool chmax(T& a, const T& b) {
    if (a >= b) return false;
    a = b;
    return true;
}

const Int K = 1e4;
signed main() {
    Int H, n;
    cin >> H >> n;
    vector<Int> a(n), b(n);
    REP(i, n) cin >> a[i] >> b[i];
    vector<Int> dp(2 * K + 1, 1e18);
    dp[0] = 0;
    REP(i, n) {
        REP(j, 2 * K + 1) {
            if (j - a[i] >= 0) chmin(dp[j], dp[j - a[i]] + b[i]);
        }
    }
    cout << *min_element(dp.begin() + H, dp.end()) << endl;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main{
	static  int c=1;
	public static void main(String[] args) {
		Scanner stdin =new Scanner(System.in);
		String s[]=new String[3];
		int i,j;
		for(i=0;i<3;i++){
				s[i]=stdin.next();
			}
		for(i=0;i<3;i++){
			char cc[]=s[i].toCharArray();
			System.out.print(cc[i]);
		}
	}
}


Measured memory_bytes: 21844
import fractions

a,b,c,d = map(int, input().split())
def sakana(x):
    e = (a-1)//x
    f = b//x
    g = f - e
    return g
m = sakana(c)
n = sakana(d)
o = sakana(c*d//fractions.gcd(c,d))
print(b-a+1-(m+n-o))


Measured memory_bytes: 5052
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		//標準入力受け取り////////////////////////////////
		String[] nandqueue = scan.nextLine().split(" ");
		int N = Integer.parseInt(nandqueue[0]); //プロセスの数受け取り
		int queue = Integer.parseInt(nandqueue[1]);	 //クオンタム受け取り
		
		String[] nameandtime = new String[2];
		String[] name = new String[N];
		String[] time = new String[N];
		
		for(int i = 0; i < N; i++) {
		nameandtime = scan.nextLine().split(" ");
		name[i] = nameandtime[0];
		time[i] = nameandtime[1];
		//System.out.println(time[i]); //確認用
		}
		//////////////////////////////////////////////////
		
		//queue作成//////////////////////////////
		//時間のdeque@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
		Deque<String> deque1 = new ArrayDeque<>();
		for(int i = 0; i < N; i++) {
			deque1.add(time[i]);
		}
		//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
		//名前のdeque@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
		Deque<String> deque2 = new ArrayDeque<>();
		for(int i = 0; i < N; i++) {
			deque2.add(name[i]);
		}
		//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
		/////////////////////////////////////////
		
		//System.out.println(deque); //確認用
		
		//処理///////////////////////////////////////
		int count = 0; //キューのクリアカウント
		int queuetime = 0; //queueを加算した時間
		for(int i = 0; count < N; i++) {
			int x =Integer.parseInt(deque1.poll());
			String y = deque2.poll();
			x -= queue;
			if(x <= 0) {
				queuetime += (queue + x);
				x = 0;
				count++;
				System.out.println(y + " " + queuetime);
			} else {
				queuetime += queue;
				deque1.add(String.valueOf(x));
				deque2.add(y);
			}
			if(i < deque1.size()) {
				i = 0;
			}
		}
		//////////////////////////////////////////////
	}
}



Measured memory_bytes: 107772
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Measured memory_bytes: 42972
#include<iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>

using namespace std;

#define rep(i,s,e) for(int i=s;i<e;i++)

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

    int t[n];
    rep(i,0,n){
        cin >> t[i];
    }
    int m;
    cin >> m;
    int p[m], x[m];
    rep(i,0,m){
        cin >> p[i] >> x[i];
    }

    rep(i,0,m){
        int _t[n];
        rep(j,0,n){
            _t[j] = t[j];
        }

        _t[p[i]-1] = x[i];

        int sum = 0;
        rep(j,0,n){
            sum += _t[j];
        }
        cout << sum << endl;
    }


    return 0;
}


Measured memory_bytes: 256
N,M,C = map(int,input().split())

B = list(map(int,input().split()))

ans = 0
for i in range(N):
    val = 0
    A = list(map(int,input().split()))
    for i in range(M):
        val += A[i-1]*B[i-1]
    if val + C > 0:
        ans += 1

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799;

struct edge{
  int to;
  int cost;
};

int n;
vector<edge> ver[100001];
int ans[100001];

void dfs(int from,int cost){
  for(edge x:ver[from]){
    if(ans[x.to] == -1){
      int d = cost + x.cost;
      if(d % 2 == 0) ans[x.to] = 0;
      else ans[x.to] = 1;
      dfs(x.to, d);
    }
  }
}

int main(){
  cin >> n;
  fill(ans, ans + 100001, -1);
  rep(i, n-1){
    int u, v, w;
    cin >> u >> v >> w;
    edge e = {v, w};
    edge f = {u, w};
    ver[u].push_back(e);
    ver[v].push_back(f);
  }
  ans[1] = 0;
  dfs(1, 0);
  rep(i, n) cout<<ans[i+1]<<endl;
}

Measured memory_bytes: 7680
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
    int a , b , d , r;
    double f;
    cin >> a >> b;
    d = a / b;
    r = a % b;
    f = a / (double)b;
    printf("%d %d %f\n", d, r, f);
 //   cout << d << " " << r << " " << f << endl; 
}   


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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    a = readint()
    b = readint()
    h = readint()
    print((a + b) * h // 2)


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
#include <stdio.h>
#include <string.h>

#define N 100
#define INF 1000001

int main(){

  int v,j,k,i,l,n,p[N+1],m[N+1][N+1];
  int t = 0;

  scanf("%d",&n);
  for(i=1; i<=n ;i++){
    scanf("%d %d",&p[i-1],&p[i]);
  }

  for(i=1; i<=n; i++) m[i][i] = 0;
  for(l=2; l<=n; l++) {
    for(i=1; i<=n-l+1; i++){
      j = i + l - 1;
      m[i][j] = INF;
      for(k=i; k<=j-1; k++){
	v  = (m[i][k] + m[k+1][j] + p[i-1] * p[k] * p[j]);
	if(v < m[i][j]){
	  m[i][j] = v;
	}
      }
    }
  }


  printf("%d\n",m[1][n]);

  return 0;
}



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

#define MAXN 5000005
#define ll long long int

int main(){
    int n;
    cin>>n;
    map<string,int> a;
    string temp;
    for(int i=0;i<n;i++){
        cin>>temp;
        a[temp]++;
    }
    cout<<"AC x "<<a["AC"]<<"\n";
    cout<<"WA x "<<a["WA"]<<"\n";
    cout<<"TLE x "<<a["TLE"]<<"\n";
    cout<<"RE x "<<a["RE"]<<"\n";
    return 0;
}


Measured memory_bytes: 3632
from collections import deque
h, w = map(int, input().split())

a = [[False]*(w+2)]
for y in range(h):
    a.append([False] + [x!='#' for x in input()] + [False])
a.append([False]*(w+2))

s = deque()
for i in range(1, h+1):
    for j in range(1, w+1):
        if not a[i][j]:
            s.append((i,j))

ans = -1
while s:
    ns = deque()
    for i, j in s:
        if a[i-1][j]:
            a[i-1][j] = False
            ns.append((i-1, j))
        if a[i+1][j]:
            a[i+1][j] = False
            ns.append((i+1, j))
        if a[i][j-1]:
            a[i][j-1] = False
            ns.append((i, j-1))
        if a[i][j+1]:
            a[i][j+1] = False
            ns.append((i, j+1))
        
    s = ns
    ans += 1
    
print(ans)


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int n = ri();
	std::vector<std::string> res(n, std::string(n, '.'));
	std::string r4[] = {
		"aacd",
		"bbcd",
		"cdaa",
		"cdbb"
	};
	std::string r5[] = {
		"aabba",
		"bcc.a",
		"b..cb",
		"a..cb",
		"abbaa"
	};
	std::string r6[] = {
		"ab..aa",
		"ab..bb",
		"ccab..",
		"..abcc",
		"abcc..",
		"abdd.."
	};
	std::string r7[] = {
		"aab.aa.",
		"b.b...a",
		"baa...a",
		"...baab",
		"...b.cb",
		"...aaca",
		"aabb..a"
	};
	std::string r3[] = {
		"aa.",
		"..b",
		"..b"
	};
	if (n == 2) {
		std::cout << -1 << std::endl;
		return 0;
	} else if (n % 3 == 0) {
		for (int i = 0; i < n; i += 3)
			for (int j = 0; j < 3; j++) std::copy(r3[j].begin(), r3[j].end(), res[i + j].begin() + i);
	} else if (n % 4 == 0) {
		for (int i = 0; i < n; i += 4)
			for (int j = 0; j < 4; j++) std::copy(r4[j].begin(), r4[j].end(), res[i + j].begin() + i);
	} else {
		auto draw = [&] (std::string *s) {
			int n = s[0].size();
			for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) res[i][j] = s[i][j];
		};
		int i = 0;
		if (n % 4 == 1) draw(r5), i = 5;
		else if (n % 4 == 2) draw(r6), i = 6;
		else if (n % 4 == 3) draw(r7), i = 7;
		for (; i < n; i += 4) {
			for (int j = 0; j < 4; j++) std::copy(r4[j].begin(), r4[j].end(), res[i + j].begin() + i);
		}
	}
	for (auto i : res) std::cout << i << std::endl;
	return 0;
}




Measured memory_bytes: 2304
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
#print(n,l)

d = []
c = []
for i in range(n):
    for j in range(n):
        tmp = [l[i][0]-l[j][0],l[i][1]-l[j][1]]
        if tmp[0] != 0 or tmp[1] != 0:
          d.append(tmp)
          if tmp not in c:
            c.append(tmp)
#print(d,c)
t = 0
for x in c:
    num = d.count(x)
    if num > t:
        t = num
ans = n - t
print(ans)

Measured memory_bytes: 40668
#include <algorithm>
#include <array>
#include <climits> // INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX, ULLONG_MAX
#include <cmath>
#include <cstdint>
#include <cstring> // memset
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

#define ALL(x) (x).begin(), (x).end()
#define INF 1e9
#define LOG(x) cout << #x << " = " << (x) << endl
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)

using namespace std;

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

    map<int, int> ball;
    REP(i, n) {
        int ai;
        cin >> ai;
        ball[ai] += 1;
    }
    vector<pair<int, int>> ball2;
    for (auto i : ball)
        ball2.push_back({i.second, i.first});
    sort(ALL(ball2));

    int count = 0;

    for (int i = ball2.size() - 1; i >= 0; i--) {
        if (k <= 0)
           count += ball2[i].first;
        k--;
   }

    cout << count << endl;
}


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

using namespace std;
#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) REP(i,0,(int)a-1)
#define FORD(i,a) REV(i,(int)a-1,0)
#define PB push_back
#define POB pop_back
#define FI first
#define SE second
#define MP make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int , int > pii;
typedef vector < int > vi;
typedef vector < pii > vii;
typedef vector < ll > vl;
typedef pair < ll , ll > pll;

const double PI = acos(-1);
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;
const int INF = 1e9;
	

ll addMod(ll a, ll b){
	if(a + b >= MOD) return a + b - MOD;
	return a + b;
}

ll mulMod(ll a, ll b){
	return (a*b)%MOD;
}

ll fast(ll a, ll b){
	if(b == 0) return 1;
	ll tmp = fast(a,b/2);
	tmp = mulMod(tmp,tmp);
	if(b%2 == 1) tmp = mulMod(tmp,a);
	return tmp;
}

ll GCD(ll a, ll b){
	if(a > b) return GCD(b,a);
	if(a == 0) return b;
	return GCD(b%a,a);
}

#define getc getchar
template<typename T>
T getnum(){
	int sign = 1;
	T ret = 0;
	char c;

	do{
		c = getc();
	}while(c == ' ' || c == '\n');
	if(c == '-')sign = -1;
	else ret = c-'0';
	while(1){
		c = getc();
		if(c < '0' || c > '9')break;
		ret = 10*ret + c-'0';
	}
	return sign * ret;
}

inline void ini(int& x){
	x = getnum<int>();
}

//////////////////////////////////////////////



int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int a,b;
	cin >> a >> b;
	cout << max(0, a - 2*b) << endl;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
a = list(map(int, input().split()))

hako = [0]*N
last_ans = 1

for i in range(N-1, -1, -1):
    #print(i)
    check = 0
    kijun = i+1
    baisuu = 1
    total = 0
    while kijun*baisuu <= N:
        if hako[kijun*baisuu-1] == 1:
            total += 1
        baisuu += 1
    total %= 2
    if total != a[i]:
        hako[i] = 1

if last_ans == 1:
    print(hako.count(1))
    if hako.count(1) != 0:
        buf = [i+1 for i, x in enumerate(hako) if x == 1]
        print(' '.join(map(str, buf)))
else:
    print(-1)

Measured memory_bytes: 19896
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    vector<vector<int>> data(3, vector<int>(3));
    
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
             cin >> data.at(i).at(j);
        }
    }
    
    int n;
    cin >> n;
    
    vector<int> b(n);
    for (int i = 0; i < n; i++) cin >> b.at(i);
    
    for (int i = 0; i < n; i++){
        //b(i)の値
        for (int j = 0; j < 3; j++){
            for (int k = 0; k < 3; k++){
                
                if (data.at(j).at(k) == b.at(i)){
                    data.at(j).at(k) = 0;
                }
                
            }
        }
    }
    
    bool ans = false;
    
    for (int i = 0; i < 3; i++){
        
        if (data.at(i).at(0) == 0){
            if (data.at(i).at(0) == data.at(i).at(1) && data.at(i).at(1) == data.at(i).at(2)){
                ans = true;
            }
        }
        if (data.at(0).at(i) == 0){
            if (data.at(0).at(i) == data.at(1).at(i) && data.at(1).at(i) == data.at(2).at(i)){
                ans = true;
            }
        }
    }
    
    if (!ans){
        if (data.at(0).at(0) == 0){
            if (data.at(0).at(0) == data.at(1).at(1) && data.at(1).at(1) == data.at(2).at(2)){
                ans = true;
            }
        }
        if (data.at(0).at(2) == 0){
            if (data.at(0).at(2) == data.at(1).at(1) && data.at(1).at(1) == data.at(2).at(0)){
                ans = true;
            }
        }
    }
    
    if (ans) cout << "Yes" << endl;
    else cout << "No" << endl;
      
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	int n, r; cin >> n >> r;
	if(n >= 10) {
		cout << r << '\n';
	} else {
		cout << r + 100 * (10 - n) << '\n';
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long MOD = (long) 1e9 + 7;

        // gcd{A1, A2, ... AN} = Xとなる数列の個数は？
        long ans = 0;
        long[] count = new long[k + 1];

        for (int i = k; i >= 1; i--) {
            int x = k / i;
            long p = pow(x, n, MOD);
            for (int j = 0; j <= x; j++) {
                p = p - count[i * j] > 0 ? p - count[i * j] : p - count[i * j] + MOD;
            }
            count[i] = p;
        }
        for (int i = 0; i <= k; i++) {
            ans = (ans + count[i] * i % MOD) % MOD;
        }
//        for (int i = k; i >= 1; i--) {
//            long tmp = 1;
//            for (int j = 0; j < n; j++) {
//                tmp = tmp * (k / i) % MOD;
//            }
//            for (int j = 1; j <= k / i; j++) {
//                long x = tmp - count[i * j];
//                tmp = x > 0 ? x % MOD : x + MOD;
//            }
//            count[i] = tmp;
//            ans = (ans +  tmp * i) % MOD;
//        }

        System.out.println(ans);
    }

    int gcd(int m, int n) {
        if (m < n) return gcd(n, m);
        if (n == 0) return m;
        return gcd(n, m % n);
    }

    long pow(int i, int n, long mod) {
        if (n == 0) {
            return 1;
        }
        long tmp = pow(i, n / 2, mod);
        tmp = tmp * tmp % mod;
        if (n % 2 == 1) {
            tmp = tmp * i % mod;
        }
        return tmp;
    }


    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

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


Measured memory_bytes: 37204
def main():
	N, M = map(int, input().split())
	a = set()

	for i in range(M):
		b = int(input())
		a.add(b)

	dp = [0]*(N+1)
	if N == 1:
		if 1 in a:
			print(0)
		else:
			print(1)
		return
	if N == 2:
		if 1 in a:
			print(1)
		else:
			print(2)
		return
	if not 1 in a:
		dp[1] = 1
	if not 2 in a:
		dp[2] = dp[1]+1

	MOD = 1000000007
	for i in range(3, N+1):
		if i in a:
			continue
		dp[i] = dp[i-1]+dp[i-2]
		dp[i] %= MOD
	print(dp[N])


if __name__ == '__main__':
	main()

Measured memory_bytes: 11884
#include <cstdio>
#include <algorithm>
using namespace std;
int cost[100][100],Time[100][100];
int n,m;
int main() {
	while(scanf("%d %d",&n,&m),n) {
		for(int i=0;i<m;i++) {
			for(int j=0;j<m;j++)  {
				if(i!=j)cost[i][j]=Time[i][j]=1<<27;
				else cost[i][j]=Time[i][j]=0;
			}
		}
		int a,b;
		for(int i=0;i<n;i++) {
			scanf("%d %d",&a,&b);
			scanf("%d %d",&cost[a-1][b-1],&Time[a-1][b-1]);
			cost[b-1][a-1]=cost[a-1][b-1];
			Time[b-1][a-1]=Time[a-1][b-1];
		}
		for(int k=0;k<m;k++) {
			for(int i=0;i<m;i++) {
				for(int j=0;j<m;j++) {
					cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j]);
					Time[i][j]=min(Time[i][j],Time[i][k]+Time[k][j]);
				}
			}
		}
		int k,p,q,r;
		scanf("%d",&k);
		for(int i=0;i<k;i++) {
			scanf("%d %d %d",&p,&q,&r);
			if(r)printf("%d\n",Time[p-1][q-1]);
			else printf("%d\n",cost[p-1][q-1]);
		}
	}
}

Measured memory_bytes: 1104
import sys
import math
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    A = sorted(list(readnums()), reverse=True)

    ans = A[0]
    for i in range(1, N // 2):
        ans += A[i] * 2
    if N % 2:
        ans += A[N // 2]

    print(ans)


if __name__ == "__main__":
    main()


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

#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;

using namespace std;
typedef long long ll;


int main()
{
    int n;
    cin >> n;
    ll x = 3;
    int ans = 1;
    while (n > x) {
        ans++;
        x *= 3;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	int n; cin >> n;
	int a[n];
	map<int, int64_t> cnt;
	rep(i,n) {
		cin >> a[i];
		++cnt[a[i]];
	}
	int64_t sum = 0;
	for(auto e : cnt) {
		sum += e.second * (e.second - 1) / 2;
	}
	rep(i,n) {
		int64_t num = cnt[a[i]];
		int64_t ans = sum;
		ans -= num * (num - 1) / 2;
		--num;
		ans += num * (num - 1) / 2;
		cout << ans << '\n';
	}
	return 0;
}

Measured memory_bytes: 10240
a = list(map(int,input().split()))
b = list(map(int,input().split()))
N = a[0]
t = True
k = 0
while t:
    k += 1
    for i in range(N):
        if b[i]%2 == 0:
             b[i] = b[i]/2
        else:
            t = False
print(k-1)

Measured memory_bytes: 3064
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
const double EPS = 1e-12;
const ll INF = numeric_limits<ll>::max()/2;
const int MOD = 1e9+7;

typedef vector<vector<P>> Graph;
bool f=true;
vector<ll> dis(111111,INF);

void dfs(const Graph &g, int node){
    //cout<<node<<endl;
    int sz=g[node].size();
    ll pos=dis[node];
    for(int i=0;i<sz;i++){
        P p=g[node][i];
        int next=p.first;
        if(dis[next]==INF){
            dis[next]=pos+p.second;
            dfs(g,next);
        }
        else if(dis[next]==pos+p.second) continue;
        else{
            f=false;
            return;
        }
    }
    return ;
}

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

    int n,m;cin>>n>>m;
    Graph g(n);
    for(int i=0;i<m;i++){
        int l,r;cin>>l>>r;l--;r--;
        ll d;cin>>d;
        g[l].push_back(P(r,d));
        g[r].push_back(P(l,-d));
    }
    for(int i=0;i<n;i++){
        if(dis[i]==INF){
            dis[i]=0;
            dfs(g,i);
        }
    }
    if(f) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 17536
N = int(input())
A = list(map(int, input().split()))
A = sorted(A,reverse=True)
first = 0
bef = 0
count = 0
for i in A:
    if count == 0 or i == bef:
        count += 1
    if count >= 2:
        if first != 0:
            print(first*i)
            exit()
        else:
            first = i
            count = 0
    if bef != i:
        count = 1
    bef = i
print(0)


Measured memory_bytes: 14672
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int w[6];
int main()
{
	for(register int i=1;i<=5;i++) scanf("%d",&w[i]);
	sort(w+1,w+6);
	int k;
	scanf("%d",&k);
	if(w[5]-w[1]>k) puts(":(");
	else puts("Yay!");
	return 0;
}

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

signed main(void){
    long long N;
    cin >> N;
    
    vector<long long> A,B;
    A.push_back(0);
    for(long long i=1;i*i<=N;i++){
        A.push_back(i);
        if(i != N/i){
            B.push_back(N/i);
        }
    }
    
    for(int i=B.size()-1;i>=0;i--){
        A.push_back(B[i]);
    }
    
    
    long long Answer = 0;
    for(long long i = 1; i<A.size();i++){
        long long num = ((N/A[i])*(N/A[i]+1)/2);
        num *= ((A[i]*(A[i]+1)/2)-(A[i-1]*(A[i-1]+1)/2));
        Answer += num;
    }
    
    cout << Answer << endl;
    
    return 0;
}


Measured memory_bytes: 3772
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

using ll = long long int;
using P = std::pair<int, int>;
using E = std::pair<P, int> ;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int c[555555],e[555555],bitree[555555],ans[555555];
E v[555555];
std::vector<int> d[555555];

int query(int x){
	int vl = 0;
	while(x){
		vl += bitree[x];
		x -= (x&-x);
	}
	return vl;
}

void update(int x, int vl = 1){
	while(x<555555){
		bitree[x] += vl;
		x += (x&-x);
	}
}

int main(void){
	int n,q,i,j,k,l,r,x=0,tt=0;
	std::cin >> n >> q;
	for(i=0; i<n; ++i){
		std::cin >> c[i]; --c[i];
		if(e[c[i]]+1<=i){
			d[e[c[i]]+1].push_back(i);
		}
		e[c[i]] = i+1;
	}
	for(i=0; i<555555; ++i){
		if(e[i]<n){
			d[e[i]+1].push_back(n);
		}
	}
	for(i=0; i<q; ++i){
		v[i].second = i;
		std::cin >> v[i].first.first >> v[i].first.second;
	}
	std::sort(v,v+q);
	for(i=0; i<q; ++i){
		if(x<v[i].first.first){
			for(k=x+1; k<=v[i].first.first; ++k){
				for(j=0; j<d[k].l_ength(); ++j){
					update(d[k][j]);
					++tt;
				}
			}
			x = v[i].first.first;
		}
		ans[v[i].second] = 555555-(tt-query(v[i].first.second-1));
	}
	for(i=0; i<q; ++i){
		std::cout << ans[i] << std::endl;
	}
	return 0;
}


Measured memory_bytes: 48308
#include<iostream>
using namespace std;
int main(){
	int n,i,sum=0;
	cin>>n;
	char a[n];
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=1;i<n;i++){
		if(a[i]!=a[i-1]){
			sum++;
		}
	}
	
	cout<<sum+1;

}



Measured memory_bytes: 384
#include<bits/stdc++.h>
#define N 100100
using namespace std;
int gcd(int a,int b){
	while(b){
		a%=b;
		swap(a,b);
	}
	return a;
}
int x[N];
int main(){
	int n,ec=0,odd=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&x[i]);
		if(x[i]%2==0) ec++;
		else odd=i;
	}
	if(ec&1) puts("First");
	else{
		int fst=0;
		while(ec==n-1&&x[odd]>1){
			fst=1-fst;
			x[odd]--;
			int g=0;
			for(int i=0;i<n;i++){
				g=gcd(g,x[i]);
			}
			ec=0;
			for(int i=0;i<n;i++){
				x[i]/=g;
				if(x[i]%2==0) ec++;
				else odd=i;
			}
		}
		if((ec&1)^fst) puts("First");
		else puts("Second");
	}
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
using lint = long;
using llint = long long;
using namespace std;

int main() {
    fastIO;
    int a, b;
    cin >> a >> b;
    cout << (a / b) << " ";
    cout << (a % b) << " ";
    cout << fixed << setprecision(5) << ((double)a / b) << endl;
}



Measured memory_bytes: 3300
import collections

N = int(input())
A = [int(x) for x in input().split()]

c = collections.Counter(A)

A = list(set(A))
A.sort()

total = 10 ** 6 + 1

X = [0] * total

for a in A:
    for aa in range(a + a, total, a):
        X[aa] = 1

ans = 0
for i in range(1, total):
    if X[i] == 0 and c[i] == 1:
        ans += 1

print(ans)


Measured memory_bytes: 45080
#include <stdio.h>

#define C(x, y, z) (nc[x] == nc[y] && nc[y] == nc[z])

int main(){
  char nc[9];
  int i, j;
  while(scanf("%s", nc) != EOF){
    if((C(0, 1, 2) || C(0, 3, 6) || C(0, 4, 8)) && nc[0] - 's') printf("%c\n", \
nc[0]);
    else if(C(1, 4, 7) && nc[1] - 's') printf("%c\n", nc[1]);
    else if((C(2, 5, 8) || C(2, 4, 6)) && nc[2] - 's') printf("%c\n", nc[2]);
    else if((C(3, 4, 5)) && nc[3] - 's') printf("%c\n", nc[3]);
    else if(C(6, 7, 8) && nc[6] - 's') printf("%c\n", nc[6]);
    else printf("d\n");
  }
  return 0;
}

Measured memory_bytes: 552
/*
 * ----------------------------------------------------------------------------
 (: Bismillahir Rahmanir Rahim :) 
 * File: /root/Programming/Atcoder/A_Coffee.cpp
 * Project: /root/Programming/Atcoder
 * Created Date: Saturday, March 28th 2020, 6:05:49 pm
 * Author: Grim Firefly :)
 * Author Mail : GrimFirefly1@gmail.com
 * -----
 * Last Modified: Sat Mar 28 2020
 * Modified By: Grim Firefly :)
 * -----
 * ----------------------------------------------------------------------------
 */






//Code Start
#include <bits/stdc++.h> 
using namespace std;

//constant
#define PI acos(-1.0)

//typedef
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned un;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef map<int, int> mii;
typedef map<char, char> mcc;
typedef map<char, int> mci;
typedef map<string, int> msi;
typedef map<ll, ll> mll;

//defined for loop


// defined for taking input
#define gl(x) getline(cin, x)
#define sf scanf
#define sfi(x) sf("%d", &x)
#define sfc(x) sf("%c", &x)
#define sfl(x) sf("%lld", &x)
#define sflu(x) sf("%llu", &x)
#define sfii(x, y) sf("%d %d", &x, &y)
#define sfll(x, y) sf("%lld %lld", &x, &y)
#define sfiii(x, y, z) sf("%d %d %d", &x, &y, &z)
#define sflll(x, y, z) sf("%lld %lld %lld", &x, &y, &z)

//defined for printing
#define pf printf
#define pfn pf("\n")
#define pfcas pf("Case %d: ", cas)
#define pfyes pf("YES")
#define pfno pf("NO")
#define pfi(x) pf("%d", x)
#define pfl(x) pf("%lld", x)

//Defined for loop
//increament
#define loopi(i, j, k) for (int i = j; i < k; i++)
#define loopl(i, j, k) for (ll i = j; i < k; i++)
#define loopc(i, j, k) for (char i = j; i < k; i++)
#define looplu(i, j, k) for (ull i = j; i < k; i++)
//decreament
#define loopri(i, j, k) for (int i = j; i > k; i--)
#define looprl(i, j, k) for (ll i = j; i > k; i--)
#define looprlu(i, j, k) for (ull i = j; i > k; i--)
#define looprc(i, j, k) for (char i = j; i > k; i--)
#define wa(t) while (t--)

//testcases
#define testc(t) for (char cas = 1; cas <= t; cas++)
#define testi(t) for (int cas = 1; cas <= t; cas++)
#define testl(t) for (ll cas = 1; cas <= t; cas++)

//some cmd
#define pb push_back
#define ppb pop_back
#define mp make_pair

//Main Function Start

int main()
{
    string str;
    cin>>str;
    if(str[2]==str[3] and str[4]==str[5]){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256