akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define llu unsigned long long
#define ll long long
#define INF 0x3f3f3f3f
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define to_lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
#define to_upper(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
#define Mod 1000000007
using namespace std;

// scan vector
template <typename T> 
inline istream &operator>>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// print vector
template <typename T> 
inline ostream &operator<<(ostream &out, vector<T> &a) {
    for(auto &x : a) out << x <<" ";
    // return in;
}
// scan pair
template <typename T, typename U> 
inline istream &operator>>(istream &in, pair<T,U> &a) {
    in >> a.first >> a.second; 
    return in;
}
vector<vector<ll> > dp;
string s1,s2;
ll solve(int n, int m)
{
	if(n<0 || m<0)
		return 0;
	if(dp[n][m]!=-1)
		return dp[n][m];
	if(s1[n]==s2[m])
		dp[n][m] = 1+solve(n-1,m-1);
	dp[n][m] = max(dp[n][m],max(solve(n-1,m),solve(n,m-1)));
	return dp[n][m];
}
string getLCS()
{
	int n=s1.length()-1, m=s2.length()-1;
	string ans="";
	while(true)
	{
		while(m>0 && dp[n][m]==dp[n][m-1])
			m--;
		while(n>0 && dp[n][m]==dp[n-1][m])
			n--;	
		if(n<0 || m<0)
			break;
		if(s1[n]==s2[m])
			ans+=s1[n];
		n--;
		m--;
		if(n<0 || m<0)
			break;
	}
	reverse(ans.begin(),ans.end());
	return ans;
}

int main()	
{
	#ifdef SANS
		freopen("ongoingin.txt","r",stdin);
		freopen("ongoingout.txt","w",stdout);
	#endif
	fast
	int t=1;
	// cin>>t;
	while(t--)
	{
		cin>>s1>>s2;
		dp.resize(s1.length());
		for(int i=0; i<s1.length(); i++)
		{
			dp[i].resize(s2.length()+1,-1);
		}
		ll len = solve(s1.length()-1,s2.length()-1); 
		if(len==0)
			cout<<""<<endl;
		else
			cout<<getLCS()<<endl;
	}
	#ifdef SANS
		cout<<"\nTime Elapsed:"<<1.0*clock()/CLOCKS_PER_SEC <<"sec\n";
	#endif
}

Measured memory_bytes: 74240
<?php
$a = fgets(STDIN);

$count = 0;

for($i=0; $i< 26; $i++){
    for($s=0; $s< 16; $s++){
        if(($i * 4) + ($s * 7) == $a && $a > 3){
            $count++;
        }
    }
}

if($count > 0){
    echo "Yes";
}else{
    echo "No";
}

?>

Measured memory_bytes: 3828
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  vector<int> a(n,0),k(m),p(m);
  vector<vector<int> > s(m,vector<int>(n));
  for(int i=0;i<m;i++){
    cin>>k[i];
    for(int j=0;j<k[i];j++)cin>>s[i][j];
  }
  for(int i=0;i<m;i++)cin>>p[i];
  int ans=0;
  for(int i=0;i<pow(2,n);i++){
    if(i){
      int j=0;
      for(;a[j];j++)a[j]=0;
      a[j]=1;
    }
    bool e=true;
    for(int c=0;c<m;c++){
      int t=0;
      for(int d=0;d<k[c];d++){
        t^=a[s[c][d]-1];
      }
      if(t!=p[c]){
        e=false;
        break;
      }
    }
    if(e)ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#define rep(v, s, e) for(int v=(s);v<(e);v++)
#define res(v, s, e) for(int v=(s);(e)<=v;v--)
#include <algorithm>
#include <array>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
using Line = array<char, 5>;
using Puzzle = vector<Line>;

void newline() {cout << endl;}
template <typename T>
void put(T input){cout << input;}
template <typename T>
void putl(T input){put(input); newline();}

int n;
int point;
Puzzle puzzle;

void swap_rec(int column, int row){
  if(0<column){
    swap(puzzle[column][row], puzzle[column-1][row]);
    swap_rec(column-1, row);
  }
}

void drop(){
  Puzzle prev_puzzle = puzzle;
  res(column, puzzle.size()-1, 0)
    res(row, puzzle[column].size()-1, 0)
      if(puzzle[column][row] == '#')
        swap_rec(column, row);
  if(puzzle != prev_puzzle) drop();
}

int clear(Line &line, int n, char c){
  if(line[n] == c){
    line[n]='#';
    if(1 <= n && n < line.size()-1){
      return int(c)-int('0')+clear(line, n+1, c)+clear(line, n-1, c);
    }else{
      return int(c)-int('0');
    }
  }
  return 0; 
}


int solve(){
  Puzzle prev_puzzle = puzzle;
  for(Line &line: puzzle)
    rep(k, 1, line.size()-1)
      if(line[k] != '#' && line[k-1] == line[k] && line[k] == line[k+1])
        point+=clear(line, k, line[k]);
  drop();
  if(prev_puzzle != puzzle) solve();
  return point;
}

int main() {
  while(cin>>n && n){
    point=0; puzzle={}; puzzle.reserve(n);
    rep(ic, 0, n){
      Line line;
      rep(lc, 0, line.size()){
        char s; cin >> s; line[lc]=s;
      }
      puzzle.push_back(line);
    }
    putl(solve());
  }
}

Measured memory_bytes: 3136
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  string s;
  cin >> s;
  int n = s.size();
  bool ok = true;
  if (s[0] != 'A') ok = false;
  int cnt = 0;
  for (int i = 1; i < n; ++i) {
    if (isupper(s[i])) {
      if (s[i] == 'C') {
        cnt++;
        if (i < 2 || n - 2 < i) {
          ok = false;
        }
      } else {
        ok = false;
      }
    }
  }
  if (cnt != 1) ok = false;
  cout << (ok ? "AC" : "WA") << endl;
  return 0;
}

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

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

