akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>
#include <deque>
#include <complex>

using namespace std;

/*
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
*/

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<long long, long long> pll;
typedef vector<pll> vpll;

typedef long double ld;
typedef vector<ld> vld;

typedef vector<bool> vb;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, n) for (ll i = 1; i <= (n); i++)
#define rrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rreps(i, n) for (ll i = (n); i >= 1; i--)
#define all(v) (v).begin(), (v).end()

template <class T> void chmin(T& a, T b) { a = min(a, b);}
template <class T> void chmax(T& a, T b) { a = max(a, b);}

constexpr int INF = 1 << 30;
constexpr ll INFL = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr ld EPS = 1e-12;
ld PI = acos(-1.0);

void solve() {
    ll h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    cout << (h2*60+m2) - (h1*60+m1) - k << endl;
    return;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}

Measured memory_bytes: 3652
using System;

namespace ITP_5_B{
    public class Program{
        public static void Main(string[] args){
            bool loopFlag = true;

            while(loopFlag){
                string[] temp = Console.ReadLine().Split(' ');
                int y = int.Parse(temp[0]);
                int x = int.Parse(temp[1]);

                if(x==0 && y==0){
                    loopFlag = false;
                }else{
                    //???????????????????????????
                    for(int h=0;h<y; h++){
                        for(int w=0;w<x; w++){
                            if(w==0 || w==(x-1) || h==0 || h==(y-1)){
                                Console.Write("#");
                            }else{
                                Console.Write(".");
                            }
                        }
                        Console.WriteLine();
                    }
                    Console.WriteLine();
                }
            }
        }
    }
}

Measured memory_bytes: 8788
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int N, M, X, Y;

	cin >> N >> M >> X >> Y;

	int max_x = X;
	int min_y = Y;

	int x;
	for (int ni = 0; ni < N; ni++) {
		cin >> x;
		max_x = max(max_x, x);
	}

	int y;
	for (int mi = 0; mi < M; mi++) {
		cin >> y;
		min_y = min(min_y, y);
	}

	if (max_x < min_y) {
		cout << "No War";
	}
	else {
		cout << "War";
	}


	return 0;
}



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

class Main {

	void solve () {

		char[] a = in.next().toCharArray(), b = in.next().toCharArray();
		int ans = 0;
		for (int i=0; i<3; i++) {
			if (a[i] == b[i]) ans++;
		}
		System.out.println(ans);
		
	}

	public static PrintWriter out = new PrintWriter(System.out);
	public static Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

}

Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int H, W, K;
int sy,sx;
struct pnt{
    int y,x,cost,cnt;
};

bool operator< (const pnt &pnt1, const pnt &pnt2){
    if(pnt1.cost<pnt2.cost){
        return true;
    }else if(pnt1.cost>pnt2.cost){
        return false;
    }else{
        return pnt1.cnt<pnt2.cnt;
    }
}
bool operator> (const pnt &pnt1, const pnt &pnt2){
    if(pnt1.cost>pnt2.cost){
        return true;
    }else if(pnt1.cost<pnt2.cost){
        return false;
    }else{
        return pnt1.cnt>pnt2.cnt;
    }
}

vector<vector<int>> mv={{1,0},{-1,0},{0,1},{0,-1}};
vector<vector<int>> dist(800,vector<int>(800,MOD));

int bfs(vector<vector<char>> &grid){
    priority_queue<pnt,vector<pnt>,greater<pnt>> que;
    que.push({sy,sx,1,0});
    while((int)que.size()>0){
        pnt now=que.top();
        que.pop();

        if(dist[now.y][now.x]<MOD){
            if(now.cnt>0){
                continue;
            }
        }else{
            dist[now.y][now.x]=now.cost;
        }
        if(now.y==0 || now.y==H-1 || now.x==0 || now.x==W-1){
            return now.cost;
        }else if(now.cnt==K){
            now.cost++;
            now.cnt=0;
        }

        for(auto &m:mv){
            int nx,ny;
            nx=now.x+m[1];
            ny=now.y+m[0];

            if(grid[ny][nx]=='#' && now.cost==1){
                continue;
            }else{
                que.push({ny,nx,now.cost,now.cnt+1});
            }
        }
        if(now.cost==1){
            que.push({now.y,now.x,now.cost+1,0});
        }
    }
}

int main(){
    cin >> H >> W >> K;
    vector<vector<char>> grid(H,vector<char>(W));
    
    for(int i=0; i<H ; i++){
        for(int j=0; j<W; j++){
            char c;
            cin >> c;
            grid[i][j]=c;
            if(c=='S'){
                sy=i;
                sx=j;
            }
        }
    }

    cout << bfs(grid) << endl;;
}

Measured memory_bytes: 10640
#include<iostream>
#include<string>
#include<bitset>
#include<algorithm>

using namespace std;

