akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
	private static int head = 0;// キューの先頭ポインタ
	private static int tail = 0;// キューの末尾ポイント
	private static final int MAX = 100005; // 制約のプロセス数が10万なので少し多めに。
	private static Process[] queue = new Process[MAX];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		// すべてのプロセスをキューに追加
		for (int i = 0; i < n; i++) {
			String name = sc.next();
			int time = sc.nextInt();
			Process p = new Process(name, time);
			queue[i] = p;
		}
		tail = n;
		// すべてのプロセスが完了する（＝キューが空になる）まで実行
		int elaps = 0; // 経過時間
		while (!(head == tail)) {
			Process p = dequeue();
			if (p.time > q) {
				p.time = p.time - q;
				enqueue(p);
				elaps += q;
			} else {
				elaps += p.time;
				System.out.println(p.name + " " + elaps);
			}
		}

	}

	private static void enqueue(Process p) {
		// 中身が満タンでないことを判定
		if ((tail + 1) % MAX == head) {
			System.err.println("エラー（オーバーフロー）");
		} else {
			queue[tail] = p;
			tail = (tail + 1) % MAX;
		}
	}

	private static Process dequeue() {
		// 中身が空じゃないことを判定
		Process ret = null;
		if (head == tail) {
			System.err.println("エラー（アンダーフロー）");
		} else {
			ret = queue[head];
			head = (head + 1) % MAX;
		}
		return ret;

	}

}

class Process {
	String name;
	int time;

	public Process(String name, int time) {
		this.name = name;
		this.time = time;
	}

}


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

