akhauriyash/Code-Regression huggingface dataset:
#include <string>
#include <cstdint>
#include <cassert>
#include <functional>
#include <vector>
#include <unordered_map>
#include <iostream>
namespace lc {
struct Edge {
	int to;
	explicit Edge(int to) : to(to) { }
};
}
namespace lc {
template <typename EdgeType>
class AdjacencyList {
public:
	typedef std::vector<EdgeType> ListType;
private:
	std::vector<ListType> m_lists;
public:
	explicit AdjacencyList(int n = 0)
		: m_lists(n)
	{ }
	int size() const { return m_lists.size(); }
	template <typename... Args>
	void add_edge(int u, Args&&... args){
		m_lists[u].emplace_back(args...);
	}
	const ListType &operator[](int u) const { return m_lists[u]; }
};
}
namespace lc {
template <typename EdgeType, typename Func>
void enumerate_maximal_independent_sets(
	const AdjacencyList<EdgeType> &graph, Func func)
{
	const int n = graph.size();
	std::vector<uint64_t> bit_graph(n), incr_bit_graph(n + 1);
	for(int i = n - 1; i >= 0; --i){
		uint64_t mask = (1ull << i);
		for(const auto &e : graph[i]){ mask |= (1ull << e.to); }
		bit_graph[i] = mask;
		incr_bit_graph[i] = mask | incr_bit_graph[i + 1];
	}
	std::function<void(int, uint64_t, uint64_t)> recur =
		[&, n](int i, uint64_t picked, uint64_t eliminated) -> void {
			if(i == n){
				func(picked);
				return;
			}
			const bool force_ignore = ((eliminated & (1ull << i)) != 0);
			int flags = 1; // 1: select v_i, 2: ignore v_i
			if(bit_graph[i] & ~(incr_bit_graph[i + 1] | eliminated)){
				flags = (force_ignore ? 2 : 1);
			}else if((incr_bit_graph[i + 1] | eliminated) & (1ull << i)){
				flags = (force_ignore ? 2 : 3);
			}
			if(flags & 1){
				recur(i + 1, picked | (1ull << i), eliminated | bit_graph[i]);
			}
			if(flags & 2){ recur(i + 1, picked, eliminated); }
		};
	recur(0, 0, 0);
}
}
namespace lc {
class NameTable {
private:
	std::unordered_map<std::string, int> m_table;
	std::vector<std::string> m_inv_table;
public:
	NameTable(){ }
	int operator[](const std::string &s){
		const auto it = m_table.find(s);
		if(it != m_table.end()){ return it->second; }
		const int t = m_inv_table.size();
		m_table.insert(std::make_pair(s, t));
		m_inv_table.push_back(s);
		return t;
	}
};
}
using namespace std;
typedef lc::Edge Edge;
int main(){
	ios_base::sync_with_stdio(false);
	while(true){
		int n;
		cin >> n;
		if(n == 0){ break; }
		lc::NameTable name_table;
		vector<int> powers(n);
		lc::AdjacencyList<Edge> graph(n);
		for(int i = 0; i < n; ++i){
			string u_name;
			int p, m;
			cin >> u_name >> p >> m;
			const int u = name_table[u_name];
			powers[u] = p;
			for(int j = 0; j < m; ++j){
				string v_name;
				cin >> v_name;
				const int v = name_table[v_name];
				graph.add_edge(u, v);
			}
		}
		int answer = 0;
		lc::enumerate_maximal_independent_sets(graph, [&](uint64_t s){
			if((s & 1) == 0){ return; }
			int sum = 0;
			for(int i = 0; i < n; ++i){
				if(s & (1ull << i)){ sum += powers[i]; }
			}
			answer = max(answer, sum);
		});
		cout << answer << endl;
	}
	return 0;
}

Measured memory_bytes: 1256
#include<bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
using ulli = unsigned long long int;
#define filein freopen ("in.txt", "r", stdin)
#define fileout freopen ("out.txt", "w", stdout)
#define dbg(x) cerr << #x << ": " << x << endl
#define all(v) ((v).begin()),((v).end()) 
#define dbgxy(x,y) cerr << #x << ": " << x <<", "<<#y<<": "<<y<<endl
#define pb push_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
int dx[8]= {1,0,-1,0,-1,-1,1,1};
int dy[8]= {0,1,0,-1,-1,1,-1,1};
void solve(){
	string s;
	cin>>s;
	for(int i = 0;i<(int) s.size();i++){
		if(s[i] == '7'){
			cout<<"Yes";
			return;
		}
	}
	cout<<"No";
}
int main(){
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
}


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

int FindSumOfDigit(int x) {
    int sum = 0;
    while (x > 0) {
        sum += x % 10;
        x /= 10;
    }

    return sum;
}

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

    int minimum = 100000000;
    for (int i=1; i<n; i++) {
        minimum = min(FindSumOfDigit(i) + FindSumOfDigit(n-i), minimum);
    }
    
    cout << minimum << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
long long int group[5]={};
long long int ans=0;

string tmp;
cin >> N;

for(int i=0;i<N;i++){
	cin>>tmp;
	switch(tmp[0]){
		case 'M': 
			group[0]++;
			break;
		case 'A':
			group[1]++;
			break;
		case 'R':
			group[2]++;
			break;
		case 'C':
			group[3]++;
			break;
		case 'H':
			group[4]++;
			break;
	}
}

for(int i=0;i<3;i++){
	for(int j=i+1;j<4;j++){
		for(int k=j+1;k<5;k++){
			ans+=group[i]*group[j]*group[k];
		}
	}
}