int main()
{
  string S;
  cin >> S;
  
  bool bS[100000];
  
  char c;
  int count= S.length();
  for(int i = 0; i < count; i++){
    c = S[i];
    if(c == '1')
    {
      bS[i] = 1;
    }
    else
      bS[i] = 0;
  }

  bool b0[count] = {};
  bool b1[count] = {};
  
  int c0 = 0, c1= 0;
  for(int i = 0; i < count; i++){
    if(i % 2 == 0){
      if(bS[i] == 1)
        c0++;
      if(bS[i] == 0)
         c1++;
    }
    else{
      if(bS[i] == 0)
        c0++;
      if(bS[i] == 1)
        c1++;
    }
  }

  cout << min(c0, c1) << endl;
  return 0;
}

Measured memory_bytes: 768
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,A,B,C = LI()
s = ['0']*N
for i in range(N):
    s[i] = str(input())

d = defaultdict(int)
d['A'] = A
d['B'] = B
d['C'] = C

def plus_minus(s,t):
    for c in ['A','B','C']:
        if (c in s) and (c in t):
            plus = c
    if s[0] == plus:
        minus = s[1]
    else:
        minus = s[0]
    return plus, minus 

def min_max(s):
    if d[s[0]] >= d[s[1]]:
        return s[1],s[0]
    else:
        return s[0],s[1]

if A+B+C == 0:
    print('No')
elif A+B+C == 1:
    ans = []
    for i in range(N):
        if d[s[i][0]] == d[s[i][1]] == 0:
            print('No')
            exit()
        else:
            if d[s[i][0]]:
                d[s[i][0]] -= 1
                d[s[i][1]] += 1
                ans.append(s[i][1])
            else:
                d[s[i][1]] -= 1
                d[s[i][0]] += 1
                ans.append(s[i][0])
    print('Yes')
    for a in ans:
        print(a)
else:
    if d[s[0][0]] == d[s[0][1]] == 0:
        print('No')
    else:
        print('Yes')
        for i in range(N):
            if d[s[i][0]] == 0:
                d[s[i][0]] += 1
                d[s[i][1]] -= 1
                print(s[i][0])
            elif d[s[i][1]] == 0:
                d[s[i][1]] += 1
                d[s[i][0]] -= 1
                print(s[i][1])
            elif d[s[i][0]] == d[s[i][1]] == 1:
                if i != N-1:
                    p,m = plus_minus(s[i],s[i+1])
                    d[p] += 1
                    d[m] -= 1
                    print(p)
                else:
                    d[s[i][0]] += 1
                    d[s[i][1]] -= 1
                    print(s[i][0])
            else:
                min_,max_ = min_max(s[i])
                d[min_] += 1
                d[max_] -= 1
                print(min_)

Measured memory_bytes: 79968
#include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

#define MAX_NSUSHI 200000

class Sushi {
  public:
    long long x;
    long long val;
    Sushi() {}
};

Sushi sushi[MAX_NSUSHI];
long long point[MAX_NSUSHI];
long long point2[MAX_NSUSHI];
long long max_point[MAX_NSUSHI];
long long max_point2[MAX_NSUSHI];
long long rev_point[MAX_NSUSHI];
long long rev_point2[MAX_NSUSHI];

void print_array(long long nsushi)
{
  for(long long i = 0; i < nsushi; i++) {
    printf("point[%lld]      = %lld\n", i, point[i]);
    printf("point2[%lld]     = %lld\n", i, point2[i]);
    printf("max_point[%lld]  = %lld\n", i, max_point[i]);
    printf("max_point2[%lld] = %lld\n", i, max_point2[i]);
    printf("rev_point[%lld]  = %lld\n", i, rev_point[i]);
    printf("rev_point2[%lld] = %lld\n", i, rev_point2[i]);
    putchar('\n');
  }
}

int main()
{
  long long nsushi, len, ans = 0;
  scanf("%lld %lld", &nsushi, &len);
  for(long long i = 0; i < nsushi; i++) {
    scanf("%lld %lld", &sushi[i].x, &sushi[i].val);
  }
  for(long long i = 0; i < nsushi; i++) {
    if(i == 0) {
      point[i] = sushi[i].val - sushi[i].x;
      point2[i] = sushi[i].val - sushi[i].x * 2;
    } else {
      point[i] = sushi[i].val - sushi[i].x + sushi[i-1].x + point[i-1];
      point2[i] = sushi[i].val - (sushi[i].x - sushi[i - 1].x) * 2+point2[i - 1];
    }
  }
  for(long long i = 0; i < nsushi; i++) {
    if(i == 0) {
      max_point[i] = 0;
      max_point2[i] = 0;
    } else {
      max_point[i] = max(point[i-1], max_point[i-1]);
      max_point2[i] = max(point2[i-1], max_point2[i-1]);
    }
  }
  for(long long i = nsushi-1; 0 <= i; i--) {
    if(i == nsushi-1) {
      rev_point[i] = sushi[i].val - (len - sushi[i].x);
      rev_point2[i] = sushi[i].val - (len - sushi[i].x) * 2;
    } else {
      rev_point[i] = sushi[i].val - (sushi[i+1].x - sushi[i].x) + rev_point[i+1];
      rev_point2[i] = sushi[i].val - (sushi[i+1].x - sushi[i].x) * 2 + rev_point2[i+1];
    }
  }
  for(long long i = 0; i < nsushi; i++) {
    ans = max(point[i], max(max_point2[i] + rev_point[i], max(max_point[i] + rev_point2[i], max(rev_point[i], ans))));
  }
  printf("%lld\n", ans);
  //print_array(nsushi);
  return 0;
}