int main(){
    int N; cin >> N;
    int sum=0;
    vector <int> A(N);
    rep(i,N){
        cin >> A[i];
        sum+=A[i];
    }
    
    if(sum%10!=0){
        cout << sum;
        return 0;
    }
    
    else{
        sort(A.begin(),A.end());
        rep(i,N){
            if(A[i]%10!=0){
                cout << sum-A[i];
                return 0;
            }
        }
        cout << 0;
        return 0;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb           push_back
#define pf           push_front
#define in           insert
#define ff           first
#define ss           second
#define int          long long
#define rep(i,x,m)   for(int i=x;i<m;i++)
#define MOD          1000000007
#define endl         "\n"
#define all(v)       v.begin(),v.end()
#define rall(v)      v.rbegin(),v.rend()
#define vi           vector<int>
#define pi           pair<int,int>
#define sz(x)       (int)x.size()
#define pq           priority_queue<int>
#define fix(y)       fixed<<setprecision(y)
#define print(v)     for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
#define FIO         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int power(int n,int m)
{int p=1;if(m==0)return 1;p=(power(n,m/2)%MOD);p=(p%MOD*p%MOD)%MOD;
return(m&1?((p%MOD*n%MOD)%MOD):(p%MOD));}


void solve()
{
     int n;
     cin>>n;
     int a[n];
     vi v;
     rep(i,0,n)
     {
        cin>>a[i];v.pb(a[i]);}
        sort(rall(v));
        int m1=v[0];
        int m2=v[1];
        rep(i,0,n)
        {
            if(a[i]==m1)
                cout<<m2<<endl;
            else
                cout<<m1<<endl;

        }


}

signed main()
{
        FIO
       
        
        int t=1;
        //cin>>t;
        while(t--)
        solve();
        cerr<<(float)clock()/CLOCKS_PER_SEC*1000<<" ms"<<endl;

        return 0;
}

Measured memory_bytes: 6580
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

int main() {
  int N; std::cin >> N;
  std::vector<std::pair<int,int>> BA(N);
  for(int i = 0; i < N; ++i) std::cin >> BA[i].second >> BA[i].first;
  std::sort(BA.begin(), BA.end());
  int t = 0;
  for(auto const& p: BA) {
    t += p.second;
    if(t > p.first) fin("No");
  }
  fin("Yes");
  return 0;
}


Measured memory_bytes: 1792
import sys
import collections
import math

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


a,b,c,d = nm()
ao=math.ceil(a/d)
su=math.ceil(c/b)
if(ao<su):
    print("No")
else:
    print("Yes")


Measured memory_bytes: 9400
W, H, N = gets.split.map(&:to_i)
left = 0
right = W
top = H
bottom = 0

N.times do |i|
    x, y, a = gets.split.map(&:to_i)
    case a
    when 1
        left = [x, left].max
    when 2
        right = [x, right].min
    when 3
        bottom = [y, bottom].max
    when 4
        top = [y, top].min
    end
end

puts [right - left, 0].max * [top - bottom, 0].max

Measured memory_bytes: 1788
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<math.h>
#include<queue>
#include<deque>
#include<map>
#include<bitset>

#define rep(i, n) for(int i = 0;i < (n);i++)
#define rrep(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)

using namespace std;
using ll = long long;

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;}

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


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



int main() {
    ll a, b, k; cin >> a >> b >> k;
    if (k > a) {
        k -= a;
        a = 0;
        // k -= a;
        // cout << k << endl;
        if (k > b) {
            b = 0;
        } else {
            b -= k;
        }
    } else {
        a -= k;
    }
    cout << a << ' ' << b << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main{
    public static void main(String []args)
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        if(n%k==0)
            System.out.println(0);
        else
            System.out.println(1);

    }
}


Measured memory_bytes: 23252
#include <iostream>
#include <math.h>
using namespace std;

int main() {
	// your code goes here
	int a = 0;
	cin>>a;
	int sum = 0;
	int b = pow(a,2);
	int c = pow(a,3);
	sum = a + b + c;
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll; //long longをllとして簡略
 
int main(){
  int a[5]={0};
  rep(i,6){
    int z;
    cin >>z;
    a[z]++;
  }
  if(a[1]<=2&&a[2]<=2&&a[3]<=2&&a[4]<=2){
    cout << "YES" <<endl;
    return 0;
  }
  cout << "NO" <<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef vector<PII> VPII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )
#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

#include <complex>
typedef complex<double> Point;
const double EPS = 1e-8;

// テ・ツ?・テ・ツ環崚」ツつケテ」ツδ暗」ツδェテ」ツδシテ」ツδ?」ツ?凝」ツつ嘉・ツョツ淌ヲツ閉ーテ、ツコツ古」ツ?、テ」ツつ津」ツ?ィテ」ツ?」テ」ツ?ヲ Point テ」ツ?ク
istream& operator >> ( istream &s, Point &a )
{
	double r, i;
	s >> r >> i;
	a = Point( r, i );
	return s;
}

// テ・ツ、ツ姪ァツゥツ催ッツシツ暗」ツつッテ」ツδュテ」ツつケテァツゥツ催ッツシツ?
double cross( const Point &a, const Point &b )
{
	return a.real() * b.imag() - a.imag() * b.real();
}

// CCW テゥツ鳴「テヲツ閉ーテ」ツ?? -> b -> c テ」ツ?ィテゥツ?イテ」ツつ?」ツ?ィテ」ツ?催」ツ??・ツ渉催ヲツ卍づィツィツ暗・ツ崢榲」ツつ甘」ツ?ェテ」ツつ?1, テァツ崢エテゥツ?イテ」ツ?ェテ」ツつ?0, テヲツ卍づィツィツ暗・ツ崢榲」ツつ甘」ツ?ェテ」ツつ?-1
// include : cross
int ccw( const Point &a, const Point &b, const Point &c )
{
	if ( cross( ( b - a ), ( c - a ) ) < -EPS )
	{
		return -1;
	}
	else if ( EPS < cross( ( b - a ), ( c - a ) ) )
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

// テァツつケ p テ」ツ?古・ツ、ツ堙ィツァツ津・ツスツ「 qs テ」ツ?ョテ・ツ??ゥツδィテ」ツ?ォテ」ツ?づ」ツつ凝」ツ??( Winding Number Algorithm) :TODO
// include : ccw
bool point_in_polygon( const Point &p, const vector<Point> &qs )
{
	const int N = qs.size();
	
	int wn = 0;
	for ( int i = 0; i < N; ++i )
	{
		const Point &s = qs[i], &t = qs[ ( i + 1 ) % N ];
		if ( s.imag() - EPS <= t.imag() && s.imag() - EPS < p.imag() && p.imag() + EPS < t.imag() ) // テ、ツクツ甘・ツ青妥」ツ?催」ツ?ョティツセツコ
		{
			wn += ccw( s, p, t ) == -1;
		}
		else if ( t.imag() - EPS <= s.imag() && t.imag() - EPS < p.imag() && p.imag() + EPS < s.imag() )
		{
			wn -= ccw( t, p, s ) == -1;
		}
	}
	return wn;
};

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

	int n;
	cin >> n;
	REP( i, 0, n )
	{
		vector<Point> tri( 3 );
		REP( j, 0, 3 )
		{
			cin >> tri[j];
		}
		Point s, t;
		cin >> s >> t;

		cout << ( point_in_polygon( s, tri ) ^ point_in_polygon( t, tri ) ? "OK" : "NG" ) << endl;
	}

	return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
#define REP(a,b,c) for((a)=(b);(a)<(c);(a)++)

using namespace std;

int main(){
    string S;
    cin >> S; 
    int ret=0, l=0, r=S.length()-1;
    while(l<r){
        if(S[l]!=S[r]) ret++;
        l++;
        r--;
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 256
fn get_input() -> String {
    let mut word = String::new();
    std::io::stdin().read_line(&mut word).unwrap();
    word.trim().to_owned()
}

fn main() {
    let (a,b,k) = {
        let line = get_input();
        let mut split = line.split_whitespace();
        let a:i64 = split.next().unwrap().parse().unwrap();
        let b:i64 = split.next().unwrap().parse().unwrap();
        let k:i64 = split.next().unwrap().parse().unwrap();
        (a,b,k)
    };

    let mut ans = 0;
    let min = std::cmp::min(a,b);

    for i in (1..min+1).rev() {
        if a % i == 0 && b % i == 0 {
            ans += 1;
            if ans >= k {
                println!("{}", i);
                break;
            }
        }
    }
}

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

const int maxn=1e5+9;

int main()
{

    char a[maxn],p[maxn];
    scanf("%s",a);
    int len=strlen(a);
    for(int i=0;i<len;i++)
    p[i+1]=a[i];

    if(p[len]=='1'||p[1]=='0')
    {
         printf("-1\n");
         return 0;
    }
    for(int i=1;i<=len/2;i++)
    {
        if((p[i]=='0'&&p[len-i]=='1')||(p[i]=='1'&&p[len-i]=='0'))
        {
            printf("-1\n");
            return 0;
        }
    }
    printf("%d %d\n",1,2);
    int cur=1;
    for(int i=2;i<len;i++)
    {
        printf("%d %d\n",cur,i+1);
        if(p[i]=='1')
        cur=i+1;
    }



    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
void Set(); void Solve(); void Clean();
int main(){Set(); Solve(); Clean(); return 0;}

int N;
vector<int>L;

void Solve()
{
	LL ans = 0L;
	sort(L.begin(), L.end(), greater<int>());
	for (int i = 0; i < N - 2; ++i){
		for (int j = i + 1; j < N - 1; ++j){
			int diff = L[i] - L[j];
			for (int k = j + 1; k < N; ++k){
				if (L[k] > diff) ans++;
				else break;
			}
		}
	}
	cout << ans << endl;
}

void Set()
{
#ifdef DEBUG_MODE
	N = 4;
	L.push_back(3); L.push_back(4);
	L.push_back(2); L.push_back(1);
#else
	cin >> N;
	int tmp;
	for (int i = 0; i < N; ++i){
		cin >> tmp; L.push_back(tmp);
	}
#endif
}

void Clean()
{
}

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define fi first
#define se second
#define setpre(x) cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ cout << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 100005;

/* ...o(^-^)o... */

int main(){
    ii2(h, a); out((h+a-1)/a);
}

Measured memory_bytes: 256
import itertools
from collections import Counter
N  = int(input())
V = [int(x) for x in input().split()]
ev_cnt = Counter(V[::2])
od_cnt = Counter(V[1::2])
# 1種のみ
ev_cnt[-1] = 0
od_cnt[-2] = 0
# 最頻値の上位２種のみ使用
ev = ev_cnt.most_common(2)
od = od_cnt.most_common(2)
ans = N
for (k1,v1), (k2,v2) in itertools.product(ev,od):
    if k1==k2:
        continue
    x = N - v1 - v2
    if ans > x:
        ans = x
print(ans)

Measured memory_bytes: 18528
import java.util.Scanner;

public class Main {

     static Scanner scanner;

     public static void main(String[] args) {
         scanner = new Scanner(System.in);

         int N=gi();
         long[][] dp=new long[10][10];
         long ans=0;
         for (int i=1;i<=N;i++) {
        	 if(i%10!=0) {
        	     String s=Nsin(i,10);
        	     int a=Integer.parseInt(s.substring(0,1));
        	     int b=i%10;
        	     if(a==b)ans++;
        	     ans+=dp[b][a]*2;
        	     dp[a][b]++;
        	 }
         }


         System.out.println(ans);
     }

  // s進数で表した時の文字列
 	public static String Nsin(int n, int s) {
 		if(n==0) return "0";

 		StringBuffer sb=new StringBuffer();
 		while(n!=0) {
 			int a=n%s;
 			sb.append(a);
 			n=(n-a)/s;
 		}

 		return sb.reverse().toString();
 	}

     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

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

int main()
{
	int n; cin>>n;
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		int x; scanf("%d", &x);
		if (i % 2 && x % 2) cnt++;
	}
	printf("%d\n", cnt);
	return 0;
}

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) (((a)+(b)-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define INF LLONG_MAX/2
#define PI acos(-1.0)
//#define MOD 1000000007

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;
typedef priority_queue<int> PQi;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vout(Vs &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int mypow(int x, int n, int m){if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int digit(int k,int i){string s = to_string(k);return s[s.size()-i]-'0';}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());} //vectorの同じ要素消す
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
int leng(int n){string s=to_string(n); return s.size();} //intの桁数
int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和
int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数
int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数
int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数
int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数
int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数
Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}


signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);
    int n,m;
    cin>>n>>m;
    if(n%2==1){
        REP(i,1,m+1){
            cout<<i<<" "<<n-i<<endl;
        }
    }else{
        int left=n/2;
        int right=left+1;
        REP(i,0,m){
            cout<<left<<" "<<right<<endl;
            left--; right++;
            if(i==n/4-1) left--;
        }
    }
    return 0;
}


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

int main()
{
  char s[3];
  cin>>s;
  
  if((s[0] == s[1]) && (s[1] == s[2]))
  {
    cout<<"No"<<"\n";
  }
  else
  {
    cout<<"Yes"<<"\n";
  }
  return 0;
}

Measured memory_bytes: 256
from collections import deque

N, M = map(int, input().split())
s = list(input())

S = []
for i in s: #S[i]=0なら頂点iのラベルは"A"、S[i]=1なら頂点iのラベルは"B"
    if i == "A": S.append(0)
    else: S.append(1)

#R[i]には頂点iと辺でつながっている頂点を入れる
R = [list() for _ in range(N)]
#C[i][0]には頂点iと辺でつながっているラベル"A"の数
#C[i][1]には頂点iと辺でつながっているラベル"B"の数
C = [[0, 0] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    R[a-1].append(b-1)
    R[b-1].append(a-1)
    C[a-1][S[b-1]] += 1
    C[b-1][S[a-1]] += 1

O = [0] * N #ダメな頂点には1を入れる
q = deque() #調べる頂点の候補リスト
for i in range(N):
    if C[i][0] * C[i][1] == 0: #もし少なくとも"A","B"どちらかに行けないなら
        q.append(i)
        O[i] = 1

while q:
    x = q.popleft()
    for v in R[x]:
        C[v][S[x]] -= 1
        if C[v][S[x]] == 0 and O[v] == 0:
            O[v] = 1
            q.append(v)

if sum(O) == N:
    answer = "No"
else:
    answer = "Yes"

print(answer)


Measured memory_bytes: 65756
// 10桁でdouble出力するパターン１ 
// printf("%.10f\n", ma);
// 10桁でdouble出力するパターン２
//cout << fixed << setprecision(10);
//  cout << ma << endl;

/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*///vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  vector<vector<int>> data(3, vector<int>(3));//int型の2次元配列(3×3要素の)の宣
  rep(i,3){
    rep(j,3){
      cin >> data.at(i).at(j);
    }
  }
  int num1;
  int num2;
  num1 = abs( data.at(0).at(0) - data.at(1).at(0) );
  num2 = abs( data.at(0).at(0) - data.at(2).at(0) );
  if(data.at(0).at(0) < data.at(1).at(0) )   rep(i,3) data.at(1).at(i) -= num1;
  else   rep(i,3) data.at(1).at(i) += num1;

  if(data.at(0).at(0) < data.at(2).at(0) )   rep(i,3) data.at(2).at(i) -= num2;
  else   rep(i,3) data.at(2).at(i) += num2;

  
//  rep(i,3) data.at(1).at(i) -= num1;
//  rep(i,3) data.at(2).at(i) -= num2;

/*  rep(i,3){
    rep(j,3){
      cout << data.at(i).at(j);
    }
    cout << endl;
  }
*/

  if(data.at(0).at(0) == data.at(1).at(0) &&
     data.at(0).at(0) == data.at(2).at(0) &&
     data.at(0).at(1) == data.at(1).at(1) &&
     data.at(0).at(1) == data.at(2).at(1) &&
     data.at(0).at(2) == data.at(1).at(2) &&
     data.at(0).at(2) == data.at(2).at(2) ) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int w=sc.nextInt(),a=sc.nextInt(),b=sc.nextInt();
		System.out.println(a+w<b?b-a-w:b+w<a?a-b-w:0);
		sc.close();
	}
}

Measured memory_bytes: 22356
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define int ll
#define MOD (ll)(1e9+7)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	string s; cin>>s;
	map<char,int> mp;
	for(auto i:s) mp[i]++;
	for(auto i:mp)
	{
		if(sz(mp)!=2 || i.S!=2)
		{
			cout<<"No\n";
			return 0;
		}
	}
	cout<<"Yes\n";
	return 0;
}















Measured memory_bytes: 256
unsigned long long n,s=1,d[2]={1},m=1000000007,i;main(){for(scanf("%llu",&n);++i<n;s=(s+d[i%2])%m)d[i%2]=(m+s-d[i%2])%m;printf("%llu\n",(s*n%m+m-d[1-n%2]*(n-1)%m)*(n-1)%m+1);}

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

#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
#define gcd __gcd
#define F first
#define S second
#define PI 3.14159265358979323

using namespace std;


ll dp[110][100010];

ll solve( vector< pair<ll,ll> > &v, ll n, ll mv)
{
    if(mv==0) return 0;
    if(n==0 || mv<0) return 999999999999;
    if(dp[n][mv]!=-1) return dp[n][mv];
    ll one=999999999999,two=999999999999;
    if(mv>=v[n-1].S)  one=v[n-1].F+solve( v, n-1, mv-v[n-1].S);
    two = solve(v, n-1, mv);

    return dp[n][mv]=min(one,two);
}


int main()
{
    ll x,y,n,w,ans=0,mv=0,kk;
    cin>>n>>w;
    vector< pair<ll,ll> > v(n);
    for(ll i=0;i<n;i++){
        cin>>x>>y;
        mv+=y;
        v[i]=mp(x,y);
    }

    memset(dp,-1,sizeof(dp));
    for(ll i=mv;i>=0;i--){
        kk=solve(v,n,i);
        if(kk<=w) { ans=i;  break;  }
    }
    cout<<ans<<"\n";

return 0;
}

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

int main() {
  int a, b;

  cin >> a >> b;

  if ((a * b) % 2 == 0) {
    cout << "Even" << endl;
  }
  else {
    cout << "Odd" << endl;
  }

  return (0);
}


Measured memory_bytes: 256
// C - /\/\/\/
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int main(){
	int N; cin>>N;
	vector<int> E(100000),O(100000);//[value]<count>
	int maxE=0,maxO=0,e1=0,e2=0,o1=0,o2=0;
	rp(i, 0, N/2){
		int e,o; scanf("%d%d",&e,&o); e--,o--;
		E[e]++;
		if(E[e] > e1){
			e1 = E[e];
			maxE = e+1;
		}
		else if(E[e] > e2){
			e2 = E[e];
		}

		O[o]++;
		if(O[o] > o1){
			o1 = O[o];
			maxO = o+1;
		}
		else if(O[o] > o2){
			o2 = O[o];
		}
	}
	int ans = N;
	ans -= maxE != maxO? e1 + o1: max(e1 + o2, e2 + o1);
	cout<< ans <<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#define N 601000
typedef long long ll; 
template<typename T> inline void read(T &x) { 
  x = 0; char  c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) { x = (x << 1) + (x << 3) + (c ^ 48); c = getchar(); }
}
using namespace std;
const int P = 924844033;
const int G = 5;
int Gi; 
inline ll quickpow(ll x, int k) {
  ll res = 1;
  while (k) {
    if (k & 1)  res = res * x % P;  
    x = x *x  % P;
    k >>= 1;
  }
  return res;
}
int n;
struct edge{
  int nxt, to; 
}e[N << 1]; 
int head[N], ecnt;
inline void addedge(int from, int to) {
  e[++ecnt] = (edge){head[from], to};
  head[from] = ecnt;
}

int siz[N], dep[N], fa[N];
void dfs_son(int cur, int faa) {
  siz[cur] = 1, fa[cur] = faa;
  for (int i = head[cur]; i; i = e[i].nxt) {
    int to = e[i].to; if (to == faa)  continue;
    dfs_son(to, cur);
    siz[cur] += siz[to];
  }
}

int cnt[N];
ll f[N], g[N], A[N], ans[N];
int limi, L, r[N];
inline void ntt(ll *a, int type) {
  for (int i = 1; i < limi; ++i)
    if (i < r[i]) swap(a[i], a[r[i]]);
  for (int i = 1; i < limi; i <<= 1) {
    ll T = quickpow(type == 1 ? G : Gi, (P - 1) / (i << 1));
    for (int j = 0; j < limi; j += (i << 1)) {
      ll t = 1;
      for (int k = 0; k < i; ++k, t = t * T % P) {
        ll nx = a[j + k], ny = t * a[j + k + i] % P;
        a[j + k] = (nx + ny) % P;
        a[j + k + i] = (nx - ny + P) % P;
      }   
    }   
  }
  if (type == -1) {
    ll inv = quickpow(limi, P - 2); 
    for (int i = 0; i < limi; ++i)  a[i] = a[i] * inv % P;
  }
}

ll jie[N], jieni[N];
inline ll get_c(int n, int m) {
  if (n < 0 || m < 0 || n - m < 0)  return 0;
  return jie[n] * jieni[m] % P * jieni[n - m] % P;
}
inline void work() {
  limi = 1;
  while (limi <= n + n + 2) limi <<= 1, ++L;
  for (int i = 0; i <= limi; ++i)
    r[i] = (r[i >> 1] >> 1) | ((i & 1) << (L - 1));
  ntt(f, 1), ntt(g, 1); 
  for (int i = 0; i < limi; ++i)  A[i] = f[i] * g[i] % P;
  ntt(A, -1);
//  for (int i= 0; i <= n; ++i)	printf("A(yuan)[%d] = %lld\n", i, A[n - i]);
  for (int k = 1; k <= n; ++k) {
    ll ans = (1ll * n * get_c(n, k) % P - jieni[k] * A[n - k] % P) % P;
//    printf("%d * %lld - %lld * %lld = \n", n, get_c(n, k), jie[k], A[n - k]);
    printf("%lld\n", (ans % P + P) % P); 
  }
}

inline void init() {
  jie[0] = jieni[0] = 1;
  int up = n + 10; 
  for (int i = 1; i <= up; ++i) jie[i] = jie[i - 1] * i % P;
  jieni[up] = quickpow(jie[up], P - 2); 
  for (int i = up - 1; i; --i)  jieni[i] = jieni[i + 1] * (i + 1) % P;
  Gi = quickpow(G, P - 2); 
}

int main() {
  read(n); init();
  for (int i = 1; i < n; ++i) {
    int u, v; read(u), read(v); addedge(u, v), addedge(v, u); 
  }
  dfs_son(1, 0); 
  for (int i = 2; i <= n; ++i) {
    ++cnt[siz[i]], ++cnt[n - siz[i]];
  }
  for (int i = 0; i <= n; ++i)  f[i] = 1ll * cnt[n - i] * jie[n - i] % P;
  for (int i = 0; i <= n; ++i)  g[i] = jieni[i];
//  for (int i = 0; i <= n; ++i)	printf("f[%d] = %lld, g = %lld\n", i, f[i], g[i]);
  work();
  return 0;
}

/*
3
1 2
2 3
//3 7 3
*/

Measured memory_bytes: 34832
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  if((a+b)%2) cout << min(2*n-a-b+1,a+b-1)/2 << endl;
  else cout << (b-a)/2 << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int osenbei[10][10000];

int main() {
	int r,c;
	while(cin>>r>>c,r){
		int i,j;
		for(i=0;i<r;i++){
			for(j=0;j<c;j++){
				cin>>osenbei[i][j];
			}
		}
		int bit,res=0,a,b,t;
		for(bit=0;bit<1<<r;bit++){
			t=0;
			for(j=0;j<c;j++){
				a=b=0;
				for(i=0;i<r;i++){
					if(osenbei[i][j]^bit>>i&1)a++;
					else b++;
				}
				t+=max(a,b);
			}
			chmax(res,t);
		}
		cout<<res<<endl;
	}
	return 0;
}

Measured memory_bytes: 1256
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;
#include <cmath>
#include <iomanip>

const int MOD = 1000000007;


ll POWER(ll x,ll y)
{
	ll ret=1;
	ll p=x;
	for (ll i=y;i>0;i/=2)
	{
		if (i%2) ret=(ret*p)%MOD;
		p=(p*p)%MOD;
	}
	return ret;
}
ll gcm(ll a, ll b)
{
	if (b>a) {ll c=a; a=b; b=c;}
	while (b>0)
	{
		ll r=a%b;
		a=b;
		b=r;
	}
	return a;
}


int main(int argc, char *argv[])
{
	string s,t;
	cin>>s>>t;
	cout<<((t.substr(0,s.length())==s) ? "Yes":"No")<<endl;

	return 0;
}



Measured memory_bytes: 3632
# your code goes here

while True:
	n = raw_input()
	if n == "0":
		break

	n = int(n)
	jewels = []

	for i in xrange(n):
		string = raw_input()
		x = string.split(" ")
		jewels.append(tuple(map(lambda y : int(y), x)))
	
	m = raw_input()
	
	m = int(m)
	ops = []
	
	for j in xrange(m):
		string = raw_input()
		x = string.split(" ")
		#print x
		ops.append(tuple(x))
	
	#print jewels
	#print ops
	
	pos = (10,10)
	
	path = []
	path.append(pos)
	
	for direct, amount in ops:
		for i in xrange(int(amount)):
			if direct == "N":
				pos = (pos[0], pos[1]+1)
			elif direct == "E":
				pos = (pos[0]+1, pos[1])
			elif direct == "W":
				pos = (pos[0]-1, pos[1])
			elif direct == "S":
				pos = (pos[0], pos[1]-1)
			path.append(pos)
	isIn = []
	for jx, jy in jewels:
		isIn.append((jx, jy) in path)
		
	if all(isIn):
		print "Yes"
	else:
		print "No"

Measured memory_bytes: 4292
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <ctime>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <unordered_map>
#include <unordered_set>

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli > plli;
typedef vector<lli> vlli;
typedef vector<plli > vplli;

#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lcm(a, b) ((a * b) / gcd(a, b))
#define sqr(x) (x)*(x)
#define all(a) a.begin(),a.end()
#define UN(v) sort(all(v)), v.resize(unique(all(v))-v.begin())

#define endl '\n'

const long long INF = 100000000000000000;
const long long MOD = 1000000007;
const long long MAXN = 100005;
const double PI = acos(-1);

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

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

lli a[MAXN], size[MAXN], n, m, k;
lli a1[MAXN], size1[MAXN];
lli cntFriends[MAXN];
vlli blocked[MAXN];

void init() {
    for (int i = 0; i < n; i++) {
        a[i] = i;
        a1[i] = i;
        size[i] = 1;
        size1[i] = 1;
    }
}

int root(int i) {
    while(a[i] != i) {
        a[ i ] = a[a[i]] ;
        i = a[i];
    }
    return i;
}

void wUnion(int p, int q) {
    int rootP = root(p);
    int rootQ = root(q);

    if(size[rootP] < size[rootQ]) {
        a[rootP] = a[rootQ];
        size[rootQ] += size[rootP];
    }
    else {
        a[rootQ] = a[rootP];
        size[rootP] += size[rootQ];
    }
}


void solve() {
    cin >> n >> m >> k;
    init();
    for (auto i = 0; i < m; ++i) {
        int p, q;
        cin >> p >> q;
        if (root(p) != root(q))
            wUnion(p, q);
        cntFriends[p]++;
        cntFriends[q]++;
    }

    for (auto i = 0; i < k; i++) {
        int p, q;
        cin >> p >> q;
        blocked[p].push_back(q);
        blocked[q].push_back(p);
    }

    for (int i = 1; i <= n; i++) {
        lli ans = (size[root(i)] - 1) - cntFriends[i];
        for (auto j : blocked[i]) {
            if (root(i) == root(j)) {
                ans--;
            }
        }
        cout << ans << ' ';
    }
}

int main()
{
    IOS;
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; i++) {
        //cout << "Case " << i << ": ";
        solve();
    }
    return 0;
}


Measured memory_bytes: 10624
import java.util.Scanner;
public class Main {
	static Scanner scan=new Scanner(System.in);
	static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
	static long lcm (int a, int b) {return a*b/gcd(a,b);}
	static int max(int a,int b) {return a>b?a:b;}
	static int min(int a,int b) {return a<b?a:b;}
	static long factorial(int i) {return i==1?1:i*factorial(i-1);}
	static int lower_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<=key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static int upper_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
		return true;
	}
	static int upper_division(int a,int b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lupper_division(long a,long b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lmax(long a,long b) {return Math.max(a, b);}
	static long lmin(long a,long b) {return Math.min(a, b);}
	static int[] setArray(int a) {
		int b[]=new int[a];
		for(int i=0;i<a;i++) {
			b[i]=scan.nextInt();
		}
		return b;
	}
	static String reverce(String str) {
		String strr="";
		for(int i=str.length()-1;i>=0;i--) {
			strr+=str.charAt(i);
		}
		return strr;
	}
	public static void main(String[] args) {
		int a=scan.nextInt()*100+scan.nextInt()*10+scan.nextInt();
		System.out.println(a%4==0?"YES":"NO");
	}
}


Measured memory_bytes: 22612
#include<iostream>
using namespace std;
 
const int N = 100010;
 
int a[N];
int main()
{
int n, k, q, x;
  cin >> n >> k >> q;
  for(int i = 1; i <= q; ++i) cin >> x, ++a[x];
  for(int i = 1; i <= n; ++i)
    if(k - (q - a[i]) <= 0) cout << "No\n";
  	else cout << "Yes\n";
	return 0;
	
	
	
	return 0;
}

Measured memory_bytes: 1024
/*
    Ujjawal Pabreja
*/
#include <bits/stdc++.h> 
#include <functional> 
using namespace std;
using ll = long long;
using ld = long double;
#define speed_cubing    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define rep(i,a)        for(ll i = 0 ; i < a ; i++)
#define repe(i,a,b)     for(ll i = a ; i < b ; i++)
#define bac(i,a)        for(ll i = a ; i >= 0 ; i--)
#define bace(i,a,b)     for(ll i = a ; i >= b ; i--)
#define pb              push_back
#define mp              make_pair
#define in              insert
#define ff              first
#define ss              second
#define vv              vector
#define vll             vector <ll>
#define pll             pair <ll,ll>
#define vpll            vector <pll>
#define umap            unordered_map
#define uset            unordered_set
#define mset            multiset
#define pqueue          priority_queue
#define setbit(x)       __builtin_popcountll(x)
#define init(c,a)       memset(c,a,sizeof(c))
#define all(c)          c.begin(),c.end()
#define sz(c)           (ll)c.size()
#define lb              lower_bound
#define ub              upper_bound
#define maxe            *max_element
#define mine            *min_element
#define gcd(a,b)        __gcd(a,b)
#define rev             reverse
#define Y				"YES"
#define N 				"NO"
#define nl              "\n"
#define debug(x)        cout << #x << " : " << x << nl;
const ll inf = 1e18;  
const ll mod = 1e9 + 7;
const ll MOD = 998244353;
const ll MAX = 2e5 + 1;

// ====== int_1024t begins ======
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
// ====== int_1024t ends ======

// ====== pbds begins ======
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, 
//         tree_order_statistics_node_update> 
//         pbds; 
// ====== pbds ends ======

// ====== Useful functions begin ======
inline ll add(ll a,ll b) {return ((a%mod)+(b%mod))%mod;}
inline ll sub(ll a,ll b) {return ((a%mod)-(b%mod)+mod)%mod;}
inline ll mul(ll a,ll b) {return ((a%mod)*(b%mod))%mod;}
ll pwr(ll x,ll n){
    if(!n) return 1;
    if(n&1) return mul(x, pwr(mul(x,x),(n-1)/2));
    else return pwr(mul(x,x),n/2);
}
ll modinv(ll n){ 
    return pwr(n,mod - 2); 
}
// ====== Useful functions end ======
 
// ====== Variables begin ======

// ====== Variables end ======
void speed_solve(){
    ll n;
    cin >> n;
    ll ans = (n * (n + 1))/2;
    ans -= ((n/3) * (3 + (n/3) * 3)) / 2;
    ans -= ((n/5) * (5 + (n/5) * 5)) / 2;
    ans += ((n/15) * (15 + (n/15) * 15)) / 2;
    cout << ans;
}
int main()
{
    speed_cubing;
    ll test_cases = 1;
    // cin >> test_cases;
    rep(i,test_cases){
        // cout << "Case #" << i + 1 << ": ";
        speed_solve();
    }
    return 0;
}

Measured memory_bytes: 3648
def main():
    a, b, c = map(int, input().split())

    seen = set()
    ans = 0
    while all(x % 2 == 0 for x in (a, b, c)):
        if (a, b, c) in seen:
            ans = -1
            break

        seen.add((a, b, c))
        a, b, c = b // 2 + c // 2, a // 2 + c // 2, a // 2 + b // 2
        ans += 1

    print(ans)

main()

Measured memory_bytes: 3060
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
using static System.Math;

class P
{
    static void Main()
    {
        int[] abk = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine(string.Join("\n", Enumerable.Range(abk[0], abk[2]).Concat(Enumerable.Range(abk[1] - abk[2] + 1, abk[2])).Where(x => abk[0] <= x && x <= abk[1]).Distinct().OrderBy(x => x)));
    }
}


Measured memory_bytes: 13408
N = gets.to_i
lst=gets.chomp.split(" ").map(&:to_i)
lst=lst.sort
flag="Yes"
if N%3!=0
  flag="No"
else
  n=N/3
match=0
for i in 0..n-2 do
  if lst[i]!=lst[i+1]
    match=1
    break
  end
end
for i in 0..n-2 do
  if lst[i+n]!=lst[i+1+n]
    match=1
    break
  end
end
for i in 0..n-2 do
  if lst[i+n+n]!=lst[i+1+n+n]
    match=1
    break
  end
end
if match==1
  flag="No"
else
  a=lst[0]
  b=lst[n]
  c=lst[n+n]
if(a^b!=c || b^c!=a || c^a!=b)
  flag="No"
end
end
end
if lst[N-1]==0
  flag="Yes"
end
  print flag


Measured memory_bytes: 10884
#include <cstdio>
#include <utility>
#include <algorithm>
#include <vector>
#include <cstdint>

using Matrix=std::vector<std::vector<intmax_t>>;

Matrix matpow(Matrix &Q, intmax_t T, intmax_t M) {
  Matrix zero=Matrix(Q.size());
  for (size_t i=0; i<zero.size(); ++i)
    zero[i].resize(Q.size());

  Matrix eye=zero;
  for (size_t i=0; i<eye.size(); ++i)
    eye[i][i] = 1;

  Matrix res=eye;
  Matrix pow=Q;

  while (T) {
    if (T & 1) {
      // res *= pow;
      Matrix tmp=zero;
      for (size_t i=0; i<Q.size(); ++i)
	for (size_t j=0; j<Q.size(); ++j)
	  for (size_t k=0; k<Q.size(); ++k) {
	    tmp[i][j] += res[i][k] * pow[k][j];
	    tmp[i][j] %= M;
	  }

      res = std::move(tmp);
    }

    {
      // pow *= pow;
      Matrix tmp=zero;
      for (size_t i=0; i<Q.size(); ++i)
	for (size_t j=0; j<Q.size(); ++j)
	  for (size_t k=0; k<Q.size(); ++k) {
	    tmp[i][j] += pow[i][k] * pow[k][j];
	    tmp[i][j] %= M;
	  }
    
      pow = std::move(tmp);
    }

    T >>= 1;
  }

  return res;
}

int testcase_ends() {
  intmax_t N, M, A, B, C, T;
  scanf("%jd %jd %jd %jd %jd %jd", &N, &M, &A, &B, &C, &T);

  if (N == 0)
    return 1;

  std::vector<intmax_t> S(N+2);
  for (int i=1; i<=N; ++i)
    scanf("%jd", &S[i]);

  std::vector<std::vector<intmax_t>> Q(N+2, std::vector<intmax_t>(N+2));
  for (int i=1; i<N+1; ++i) Q[i][i] = B;
  for (int i=1; i<N+1; ++i) {
    Q[i][i-1] = A;
    Q[i][i+1] = C;
  }

  Matrix R=matpow(Q, T, M);

  std::vector<intmax_t> res(N+2);
  for (int i=0; i<=N+1; ++i)
    for (int j=0; j<=N+1; ++j) {
      res[i] += R[i][j] * S[j];
      res[i] %= M;
    }

  for (int i=1; i<=N; ++i)
    printf("%jd%c", res[i], i<N? ' ':'\n');

  return 0;
}

int main() {
  while (!testcase_ends()) {}

  return 0;
}

Measured memory_bytes: 2884
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
A,B,H,M = map(int,input().split())
hun = H * 60 + M
kaku = 5.5*hun
kaku = kaku % 360
rad = math.radians(kaku)
c = A**2+B**2-2*A*B*math.cos(rad)
d = c ** (0.5)
print(d)

Measured memory_bytes: 27288
#include<stdio.h>
#define N 200000
int main(){

  int i,j,n;
  int data[N];
  int res,max_i;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&data[i]);
  }

  max_i=1;
  for(i=2;i<n;i++){
    if(data[max_i]<data[i]){
      max_i=i;
    }
  }
  res=data[1]-data[0];
  for(i=0;i<n-1;i++){
    if(max_i==i){
      max_i++;
      for(j=i+1;j<n;j++){
	if(data[max_i]<data[j]){
	  max_i=j;
	}
      }
      if(res<data[max_i]-data[i]){
	res=data[max_i]-data[i];
      }
    }
    else{ 
      if(res<data[max_i]-data[i]){
	res=data[max_i]-data[i];
      }
    }
  }
  printf("%d\n",res);
  return 0;
}
  



