akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int fl=0,flag=0;
    int p;
    cin>>p;
    int i=0;
    for(i=0;i<p;i++)
    {
        
        long int m,n;
        cin>>m>>n;
        if(fl!=1){
        if(m==n){
            flag++;
        }
        else
        {
            flag=0;
        }
            
        
        if(flag>=3)
            fl=1;
        }
    }
    
    
    if(fl==1)
    {
        cout<<"Yes";
    }
    if(fl==0)
    {
        cout<<"No";
    }
    
}

Measured memory_bytes: 3580
#include<bits/stdc++.h>
using namespace std;
  int main(){
    int N,X;
    cin >> N >> X;
    vector<int>L(N);
    for(int i=0;i<N;i++){
      cin >> L.at(i);
    }
    int count = 1;
    int D = 0;
    for(int i=0;i<N;i++){
      D += L.at(i);
      if(D<=X){
        count++;
      }
    }
    cout << count << endl;
  }

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

int main() {
  int N , K , x ;
  cin >> N >> K ;
  int i = 0 , j = 0 ;
  
  for ( i ; i < N ; i ++ )
  {
    cin >> x ;
    if ( x >= K-x )
      j += K-x;
    else
      j += x;
  }
  cout << j*2 << endl ;
}


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

int main()
{
  int N;
  std::cin >> N;
  int answer = INT_MAX;
  for(int i = 0; i < N; i++) {
    int a;
    std::cin >> a;
    if(a % 2 != 0) {
      std::cout << 0 << std::endl;
      return 0;
    }
    int ans = 0;
    while(a > 1 && a % 2 == 0) {
      a /= 2;
      ++ans;
    }
    answer = std::min(answer, ans);
  }
  std::cout << answer << std::endl;
}


Measured memory_bytes: 384
n,m = map(int,input().split())

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)
    
    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#xが属するグループの要素全てを返す
def members(x):
    root = find(x)
    return [i for i in range(n) if find(i) == root]

#全ての根の要素をlistで返す(一個下の関数で使う)
def roots():
    return [i for i,x in enumerate(par) if x < 0]

#グループ数を返す
def group_count():
    return len(roots())

#根をkey,そのグループに含まれる要素をvalueとして全てを辞書型で返す
def all_group_members():
    return {r: members(r) for r in roots()}

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

"""
uniteでまとめ、findで見つける。
n(要素数)だけ最初に付け加えること。
"""
lst = []
for i in range(m):
    x,y,z = map(int,input().split())
    x,y = x-1,y-1
    if z%2 == 0:
        unite(x,y)
    else:
        lst.append([x,y])

for i,j in lst:
    unite(i,j)

print(group_count())

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

#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;

int main() {
  map<int, int> mp;
  int n;
  cin >> n;
  rep(i, n) {
    int a;
    cin >> a;
    mp[a]++;
  }

  ll sum = 0;
  for (auto i = mp.begin(); i != mp.end(); i++) {
    sum += i->first * i->second;
  }

  int q;
  cin >> q;
  rep(i, q) {
    int b, c;
    cin >> b >> c;
    int n_b = mp[b];
    if (n_b == 0) {
      cout << sum << endl;
      continue;
    }
    mp[b] = 0;
    mp[c] += n_b;
    sum += (c - b) * n_b;
    cout << sum << endl;
  }
  return 0;
}