Measured memory_bytes: 12032
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
#define reps(i, n) for(int i = 1; i <= n; i++)
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;
 
int main()
{
	int a, b, c, d, x, y;
  	cin >> a >> b >> c >> d;
  	x=max(a, c);
  	y=min(b, d);
  	if(x<y) cout << (y-x) << endl;
  	else cout << '0' << endl;
	return 0;
}

Measured memory_bytes: 256
k = int(input())
ans = [str(i) for i in range(1,10)]
c = 0

while len(ans) < k:
    now = ans[c]
    t = int(now[-1])
    if t != 0:
        ans.append(str(now) +str(t-1))

    ans.append(str(now) +str(now)[-1])

    if t != 9:
        ans.append(str(now) +str(t+1))

    c += 1
print(ans[k-1])

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  string s;
  cin >> s;
  cout << s.substr(0, 3);
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 3600
#include "iostream"
#include "algorithm"
#include "vector"
#include "string"
#define cout(s) cout<<s<<endl 
using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if (a <= c&&c <= b)cout("Yes");
	else cout("No");
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <limits>
typedef long long ll;
const int MOD = 1000000007;
const ll INF = 1234567890123456;

#define REP(i,n)   for(int i=0; i<(int)(n); ++i)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); ++i)

#define in cin
#define out cout
#define pb push_back
using namespace std;

int main(){
	int n, w, h;
	int H[100010] = { 0 }, W[100010] = { 0 };
	in >> n >> w >> h;
	int x, y, l;
	REP(i, n) {
		in >> x>> y>> l;
		int xs = x - l, ys = y - l;
		int xe = x + l, ye = y + l;
		if (x - l < 0)xs = 0;
		if (x + l >= w)xe = w+1;
		if (y - l < 0)ys = 0;
		if (y + l >= h)ye = h+1;
		W[xs]++; W[xe]--;
		H[ys]++; H[ye]--;
	}
	/*
	REP(i, w)out << W[i] ;
	out << endl;
	REP(i, h)out << H[i] ;
	*/
	
	int f1 = 0, f2 = 0, tmp = 0;
	REP(i, w + 1) {
		tmp += W[i];
		if (tmp == 0)f1 = 1;
	}
	tmp = 0;
	REP(i, h + 1) {
		tmp += H[i];
		if (tmp == 0)f2 = 1;
	}
	string ans = "Yes";
	if (f1&&f2)ans = "No";
	out << ans << endl;
	int aa;
	in >> aa;
	return 0;

}

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

int K;
string s,t;
map<string,bool>T;
priority_queue<string,vector<string>,greater<string> >Q;

int main(void){
    cin >> s >> K;
    for(int i=1;i<=K;i++){//i取り出す文字の長さ
        for(int j=0;j+i-1<s.length();j++){
            t = s.substr(j,i);
            if(!T[t]){
                T[t] = true;
                Q.push(t);
            }
        }
    }
    
    for(int i=0;i<K;i++){
        t=Q.top();Q.pop();
    }
    cout << t << endl;

}


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

int main(){
  int n,ttl=0;cin>>n;
  vector<int> a(n,0);
  REP(i,n){
    cin>>a.at(i);
    ttl^=a.at(i);
  }
  REP(i,n){
    int tmp=ttl^a.at(i);
    cout<<tmp<<" ";
  }
}

Measured memory_bytes: 4052
// g++ -I ~/Documents/programming/cppLib -std=gnu++14 -o test ~/Documents/programming/cppLib/test.cpp && ./test && rm test
#include <bits/stdc++.h>
using namespace std;
template <typename T> using vector2 = vector <vector  <T>>;
template <typename T> using vector3 = vector <vector2 <T>>;
template <typename T> using vector4 = vector <vector3 <T>>;
using lint = long long;
#define FOR( i, a, b ) for( lint i=(a) ; i < (b) ; ++i )
#define REP( i, n )    for( lint i= 0  ; i < (n) ; ++i )
#define ALL( v )       (v).begin(), (v).end()

int main() {
    int N;
    cin >> N;
    cout << (N-2)*180 << endl;
}


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

int main(){

  int ans,a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;

  if(e-a <= k){
    cout << "Yay!" << endl;
  }
  else{
    cout << ":(" << endl;
  }

  return 0;
}

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

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

    int cost_min = 1e9;
    for (int target = -100; target <= 100; ++target) {
        int cost = 0;
        for (int i = 0; i < N; ++i) {
            cost += pow(a[i] - target, 2);
        }
        cost_min = min(cost_min, cost);
    }

    cout << cost_min << endl;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

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

use std::cmp::{max, min};
const MOD: i64 = 1_000_000_007;

fn main() {
    let n: usize = read();
    let m: usize = read();
    let mut a: Vec<usize> = vec![1; n + 1];

    for _ in 0..m {
        a[read::<usize>()] = 0;
    }
    let mut b: Vec<i64> = vec![0; n + 1];
    b[0] = 1;

    for i in 0..n {
        if b[i] > 0 {
            if i + 1 < b.len() && a[i + 1] == 1 {
                b[i + 1] += b[i];
                b[i + 1] %= MOD;
            }
            if i + 2 < b.len() && a[i + 2] == 1 {
                b[i + 2] += b[i];
                b[i + 2] %= MOD;
            }
        }
    }
    println!("{}", b[n]);
}