printf("%lld\n",ans);
return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        if(S.equals("Sunny")){
            System.out.println("Cloudy");
        }else if(S.equals("Cloudy")){
            System.out.println("Rainy");
        }else{
            System.out.println("Sunny");
        }
    }
}

Measured memory_bytes: 20820
#include <iostream>
#include <string>

using namespace std;

int main(void){
	string str;
  	cin >> str;
  	int i;	
  	int pls = 0,mns = 0;
  	for(i=0;i<str.size();i++){
    	if(str[i] == '+') pls++; 
        else if(str[i] == '-') mns++;
    }
  	cout << pls - mns << endl;
  	
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <string>
#include <bitset>
#include <queue>
#include <tuple>
#include <cmath>
#include <map>
#include <cstring>

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

using namespace std;

using ll = long long;
using ull = unsigned long long;

using Pint = pair<int, int>;
using Pll  = pair<ll, ll>;
using Pull = pair<ull, ull>;

#define eb emplace_back
#define pb push_back
#define mp make_pair
#define mt make_tuple

#define F first
#define S second

#define rep( i, n ) for ( int i = 0; i < (int)( n ); ++i )
#define reps( i, n ) for ( int i = 1; i <= (int)( n ); ++i )
#define rrep( i, n ) for ( int i = (int)( ( n ) - 1 ); i >= 0; --i )
#define rreps( i, n ) for ( int i = (int)( ( n ) ); i > 0; --i )
#define arep( i, v ) for ( auto &&i : ( v ) )

template<typename T> T gcd( const T a, const T b ) { return ( b ? gcd( b, a % b ) : a ); }

#define ALL( c ) ( c ).begin(), ( c ).end()
#define RALL( c ) ( c ).rbegin(), ( c ).rend()
#define UNIQUE( c ) ( c ).erase( unique( ( c ).begin(), ( c ).end() ), ( c ).end() )

constexpr ll MOD = 1000000007LL;

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

template<typename T = ll> class UnionFind {
public:
	UnionFind( T n ) { rep( i, n ) { par.resize( n ); siz.resize( n ); par[i] = i; siz[i] = 1; } }
	T find( T x ) { if ( x == par[x] ) return ( x ); else return( par[x] = find( par[x] ) ); }
	void unite( T x, T y ) { T xx = find( x ); T yy = find( y ); if ( xx == yy ) return;
		if ( siz[xx] <= siz[yy] ) swap( xx, yy ); par[yy] = xx; siz[xx] += siz[yy]; }
private:
	vector<T> par, siz;
};

template<typename T = ll> T power( T a, T b, T m = MOD ) {
	T res = 1;
	while ( b > 0 ) { if ( b & 1 ) res = res * a % m;
		a = a * a % m; b >>= 1; }
	return ( res );
}

/*
constexpr ll MAX = 500010;
ll fact[MAX];
ll inv[MAX];
ll inv_fact[MAX];

template<typename T> void initComb( T n, T m = MOD )
{
	fact[0] = fact[1] = inv_fact[0] = inv_fact[1] = 1;
	inv[1] = 1;
	for ( int i = 2; i < n; i++ ) {
		fact[i] = ( fact[i - 1] * i ) % m;
		inv[i] = m - inv[m % i] * ( m / i ) % m;
		inv_fact[i] = inv_fact[i - 1] * inv[i] % m;
	}
}

template<typename T> T comb( T n, T r, T m = MOD )
{
	if ( n < r ) return ( 0 );
	if ( n < 0 || r < 0 ) return ( 0 );
	return ( fact[n] * ( inv_fact[r] * inv_fact[n - r] % m ) % m );
}
*/

void replace( string &s, string t, string r ) {
	string::size_type p = 0;
	while ( ( p = s.find( t, p ) ) != string::npos ) {
		s.replace( p, t.length(), r );
		p += r.length();
	}
}


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

	ll ans = (ll)ceil( (double)N / ( 2 * D + 1 ) );
	cout << ans << endl;

	return ( 0 );
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

signed main() {
    int n;
    cin>>n;
    int a[n];
    ll cnt[n + 1] = {};
    rep(i, n) {
        cin >> a[i];
        cnt[a[i]]++;
    }
    ll sum = 0;
    rep(i, n + 1) {
        sum += cnt[i] * (cnt[i] - 1) / 2;
    }
    rep(i,n){
        cout << sum - cnt[a[i]] * (cnt[a[i]] - 1) / 2 +
                    (cnt[a[i]] - 1) * (cnt[a[i]] - 2) / 2
             << endl;
    }
    return 0;
}

Measured memory_bytes: 4992
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int main(int argc, char const *argv[])
{
	char buf[21];
	char ans[21];
	scanf("%s", buf);
	int i = 0;
	for (;i < 21; i++)
	{
		if (buf[i] == '\0') break;
	}
	i--;
	for (int j = 0; j <= i; j++)
	{
		ans[j] = buf[i-j];
	}
	ans[i+1] = '\0';
	printf("%s\n", ans);
	return 0;
}

Measured memory_bytes: 3132
#include <iomanip>
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  char c;
  cin >> c;
  c++;
  cout << c << endl;
 
  return 0;
}


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

int main() {
  string N;
  cin>>N;
  
  int x=N.size();
    
  if(x==1){
    if(N=="3")
      cout<<"bon"<<endl;
    else if(N=="0"||N=="1"||N=="6"||N=="8")
      cout<<"pon"<<endl;
    else
      cout<<"hon"<<endl;
  }
  
  if(x==2){
    char s = N.at(1);
    if(s=='3')
      cout<<"bon"<<endl;
    else if(s=='0'||s=='1'||s=='6'||s=='8')
      cout<<"pon"<<endl;
    else
      cout<<"hon"<<endl;
  }
  
  if(x==3){
    char t = N.at(2);
    if(t=='3')
      cout<<"bon"<<endl;
    else if(t=='0'||t=='1'||t=='6'||t=='8')
      cout<<"pon"<<endl;
    else
      cout<<"hon"<<endl;
  }
    
}