Measured memory_bytes: 7852
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int s;
  cin >> s;
  if (s == 4 || s == 2 || s == 1) {
    cout << 4;
  } else {
  for (int i = 2; i < 1000001; i++) {
    s = (s % 2 == 0 ? s / 2 : 3 * s + 1);
    if (s == 4) {
      cout << i + 3;
      break;
    }
  }
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <queue>
#include <map>
#include <set>
using namespace std;
using Int = int64_t;
const Int INF = 1<<30;
const Int MOD = (Int)1e9 + 7;
const Int MAX_N = (Int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

void solve()
{
    Int n; cin >> n;
    Int sqrt_n = sqrt(n);
    Int ans = INF;
    for(Int A = 1; A <= sqrt_n; A++)
    {
        if(n % A) continue;
        Int B = n / A;
        string s = to_string(A);
        string t = to_string(B);
        Int f = max((Int)s.size(), (Int)t.size());
        ans = min(ans, f);
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 256
#![allow(unused_imports)]
use std::cmp::{self, Ord, Ordering};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

fn main() {
    let stdin = std::io::stdin();
    let mut sc = nyan::Scanner::new(stdin.lock());

    let mut a: Vec<i32> = sc.read_vec(3);
    a.sort();

    println!("{}", (a[2] - a[1]).abs() + (a[0] - a[1]).abs());
}

#[allow(dead_code)]
mod nyan {
    use std::fmt::Debug;
    use std::io::Read;
    use std::iter::FromIterator;
    use std::str::FromStr;

    pub struct Scanner<R: Read> {
        reader: R,
    }

    impl<R: Read> Scanner<R> {
        pub fn new(reader: R) -> Scanner<R> {
            Scanner { reader: reader }
        }

        fn chars<'a>(&'a mut self) -> Box<Iterator<Item = char> + 'a> {
            Box::new(self.reader.by_ref().bytes().map(|b| b.unwrap() as char))
        }

        // since Rust 1.26
        // fn chars<'a>(&'a mut self) -> impl Iterator<Item = char> + 'a {
        //     self.reader.by_ref().bytes().map(|b| b.unwrap() as char)
        // }

        pub fn next<T: FromIterator<char>>(&mut self) -> T {
            self.chars()
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        }

        pub fn next_line<T: FromIterator<char>>(&mut self) -> T {
            self.chars()
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace() || c == &' ')
                .collect()
        }

        pub fn read<T>(&mut self) -> T
        where
            T: FromStr,
            <T as FromStr>::Err: Debug,
        {
            self.next::<String>().parse().unwrap()
        }

        pub fn read_vec<T, U>(&mut self, n: usize) -> T
        where
            T: FromIterator<U>,
            U: FromStr,
            <U as FromStr>::Err: Debug,
        {
            (0..n).map(|_| self.read()).collect()
        }

        pub fn read_vec2d<T, U, V>(&mut self, m: usize, n: usize) -> T
        where
            T: FromIterator<U>,
            U: FromIterator<V>,
            V: FromStr,
            <V as FromStr>::Err: Debug,
        {
            (0..m).map(|_| self.read_vec(n)).collect()
        }

        pub fn read_line<T: FromIterator<char>>(&mut self) -> T {
            self.next_line()
        }

        pub fn read_lines<T, U>(&mut self, n: usize) -> T
        where
            T: FromIterator<U>,
            U: FromIterator<char>,
        {
            (0..n).map(|_| self.read_line()).collect()
        }
    }
}


Measured memory_bytes: 4352
object Main extends App {
  val sc = new FastScanner(System.in)
  val n, m = sc.nextInt()
  var k = sc.nextInt()
  val a = Array.fill(n)(sc.nextLong())
  val b = Array.fill(m)(sc.nextLong())

  val aSum = a.scanLeft(0L)(_ + _)
  val bSum = b.scanLeft(0L)(_ + _)

  def binSearch(begin: Int, end: Int, l: Long): Int = {
    if (end - begin <= 1) {
      begin
    } else {
      val m = begin + (end - begin) / 2
      if (bSum(m) <= l) binSearch(m, end, l) else binSearch(begin, m, l)
    }
  }

  val ans = aSum.takeWhile(_ <= k).zipWithIndex.map{ case (v, idx) =>
    idx + binSearch(0, m+1, k - v)
  }.max
  println(ans)
}

class FastScanner(source: java.io.InputStream) {
  val buf = new Array[Byte](1024)
  var now, end = 0

  def isPrintable(b: Byte): Boolean = 33 <= b && b <= 126
  def isNum(b: Byte): Boolean = 48 <= b && b <= 57

  def hasNextByte: Boolean = {
    if (now < end) {
      true
    } else {
      now = 0
      end = source.read(buf)
      end > 0
    }
  }

  def nextByte(): Byte = {
    if (hasNextByte) {
      val b = buf(now)
      now += 1
      b
    } else {
      -1
    }
  }

  def hasNext: Boolean = {
    while (hasNextByte && !isPrintable(buf(now))) {
      now += 1
    }
    hasNextByte
  }

  def next(): String = {
    if (hasNext) {
      val sb = new StringBuilder()
      var b = nextByte()
      while (isPrintable(b)) {
        sb += b.toChar
        b = nextByte()
      }
      sb.toString
    } else {
      throw new NoSuchElementException()
    }
  }

  def nextInt(): Int = {
    nextLong().toInt
  }

  def nextLong(): Long = {
    if (hasNext) {
      var b = nextByte()
      var sign = 1
      var n = 0L
      if (b == '-') {
        sign = -1
        b = nextByte()
      }
      while (isNum(b)) {
        n = n * 10 + (b - 48)
        b = nextByte()
      }
      sign * n
    } else {
      throw new NoSuchElementException()
    }
  }

  def nextDouble(): Double = next().toDouble
}


Measured memory_bytes: 85816
#include <stdio.h>

int main()
{
	int s;
	scanf("%d",&s);
	int a[1000000];
	a[0]=s;
	int judge=0;
	for (int i = 1; i < 1000000; ++i)
	{
		if(a[i-1]%2==0){
			a[i]=a[i-1]/2;
		}else{
			a[i]=a[i-1]*3+1;
		}
		for (int j = 0; j < i; ++j)
		{
			if(a[i]==a[j]){
				judge++;
			}
		}
		if(judge!=0){
			printf("%d",i+1);
			break;
		}
	}
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define vint vector<int>
#define pri_que priority_queue
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    vint a(n),b(n),c(n-1);
    rep(i,n) cin >> a[i], a[i]--;
    rep(i,n) cin >> b[i];
    rep(i,n-1) cin >> c[i];

    int res=0;
    rep(i,n){
        res+=b[a[i]];
        if(i!=n-1 && a[i]==(a[i+1]-1)) res+=c[a[i]];
        
    }
    cout<<res<<endl;
}


Measured memory_bytes: 3668
#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<climits>
#include<set>
#include<map>
#include<cmath>
#include<iomanip>
#include<iterator>
#include<queue>
#include<stack>
#include<cctype>
#include<deque>
#include<time.h>
#include<bitset>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<sstream>
#include<random>

//by Skeef79

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#define pb push_back
#define en '\n'
#define for0(i,n) for(int i = 0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

const int INF = 2000000000;
const ll LINF = 2000000000000000000;

template<typename T> void print(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}

template <typename T> void input(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
		for (int j = 0; j < a[i].size(); j++)
			cin >> a[i][j];
}

void solve()
{
	int n, m;
	cin >> n >> m;
	int cnt_ac = 0, cnt_wa = 0;
	vector<bool> ok(n + 1);
	vector<int> cnt(n + 1);

	while (m--)
	{
		int x;
		string s;
		cin >> x >> s;
		if (s == "AC")
			if (!ok[x])
			{
				cnt_ac++;
				ok[x] = true;
			}

		if (s=="WA")
			if (!ok[x])
			{
				cnt[x]++;
			}
	}
	for (int i = 0; i <= n; i++)
		if (ok[i])
			cnt_wa += cnt[i];

	cout << cnt_ac << ' '<< cnt_wa;
}

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

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif

	int tst = 1;
	//cin >> tst;
	while (tst--)
		solve();
}