struct V {
  double x, y;
  V(double x = 0, double y = 0) : x(x), y(y) {}
  V& operator+=(const V& v) {
    x += v.x;
    y += v.y;
    return *this;
  }
  V operator+(const V& v) const { return V(*this) += v; }
  V& operator-=(const V& v) {
    x -= v.x;
    y -= v.y;
    return *this;
  }
  V operator-(const V& v) const { return V(*this) -= v; }
  V& operator*=(double s) {
    x *= s;
    y *= s;
    return *this;
  }
  V operator*(double s) const { return V(*this) *= s; }
  V& operator/=(double s) {
    x /= s;
    y /= s;
    return *this;
  }
  V operator/(double s) const { return V(*this) /= s; }
  double dot(const V& v) const { return x * v.x + y * v.y; }
  double cross(const V& v) const { return x * v.y - v.x * y; }
  double norm2() const { return x * x + y * y; }
  double norm() const { return sqrt(norm2()); }

  int ort() const {  // orthant
    if (y > 0)
      return x > 0 ? 1 : 2;
    else
      return x > 0 ? 4 : 3;
  }
  bool operator<(const V& v) const {
    int o = ort(), vo = v.ort();
    if (o != vo) return o < vo;
    return cross(v) > 0;
  }
};
istream& operator>>(istream& is, V& v) {
  is >> v.x >> v.y;
  return is;
}
ostream& operator<<(ostream& os, const V& v) {
  os << "(" << v.x << "," << v.y << ")";
  return os;
}

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;

  vector<V> vs(n);
  rep(i, n) cin >> vs[i];

  Sort(vs);

  vector<V> arr(2 * n);
  rep(i, n) arr[i] = arr[i + n] = vs[i];

  double ans = 0.0;
  rep(i, n) {
    repLRE(j, 1, n){
      V u;
      u.x = 0.0, u.y = 0.0;
      rep(k, j) u += arr[i + k];
      chmax(ans, u.norm());
    }
  }

  cout << ans << endl;  

  return 0;
}


Measured memory_bytes: 3872
package main

import (
	"fmt"
)

func main() {
	var n, m int
	var dp []int
	var brokenStairs []bool

	fmt.Scanf("%d %d", &n, &m)
	dp = make([]int, n+1)
	brokenStairs = make([]bool, n+1)

	for i := 0; i < m; i++ {
		_i := 0
		fmt.Scanf("%d", &_i)
		brokenStairs[_i] = true
	}

	cur := 2

	dp[0] = 1
	if !brokenStairs[1] {
		dp[1] = 1
	}

	for cur <= n {
		if !brokenStairs[cur] {
			dp[cur] = dp[cur-1] + dp[cur-2]
			dp[cur] %= 1000000007
		}
		cur++
	}

	fmt.Print(dp[n])
}


Measured memory_bytes: 5504
#include <iostream>
#include <string>
#include <algorithm> 

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i >= (b); i--)
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)
#define PRINT_ARRAY(name, i) printf("the value of "#name"[%d] is %d\n", (i), name[(i)])
#define DEBUG_ARRAY(name, begin, end) REP(i, begin, end) PRINT_ARRAY(name, i)

using namespace std;

int N;

string makeNBasedNumber(int base, int n) {
	string s = "";
	while ( n != 0 ) {

		int r = n % base;

		if ( r < 0 ) r -= base;

		if (r < 10) s += (char)( r + '0' );
		else s += (char)( r - 10 + 'a');

		// N = base * q + r
		n = (n - r) / base;
	}
	if ( s.size() == 0) return "0";
	reverse(s.begin(), s.end());
	return s;
}

int main(void) {
    scanf("%d", &N);
    
    printf("%s\n", makeNBasedNumber(-2, N).c_str());

	return 0;
}


Measured memory_bytes: 256
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N, *A = map(int, read().split())
    ans = 1
    lim = pow(10,18)
    
    try:
        zero = A.index(0)
        print(0)
        return
    except:
        pass
    
    for a in A:
        ans *= a
        if ans > lim:
            print(-1)
            return
            
    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 85848
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(all(x));
#define RSORT(x) sort(rall(x));
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const int inf = 1<<29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

int main () {
  int A, B, C; cin >> A >> B >> C;
  cout << max(C-(A-B),0) << endl;
}