Measured memory_bytes: 3628
#include<stdio.h>
#include<math.h>

struct Point{
  double x;
  double y;
};

void koch(int d, struct Point p1, struct Point p2){
  struct Point s, t, u;
  double k;

  if(d == 0) return;

  k = M_PI * 60.0 / 180.0;

  s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0;
  s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0;
  t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0;
  t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0;
  u.x = (t.x - s.x) * cos(k) - (t.y - s.y) * sin(k) + s.x;
  u.y = (t.x - s.x) * sin(k) + (t.y - s.y) * cos(k) + s.y;

  koch(d-1, p1, s);
  printf("%.8f %.8f\n", s.x, s.y);
  koch(d-1, s, u);
  printf("%.8f %.8f\n", u.x, u.y);
  koch(d-1, u, t);
  printf("%.8f %.8f\n", t.x, t.y);
  koch(d-1, t, p2);
}

int main(){
  struct Point p1, p2;
  int n;

  scanf("%d", &n);

  p1.x = 0;
  p1.y = 0;
  p2.x = 100;
  p2.y = 0;

 printf("%.8f %.8f\n", p1.x, p1.y);
 koch(n, p1, p2);
 printf("%.8f %.8f\n", p2.x, p2.y);

 return 0;
}



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

int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A * B <= C * D)
    {
        cout << C * D << endl;
    }
    else
    {
        cout << A * B << endl;
    }
    return 0;
}

Measured memory_bytes: 256
//#pragma warning(disable:4996)
#include <stdio.h>

int main() {
	int n, k;
	char s[11];

	scanf("%d %s %d", &n, s, &k);
	char a = s[k-1];
	for (int i = 0; i < n; i++) {
		if (s[i] != a) {
			s[i] = '*';
		}
	}
	printf("%s", s);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int A;
  cin >> A;
  vector<string> vec(A);
  for(int i=0;i<A;i++){cin >> vec.at(i);}
  int a=0,b=0,c=0,d=0;
  for(int i=0;i<A;i++){if(vec.at(i)=="AC"){a++;}
  if(vec.at(i)=="WA"){b++;}
  if(vec.at(i)=="TLE"){c++;}
  if(vec.at(i)=="RE"){d++;}
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}

Measured memory_bytes: 6364
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.IntStream;

public class Main{
	public static void main(String[]$) throws IOException{
		new Main().solve();
	}
	static FastScanner s=new FastScanner(System.in);
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static int gInt() throws IOException{return s.nextInt();}
	static long gLong() throws IOException{return s.nextLong();}
	static long gDouble() throws IOException{return s.nextLong();}

	private void solve() throws IOException{
		int f=gInt(),t=gInt();
		System.out.println(f+(t-f)*2);
	}

	static void yesno(boolean f) {
		yesno(f,"YES","NO");
	}
	static void yesno(boolean f,String yes,String no) {
		System.out.println(f?yes:no);
	}
}
class FastScanner{
	private final BufferedInputStream	in;
	private static final int			bufSize	=1<<16;
	private final byte					buf[]	=new byte[bufSize];
	private int							i		=bufSize;
	private int							k		=bufSize;
	private final StringBuilder			str		=new StringBuilder();

	FastScanner(InputStream in){
		this.in=new BufferedInputStream(in,bufSize);
	}
	int nextInt() throws IOException{
		return (int)nextLong();
	}
	long nextLong() throws IOException{
		int c;
		long x=0;
		boolean sign=true;
		while((c=nextChar())<=32)
			;
		if(c=='-'){
			sign=false;
			c=nextChar();
		}
		if(c=='+'){
			c=nextChar();
		}
		while(c>='0'){
			x=x*10+(c-'0');
			c=nextChar();
		}
		return sign?x:-x;
	}
	int nextChar() throws IOException{
		if(i==k){
			k=in.read(buf,0,bufSize);
			i=0;
		}
		return i>=k?-1:buf[i++];
	}
	String next() throws IOException{
		int c;
		str.setLength(0);
		while((c=nextChar())<=32&&c!=-1)
			;
		if(c==-1){
			return null;
		}
		while(c>32){
			str.append((char)c);
			c=nextChar();
		}
		return str.toString();
	}
	String nextLine() throws IOException{
		int c;
		str.setLength(0);
		while((c=nextChar())<=32&&c!=-1)
			;
		if(c==-1){
			return null;
		}
		while(c!='\n'){
			str.append((char)c);
			c=nextChar();
		}
		return str.toString();
	}
}

Measured memory_bytes: 21204
// CODE FESTIVAL 2016 qual A
// C - 次のアルファベット / Next Letter

#include <cstdio>
#include <cstring>
#define MAX_S 100000
#define ALPHABETS 26
using namespace std;


char s[MAX_S + 2];
int K;

int main() {

  int len = 0;
  int n;

  scanf("%s", s);
  scanf("%d", &K);
  len = strlen(s);

  for (int i = 0; i < len; i++) {
    n = s[i] - 'a';
    if (n == 0) {
      continue;
    }
    if (K >= ALPHABETS - n) {
      K -= ALPHABETS - n;
      s[i] = 'a';
    }
  }
  if (K > 0) {
    n = s[len - 1] - 'a';
    n = (n + K) % ALPHABETS;
    s[len - 1] = n + 'a';
  }

  printf("%s\n", s);

  return 0;

}




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

int main()
{
ll m , d ;
cin >> m >> d ;
rep(i,d+1){
  ll a=i/10;
  ll b=i%10;
  if(a<2||b<2)continue;
  if(a*b<=m)ans++;
}

cout << ans << endl;
return 0;
}


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

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

#define fi first
#define se second
#define pb push_back

int a, b, n;

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

    cin >> n>>a>>b ;

    cout<<min(a,b)<<' '<<max(0,a+b-n);

    return 0;
}


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