Measured memory_bytes: 3608
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

N,u,v = MI()
Graph = [[] for _ in range(N+1)]

for i in range(N-1):
    a,b = MI()
    Graph[a].append(b)
    Graph[b].append(a)

dist_T = [-1]*(N+1)
dist_A = [-1]*(N+1)
dist_T[u] = 0
dist_A[v] = 0

from collections import deque
q1 = deque([u])
q2 = deque([v])
while q1:
    n = q1.pop()
    for d in Graph[n]:
        if dist_T[d] == -1:
            dist_T[d] = dist_T[n] + 1
            q1.appendleft(d)
while q2:
    n = q2.pop()
    for d in Graph[n]:
        if dist_A[d] == -1:
            dist_A[d] = dist_A[n] + 1
            q2.appendleft(d)

ans = 0
for i in range(1,N+1):
    if dist_T[i] < dist_A[i]:
        ans = max(ans,dist_A[i]-1)

print(ans)


Measured memory_bytes: 89080
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	boolean[] isPrime = new boolean[1000001];
	void run() {
		Scanner sc = new Scanner(System.in);
		for(int i=2;i<=1000000;i++) { 
			if(!isPrime[i])
				for(int j=i*2;j<=1000000;j+=i) isPrime[j] = true;
		}
		isPrime[0] = isPrime[1] = true;
		for(;;) {
			int n = sc.nextInt();
			int cost = sc.nextInt();
			if((n|cost) == 0) break;
			boolean[] dp = new boolean[cost+1];
			fill(dp, false);
			dp[0] = true;
			int[] dish = new int[n];
			for(int i=0;i<n;i++) dish[i] = sc.nextInt();
			
			for(int i=0;i<=cost;i++) for(int j=0;j<n;j++) {
				if(i + dish[j] <= cost && dp[i]) 
					dp[i+dish[j]] = true;
			}
			int ans;
			for(ans = cost;ans>=0;ans--) {
				if( dp[ans]&(!isPrime[ans]) ) break;
			}
			if(ans == -1) System.out.println("NA");
			else System.out.println(ans);
		}
		
	}

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