Measured memory_bytes: 256
/*
  AUTHOR:SOURABH
  CREATED:26:10:19
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<pll , null_type, less< pll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32
#define PI 3.14159265

using namespace std;
using namespace __gnu_pbds;

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

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    ll a,b,x;
    ld r,ans;
    cin>>a>>b>>x;
    r=(ld)(2*a*a*b-2*x)/(a*a);
    if(r<=b)
    r=r/a;
    else
    r=(ld)(a*b*b)/(2*x);
    ans=(ld)atan(r);
    ans=(ans*180)/PI;
    cout<<fixed<<setprecision(10)<<ans;
    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++)
bool debug = false;

int main() {
  int X; cin >> X; // 入力値：２～１０＾５
  int Ans = 0;      // 最小の素数

  int tmp_i;  // 割り算用の数値（仮
  int tmp_b;  // true:素数／false:素数で無い
  for(int i=X;i<1000000;i++){
    // i が素数か判定する。
    bool tmp_div = false; // i の割り切れ判定
    for(int j=2;j<sqrt(i);j++){
      if (i%j==0){tmp_div=true;break;}
    }
    if(!tmp_div){
      Ans=i;
      break;
    }
  }

  cout << Ans << endl;
}


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

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

//compare function (ascending order)
//qsort(array, n, size, cmp)
int cmp(const void *a,const void *b){ 
    if(*(int*)a < *(int*)b){
        return -1;
    }
    else if(*(int*)a == *(int*)b){
        return 0;
    }
    return 1;
}

//a^b mod d
int modpow(long long a, long long b, long long d){
	if(b == 0)		return 1;
	if(b % 2 == 0)	return modpow(a*a % d, b/2, d);
	else			return a*modpow(a, b-1, d) % d;
}

int main(void){
	int n;
	int i;
	scanf("%d",&n);
	int d[n];
	long long cntp=1, cnta=1, p;
	long long ans=1;
	rep(i,n){
		scanf("%d",&d[i]);
		if(d[i] == 0 && i != 0){
			printf("0\n");
			return 0;
		}
	}
	if(d[0] != 0){
		printf("0\n");
		return 0;
	}
	qsort(d, n, sizeof(d[0]), cmp);
/*	rep(i,n){
		printf("%d",d[i]);
	}
	printf("\n");	*/
	for(i=1;i<n;i++){
		if(d[i]-d[i-1] != 1 && d[i]-d[i-1] != 0){
			printf("0\n");
			return 0;
		}
		if(d[i] == d[i+1] && i != n-1){
			cnta++;
		}
		else{
			p = modpow(cntp, cnta, MOD);
			ans = ans*p;
			ans = ans % MOD;
			cntp = cnta;
			cnta = 1;
		}
	}
	printf("%lld\n",ans);
    return 0; 
}


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

int main(){
    int H, W;
    cin >> H >> W;
    vector<string> grid(H);
    for (int i = 0; i < H; i++) cin >> grid[i];
    vector<vector<int>> ans(H+2, vector<int>(W+2, 10000));
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            if (grid[i-1][j-1] == '#') ans[i][j] = 0;
        }
    }
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            ans[i][j] = min(ans[i][j], ans[i-1][j]+1);
        }
    }
    for (int i = H; i >= 1; i--) {
        for (int j = W; j >= 1; j--) {
            ans[i][j] = min(ans[i][j], ans[i+1][j]+1);
        }
    }
    
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            ans[i][j] = min(ans[i][j], ans[i][j-1]+1);
        }
    }
    for (int i = H; i >= 1; i--) {
        for (int j = W; j >= 1; j--) {
            ans[i][j] = min(ans[i][j], ans[i][j+1]+1);
        }
    }
    int m = 0;
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            m = max(m, ans[i][j]);
        }
    }
    cout << m << endl;
    return 0;
}

Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  string ans;
  if(s=="Sunny")
    ans="Cloudy";
  else if(s=="Cloudy")
    ans="Rainy";
  else ans="Sunny";
  cout<<ans;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>

using namespace std;

typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define Fst first
#define Snd second
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repv(t,it,v) for(vector<t>::iterator it = v.begin() ; it != v.end() ; ++it)

int N;

int main(){
	scanf("%d" , &N);
	if(N==2){
		printf("-1\n");
	} else if(N%2==0){
		repp(i,0,N/2){
			repp(j,1,N){
				printf("%d%c" , ((i+j)%N) + 1 , j+1==N ? '\n' : ' ');
			}
		}
		repp(i,N/2,N){
			repp(j,1,N-1){
				printf("%d " , ((i+j+(j%2==0?-1:1))%N) + 1);
			}
			printf("%d\n" , ((i+N-1)%N) + 1);
		}
	} else {
		repp(i,0,N){
			repp(j,1,N){
				printf("%d%c" , ((i+j)%N) + 1 , j+1==N ? '\n' : ' ');
			}
		}
	}
	return 0;
}


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

typedef long long int lli;
const int MOD = 1000000007;
#define rep(i,n) for (int i = 0; i < n; i++)