Measured memory_bytes: 2608
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
using namespace std;

int main(){
    long long n, m, a, b;
    cin >> n >> m;
    map<long long,long long> x;
    for(long long i = 0; i < n; i++){
        cin >> a;
        x[a]++;
    }
    for(long long i = 0; i < m; i++){
        cin >> a >> b;
        x[b] += a;
    }
    long long ans = 0;
    for(long long i = 0; i < n; i++){
        a = x.rbegin()->first;
        ans += a;
        x[a]--;
        if(x[a] == 0) x.erase(a);
    }
    cout << ans << '\n';
}


Measured memory_bytes: 12800
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int main() {
  int n;
  cin >> n;
  long long sum = 0;
  int ma = -1e9;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    sum += x;
    if (x > ma) ma = x;
  }
  if (sum - ma > ma) {
    cout << "Yes" << endl;
  } else cout << "No" << endl;
  return 0;
}


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

#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
inline int in() { int x; cin >> x; return x; }

int counte;
vector<bool> seen;
vector<bool> watch;
vector<int> member;
vector<int> F[100100];
vector<int> B[100100];
int answer[100100];
void dfs(int v) {
  if (!seen[v]) {
    counte++;
    member.push_back(v);
  }
  seen[v] = true;
  watch[v] = true;
  for (auto next_v : F[v]) {
    if (seen[next_v]) continue;
    dfs(next_v); // 再帰的に探索
  }
}