Measured memory_bytes: 15000
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = System.Console.ReadLine().Trim().Split(' ');
            int iN = int.Parse(sS[0]);
            int iK = int.Parse(sS[1]);
            string s2 = System.Console.ReadLine().Trim();

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            char[] cS = s2.ToCharArray();
            cS[iK - 1] = Char.ToLower(cS[iK - 1]);
            string sOut = new string(cS);

            // 出力
            System.Console.WriteLine("{0}", sOut.ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


Measured memory_bytes: 11220
using System;
using System.Text;
using System.Linq;

class Program
{
    static void Main(string[] args) {
#if DEBUG
        System.Diagnostics.Debug.WriteLine("-----TextFile1");
        System.Diagnostics.Debug.WriteLine(process("../TextFile1.txt"));
        System.Diagnostics.Debug.WriteLine("-----TextFile2");
        System.Diagnostics.Debug.WriteLine(process("../TextFile2.txt"));
        System.Diagnostics.Debug.WriteLine("-----TextFile3");
        System.Diagnostics.Debug.WriteLine(process("../TextFile3.txt"));
#endif

#if !DEBUG
        String ret = process(new System.IO.StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static string process(string filePath) {
        using (var input = new System.IO.StreamReader(filePath)) {
            if(input.EndOfStream) return "NO PROC";
            return process(input);
        }
    }

    static string process(System.IO.TextReader input) {
        var s     = input.ReadLine();
        var spl   = s.Split(' ');
        int n     = int.Parse(spl[0]);
        int d     = int.Parse(spl[1]);

        int[][] ary  = new int[n][];

        for(int i=0; i<n; i++) {
            ary[i] = ToIntArray(input.ReadLine(), d);
        }

        int count = 0;
        for(int i=0; i<n; i++) {
            for(int j=i; j<n; j++) {
                if (i == j) continue;
                if (calc(ary[i], ary[j], d)) count++;
            }
        }

        return count.ToString();
    }

    static bool calc(int[] xi, int[] xj, int size) {
        int v = 0;
        for(int i=0; i<size; i++) {
            int k = xi[i] - xj[i];
            v += k * k;
        }
        for(int i=0; ; i++) {
            int ii = i * i;
            if (ii == v) return true;
            if (ii > v) return false;
        }
    }
    
    static int[] ToIntArray(string strs, int n) {
        int[] ret = new int[n];
        var spl =strs.Split(' ');
        for (int i = 0; i < n; i++) ret[i] = int.Parse(spl[i]);
        return ret;
    }
}

Measured memory_bytes: 13268
n,m,k = map(int,input().split())
arr1 = list(map(int,input().split()))
arr2 = list(map(int,input().split()))

acum1 = [0]
for i in range(n):
    acum1.append(acum1[-1]+arr1[i])

acum2 = [0]
for i in range(m):
    acum2.append(acum2[-1]+arr2[i])

ans = 0
j = m
for i in range(n+1):
    if acum1[i]>k:
        break
    while acum2[j]>k-acum1[i] and j>0:
        j -= 1
    ans = max(ans, i+j)
print(ans)

Measured memory_bytes: 47476
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int min = 101;
        int sum = 0;
        
        for(int i = 0; i < n; i++){
            if(Math.abs(l + i) < Math.abs(min)){
                min = l + i;
            }
            
            sum = sum + l + i;
        }
        
        System.out.println(sum - min);
    }
}


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

using namespace std;
const int N = 1e5, MOD = 1e9 + 7;

int dpw[1 + N], dpb[1 + N];
vector <int> gr[1 + N];
#define pb push_back

void dfs (int nod, int tata) {
    for (auto fiu : gr[nod])
        if (fiu != tata) {
            dfs (fiu, nod);
            dpb[nod] = (1ll * dpb[nod] * dpw[fiu]) % MOD;
            dpw[nod] = (1ll * dpw[nod] * (dpw[fiu] + dpb[fiu])) % MOD;
        }
}

int main() {
    int n;
    cin >> n;
    for (int i = 1; i < n; i++) {
        int x, y;
        cin >> x >> y, gr[x].pb (y), gr[y].pb (x);
    }
    for (int i = 1; i <= n; i++)
        dpw[i] = dpb[i] = 1;
    dfs (1, 0);
    cout << (dpw[1] + dpb[1]) % MOD;
    return 0;
}


Measured memory_bytes: 13440
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	string str;
	cin>>str;
	char c=str[0];
	int ans=1;
	for(int i=1;i<str.length();i++){
		if(str[i]!=c){
			ans++;
			c=str[i];
		}
	}
	cout<<ans;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
#define m_p make_pair
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if  (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    string s;
    cin >> s;
    rep(i,s.size()){
        if((i%2==0 && s[i]=='L') || (i%2!=0 && s[i]=='R')){
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
    return 0;
}

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

int main(){
	int N, K;
  	cin >> N >> K;
  	vector<int> f(N);
  	for(int i=0;i<N;i++) cin >> f.at(i);
  	sort(f.begin(),f.end());
  	int res=0;
  	for(int i=0;i<K;i++) {
    	res += f.at(i);
    }
   cout << res << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 1000000007;
const ll INF = 10000000000;
#define all(v) v.begin(), v.end()

vector<ll> par(100000);
vector<ll> ran(100000);
void init(ll n){
  rep(i,n){
    par.at(i)=i;
    ran.at(i)=0;
  }
}
ll find(ll x){
  if(par.at(x)==x){
    return x;
  }else{
    return par.at(x)=find(par.at(x));
  }
}
void unite(ll x,ll y){
  x=find(x);
  y=find(y);
  if(x==y) return;
  if(ran.at(x)<ran.at(y)){
    par.at(x)=y;
  }else{
    par.at(y)=x;
    if(ran.at(x)==ran.at(y)) ran.at(x)++;
  }
}


int main(){
  ll N,M,ans=0;
  cin >> N >> M;
  init(N);
  rep(i,M){
    ll x,y,z;
    cin >> x >> y >> z;
    unite(x-1,y-1);
  }
  rep(i,N){
    if(i==par.at(i)) ans++;
  }
  cout << ans << endl;
  
}

Measured memory_bytes: 1792
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)

def solve():
    N = int(input())
    AB = [tuple(map(int,input().split())) for i in range(N-1)]
    MOD = 10**9+7
    es = [[] for _ in range(N)]
    for a,b in AB:
        a,b = a-1,b-1
        es[a].append(b)
        es[b].append(a)

    cs = [1] * N
    def dfs(v,p=-1):
        ret = 1
        for to in es[v]:
            if to==p: continue
            ret += dfs(to,v)
        cs[v] = ret
        return ret
    dfs(0)

    pow2 = [1]
    for i in range(N):
        pow2.append((pow2[-1]*2) % MOD)

    ans = 0
    for i in range(N):
        if len(es[i]) == 1: continue
        ans += pow2[N-1] - 1
        c = 0
        for to in es[i]:
            if cs[to] > cs[i]: continue
            c += cs[to]
            ans -= pow2[cs[to]] - 1
        ans -= pow2[N-c-1] - 1

    ans *= pow(pow2[N], MOD-2, MOD)
    print(ans%MOD)
solve()

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

int read(){
    int x=0;bool f=0;char c=getchar();
    while(c<'0'||c>'9') f|=c=='-',c=getchar();
    while(c>='0'&&c<='9') x=x*10+(c^48),c=getchar();
    return f?-x:x;
}

#define MAXN 100000
int N,K,Q;
int S[MAXN+5];

int main(){
    N=read(),K=read(),Q=read();
    for(int i=1;i<=Q;i++)
        S[read()]++;
    for(int i=1;i<=N;i++)
        puts(K-(Q-S[i])<=0?"No":"Yes");
}


Measured memory_bytes: 1024
const euq = (a, b) => {
  if (isNaN(a) || isNaN(b)) {
    return null
  }
  if (a < b) {
    let tmp = b
    b = a
    a = tmp
  }
  if (b == 0) {
    return a
  }
  while (1) {
    let c = a % b
    if (c == 0) {
      return b
    }
    a = b
    b = c
  }
}

const solve = (as) => {
  // p(as)
  // as.sort((a, b) => b - a)
  // ...
  let l = [0]

  for (var i = 0; i < as.length - 1; i++) {
    l[i + 1] = euq(l[i], as[i])
  }

  let r = []
  r[as.length - 1] = 0
  for (var i = 1; i < as.length; i++) {
    let j = as.length - 1 - i
    // console.log(as[j])
    r[j] = euq(r[j + 1], as[j + 1])
  }
  // p(l, r)
  let z = []
  for (var i = 0; i < as.length; i++) {
    z[i] = euq(l[i], r[i])
  }
  // p(z)
  z.sort((a, b) => b - a)
  return z[0]
}

const main = (input) => {
  const [n, as] = input.split("\n")
  return solve(as.split(" ").map(Number))
}

if (process.env.NODE_ENV !== "test") {
  const input = require("fs").readFileSync("/dev/stdin", "utf8")
  console.log(main(input.trim()))
}

Measured memory_bytes: 31512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;

int main()
{
    int a, b, c;
    string s;

    cin >> a;
    cin >> b;
    cout << (a - 1) * (b - 1) << endl;
    return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <string>

using namespace std;

int n, m, q;
vector<int> a, b, c, d, v;

int calc() {
	int ret = 0;
	for (int i = 0; i < q; i++) {
		if (v[b[i]] - v[a[i]] == c[i]) {
			ret += d[i];
		}
	}

	// for (auto x: v) {
	// 	printf("%d ", x);
	// }
	// printf(": %7d\n", ret);

	return ret;
}

int dfs(int idx) {
	if (idx == n) {
		int ret = calc();
		return ret;
	}

	int st = idx == 0 ? 1 : v[idx-1];
	int ret = -1;
	for (int i = st; i <= m; i++) {
		v[idx] = i;
		int tmp = dfs(idx+1);
		ret = max(tmp, ret);
	}

	return ret;
}

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

	a.assign(q, 0);
	b.assign(q, 0);
	c.assign(q, 0);
	d.assign(q, 0);
	for (int i = 0; i < q; i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
		a[i]--;
		b[i]--;
	}

	v.assign(n, 0);

	int ans = dfs(0);
	cout << ans << endl;
	return 0;
}


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

int main(){
    int x,y;
    cin >> x >> y;
    
    bool flag = 0;
    for(int i = 0; i <=x; i++) {
        if(y == 2*i+4*(x-i)) flag = 1;
    }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define llong long long
#define mkpr make_pair
#define x first
#define y second
#define iter iterator
#define riter reversed_iterator
#define y1 Lorem_ipsum_
#define tm dolor_sit_amet_
using namespace std;

inline int read()
{
	int x = 0,f = 1; char ch = getchar();
	for(;!isdigit(ch);ch=getchar()) {if(ch=='-') f = -1;}
	for(; isdigit(ch);ch=getchar()) {x = x*10+ch-48;}
	return x*f;
}

const int mxN = 1e5;
struct Interval
{
	llong l,r;
	bool operator <(const Interval &arg) const {return r<arg.r;}
} a[mxN+3];
vector<int> disc;

int f[mxN*2+3];
int n;

int getid(llong x) {return lower_bound(disc.begin(),disc.end(),x)-disc.begin()+1;}

int main()
{
	n = read();
	for(int i=1; i<=n; i++) {a[i].l = read(),a[i].r = read(),a[i].l-=a[i].r,a[i].r=a[i].l+2*a[i].r,disc.push_back(a[i].l),disc.push_back(a[i].r);}
	sort(disc.begin(),disc.end()); disc.erase(unique(disc.begin(),disc.end()),disc.end());
	for(int i=1; i<=n; i++) a[i].l = getid(a[i].l),a[i].r = getid(a[i].r);
	sort(a+1,a+n+1);
	for(int i=1,j=1; i<=disc.size(); i++)
	{
		while(j<=n&&a[j].r<=i)
		{
			f[i] = max(f[i],f[a[j].l]+1);
			j++;
		}
		f[i] = max(f[i],f[i-1]);
	}
	printf("%d\n",f[disc.size()]);
	return 0;
}

Measured memory_bytes: 3444
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int slime = scan.nextInt();
		String color = scan.next();
		String[] array = new String[slime+1];
		int count = 0;

		for(int i=0;i<slime;i++) {

			array[i] = color.substring(i,i+1);
		}
		for(int i=0;i<slime;i++) {
			if(!array[i].equals(array[i+1])) {
				count++;
			}
		}

		System.out.println(count);
		scan.close();

	}

}


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

const int MAXN = 200000;
int N, Q, a, b;
vector<int> adj[MAXN+1];
int point[MAXN+1];
int ans[MAXN+1];

int main() {
  ios::sync_with_stdio(false);
  cin >> N >> Q;
  for(int i = 0; i < N-1; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for(int i = 0; i < Q; i++) {
    cin >> a >> b;
    point[a] += b;
  }
  for(int i = 1; i <= N; i++)
    ans[i] = -1;

  queue<int> q;
  q.push(1);
  ans[1] = point[1];

  while(q.size()) {
    int cur = q.front(); q.pop();
    for(int x : adj[cur]) {
      if(ans[x] != -1) continue;
      ans[x] = ans[cur] + point[x];
      q.push(x);
    }
  }
  for(int i = 1; i <= N; i++)
    cout << ans[i] << " ";
}


Measured memory_bytes: 15604
#include <iostream>

using namespace std;

int main(){
    int n,count=0;
    bool fl=false;
    cin>>n;
    for(int i=0; i<n; i++) {
        int a,b;
        cin>>a>>b;
        if(a==b) count++;
        else count=0;

        if(count>=3) fl=true;
    }

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

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

#define VARNAME(x) #x
#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
vector<T> Vec(int n, T v)
{
    return vector<T>(n, v);
}
template <class... Args>
auto Vec(int n, Args... args)
{
    auto val = Vec(args...);
    return vector<decltype(val)>(n, move(val));
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = (ll)1e9 + 7LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<ll> sum1(N);
    vector<ll> sum2(N);
    for (int i = 0; i < N; i++) {
        cin >> sum1[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> sum2[i];
    }
    for (int i = 1; i < N; i++) {
        sum1[i] += sum1[i - 1];
    }
    for (int i = N - 2; i >= 0; i--) {
        sum2[i] += sum2[i + 1];
    }
    ll maxi = 0;
    for (int i = 0; i < N; i++) {
        maxi = max(maxi, sum1[i] + sum2[i]);
    }
    cout << maxi << endl;

    return 0;
}


Measured memory_bytes: 256
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    if s[0] == s[1] and s[1] == s[2]:
        print('Yes')
        return
    if s[1] == s[2] and s[2] == s[3]:
        print('Yes')
        return
    
    print('No')
    return


solve()


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#define rep(i, a, n) for(int i = a;i < n;i++)
using namespace std;


int n;
int c[500];
int s[500];
int f[500];


int solve(int ss){
	if(ss == n-1) return 0;
	int time = s[ss] + c[ss];
	rep(i, ss+1, n-1){
		if(time >= s[i]){
			if(!((time - s[i]) % f[i])){
				time += c[i];
				continue;
			}
			else {
				time += f[i] - ((time - s[i]) % f[i]);
				time += c[i];
				continue;
			}
		}
		else {
			time = s[i] + c[i];
			continue;
		}
	}
	return time;
}


int main(){
	cin >> n;
	rep(i, 0, n-1) cin >> c[i] >> s[i] >> f[i];

	rep(i, 0, n) cout << solve(i) << endl;

	return 0;
}

Measured memory_bytes: 256
macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}

fn check(rate: usize) -> String {
    if rate < 1200 {"ABC".to_owned()}
    else {"ARC".to_owned()}
}

fn main() {
    let rating = get!(usize);
    println!("{}", check(rating));
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = (int)1e9 + 7;

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

    int n, w;
    cin >> n >> w;

    vector<int> wei(n), val(n);
    REP(i, n) cin >> wei[i] >> val[i];

    vector<vector<LL>> dp(n+1, vector<LL>(100005, INFL));
    dp[0][0] = 0;
    REP(i, n){
        REP(j, 100005){
            if(val[i] <= j && dp[i][j - val[i]] + wei[i] <= w){
                dp[i+1][j] = min(dp[i][j], dp[i][j-val[i]] + wei[i]);
            }else{
                dp[i+1][j] = dp[i][j];
            }
        }
    }

    int ans = 0;
    REP(i, 100001) if(dp[n][i] != INFL) ans = i;

    cout << ans << endl;
}

Measured memory_bytes: 80256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N = INT()
A = LIST()

A1 = [A[i]+i+1 for i in range(N)]
A2 = [i+1-A[i] for i in range(N)]

C1 = Counter(A1)
C2 = Counter(A2)

ans = 0
for x in C1.keys():
	ans += C1[x]*C2[x]

print(ans)

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

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

  int num;
  num=A%B;
  bool t=false;

  for(int i=1;i<B;i++)  {
    if(num*i%B==C) t=true;
  }
  if(t) cout << "YES" << endl;
  else cout << "NO" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	int a,b;cin>>a>>b;
	cout << a * b << endl;
	return 0;
}

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

#define ll long long
#define F first
#define S second
#define ii pair < int , int >
#define ever (;;)

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

    if( x >= 30 )
        cout<<"Yes\n";
    else
        cout<<"No\n";
}


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


using namespace std;

#define f first
#define s second


using ll = long long;
const int MOD = 1000000007;
template<class T, class U> void add(T &a, U b){
    a += b;
    if (a >= MOD) {
        a -= MOD;
    }
}

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    int h, w;
    cin >> h >> w;
    vector<vector<char> > a(h+1, vector<char>(w+1, '*'));
    vector<vector<ll> > dp(h+1, vector<ll>(w+1, 0));
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> a[i][j];
        }
    }
    dp[0][0] = 1;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if(i && a[i-1][j] != '#'){
                add(dp[i][j], dp[i-1][j]);
            }
            if(j && a[i][j-1] != '#'){
                add(dp[i][j], dp[i][j-1]);
            }
        }
    }
    cout << dp[h-1][w-1] << "\n";
}