using namespace std;

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

	int N, X; cin >> N >> X;
	vector<int> ver(N);
	rep(i, N) { cin >> ver[i]; }
	vector<int>S(N+1);
	S[0] = 0;
	int A = 0;
	for (int i = 0; i <N; i++)
	{
		A = A + ver[i];
		S[i+1] = A;
	} 
	int res=0;
	rep(i, N+1) {
		if (S[i] <= X) {
			res++;
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 256
from sys import stdin

for _ in range(int(stdin.readline())):
    s = list(map(int, stdin.readline().split()))
    a = 0
    b = 0
    for c in s:
        if a<c: a=c
        elif b<c: b=c
        else:
            print("NO")
            break
    else:
        print("YES")



Measured memory_bytes: 5588
#include <iostream>
using namespace std;
int main()
{
  int a,b;
  cin >> a;
  cin >> b;
  if (a > b) {
    cout << "a > b" << endl;
  }
  else if (a<b) {
    cout << "a < b" << endl;
  }
  else {
    cout << "a == b" << endl;
  }
  return 0;
}

Measured memory_bytes: 3092
using System;
  
class Program {
    private static int Main() {
        while( true ) {
            var cards = Console.ReadLine();
            if( cards == "-" ) { break; }
  
            var input = Console.ReadLine();
            int count = int.Parse( input );
  
            int index = 0;
            for( int i = 0; i < count; ++i ) {
                input = Console.ReadLine();
                index += int.Parse( input );
            }
  
            index %= cards.Length;
  
            var output = cards.Substring( index ) + cards.Substring( 0, index );
            Console.WriteLine( output );
        }
  
        return 0;
    }
}

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

int main(){
	ll n;
	cin >> n;
	map<ll,int> mp;
	rep(i,n){
		ll a;
		cin >> a;
		mp[a]++;
	}
	ll ans = 0;
	for (auto k: mp){
		if(k.second % 2 == 1) ans++;
	}
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 6528
import sys
import bisect
input = sys.stdin.readline

N = int(input())
A = list(map(int,input().split()))
A = [a-1 for a in A]
AINV=[0]*N

for i,x in enumerate(A):
    AINV[x]=i

ANS = 0

# BIT(BIT-indexed tree)

LEN=N# 必要なら座標圧縮する

BIT=[0]*(LEN+1)# 1-indexedなtree

def update(v,w):# index vにwを加える
    while v<=LEN:
        BIT[v]+=w
        v+=(v&(-v))# 自分を含む大きなノードへ. たとえばv=3→v=4

def getvalue(v):# [1,v]の区間の和を求める
    ANS=0
    while v!=0:
        ANS+=BIT[v]
        v-=(v&(-v))# 自分より小さい2ベキのノードへ. たとえばv=3→v=2へ
    return ANS

update(AINV[-1]+1,1)

ANS=0

def search(score):
    if score<=0:
        return 0
    if score>getvalue(N):
        return N+1

    MIN=1
    MAX=N

    while MIN!=MAX:
        x=(MIN+MAX)//2

        if getvalue(x)>=score:
            MAX=x
        else:
            MIN=x+1

    return MIN
            

for i in range(N-2,-1,-1):
    update(AINV[i]+1,1)

    sc=getvalue(AINV[i]+1)


    ANS+=(i+1)*((search(sc)-search(sc-1))*(search(sc+2)-search(sc+1))+(search(sc-1)-search(sc-2))*(search(sc+1)-search(sc)))


print(ANS)

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

N,u,v=map(int,input().split())
E=[tuple(map(int,input().split())) for i in range(N-1)]

EDGE=[[] for i in range(N+1)]

for x,y in E:
    EDGE[x].append(y)
    EDGE[y].append(x)

from collections import deque
T=[-1]*(N+1)

Q=deque()
Q.append(u)
T[u]=0

while Q:
    x=Q.pop()
    for to in EDGE[x]:
        if T[to]==-1:
            T[to]=T[x]+1
            Q.append(to)

A=[-1]*(N+1)

Q=deque()
Q.append(v)
A[v]=0

while Q:
    x=Q.pop()
    for to in EDGE[x]:
        if A[to]==-1:
            A[to]=A[x]+1
            Q.append(to)


OK=[0]*(N+1)

for i in range(N+1):
    if T[i]<A[i]:
        OK[i]=1

ANS=0
for i in range(N+1):
    if OK[i]==1:
        ANS=max(ANS,A[i])

print(max(0,ANS-1))

Measured memory_bytes: 37348
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
using P = pair <int, int>;
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; }
 
ll MOD = 1000000007;
ll INF =1<<30;



int main(){
   string s;
   cin>>s;
   if(s.size()==2) cout <<s <<endl;
   else {
       cout << s[2]<<s[1]<<s[0] <<endl;
   }
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++)
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b);
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define pb push_back
#define pf push_front
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={1,0,-1,0,1,-1,-1,1};
int dy[]={0,1,0,-1,1,1,-1,-1};
const int MOD = 1e9+7;
const long long INF = 1e18+10;

/*--------------------------------------------------------------------*/
signed main(){
	int n;
	cin>>n;
	map<int,int> yaku;

	FOR(z,1,n){
		int k=z;
		for(int i=2;i<=k;i++){
			int cnt=0;
			while(k%i==0){
				k/=i;
				cnt++;
			}
			if(cnt>0)yaku[i]+=cnt;
		}
	}
	int ans=1;
	for(auto p:yaku){
		ans*=p.second+1;
		ans%=MOD;
	}
	cout<<ans<<endl;

	return 0;
}


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

int main(void) {
    int A,B,C;cin>>A>>B>>C;
    if (A > B) swap(A, B);
    if (A > C) swap(A, C);
    if (B > C) swap(B, C);
    int result = 0;
    result += C - B;
    A += C - B;
    result += (C - A) / 2;
    A += ((C - A) / 2) * 2;
    if (A < C) result += 2;
    cout << result << endl;
    return 0;
}

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

int main() {
  int n,ans=0;
  cin >> n;
  int c[10][10];
  rep(i,10) rep(j,10) c[i][j] = 0;
  for(int i=1;i<=n;i++){
    int x = i;
    while(x>9) x /= 10;
    c[x][i%10]++;
  }
  rep(i,10) rep(j,10) ans += c[i][j] * c[j][i];
  cout << ans << endl;
}


Measured memory_bytes: 256
#if DEBUG
using Console = AtCoder.Console;
#endif
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
#if DEBUG
            Console.Arg =
@"5
9 5 6 8 4
";
#endif
            var n = Console.ReadLine().ToInt();
            var h = Console.ReadLine().Split(' ').Select(x => x.ToInt()).ToArray();
            var maxH = h[0];
            var count = 1;
            for(int i = 1; i < n; i++) {
                if(maxH <= h[i]) {
                    count++;
                    maxH = h[i];
                }
            }
            Console.WriteLine(count);
#if DEBUG
            Console.Wait();
#endif

        }
    }

    public static class StringExtension
    {
        public static int ToInt(this string str) => int.Parse(str);

        public static long ToLong(this string str) => long.Parse(str);

        public static short ToShort(this string str) => short.Parse(str);
    }
}