Measured memory_bytes: 640
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {
        n: usize,
        a: usize,
        b: usize,
    }
    if a > b {
        println!("0");
    } else if a == b {
        println!("1");
    } else {
        if n == 1 && a != b {
            println!("0");
        } else {
            let ans = (b - a) * (n - 2) + 1;
            println!("{}", ans);
        }
    }
}


Measured memory_bytes: 2200
//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdio>
#include<type_traits>
#include<numeric>
#include<limits>
#include<iomanip>
#include<set>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;

//define
#define INF 100000000
#define NUM 1000000007


int main() {
	int n, m, x;
	cin >> n >> m >> x;
	VI a(m);
	int cnt_a = 0,cnt_b=0;
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}

	sort(a.begin(), a.end());
	
	for (int i = 0; i < m; i++) {
		if (a[i] < x) {
			cnt_a++;
		}
		else {
			cnt_b++;
		}
	}

	int ans = min(cnt_a, cnt_b);
	cout << ans << endl;
	return 0;
}


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


int main(){

  while(1){
    int m,f,r; cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1)break;
    if(m == -1 || f == -1) cout << "F\n";
    else if(m + f >= 80) cout << "A\n";
    else if(m + f >= 65) cout << "B\n";
    else if(m + f >= 50) cout << "C\n";
    else if(m + f >= 30)
      if(r >=50) cout << "C\n";
      else cout << "D\n";
    else cout << "F\n";
  }


}

Measured memory_bytes: 1120
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(void){
    int N;
    cin >> N;
    vector<int> A(N);
    int neg=0, i_min=0;
    long sum=0;
    for(int i=0, x; i<N; i++){
        cin >> x;
        A[i] = abs(x);
        if(x < 0) neg++;
        if(A[i] < A[i_min]) i_min = i;
        sum += A[i];
    }
    if(neg%2 == 1){
        sum -= A[i_min] * 2;
    }

    cout << sum << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long N){
	bool flg = false;
	repn(i,9) {
		repn(j,9) {
			if (i*j == N) flg = true;
		}
	}
	if (flg) cout << "Yes" << endl; else cout << "No" << endl;
}