Measured memory_bytes: 12172
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

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

    if((A==B&&A!=C)||(C==B&&B!=A)||(A==C&&B!=C)){
        cout << "Yes";
    }
    else{
        cout << "No";
    }

    return 0;
}

Measured memory_bytes: 256
S = input()
ans = 0
for i in range(2**(len(S)-1)):
    plus = []
    bit = i
    for j in range(len(S)-1):
        if bit & 1 == 1:
            plus.append(True)
        else:
            plus.append(False)
        bit = bit >> 1
    elm = []
    tmp = S[0]
    for j in range(1,len(S)):
        if plus[j-1] == True:
            elm.append(int(tmp))
            tmp = S[j]
        else:
            tmp += S[j]
    if tmp != '':
        elm.append(int(tmp))

    ans += sum(elm)
print(ans)






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

int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i=0;i<h;i++) cin >> s.at(i);
  for(int i=0;i<h;i++) {
    for(int j=0;j<w;j++) {
      if(s[i][j]=='#'){
        cout << '#';
        continue;
      };
      int ans=0;
      for(int k=-1;k<2;k++) {
        if(i+k>=0&&i+k<h) {
          for(int l=-1;l<2;l++) {
            if(j+l>=0&&j+l<w) {
              if(s[i+k][j+l]=='#'&&!(k==0&&l==0)) ans++;
            };
          };
        };
      };
      cout << ans;
    };
    cout << endl;
  };
}

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