Measured memory_bytes: 13396
n = gets.to_i
sp = []
n.times do |i|
  tmp = gets.split
  sp << {:num => i, :name => tmp[0], :score => tmp[1].to_i }
end
sp.sort! do |a, b|
  a[:name] == b[:name] ? b[:score] <=> a[:score] : a[:name] <=> b[:name]
end
sp.map{|e| puts (e[:num]+1)}

Measured memory_bytes: 1788
/*input
7
50
30
50
100
50
80
30
*/
#include <bits/stdc++.h>

using namespace std;

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


#define FileIn(file) freopen(file, "r", stdin)
#define FileOut(file) freopen(file, "w", stdout)
#define syso(n) cout<<n<<endl;
#define sysom(message, n) cout<<message<<n<<endl;
#define all(c) c.begin(), c.end() 
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++) 
#define present(container, element) (container.find(element) != container.end())  //map, set
#define cpresent(container, element) (find(all(container),element) != container.end()) //vector
#define what_is(x) cout << #x << " is " << x << endl; 


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

ll lcm(ll fir, ll sec){
	return (fir*sec)/(gcd(fir, sec));
}


const int MOD = 1e9 + 7;
const string small_alphabets = "abcdefghijklmnopqrstuvwxyz";
const int month_days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// --
// -- 
// -- 
// std::cout << std::fixed;
// std::cout << std::setprecision(5) << f << '\n';


int main(){
	int n;
	cin>>n;
	set<int> s;
	int x;
	for (int i = 0; i < n; ++i){
		cin>>x;
		s.insert(x);
	}
	syso(s.size());
	return 0;
}


Measured memory_bytes: 256
//============================================================================
// Name        : abc110c.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>

using namespace std;