int main() {
	int l,r,d,c=0;
	cin >> l >> r >> d;
	for(int i=l;i<=r;i++)
	{
		if(i%d==0)
		{
			c++;
		}
	}
	cout << c <<endl;
	return 0;
}


Measured memory_bytes: 3632
list1 = input().split()
list1 = [int(x) for x in list1]

startHour = list1[0]
startMinute = list1[1]
endHour = list1[2]
endMinute = list1[3]
studyTime = list1[4]

startTime = startHour * 60 + startMinute
endTime = endHour * 60 + endMinute

print(endTime - startTime - studyTime)

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

typedef pair<int, int> pii;

string A, B;
vector<int> pre, nxt;

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

    bool ok = false;
    for(int i = 0; i < B.size(); i++) {
        if(B[i] == '1') {
            ok = true;
            break;
        }
    }

    if(!ok) {
        for(int i = 0; i < A.size(); i++) {
            if(A[i] == '1') {
                cout << -1;
                return 0;
            }
        }
        cout << 0;
        return 0;
    }

    pre = vector<int>(B.size());
    for(int i = 0; i < B.size(); i++) {
        pre[i] = i? pre[i - 1] : -1;
        if(B[i] == '1') pre[i] = i;
    }
    for(int i = 0; i < B.size(); i++) {
        if(pre[i] == -1) pre[i] = -(int)B.size() + pre.back();
        else break;
    }
    nxt = vector<int>(B.size());
    for(int i = B.size() - 1; i >= 0; i--) {
        nxt[i] = (i != B.size() - 1)? nxt[i + 1] : -1;
        if(B[i] == '1') nxt[i] = i;
    }
    for(int i = B.size() - 1; i >= 0; i--) {
        if(nxt[i] == -1) nxt[i] = B.size() + nxt[0];
        else break;
    }

    int ans = 1e9;
    for(int i = 0; i < A.size(); i++) {
        int cnt = 0;
        for(int j = 0; j < A.size(); j++) {
            if(A[j] != B[ (j + i) % A.size() ]) cnt++;
        }
        vector<pii> tmp;
        for(int j = 0; j < A.size(); j++) {
            if(A[j] != B[ (j + i) % A.size() ] && nxt[j] - j > i) {
                tmp.push_back(pii(j - pre[j], nxt[j] - (j + i)));
            }
        }
        if(tmp.size() == 0) {
            ans = min(ans, cnt + i);
            continue;
        }
        sort(tmp.begin(), tmp.end());
        vector<int> dp(tmp.size() + 1, 0);
        for(int j = tmp.size() - 1; j >= 0; j--) {
            dp[j] = tmp[j].second;
            dp[j] = max(dp[j], dp[j + 1]);
        }
        int mn = dp[0];
        for(int j = 0; j < tmp.size(); j++) {
            mn = min(mn, tmp[j].first + dp[j + 1]);
        }
        ans = min(ans, cnt + i + 2*mn);
    }
    for(int i = 0; i < A.size(); i++) {
        int cnt = 0;
        for(int j = 0; j < A.size(); j++) {
            if(A[j] != B[ (j + (int)A.size() - i) % A.size() ]) cnt++;
        }
        vector<pii> tmp;
        for(int j = 0; j < A.size(); j++) {
            if(A[j] != B[ (j + (int)A.size() - i) % A.size() ] && j - pre[j] > i) {
                tmp.push_back(pii(j - pre[j] - i, nxt[j] - j));
            }
        }
        if(tmp.size() == 0) {
            ans = min(ans, cnt + i);
            continue;
        }
        sort(tmp.begin(), tmp.end());
        vector<int> dp(tmp.size() + 1, 0);
        for(int j = tmp.size() - 1; j >= 0; j--) {
            dp[j] = tmp[j].second;
            dp[j] = max(dp[j], dp[j + 1]);
        }
        int mn = dp[0];
        for(int j = 0; j < tmp.size(); j++) {
            mn = min(mn, tmp[j].first + dp[j + 1]);
        }
        ans = min(ans, cnt + i + 2*mn);
    }
    cout << ans;
}


Measured memory_bytes: 384
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let a:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	let b:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	let c:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	if a == b && c != a && c != b {
		println!("Yes");
	}else if a == c && b != a && b != c {
		println!("Yes");
	}else if b == c && a != b && a != c {
		println!("Yes");
	}else{
		println!("No");
	}
}

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

long long factor(int n){
  long long ans = 1;
  for(int i=1; i <= n; i++){
      ans = (ans * i) % 1000000007;
  }
  return ans;
}