using namespace std;

int main(){
	char* s = (char*)calloc(100, sizeof(char));
	cin >> s;
	char* cp = (char*)calloc(strlen(s)+1, sizeof(char));
	strcpy(cp, s);
	char* p = (char*)calloc(100, sizeof(char));
	cin >> p;
	
	for(size_t i = 0; i < strlen(s); i++){
		int index = i;
		bool flg = true;
		for(size_t j = 0; j < strlen(p); j++){
			//cout << "comp:" << cp[index] << " and " << p[j] << endl;
			if(cp[index] != p[j]){
				flg = false;
				break;
			}
			index++;
			if(index > strlen(cp)-1) index = 0;
		}
		if(flg){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	
	
}





Measured memory_bytes: 3168
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

/*

*/



int main(void){
	ll n,sum=0,a[1010][1010],cur=1;
	cin>>n;
	reg(i,1,100010){
		rep(j,i){
			a[j][i-1]=cur;
			a[i][j]=cur;
			cur++;
		}
		sum+=2*i;
		if(sum>n*2)break;
		if(sum==n*2){
			//可能
			cout<<"Yes"<<endl;
			cout<<i+1<<endl;
			rep(j,i+1){
				printf("%d ",i);
				rep(k,i){
					printf("%lld ",a[j][k]);
				}
				printf("\n");
			}
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 6784
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B

#C
n,x = LI()
a = LI()
ans = 0
for i in range(n-1):
    if a[i]+a[i+1] > x:
        ans += a[i+1]+a[i]-x
        if x > a[i]:
            a[i+1] = x-a[i]
        else:
            a[i+1] = 0
            a[i] = x
print(ans)
#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 60144
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

ll N;
double x[8], y[8];
double len(ll a, ll b){
    return hypot(x[a] - x[b], y[a] - y[b]);
}    


int main(){

    cin >> N;
    rep(i, N)cin >> x[i] >> y[i];
    vector<ll>v(N);
    rep(i, N)v[i] = i;
    double sum = 0.0;
    ll cnt = 0;
    do{
        cnt++;
        for(ll i = 1; i < N; i++){
            sum += len(v[i-1], v[i]);
        }
    }while(next_permutation(v.begin(), v.end()));
    printf("%.10f\n", sum / cnt);

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
  
#define DIV 1000000007
typedef vector<ll> Array;
typedef vector<Array> matrix;
typedef tuple<int,int,int> tiii;
#define mt make_tuple

int main(){
  string s; cin >> s;
  string a = "CODEFESTIVAL2016";
  int ans = 0;
  rep(i,a.size()) if(a[i] != s[i]) ans++;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 100000
typedef long long llong;

int n, k;
 llong T[MAX];

int check(llong P){
	int i = 0;
	for (int j = 0; j < k; j++) {
		llong s = 0;
		while (s + T[i] <= P) {
			s += T[i];
			i++;
			if (i == n)return n;
		}
	}
	return i;
}

int solve() {
	llong left = 0;
	llong right = 100000 * 10000;
	llong mid;
	while (right - left > 1) {
		mid = (left + right) / 2;
		int v = check(mid);
		if (v >= n)right = mid;
		else left = mid;
	}

	return right;
}

int main() {
	cin >> n >> k;
	for (int i = 0; i < n; i++)cin >> T[i];
	llong ans = solve();
	cout << ans << endl;
}

Measured memory_bytes: 3884
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
  int n, m;
  cin >> n >> m;
  if (n == m) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256