int main() {
	string s, t;
	cin >> s;
	map<char, vector<char>> mp1;
	map<char, vector<char>> mp2;

	for (int i = 0; i < s.length(); ++i) {
		char c;
		cin >> c;
		t += c;

		mp1[c].push_back(s[i]);
		mp2[s[i]].push_back(c);
	}

	for (int i = 0; i < t.length(); ++i) {
		static map<char, bool> check;
		if (check[t[i]] == true) {
			continue;
		}
		check[t[i]] = true;
		vector<char> c1 = mp1[t[i]];
		sort(c1.begin(), c1.end());
		if (c1[0] != c1[c1.size() - 1]) {
			cout << "No" << endl;
			return 0;
		}
	}
	for (int i = 0; i < t.length(); ++i) {
		static map<char, bool> check;
		if (check[s[i]] == true) {
			continue;
		}
		check[s[i]] = true;
		vector<char> c2 = mp2[s[i]];
		sort(c2.begin(), c2.end());
		if (c2[0] != c2[c2.size() - 1]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 1532
// #define STOPIT
#include <bits/stdc++.h>
#define loop(n) for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int x, y; std::cin >> x >> y;
  int three = 3;
  std::vector<int> mul(three, 0);
  x--,y--;
  mul.at(x)++;
  mul.at(y)++;

  rep(i,0,three) {
    if (!mul.at(i)) {
      std::cout << i+1 << std::endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        int n, y, m, d, mil;
        mil=getDate(1000, 1, 1);
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        for (int i=0;i<n;i++){
            y=sc.nextInt();
            m=sc.nextInt();
            d=sc.nextInt();
            System.out.println(mil-getDate(y, m, d));
        }
    }
    public static int getDate(int y, int m, int d){
        int c=0;
        Boolean b=false;
        for (int i=1;i<=y;i++){
            if (i%3==0) b=true;
            if (i!=y){
                for (int j=1;j<=10;j++){
                    if (j%2==0&&!b) c+=19;
                    else c+=20;
                }
            }
            else{
                for (int j=1;j<m;j++){
                    if (j%2==0&&!b) c+=19;
                    else c+=20;
                }
            }
            b=false;
        }
        c+=(d-1);
        return c;
    }
}

Measured memory_bytes: 27992
#include <stdio.h>
int main(){
  int A[100];
  int i,j,N,tmp,cnt = 0;
  int flag = 1;

  while(1){
    scanf("%d",&N);
    if(1 <= N && N <= 100){
      break;
    }
  }

  for(i = 0;i < N;i++){
    scanf("%d",&A[i]);
  }
  
  while(flag){
    flag = 0;
    for(j = N-1;j>=1;j--){
      if(A[j] < A[j-1]){
	tmp = A[j];
	A[j] = A[j-1];
	A[j-1] = tmp;
	flag = 1;
	cnt++;
      }
    }
  }
  
  for(i = 0;i < N;i++){
    if(i != N-1){
      printf("%d ",A[i]);
    }
    else printf("%d\n",A[i]);
  }
  printf("%d\n",cnt);
 
  return 0;
}



Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  int ans = 1;
  for(int i = 0; i < N; i++) {
    cin >> vec.at(i);
    if(i != 0) {
      bool finished = true;
      for(int j = 0; j < i; j++) {
        if(vec.at(i) == vec.at(j)) {
          finished = false;
          break;
        }
      }
      if(finished)
        ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine().Split(' ');

        var min = int.MaxValue;
        var max = int.MinValue;
        for (int i = 0; i < n; i++)
        {
            var x = int.Parse(s[i]);
            min = Math.Min(min, x);
            max = Math.Max(max, x);
        }

        Console.WriteLine(max - min);
    }
}


Measured memory_bytes: 11092
n = int(input())

pattern = {str(h) + str(t): 0 for h in range(1, 10) for t in range(1, 10)}
for a in range(1, n + 1):
  a_str = str(a)
  a_head = a_str[0]
  a_tail = a_str[-1]
  if a_tail != "0":
    pattern[a_head + a_tail] += 1

ans = 0
for k, v in pattern.items():
  ans += v * (pattern.get(k[::-1]) or 0)

print(ans)



Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

const int maxN = 100011;

int n, i, x, y;
vector<int> le, ri;
ll ans;

int main()
{
   // freopen("test.in","r",stdin);

    scanf("%d", &n);
    for (i = 1; i <= n; i++) {
        scanf("%d%d", &x, &y);
        le.pb(x);
        ri.pb(y);
    }

    le.pb(0);
    ri.pb(0);

    sort(le.begin(), le.end());
    reverse(le.begin(), le.end());
    sort(ri.begin(), ri.end());

    for (i = 0; i < le.size(); i++) {
        int a = ri[i];
        int b = le[i];
        if (a >= b) break;
        ans += 1LL * (b - a);
    }

    ans *= 2LL;
    printf("%lld", ans);



    return 0;
}


Measured memory_bytes: 1276
t = input()
s = [i for i in t]
if s[0] == "?":
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i] == "?":
        if s[i-1] == "D" and s[i+1] == "D":
            s[i] = "P"
        elif s[i-1] == "p" and s[i+1] == "P":
            s[i] = "D"
        elif s[i-1] == "D" and s[i+1] == "?":
            s[i] = "P"
        elif s[i-1] == "P" and s[i+1] == "?":
            s[i] = "D"
        else:
            s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))

Measured memory_bytes: 11172
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

int main() {
    int n;
    cin >> n;
    int a[n+1];
    int b[n+1];
    memset(b, 0, sizeof(b));

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

    for (int i=n; i>=1; i--) {
        int num = 0;
        for (int x=2*i; x<=n; x+=i) {
            num += b[x];
        }
        if (num % 2 == a[i]) {
            b[i] = 0;
        } else {
            b[i] = 1;
        }
    }

    int sum = 0;
    for (int i=1; i<=n; i++)
        sum += b[i];

    //cout << "debug: ";
    //for (int i=1; i<=n; i++) {
    //    if (i != 1)
    //        cout << " ";
    //    cout << b[i];
    //}
    //cout << endl;

    cout << sum << endl;
    if (sum != 0) {
        bool first = true;
        for (int i=1; i<=n; i++) {
            if (b[i] == 1) {
                if (!first) {
                    cout << " ";
                } else {
                    first = false;
                }
                cout << i;
            }
        }
        if (!first) {
            cout << endl;
        }
    }
}