int main(){
  int N,M;
  cin >> N >> M;
  if(abs(N-M) > 1){
    cout << 0 << endl;
    return 0;
  }
  else if(abs(N-M) == 1){
    cout << factor(max(N,M)) * factor(min(N,M)) % 1000000007 << endl;
  }else{
    cout << factor(N) * factor(M) * 2 % 1000000007 << endl;
  }
  return 0;

}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int w, h;
  char c;
  char flag[21][21];
  int i, j;

  scanf("%d %d %c", &w, &h, &c);
  
  flag[0][0] = flag[0][w - 1]
    = flag[h - 1][0] = flag[h - 1][w - 1] = '+';

  for (i = 1; i < w - 1; i++) {
    flag[0][i] = flag[h - 1][i] = '-';
  }

  for (i = 1; i < h - 1; i++) {
    flag[i][0] = flag[i][w -1] = '|';
  }

  for (i = 1; i < h - 1; i++) {
    for (j = 1; j < w - 1; j++) {
      flag[i][j] = '.';
    }
  }

  flag[h / 2][w / 2] = c;

  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j++) {
      putchar(flag[i][j]);
    }
    putchar('\n');
  }

  return 0;
}



Measured memory_bytes: 2040
import sys

H, N = map(int, input().split())
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

dp = [0 for _ in range(H + max(AB, key=lambda x: x[0])[0])]
for h in range(1, len(dp)):
    dp[h] = min(dp[h-a] + b for a, b in AB)

print(dp[H])


Measured memory_bytes: 42972
#include <stdio.h>
#include <string.h>
int main(void){
    int n;
    char s[100+5], t[100+5];
    scanf("%d", &n);
    scanf("%s", s);
    scanf("%s", t);
    
    int ans=2*n;
    for(int i=0; i<n; i++){
        if(strncmp(s+i, t, n-i)==0){
            ans=n+i;
            break;
        }
    }
    
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 1748
#include<bits/stdc++.h>
#define N 300050
#define M 200
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(),v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
#define MOD mod
using namespace std;
int n,k;
vector< pair< int , int > > ar;
int mod = 1e9 + 7;
int fast_exp(int base,int ex) {
    int res=1;
    while(ex>0) {
       if(ex%2==1) res=(res*base)%mod;
       base=(base*base)%mod;
       ex/=2;
    }
    return res%mod;
}
signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
    int ans = 0;
    cin>>n>>k;
    ar.resize(n);
    for(int i=0;i<n;i++){
        cin>>ar[i].x;
        if(ar[i].x<0)ar[i].y = -1;
        else ar[i].y = 1;
        ar[i].x = abs(ar[i].x);
    }
    sort(all(ar));
    reverse(all(ar));
    int ne = 0, pos =0;
    int pr = 1;
    int ze = 0;
    for(int i=0;i<k;i++){
        pr *= ar[i].x;
        pr %= mod;
        if(ar[i].y<0)ne++;
        if(ar[i].x==0)ze = 1;
    }
    if(ne%2==0){
        cout<<pr;
        return 0;
    }
    //cout<<"he ";
    int a=1e10,b = 1e10;
    for(int i=k;i<n;i++){
        if(a==1e10&&ar[i].y==-1)a = ar[i].x;
        if(b==1e10&&ar[i].y==1)b = ar[i].x;
    }
    int c = 1e10,d = 1e10;
    for(int i=k-1;i>=0;i--){
        if(c==1e10&&ar[i].y==-1)c = ar[i].x;
        if(d==1e10&&ar[i].y==1)d = ar[i].x;
    }
    if((a==1e10||d==1e10)&&(b==1e10||c==1e10)){
        int ans = 1;
        for(int i=n-1;i>=n-k;i--){
            ans *= ar[i].x;
            ans %= mod;
        }
        ans *= -1;
        if(ans<0)ans += mod;
        if(ze)ans = 0;
        cout<<ans;
        return 0;
    }
    if(a==1e10||d==1e10){
        pr *= fast_exp(c,mod-2);
        pr %= mod;
        pr *= b;
        pr %=mod;
        cout<<pr;
        return 0;
    }
    if(b==1e10||c==1e10){
        pr *= fast_exp(d,mod-2);
        pr %= mod;
        pr *= a;
        pr %=mod;
        cout<<pr;
        return 0;
    }
    if(b*d>a*c){
        pr *= fast_exp(c,mod-2);
        pr %= mod;
        pr *= b;
        pr %=mod;
        cout<<pr;
        return 0;
    }
    pr *= fast_exp(d,mod-2);
        pr %= mod;
        pr *= a;
        pr %=mod;
        cout<<pr;
  	return 0;
}



Measured memory_bytes: 6316
#ARC071C

def f(s):
 l=[]
 for i in xrange(97,123):
  l.append(s.count(chr(i)))
 return l

n=int(raw_input())
t=[]
for i in xrange(n):
 u=raw_input()
 t.append(f(u))

v=[0 for i in xrange(26)]
for i in xrange(26):
 temp=50
 for j in xrange(n):
  temp=min(t[j][i],temp)
  v[i]=temp

res=""
for i in xrange(26):
 res+=chr(i+97)*v[i]
print res


Measured memory_bytes: 2692
#include <iostream>                                                                                    

using namespace std;

int main () {
  int X, Y;
  cin >> X;
  cin >> Y;

  int sum = 0;
  if (X == 1) {
    sum += 300000;
  } else if (X == 2) {
    sum += 200000;
  } else if (X == 3) {
    sum += 100000;
  }

  if (Y == 1) {
    sum += 300000;
  } else if (Y == 2) {
    sum += 200000;
  } else if (Y == 3) {
    sum += 100000;
  }

  if (X == 1 && Y == 1) {
    sum += 400000;
  }

  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<long long> vll;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  double r;
  ll N,M,H;
  ll ans=0;
  cin>>N>>M;
  for(ll i=0;i<M;i++)
  {
      cin>>H;
      ans=ans+H;
  }
 //cout<<ans<<endl;
 if(ans<=N)
 {
     cout<<N-ans<<endl;
 }
 else
 {
     cout<<"-1"<<endl;
 }
   return 0;
}