int main(){
  int N = in(), M = in(), K = in();
  watch.assign(N,false);
  REP(i,M) {
    int a = in()-1, b = in()-1;
    F[a].push_back(b);
    F[b].push_back(a);
    B[a].push_back(b);
    B[b].push_back(a);
  }
  REP(i,K) {
    int a = in()-1, b = in()-1;
    B[a].push_back(b);
    B[b].push_back(a);
  }
  REP(i,N) {
    if (watch[i] == 0) {
      counte = 0;
      seen.assign(N,false);
      member.assign(0,0);
      dfs(i);
      REP(j,member.size()){
        int counter = 0;
        int mj = member[j];
        REP(l,B[mj].size()){
          if(seen[B[mj][l]] == 1)counter++;
        }
        answer[mj] = counte - counter - 1;
      }
    }
  }
  REP(i,N) cout << answer[i] << endl;
}


Measured memory_bytes: 16120
#include <bits/stdc++.h>
using namespace std;
#define ll	    long long
#define vi      vector <int>
#define vii     vector <pair<int,int>>
#define ii      pair<int,int>
#define loop(n)	for(int i=0;i<n;i++)
ll mod=1e9+7;
bool is_prime(int n)
{
    if(n==2)
        return true;
    if(n%2==0||n<2)
        return false;
    for(int i=3; i<=sqrt(n); i+=2)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
long long power(ll n, ll k){
    if(k==0) return 1;
    ll sq=(power(n,k/2))%mod;
    sq=(sq*sq)%mod;
    if(k%2==1)
        sq=(sq*n)%mod;
    return sq%mod;
}
void low(char &c){
c=tolower(c);
}
void primeFactors(int n)
{
    while (n % 2 == 0)
    {
        cout << 2 << " ";
        n = n/2;
    }

    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        while (n % i == 0)
        {
            cout << i << " ";
            n = n/i;
        }
    }

    if (n > 2)
        cout << n << " ";
}