Measured memory_bytes: 2432
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mod 1000000007
using namespace std;
ll binpow(ll x,ll y)/* (x^y)%p in O(log y) */{ll res=1;while (y > 0){if(y&1)res=(res*x);y = y>>1;x=(x*x);}return res;}
ull binpowmod(ull x,ull y,ull p)/* (x^y)%p in O(log y) */{ull res=1;x=x%p;while (y > 0){if(y&1)res=(res*x)%p;y = y>>1;x=(x*x)%p;}return res;}
ll mod_inverse(ll n,ll p)/* Returns n^(-1) mod p */{return binpowmod(n,p-2,p);}
ull gcd(ull x,ull y)
{
    if(y==0)
        return x;
    return gcd(y,x%y);
}
bool comp(pair<int,int> x,pair<int,int> y)
{
    return x.first<y.first;
}
bool comp_pairs_by_s(pair<ll,ll> &x ,pair<ll,ll> &y)
{
    return x.second<y.second;
}
bool isPowerOfTwo (ll x)  
{  
    /* First x in the below expression is for the case when x is 0 */
    return x && (!(x&(x-1)));  
}

class cmp      //comparator for priority_queue 
{               //declaration: priority_queue<int,vector<int>,cmp>
public:         
    bool operator()(pair<int,int> A,pair<int,int> B)
    {
        if(abs(A.first-A.second)==abs(B.first-B.second))
            return A.first>B.first;
        return abs(A.first-A.second)<abs(B.first-B.second);
    }
};
// int prime[100005]={0};
// void sieve(void)
// {
//  int i,j;
//  for(i=0;i<100005;i++)
//         prime[i]=1;
//  prime[0]=0,prime[1]=0;
//  for(i=2;i<=sqrt(100005);i++){
//      if(prime[i]){
//          for(j=i*i;j<100005;j+=i){
//              prime[j]=0;
//          }
//      }
//  }
    
// }
void swap(int &x,int &y){
    int temp=x;
    x=y;
    y=temp;
}
ll dp[3001][3001];
void solve()
{   
    int n;
    cin>>n;
    vector<ll> v(n);
    for(auto &it :v)
        cin>>it;
    dp[0][0]=0;
    for(int L=n-1;L>=0;--L){
        for(int R=L;R<n;++R){
            if(L==R) dp[L][R]=v[L];
            dp[L][R]=max(v[L]-dp[L+1][R],v[R]-dp[L][R-1]);
        }
    }
    cout<<dp[0][n-1];
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
}   


Measured memory_bytes: 70016
n,c,k = map(int, input().split())
tt = sorted([int(input()) for _ in range(n)])
# print(tt)
ans = 0
limit = 0
buss = 1
for i,t in enumerate(tt):
    if buss == c or t>limit:
        # print('NEED MORE BUSS')
        ans += 1
        buss = 1
        limit = t+k
    else:
        buss +=1
    # print(ans, buss, t, limit)
print(ans)

Measured memory_bytes: 8276
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

template<class T>
bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;}
template<class T>
bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;}
void print() {
    cout << endl;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    print(forward<Tail>(tail)...);
}

template <class T>
void print(vector<T> &vec) {
    for (auto& a : vec) {
        cout << a;
        if (&a != &vec.back()) cout << "\n";
    }
    cout << endl;
}

template <class T>
void print(vector<vector<T>> &df) {
    for (auto& vec : df) {
        print(vec);
    }
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    ll m = 1LL << n;
    vector<ll> a(m);
    for(int i = 0; i < m; i++) cin >> a[i];
    vector<Pll> v(m, {0, 0});
    rep(i, 1, m) {
        for(ll mask = i; mask >= 0; mask = (mask - 1) & i) {
            if(v[i].second <= a[mask]) v[i].second = a[mask];
            if(v[i].second >= v[i].first) swap(v[i].first, v[i].second);
            if(mask == 0) break;
        }
    }
    vector<ll> dp(m);
    rep(i, 1, m) chmax(dp[i], max(dp[i - 1], v[i].first + v[i].second));
    rep(i, 1, m) cout << dp[i] << "\n";
}

Measured memory_bytes: 11532
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int[] B = new int[N-1];

		for (int i=0; i<N-1; i++){
			B[i] = sc.nextInt();
		}

		int ans = 0;
		ans += B[0];
		for (int i=0; i<N-2; i++){
			ans += Math.min(B[i], B[i+1]);
		}
		ans += B[N-2];
		System.out.println(ans);
	}
}

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

int main(){
	int n;
	cin >> n;
    vector<pair<string,int>> sh(n);
    vector<tuple<string,int,int>> sh2(n);
    rep(i, n){
      cin >> sh.at(i).first >> sh.at(i).second;
      get<0>(sh2.at(i)) = sh.at(i).first;
      get<1>(sh2.at(i)) = sh.at(i).second;
      get<2>(sh2.at(i)) = i+1;
    }
    sort(sh.begin(), sh.end());
    sort(sh2.begin(), sh2.end());
    reverse(sh2.begin(), sh2.end());
    rep(i, n){
      rep(j, n){
        if(sh.at(i).first == get<0>(sh2.at(j))){
          cout << get<2>(sh2.at(j)) << endl;
          get<0>(sh2.at(j)) = "--";
          break;
        }
      }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
  int i,l;
  char s[100010];
  scanf("%s",s);
  for(l=strlen(s)-1;l;l--){
    if(l%2)continue;
    for(i=0;i*2<l;i++){
      if(s[i]!=s[i+l/2])goto NEXT;
    }
    printf("%d\n",l);
    return 0;
    NEXT:;
  }
}
  


Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

using namespace std;
typedef long long unsigned int ll;

int main() {
  
  vector<string> c(3);
  for (int i = 0; i < 3; ++i) {
    cin >> c[i];
  }

  for (int i = 0; i < 3; ++i) cout << c[i][i];
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			double x = sc.nextDouble();
			System.out.println(x<=48.00?"light fly":x<=51.00?"fly":x<=54.00?"bantam":x<=57.00?"feather":
                                           x<=60.00?"light":x<=64.00?"light welter":x<=69.00?"welter":
                                           x<=75.00?"light middle":x<=81.00?"middle":x<=91.00?"light heavy":"heavy");
		}
	}
}