Measured memory_bytes: 3640
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

// vars
lint x;
void input(){
    cin >> x;
}

void solve(){
    lint m = 100;
    for (int i=1; i<=4000; ++i){
        lint k = m / 100;
        m += k;
        if(m >= x){
            cout << i << endl;
            return;
        }
    }
}

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

Measured memory_bytes: 3200
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>

using namespace std;
typedef long long ll;

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

int main() {

    ll X;
    cin >> X;
    ll N =300;
    ll A,B;
    A = 0;
    B = 0;
    ll f[N];
    rep(i,N) f[i] = (ll)pow(i-N/2,5);
    for(ll i= 0;i<N;i++){
        for(ll j=i;j<N;j++){
            if(f[j]-f[i]==X){
                A = j-N/2;
                B = i-N/2;
                break;
            }
        }
    }
    cout << A << " " << B << endl;
    return 0;
}


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

long long int mod = 1000000007;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);

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

    int prefixSum[n];
    int sum = arr[n-1];
    prefixSum[n-1]=sum;
    for(int i=n-2; i>=0; i--){
        sum = (sum%mod + arr[i]%mod)%mod;
        prefixSum[i]=sum;
    }

    long long int ans = 0;
    for(int i=0; i<n-1; i++){
        ans = (ans%mod + (arr[i]%mod*prefixSum[i+1]%mod)%mod)%mod;
    }

    cout<<ans<<'\n';

    return 0;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main () {
    int N; cin >> N;
    vector<int> a(N);
    rep(i, N) {cin >> a[i]; a[i]--;}

    int ans = 0, cur = 0;
    vector<bool> flg(N);
    while (!flg[cur]) {
        flg[cur] = true;
        cur = a[cur];
        ans++;
        if (cur == 1) break;
        else if (flg[cur]) {ans = -1; break;}
    }
    cout << ans << endl;
}



Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

const int INF = INT_MAX / 2;

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

    vector<int> dp(1<<n, INF);
    dp[0] = 0;
    for(int i=0; i<m; ++i){
        int a, b;
        cin >> a >> b;
        bitset<32> bs;
        for(int i=0; i<b; ++i){
            int c;
            cin >> c;
            bs[c-1] = true;
        }

        for(int j=0; j<(1<<n); ++j){
            bitset<32> next = j;
            next |= bs;
            dp[next.to_ulong()] = min(dp[next.to_ulong()], dp[j] + a);
        }
    }

    if(dp.back() < INF)
        cout << dp.back() << endl;
    else
        cout << -1 << endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<string>
#include<stack>
using namespace std;
//#define int long long
typedef pair<int, int> pii;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

stack<int> sta;

signed main(){
    string s;
    getline(cin, s);
//    cout << s << endl;
    int N = (int)s.size();
    int m = 0;
    for(int i = 0; i < N; i++){
        if('0' <= s[i] && s[i] <= '9'){
            m *= 10;
            m += s[i] - '0';
            if(s[i + 1] == ' '){
                sta.push(m);
                m = 0;
            }
        }
        else if(s[i] == '+'){
            int a = sta.top();
            sta.pop();
            int b = sta.top();
            sta.pop();
            sta.push(a + b);
            //cout << sta.top() << endl;
        }
        else if(s[i] == '-'){
            int a = sta.top();
            sta.pop();
            int b = sta.top();
            sta.pop();
            sta.push(b - a);
            //cout << sta.top() << endl;
        }
        else if(s[i] == '*'){
            int a = sta.top();
            sta.pop();
            int b = sta.top();
            sta.pop();
            sta.push(a * b);
            //cout << sta.top() << endl;
        }
    }
    cout << sta.top() << endl;

    return 0;
}

/*

*/


Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
const int Nmax=200010;
int main() {
	int A,B,a[4]={},cnt=0,value;
	cin >> A >> B;
	for(int i=A;i <= B;i++){
		value = i;
		a[0] = value % 10; value /= 10;
		a[1] = value % 10; value /= 100;
		a[2] = value % 10; value /= 10;
		a[3] = value % 10;
		if(a[0] == a[3] && a[1] == a[2]) cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        
        AtCoder problem = new AtCoder(sc);
        problem.solve(out);
        
        out.flush();
    }
    
}

class AtCoder {
    int N;
    AtCoder(FastScanner sc) {
        N=sc.nextInt();
    }

    void solve(PrintWriter out) {
        out.println(N/3);
    }
    
}

class FastScanner {
    
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    
    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }
    
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }
    
    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    
    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 23380
n,*z=`dd`.split.map &:to_i
t=(e=[*0...n]).dup
f=->a{t.map{|q|a[q]}}
a=z.shift n+1
n.downto(1){|i|a[i]-=a[i-1]}
k,*z=z
z.map{|x|t[x-2],t[x-1]=t[x-1],t[x-2]}
(k%2>0&&e=f[e];t=f[t];k/=2)while k>0
k,*a=a
n.times{|i|p k;k+=a[e[i]]}

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

typedef pair<int, int> P;

double dist(P p1, P p2){
    double tmp;
    tmp = (p1.first - p2.first)*(p1.first - p2.first) + (p1.second-p2.second)*(p1.second-p2.second);
    tmp = sqrt(tmp);
    return tmp;
}