#include <iostream>
using namespace std;
void fast();
map<string,ll> M;
int arr[200000];
int arr2[200000];
int arr3[200000];
int main() {
//fast();
int n,m;
cin >>n;
loop(n){
    cin >> arr[i];
    arr2[i] = arr[i];
}
sort(arr,arr+n);
int mx=arr[n-1], mx1=arr[n-2];
for(int i=0;i < n;i++){
    if(mx == arr2[i]){
        cout << mx1 <<endl;
    }else{
        cout << mx << endl;
    }
}

}


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

}


Measured memory_bytes: 3200
#include<iostream>
using namespace std;
int main(void){
    int N,T;
    cin>>N>>T;
    int t[200000]={0};
    for(int i(0);i<N;i++){
        cin>>t[i];
    }
    long long total_time(0);
    total_time = (long long)T*N;
    for(int i(0);i<N-1;i++){
        if(t[i+1]-t[i]<T)total_time -= T - t[i+1] + t[i];
    }
    cout<<total_time<<endl;
    return 0;
}

Measured memory_bytes: 1272
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define ll long long
int main(){
	ll A,B;
	cin >> A >>B;
	ll p=A,q=B,r=1;
	while(r>0){
		r=p%q;
		p=q;
		q=r;
	}
	cout << A*B/p;
    return 0;
}


Measured memory_bytes: 256