Measured memory_bytes: 19268
#include<bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=(a),_ed=(b);i<=_ed;++i)
#define DREP(i,a,b) for(int i=(a),_ed=(b);i>=_ed;--i)
typedef long long ll;
inline int read(){
    register int x=0,f=1;register char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=0;ch=getchar();}
    while(isdigit(ch)){x=x*10+(ch^'0');ch=getchar();}
    return f?x:-x;
}

#define Fail return puts("No"),0;
const int N=3e5+5;
int n,p[N],tr[N];
inline void add(int x,int v){for(;x<=n;x+=x&-x)tr[x]+=v;}
inline int query(int x){int ans=0;for(;x;x-=x&-x)ans+=tr[x];return ans;}

int main(){
    //freopen("in.in","r",stdin);
    REP(i,1,n=read())p[i]=read();
    ll a=0,s=0;
    for(int i=(n&1?n:n-1);i>0;i-=2){
	if(!(p[i]&1))Fail;
	a+=query(p[i]);
	add(p[i],1);
    }
    memset(tr,0,sizeof tr);
    for(int i(n&1?n-1:n);i>0;i-=2){
	if(p[i]&1)Fail;
	a+=query(p[i]);
	add(p[i],1);
    }
    memset(tr,0,sizeof tr);
    DREP(i,n,1)s+=query(p[i]),add(p[i],1);
    return puts(a*3==s?"Yes":"No"),0;
}


Measured memory_bytes: 2688
#include <iostream>
#include <queue>
#define abs(a) ((a)>0 ? (a) : -(a))

using namespace std;

long diffmin,n,p[20];
void dfs(int layer, long a, long b){
	if (layer < n){
		dfs(layer + 1, a + p[layer], b);
		dfs(layer + 1, a, b + p[layer]);
	} else {
		if (diffmin > abs(a - b)){
			diffmin = abs(a - b);
		}
		return;
	}
}
int main(){
	long all = 0, party0 = 0, party1 = 0;
	cin >> n;
	while (n){
		for (int i = 0; i < n; i++){
			long input;
			cin >> input;
			p[i] = input;
			all += input;
		}
		diffmin = all;
		dfs(0, 0, 0);
		cout << diffmin << endl;
		cin >> n;
		party0 = party1 = 0;
		all = 0;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>

#define LEN_MAX 100

void main()
{
    char str[LEN_MAX + 1];
    int len;
    int JudgeNum;

    scanf("%d", &len);
    scanf("%s", str);

    if(len % 2 != 0)
    {
        printf("No");
        return;
    }

    JudgeNum = len / 2;

    for(int i = 0; i < JudgeNum; i++)
    {
        if(str[i + JudgeNum] != str[i])
        {
            printf("No");
            return;
        }
    }

    printf("Yes");
    return;
}

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

#define rep(i,l,r) for(int i=l;i<=r;++i)
const int N=1e5+5;
int cnt[N];
bool may[N];

int main()
{
	//freopen("1.in","r",stdin);
	int n,m;
	cin>>n>>m;
	rep(i,1,n)cnt[i]=1;
	may[1]=1;
	while(m--)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		--cnt[x];++cnt[y];
		may[y]|=may[x];
		may[x]&=bool(cnt[x]);
	}
	int ans=0;
	rep(i,1,n)ans+=may[i];
	cout<<ans;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#include <unistd.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 3e18;
const ll fact_table = 800008;
double Pi = 3.1415926535897932384626;
 
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←
 
 
#define p(x) cout<<x<<"\n";
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(8)<<x<<"\n";
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
 
 
//ll mod = 998244353;
ll mod = 1000000007;
 
ll rui(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll mod1 = 2000000011;
ll mod2 = 2000000033;


ll rui1(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui1(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod1;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod1;
        }
        return number3;
    }
}

ll rui2(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui2(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod2;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod2;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
 
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
 
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
 
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
 
/*
ll fact[fact_table + 5],rfact[fact_table + 5];
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = rui(fact[fact_table],mod - 2);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
*/
 
ll n,m,num,a,b,c,d,e,g,h,w,i,j,q,r,l;
ll k;
ll ans;
ll x[500005], y[500005], z[200005];
char s[500005];
//vector<ll> G[550010];

void solve_a(){
    cin >> a >> b >> c;
    bool flag = false;
    if(a == b && a != c)flag = true;
    if(a == c && a != b)flag = true;
    if(a != b && b == c)flag = true;
    Yes(flag);
}

int main(){
    solve_a();
    return 0;
}











Measured memory_bytes: 256