int main(){
    int n;
    cin >> n;
    vector<P> p(n);
    vector<int> c(n);
    rep(i,n){
        cin >> p[i].first >> p[i].second;
        c[i] = i;
    }

    double ans = 0;
    double time = 0;
    do{
        rep(i,n-1){
            ans += dist(p[c[i]], p[c[i+1]]);
        }
        time++;
    }while(next_permutation(c.begin(),c.end()));

    cout << fixed;
    cout << setprecision(10) << ans/time << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <numeric>
#include <set>
#include <boost/math/constants/constants.hpp>
#include <boost/math/common_factor_rt.hpp>
#include <queue>

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

int main(){
  ll N, M;
  cin >> N >> M;
  int a, b;
  vector<pair<int, int>> p(N);
  rep(i,N) cin >> a >> b, p.at(i) = make_pair(a, b);
  
  sort(p.begin(), p.end());
  
  priority_queue<int> q;
  int start = 0;
  int ans = 0;
  
  rep(i, M){
      while(p[start].first <= i+1 && start<N){
        q.push(p[start].second);
        start++;
      }
    if(!q.empty()){
      ans += q.top();
      q.pop();
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 1660
def main():
    N, M, C = map(int, input().split())
    B = list(map(int, input().split()))
    ans = 0
    for _ in range(N):
        A = list(map(int, input().split()))
        if sum([a * b for a, b in zip(A, B)]) + C > 0:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 61736
N,K=map(int,input().split())
arr=[]
ans=[str(i) for  i in range(1,N+1)]
for i in range(K):
    _=input()
    arr.extend((input().split()))
    arr=list(set(arr))
p=0
for n  in  ans:
    if(not(n in arr) ) :
        p=p+1
print(p)




Measured memory_bytes: 9068
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <bitset>
#include <vector>
#include <queue>
#include <map>
#include <set>

#define i64 int64_t
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define st(vvv) sort(vvv.begin(),vvv.end())
#define rvs(vvv) reverse(vvv.begin(),vvv.end())
int inf = 1000000007;

using namespace std;

int main() {
	string s;
	cin >> s;
	deque<char> t;
	ff(i, 0, s.size()) {
		t.push_back(s[i]);
	}
	cout << endl;
	while (!t.empty()) {
		if (t.front() == 'd') {
			if (t[1] == 'r' && t[2] == 'e' && t[3] == 'a' && t[4] == 'm') {
				ff(i, 0, 5)t.pop_front();
				if (t.empty())break;
				if (t.size() == 1) {
					cout << "NO" << endl;
					return 0;
				}
				if (t[0] == 'e' && t[1] == 'r') {
					if (t.size() == 2) {
						ff(i, 0, 2)t.pop_front();
					}
					else if (t[2] != 'a') {
						ff(i, 0, 2)t.pop_front();
					}
				}
			}
			else {
				cout << "NO" << endl;
				return 0;
			}
		}
		else if (t.front() == 'e') {
			if (t[1] == 'r' && t[2] == 'a' && t[3] == 's' && t[4] == 'e') {
				ff(i, 0, 5)t.pop_front();
				if (t.empty())break;
				if (t[0] == 'r') {
					t.pop_front();
				}
			}
			else {
				cout << "NO" << endl;
				return 0;
			}
		}
		else {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 512
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        //値の取得
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        int[] b = new int[3];
        
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; ++i){
            for (int j = 0; j < 3; ++j){
                c[i][j] = sc.nextInt();
            }
        }
        
        a[0] = 0;   //仮定
        
        for (int i = 0; i < 3; ++i){    //各列
           b[i] = c[0][i] - a[0];
        }
        for (int i = 0; i < 3; ++i){    //各行
           a[i] = c[i][0] - b[0];
        }
        
        for (int i = 0; i < 3; ++i){
            for (int j = 0; j < 3; ++j){
                if (c[i][j] != a[i] + b[j]){  //一つでも異なるものがあれば、正しいとは言えない
                    System.out.println("No");
                    System.exit(0);
                }
            }
        }
        
        System.out.println("Yes");
        
    }
}

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

int main(){
int n; cin >> n; int p; cin >> p;
vector<int> h(n); h[0] = p; int ans=0; p=1; int max=0;
while(p<n){
    int hh; cin >> hh;
    h[p] = hh;
    if(h[p-1]>=h[p]) max++;
    else {ans = (max<ans) ? ans : max; max=0;}
    p++;
}
  ans = (max<ans) ? ans : max;
cout << ans << endl;
return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define INF 1145141919
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int ny, nx;
typedef long long int ll;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

ll llpow(ll x, ll y)
{
    ll ans = 1;
    REP(i, y)
    ans *= x;
    return ans;
}

int ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0; 
}
////////////////////////////////////////////////////////////////////
double N,K;

long double func(int i, int k){
    long double ans=i, cnt=0;
    while(ans<k){
        ans*=2;
        cnt++;
    }
    return cnt;
}

long double calc(long double cnt){
    return powl(0.5000000000000,cnt);
}

int main()
{
    cin >> N >> K;
    double ans=0;

    FOR(i,1,N+1){
        /*cout << func(i,K) << endl;
        cout << calc(func(i,K)) << endl;
        cout << endl;*/
        ans += calc(func(i,K));
    }

    printf("%.12f\n", ans/N);


    return 0;
}


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

int main()
{
	int X, N;
	int p[100];
	int flag = 0;
	int min = 100;
	int n_closest = 100;

	cin >> X >> N;
	for (int i = 0; i < N; i++) {
		cin >> p[i];
	}

	for (int n = 200; n >= 0; n--) {
		for (int i = 0; i < N; i++) {
			if (n == p[i])
				flag = 1;
		}
		if (flag == 0) {
			if (min >= abs(X - n)) {
				min = abs(X - n);
				n_closest = n;
			}
		}
		flag = 0;
	}

	cout << n_closest << endl;

	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <regex>
#ifdef _DEBUG
#include "debug.h"
#endif
#define int ll
#define FOR(i, s, e) for (int i = int(s); i < int(e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define mkpr make_pair
#define mktp make_tuple
#define tv(tp, i) get<(i)>(tp)
#define var auto
#define OUT(type) type &
#define IN(type) const type &
#define self (*this)
#define in :
#define True true
#define False false
using namespace std; using str = string; using cstr = const str;
using ll = long long; using ull = unsigned long long; using cint = const int; using cll = const ll;
using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>;
using vb = vector<bool>; using vvb = vector<vb>; using vd = vector<double>; using vvd = vector<vd>;
using vc = vector<char>; using vvc = vector<vc>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using psl = pair<string, ll>;
using tiii = tuple<int, int, int>; using tlll = tuple<ll, ll, ll>;
static const int MGN = 10; static const int ARYSZ_MAX = (int)1e7;
static const ll LINF = LLONG_MAX/2;
#ifdef int
static const int INF = LINF;
#else
static const int INF = INT_MAX/2;
#endif
static double EPS = 1e-9;
static inline bool DBLEQ(double a, double b) {return abs(a - b) < EPS;}
static inline void EPR(str msg) {cerr << msg << endl;}
static inline void AST(bool exp, str msg) {if(!exp){EPR(msg);} assert(exp);}
static inline void TAST(bool exp, str msg) {if(!exp){EPR(msg);} while(!exp){}}


int32_t main(int32_t argc, char* argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef _DEBUG
    vs args(argv, argv+argc);
    string sample = make_sample(args, 1);
    ifstream ifs(sample); cin.rdbuf(ifs.rdbuf());
#endif


    int N,X,Y; cin>>N>>X>>Y;
    X--;Y--;

    vvi es(N);
    REP(i,N-1) {
        es[i].push_back(i+1);
        es[i+1].push_back(i);
    }
    es[X].push_back(Y);
    es[Y].push_back(X);

    vvi dist(N);

    REP(s,N) {
        queue<int> que;
        que.push(s);
        vb vis(N, false);
        vi ds(N, INF);
        ds[s] = 0;
        while(!que.empty()) {
            int x = que.front(); que.pop();
            vis[x] = true;

            for (int nx : es[x]) {
                if (vis[nx]) continue;
                ds[nx] = min(ds[nx], ds[x]+1);
                que.push(nx);
            }
        }
        dist[s] = ds;
    }

    map<int, int> ans;
    REP(i,N) {
        FOR(j,i+1,N) {
            ans[dist[i][j]] += 1;
        }
    }

    FOR(k, 1, N) {
        cout << ans[k] << endl;
    }


    return 0;
}

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

cnt = 0
l = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    d1,d2 = l[i][0],l[i][1]
    if(d1==d2):
        cnt += 1
    else:
        cnt = 0
    if(cnt == 3):
        print('Yes')
        exit()

print('No')
        

Measured memory_bytes: 9176
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MAX = 1000;
const int INF = 1e9;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
#define PI 3.14159265358979323846264338327950L
//setprecision(15)

int main() {
	string s; cin >> s;
	for (int i = 0; i < s.length(); i++) {
		s[i] = 'x';
	}
	cout << s << endl;
}

Measured memory_bytes: 3636
import std.stdio;
import std.typecons;

alias Tuple!(int, "from", int, "to", int, "day") Edge;

void main() {
  int nodes_len, edges_len;
  readf("%d %d\n", &nodes_len, &edges_len);
  Edge[] edges = new Edge[](edges_len);
  for(int from, to, day, i = 0; i < edges_len; i++) {
    readf("%d %d %d\n", &from, &to, &day);
    edges[i] = Edge(from, to, day);
  }
  
  int[] dist = new int[](nodes_len);
  foreach(ref d; dist) d = int.min;
  dist[0] = 0;

  while(true) {
    bool update = false;
    foreach(e; edges) {
      if (dist[e.from] != int.max && dist[e.to] < (dist[e.from] + e.day)) {
        dist[e.to] = dist[e.from] + e.day;
        update = true;
      }
    }
    if (!update) break;
  }
  writeln(dist[nodes_len - 1]);
}

Measured memory_bytes: 1080
k = $stdin.gets.chomp.to_i
ans = 1
if k % 2 == 0 || k % 5 == 0
  puts "-1"
  exit
end

amari = 7 % k
amari_mae = 7 % k
until amari == 0
	amari += (amari_mae * 10) % k
    amari_mae = (amari_mae * 10) % k
  	amari = amari % k
    ans += 1
end
puts ans

Measured memory_bytes: 14428
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)

using namespace std;

int main(){

	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/

	char c[4];
	rep0(i,4) cin >> c[i];
	int flag0 = 0, flag1 = 0;
	if(c[0]=='0' && c[1]!='0') flag0 = 1;
	else if(c[0]=='1'){
		if(c[1]=='2' || c[1]=='1') flag0 = 1;
	}
	if(c[2]=='0' && c[3]!='0') flag1 = 1;
	else if(c[2]=='1'){
		if(c[3]=='2' || c[3]=='1') flag1 = 1;
	}
	if(flag0==1 && flag1==0) cout << "MMYY";
	if(!flag0 && flag1) cout << "YYMM";
	if(flag0 && flag1) cout << "AMBIGUOUS";
	if(!flag0 & !flag1) cout << "NA";

	//cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

	return 0; 
}

Measured memory_bytes: 256