int main(){	
	long long N;
	scanf("%lld",&N);
	solve(N);
	return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n],a2[n],smt,num,x;
	smt=2147483647;
	x=0;
	for(int b=1;b<=n;b++){
		cin>>a[b];
	}
	for(int c=1;c<=n;c++){
		for(int d=1;d<=n;d++){
			if(a[d]<smt){
				smt=a[d];
				num=d;
			}else if(a[d]==smt){
				a[d]=2147483647;
			}
		}
		a2[c]=smt;
		a[num]=2147483647;
		smt=2147483647;
	}
	for(int f=1;f<=n;f++){
		if(a2[f]!=2147483647){
			x++; 
		}
	}
	cout<<x<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#define INF 1<<30
#define LL long long
using namespace std;
int n,c=-1,f=-1;
string a; 
int main()
{
	cin>>a;
	n=a.length();
	for(int i=0;i<n;i++)
	{
		if(a[i]=='C')
		{
			c=i;
			break;
		}
	} 
	if(c==-1) 
	{
		cout<<"No";
		return 0;
	}
	for(int i=c+1;i<n;i++)
	{
		if(a[i]=='F')
		{
			f=i;
			break;
		}
	}
	if(f==-1)
	{
		cout<<"No";
		return 0;
	}
	else cout<<"Yes";
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using PP=pair<ll,P>;
using vp=vector<P>;
using vpp=vector<PP>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename A,typename B>istream&operator>>(istream&is,pair<A,B> &p){is>>p.fi>>p.se;return is;}
template<typename A,typename B>ostream&operator<<(ostream&os,const pair<A,B> &p){os<<"("<<p.fi<<","<<p.se<<")";return os;}
template<typename T>istream&operator>>(istream&is,vector<T> &t){REP(i,t.size())is>>t[i];return is;}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&t){os<<"{";REP(i,t.size()){if(i)os<<",";os<<t[i];}cout<<"}";return os;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int main(){
    ll r,g,b,n;
    cin>>r>>g>>b>>n;
    ll ans=0;
    REP(i,n/r+1){
        REP(j,n/g+1){
            if((n-i*r-j*g)%b==0&&(n-i*r-j*g)/b>=0){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <stack>


using namespace std;


int a,b,c,d;

int main()
{
    cin >> a >> b >> c >> d;
    if(abs(c - a) <= d)
        cout << "Yes" << endl;
    else 
    {
        int f = abs(b-a);
        int k = abs(c-b);
        if(k <= d && f <= d)
            cout << "Yes" << endl;
        else 
            cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int n;
  int pm,pe,pj;
  int i;

  while(1){
    scanf("%d",&n);
    if(n==0)
      break;
    for(i=0;i<n;i++){
      scanf("%d %d %d",&pm,&pe,&pj);
      if(pm==100 || pe==100|| pj==100)
	puts("A");
      else if((pm+pe)/2>=90)
	puts("A");
      else if((pm+pe+pj)/3>=80)
	puts("A");
      else if((pm+pe+pj)/3>=70)
	puts("B");
      else if((pm+pe+pj)/3>=50 && (pm>=80 || pe>=80))
	puts("B");
      else
	puts("C");
    }
  }
  return 0;
}

Measured memory_bytes: 584
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin)-1;i>=(end);i--)
#define IREP(i, n) IFOR(i,n,0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=(" << v[0]; FOR(i_debug, 1, v.size()){ cout << "," << v[i_debug]; } cout << ")" << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#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))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;


template<typename T> void readv(vector<T> &a) { REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a) { REP(i, a.size()) {cin >> a[i]; a[i]--;} }

ll mod = 1000000007;

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

	if((A+B)%2){
		cout<<"IMPOSSIBLE"<<endl;
		return 0;
	}
	else{
		cout<<(A+B)/2 <<endl;
		return 0;
	}
	

	return 0;
}

Measured memory_bytes: 256
rates = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
n = input()
A = map(int, raw_input().split())
cnts = [0]*9
for a in A:
    for i, r in enumerate(rates):
        if a < r:
            cnts[i] = 1
            break
    else:
        cnts[-1] += 1
mi = max(sum(cnts[:-1]), 1)
ma = sum(cnts)
print mi, ma


Measured memory_bytes: 2568
#include <bits/stdc++.h>
#define Y "YES"
#define N "NO"
using namespace std;

int a, b, c;
 
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> a >> b >> c;
	if ((10 * b + c) % 4) cout << N;
	else cout << Y;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
const int ddx[4] = {1,1,-1, -1};
const int ddy[4] = {1,-1,-1,1};
//////////////////////////////////

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

  return 0;
}

// EOF


Measured memory_bytes: 256
n = int(input())
h = [int(x) for x in input().split()]

chains = 0
max_chains = 0
current_height = h[0]

for i in range(1, n):
    next_height = h[i]
    if current_height >= next_height:
        chains += 1
    else:
        if chains > max_chains:
            max_chains = chains
        chains = 0
    current_height = next_height

if chains > max_chains:
    max_chains = chains


print(max_chains)


Measured memory_bytes: 14252
#include <stdio.h>
int main(void)
{
        int i=0,j,a,b;

        scanf("%d%d",&a,&b);

        j=1;
        for(i=0; i<a; i++){
          if(j*2>j+b) j=j+b;
          else j=j*2;
        }
        printf("%d\n",j);
                return 0;
}

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

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
	
	int n, m;
	cin >> n >> m;

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

	for (int i = 1; i <= n; i++)
		cout << count[i] << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define REP(i,n,m) for(int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D, w) for(auto vec : vec2D) { for (auto v : vec) cerr << setw(w) << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

const char en = '\n';

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

typedef ll Weight;
void add_edge(vector<vector<Weight>>& g, Weight from, Weight to, bool isDirected) {
	g[from].push_back(to);
	if (!isDirected) g[to].push_back(from);
}

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

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

	ll n; cin >> n;

	vector<ll> p(13), sump(13);
	p[0] = 1; sump[0] = 1;
	rep(i, 12) { p[i + 1] = p[i] * 26; sump[i + 1] = p[i + 1] + sump[i]; }

	char name[12] = { 0 };

	rrep(i, 12) {
		if (n < sump[i]) continue;
		if (i-1 < 0) name[11 - i] = 'a' + n / p[i] - 1;
		else name[11 - i] = 'a' + (n - sump[i-1]) / p[i] - 1;
		//if (i - 1 >= 0)cerr << n << " "  <<  n/p[i] << " " << (n - sump[i - 1]) / p[i] << endl;
		if (i-1 >= 0) n -= (n - sump[i - 1]) / p[i] * p[i];
	}

	rep(i, 12) if (name[i] != 0) cout << name[i]; cout << en;

}


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

int main() {
  int N,T;
  cin>>N>>T;
  int ans=10000;
  for(int i=0;i<N;i++){
    int c,t;
    cin>>c>>t;
    if(t<=T){
      ans=min(ans,c);
    }
  }
  if(ans==10000){
    cout<<"TLE"<<endl;
  }
  else{
    cout<<ans<<endl;
  }
}




Measured memory_bytes: 3536
#include <iostream>
#include <iomanip>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <deque>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_set>
#define int long long
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()

using namespace std;

const int MOD = 998244353;
const int INF = 1e15;

void fast()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

const int sz = 1e6 * 2 + 10;

vector<int> pref;
int dp[sz];

int get_sum(int l, int r) 
{
	if (l < 0) 
		l = 0;
	if (r < 0) 
		r = -1;

	return pref[r + 1] - pref[l];
}

signed main()
{
	fast();

	int n, k;
	cin >> n >> k;
	pref.push_back(0);
	vector<pair<int, int>> segs;

	for (int i = 0; i < k; ++i) 
	{
		int l, r;
		cin >> l >> r;
		segs.push_back({ l, r });
	}

	dp[0] = 1;

	pref.push_back(1);

	for (int i = 1; i < n; ++i) 
	{
		for (int j = 0; j < k; ++j) 
		{
			int mn = i - segs[j].first;
			int mx = i - segs[j].second;
			dp[i] = (get_sum(mx, mn) + dp[i]) % MOD;
		}

		pref.push_back(dp[i] + pref.back());
	}

	cout << dp[n - 1];

	return 0;
}

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

#define NREP() for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;g
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
using ll = long long;
const static ll MOD = 1e9 + 7;


bool check(bool checked[3][3]) {
    // 横
    REP(i, 3) {
        if (checked[i][0] && checked[i][1] && checked[i][2]) return true;
    }

    // 縦
    REP(i, 3) {
        if (checked[0][i] && checked[1][i] && checked[2][i]) return true;
    }

    // 斜め
    if (checked[0][0] && checked[1][1] && checked[2][2]) return true;
    if (checked[2][0] && checked[1][1] && checked[0][2]) return true;

    return false;
}

int main(int argc, char *argv[]) {
    ll board[3][3];
    bool checked[3][3];

    REP(i, 3) {
        REP(j, 3) {
            cin >> board[i][j];
            checked[i][j] = false;
        }
    }

    ll n;
    cin >> n;

    NREP() {
        ll b;
        cin >> b;
        REP(j, 3) {
            REP(k, 3) {
                if (board[j][k] == b) {
                    checked[j][k] = true;
                }
            }
        }
    }

    Yn(check(checked))
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    s = S()
    r = 0
    for c in s:
        if c == '1':
            r += 1
    return r


print(main())




Measured memory_bytes: 7368
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
A = lr()
A.sort()

MOD = 10 ** 9 + 7
if K == 1:
    print(0)
    exit()

def cmb(n, k):
    # nCkを計算する
    k = min(k, n-k)
    return fac[n] * ifac[k] % MOD * ifac[n-k] % MOD

def make_tables(MOD, n):
    # 階乗テーブル、逆元の階乗テーブルを作成する
    fac = [1, 1] # 階乗テーブル
    ifac = [1, 1] # 逆元の階乗テーブル
    inverse = [0, 1] # 逆元テーブル 0の階乗は1 0の逆元は0

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % MOD)
        inverse.append((-inverse[MOD % i] * (MOD//i)) % MOD)
        ifac.append((ifac[-1] * inverse[-1]) % MOD)
    return fac, ifac

fac, ifac = make_tables(MOD, 10**6)
answer = 0
for i in range(K-1, N):
    # 最大値として何回登場するか、A[i] * i C (K-1)
    answer += A[i] * cmb(i, K-1)
    answer %= MOD

for i in range(N-K+1):
    # A[i] * (N-(i+1)) C (k-1)
    answer -= A[i] * cmb(N-(i+1), K-1)
    answer %= MOD

print(answer % MOD)
# 51

Measured memory_bytes: 126964
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
//#define mod 998244353
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/*void chmax(P &a,P b) {
  if (a.ft<b.ft) a.sc=max(a.ft,b.sc), a.ft=b.ft;
  else a.sc=max(a.sc,b.ft);
}*/

const ll INF=1e18;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n,m;
    cin>>n>>m;
    ll ans;
    V<ll> d;
    for(ll i=1;i*i<=m;i++){
        if(m%i==0){
            d.push_back(i);
            if(i!=m/i){
                d.push_back(m/i);
            }
        }
    }
    sort(all(d));
    ll cnt=lb(all(d),n)-d.begin();
    ans=m/d[cnt];
    cout<<ans<<endl;
}

Measured memory_bytes: 256
(defun solve (a b)
  (let ((a-str (make-string b :initial-element (code-char (+ a (char-code #\0)))))
        (b-str (make-string a :initial-element (code-char (+ b (char-code #\0))))))
    (if (string<= a-str b-str)
        a-str
        b-str)))

#-swank
(let* ((a (read))
       (b (read)))
  (format t "~A~%" (solve a b)))


Measured memory_bytes: 19556
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define REP(i, b, n) for (Int i = b; i < Int(n); i++)
#define rep(i, n) REP(i, 0, n)
using namespace std;
using Int = long long;
Int inf = 1000000000000000001LL;
using vi = vector<Int>;
using vvi = vector<vi>;
using mapis = unordered_map<Int,string>;
using mapii = unordered_map<Int,Int>;
using pii = pair<Int,Int>;

Int GCD(Int a, Int b){
    if(b==0) return a;
    if(a < b) return GCD(b, a);
    unsigned r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

Int modinv(Int a, Int m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

Int binary_search_index(Int Y, vi &q){
    int left = 0, right = q.size() - 1;
    while (right >= left) {
        int mid = left + (right - left) / 2;
        if (q[mid] == Y) return mid;
        else if (q[mid] > Y) right = mid - 1;
        else if (q[mid] < Y) left = mid + 1;
    }
    return -1;
}

int main() {
    Int N,M;
    vi A,B,C;
    cin >> N >> M;
    A = vi(N);
    B = vi(M);
    C = vi(M);
    map<Int,Int> c_to_b;
    rep(i,N){
        cin >> A[i];
    }
    rep(i,M){
        cin >> B[i] >> C[i];
        c_to_b[C[i]] += B[i];
    }

    sort(C.begin(),C.end(),greater<>());

    sort(A.begin(),A.end());
    int now_i = 0;
    int c_index = 0;
    while(now_i<N){
        if(c_index >= M){
            break;
        }
        auto it = lower_bound(A.begin()+now_i, A.end(), C[c_index]);
        int progress_index = it - A.begin();

        if(progress_index-now_i>=c_to_b[C[c_index]]){
            int loop = c_to_b[C[c_index]];
            REP(j,now_i,now_i + loop){
                A[j] = C[c_index];
            }
            now_i += c_to_b[C[c_index]];
            c_to_b[C[c_index]] = 0;
        }else{
            REP(j,now_i,progress_index){
                A[j] = C[c_index];
            }
            c_to_b[C[c_index]] -= progress_index-now_i;
            now_i += progress_index;
        }

        c_index++;
    }

    Int ans =0;
    rep(i,N){
        ans += A[i];
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 8832
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        if(scanner.nextInt() % scanner.nextInt() == 0)System.out.println(0);
        else System.out.println(1);

    }





























}


Measured memory_bytes: 23124
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int rep = scan.nextInt();
        long sum = 0, max = -1000001, min = 1000001;
        int[] data = new int[rep];

        for (int i = 0; i < rep; i++)
            data[i] = scan.nextInt();

        for (int i = 0; i < rep; i++) {
            sum += data[i];
            if (data[i] < min)
                min = data[i];
            if (data[i] > max)
                max = data[i];
        }

        System.out.printf("%d %d %d\n", min, max, sum);
    }
}


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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

int op(int a, int b) { return max(a, b); }
int e() { return -1; }

int f_target;
bool f(int val) { return val < f_target; }

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

    vector<int> a(N);
    for_(i,0,N) cin >> a[i];

    segtree<int, op, e> seg(a);
    for_(i,0,Q) {
        int t;
        cin >> t;
        
        if (t == 1) {
            int x, v;
            cin >> x >> v;
            seg.set(x - 1, v);
        }

        if (t == 2) {
            int l, r;
            cin >> l >> r;
            cout << seg.prod(l - 1, r) << endl;
        }

        if (t == 3) {
            int x, v;
            cin >> x >> v;
            f_target = v;
            cout << seg.max_right<f>(x - 1) + 1 << endl;
        }
    }
}

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;

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

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

#define DEBUG

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	vi a(3);
	rep(i,3) cin >> a[i];

	int seven = 0;
	int five = 0;
	rep(i, 3)
	{
		if(a[i] == 5) five++;
		if(a[i] == 7) seven++;
	}

	if(five == 2 && seven == 1) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int gcd(int p, int q){
  while(q != 0){
    int r = p % q;
    p = q;
    q = r;
  }
  return p;
}
int main(void) {
  int n;
  int sum = 0;
  scanf("%d",&n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        sum += gcd(i, gcd(j, k));
      }
    }
  }
  printf("%d\n", sum);
}

Measured memory_bytes: 1732
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n = I()

ret = 0
for l in range(1, len(str(n)) + 1):
    for i in product(*[('3', '5', '7') for _ in range(l)]):
        num = ''.join(i)
        if '3' not in num or '5' not in num or '7' not in num or int(num) > n:
            continue
        ret += 1


print(ret)


Measured memory_bytes: 45168
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#pragma warning(disable : 4996)
using namespace std;
int H, W, K;
int solve(string x) {
	int ret = 0; vector<int> sum(x.size() + 1, 0);
	for (int i = 0; i < x.size(); i++) {
		sum[i + 1] = sum[i] + (x[i] == '#' ? 1 : 0);
	}
	for (int i = K; i <= x.size(); i++) {
		if (sum[i] - sum[i - K] == 0) ret++;
	}
	return ret;
}
int main() {
	cin >> H >> W >> K;
	vector<string> s(H);
	for (int i = 0; i < H; i++) cin >> s[i];
	int ret = 0;
	for (int i = 0; i < H; i++) ret += solve(s[i]);
	for (int i = 0; i < W; i++) {
		string t;
		for (int j = 0; j < H; j++) t += s[j][i];
		ret += solve(t);
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 3164
#include<bits/stdc++.h>
#define f(i,a,b) for(long long int i=a;i<b;i++)
#define ll long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define endl '\n'



using namespace std;
ll exp(ll a,ll b,ll m)
{
if(b==0)
	{
		return 1;
	}
	ll temp =exp(a,b/2,m);
	temp=(temp*temp)%m;
	if(b&1)
	{
		return (temp*(a%m))%m;
	}
	return temp;
}
	
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	bool flag=true;
	if(a==b && a!=c	) flag = false;
	if(b==c && b!=a) flag=false;
	if(a==c && b!=a) flag=false;
	
	if(!flag) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;	
	return 0;
}



Measured memory_bytes: 256
N,M = map(int,input().split())
lh = list(map(int,input().split()))
la = [0]*N
for i in range(M):
    a,b = map(int,input().split())
    a-=1
    b-=1
    if lh[a] >= lh[b]:
        la[b] +=1
    if lh[b]>=lh[a]:
        la[a] += 1
a = 0
for i in range(N):
    if la[i] == 0:
        a += 1
print(a)


Measured memory_bytes: 84988
#include <iostream>
#include <cmath>
#include <map>
using namespace std;

typedef long long ll;

int main () {
	ll N;
	cin >> N;
	ll s = (ll)sqrt(N);
	map <ll, ll> mp;
	bool f = false;
	while (N%2==0) {
		mp[2]++;
		N /= 2;
		f = true;
	}
	for (ll i=3; i<=s; i+=2) {
		while (N%i==0) {
			mp[i]++;
			N/=i;
			f = true;
		}
	}
	if (N > s) {
		mp[N] ++;
	}
	if (f) {
		ll res = 0;
		for (auto itr=mp.begin(); itr!=mp.end(); itr++) {
			int n=1;
			while (n*(n+1)<=2*itr->second)
				n++;
			res += n-1;
		}
		cout << res << endl;
	} else if (N!=1) {
		cout << 1 << endl;
	} else {
		cout << 0 << endl;
	}
	return 0;
}

Measured memory_bytes: 3724
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[200010],dp[600][600];

int main(){
  cin >> n >> m;
  l = INF;
  l = (m - n >= 0) ? min(l,m - n) : l;
  l = (m + n + 1 >= 0) ? min(l,m + n + 1) : l;
  l = (- m - n + 1 >= 0) ? min(l,- m - n + 1) : l;
  l = (- m + n + 2 >= 0) ? min(l,- m + n + 2) : l;
  print(l);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout <<(#x)<<" is "<<(x)<<endl
#define debug cout <<"hi"<<endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int MOD=1e9+7;
const int INF32=1<<30;
const ll INF64=1LL<<60;

void solve(){
  int k,t=0,c=0; cin >>k;
  vector<bool>check(k);
  while(1){
    t=t*10+7; t%=k; c++;
    if(!t){cout <<c; return;}
    if(check[t]){cout <<-1; return;}
    check[t]=1;
  }
}

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

Measured memory_bytes: 3716
s = input()
a = list("abcdefghijklmnopqrstuvwxyz")
if len(s) != 26:
    nokori = set(a) - set(s)
    nokori = sorted(nokori, key=a.index)
    print(s + nokori[0])
else:
    for i in range(2, 27):
        if s[-i] <= s[-i + 1]:
            break
        if i == 26:
            print(-1)
            exit()
    s_ = sorted(s[-i + 1:])
    for j in s_:
        if j > s[-i]:
            break
    print(s[:-i] + j)

Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

template <class T> void get_max(T& a, const T b) { a = max(a, b); }
template <class T> void get_min(T& a, const T b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		vector<int> c[2];
		c[0].resize(n);
		for (int i = 0; i < n; ++i)
			scanf("%d", &c[0][i]);
		sort(all(c[0]));
		for (int i = 1; i <= 2*n; ++i)
			if (find(all(c[0]), i) == c[0].end())
				c[1].push_back(i);

		int field = 0;
		int turn = 0;
		while (!c[0].empty() && !c[1].empty())
		{
			vector<int>& t = c[turn];
			vector<int>::iterator k = lower_bound(all(t), field);
			if (k == t.end())
				field = 0;
			else
			{
				field = *k;
				t.erase(k);
			}

			turn = (turn + 1) % 2;
		}
		printf("%d\n%d\n", c[1].size(), c[0].size());
	}
}

Measured memory_bytes: 0
#include<stdio.h>

int main(void) {
	int N,d[100],i,j,k=0;

	scanf("%d", &N);
	for (i = 0; i < N; i++) {
		scanf("%d", &d[i]);
	}
	for (i = 0; i < N-1; i++) {
		for (j = i + 1; j < N; j++) {
			if (d[i] == d[j]) {
				k++;
				break;
			}
		}
	}
	printf("%d", N - k);

	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <climits>
#include <functional>
#include <array>
#include <cmath>

using namespace std;

int c[3][3];

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

	int a[3]{}, b[3]{};
	for (int i = 0; i < 3; ++i) {
		b[i] = c[i][0];
	}
	for (int i = 0; i < 3; ++i) {
		a[i] = c[0][i] - b[0];
	}

	for (int i = 0; i < 3; ++i) {
		for (int k = 0; k < 3; ++k) {
			if (a[k] + b[i] != c[i][k]) {
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef double ld;
using namespace std;
void solve(){
    ll n;
    cin>>n;
    ll x;
    cin>>x;
    ll y=0;
    for (int i = 0; i < x; ++i)
    {
        /* code */
        ll c;
        cin>>c;
        y+=c;
    }
    if(y>n)
    {
        cout<<-1;
        return;
    }
    cout<<n-y;
    }
    
int main(){
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
return 0;
}

Measured memory_bytes: 3636