akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

template<typename T>
vector<T> gen_v(size_t a) { return vector<T>(a); }
template<typename T, typename ...Ts>
auto gen_v(size_t a, Ts... ts) { return vector<decltype(gen_v<T>(ts...))>(a, gen_v<T>(ts...)); }
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N; cin >> N;
	vector<int> B(N - 1); rep(i, 0, N - 1) {
		cin >> B[i];
	}
	vector<int> A(N);
	rep(i, 0, N) {
		if (i == 0) A[i] = B[i];
		else if (i == N - 1) A[i] = B[i - 1];
		else {
			A[i] = min(B[i], B[i - 1]);
		}
	}
	cout << accumulate(all(A), 0) << endl;
	return 0;
}

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

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

		double N = in.nextDouble();
		double K = in.nextDouble();

		double y = 1;
		double sum = 0;

		for ( int i = 1; i <=N; i++ ) {

			while ( i * y < K ) {
				y *= 2;
			}
			sum += (1 / y)*(1 / N);
			y = 1.0;
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 26580
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  // 入力
  int K;
  cin >> K;
  ll a[K];
  for (int i = 0; i < K; i++) cin >> a[i];

  if (a[K-1] != 2) {
    cout << -1 << endl;
    return 0;
  }

  ll mini = 2;
  ll maxi = 3;
  for (int i = K - 2; i >= 0; i--) {
    ll tmp = (mini + a[i] - 1) / a[i];
    mini = tmp * a[i];
    if (mini > maxi) {
      cout << -1 << endl;
      return 0;
    }
    tmp = maxi / a[i];
    maxi = (tmp + 1) * a[i] - 1;
  }

  // 解答
  cout << mini << " " << maxi << endl;

  return 0;
}


Measured memory_bytes: 1024
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy
 


def main():
    a,b,c,d = map(int, input().split())
    max_num = max(a*c,a*d, b*c, b*d)
    print(max_num)


   
if __name__ == "__main__":
    main()

Measured memory_bytes: 9608
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    string a,b,c;
    cin >>a>>b;
    int s_a=a.size(),s_b=b.size();
    int s_max = max(s_a,s_b),s_min = min(s_a,s_b);
    int x=0, y=0;
    for(int i=0; i<s_max; i++){
      if(i<s_min) x = a[s_a-i-1]+b[s_b-i-1]-'0'*2+y;
      else if(i<s_a) x = a[s_a-i-1]-'0'+y;
      else if(i<s_b) x = b[s_b-i-1]-'0'+y;
      y = x/10;
      c+=(char)('0'+x%10);
    }
    if(y>0) c+='1';
    if(c.size()>80) cout <<"overflow";
    else for(int i=c.size()-1; i>=0; i--) cout <<c[i];
    cout <<endl;
  }
  return 0;
}

Measured memory_bytes: 1200
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<cmath>
#include<cstdio>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(){
    int n;
    int a=0,b=0;
    cin >> n;
    vector<int> card(n);
    rep(i,n) cin >> card[i];
    sort(card.begin(),card.end());
    if(n%2==0){
        for(int i=n-1;i>-1;i--){
            if(i%2==0 or i==0){
                b+=card[i];
            } else {
                a+=card[i];
            }
        }
    } else {
        for(int i=n-1;i>-1;i--){
            if(i%2==0 or i==0){
                a+=card[i];
            } else {
                b+=card[i];
            }
        }
    }
    cout << a-b;
    return 0;
}

Measured memory_bytes: 384
//https://codeforces.com/blog/entry/61015
#include<queue>
#include<map>
#include <string>
#include<bits/stdc++.h>
#define pi 3.141592654
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define input ios_base::sync_with_stdio(0);cin.tie(0);
//#define x real()
//#define y imag()
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef complex<double> point;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<30> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//#define var(x) ((x)<<1)
//#define nvar(x) ((x)^1)
const int N=100000,M=100000;


int n,k;
 main()
{

//cout<<Pow((ll)1000000,(ll)110);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
//    char input[15];
//    scanf("%s", &input);  array of char
//  gets(c+1);  array of char
//printf("%s, ",name[k[i]].c_str());  printf of string
//priority_queue<ll,vector<ll>,greater<ll>>y;
input;
cin>>n>>k;
if(k==1)cout<<"0";
else
cout<<n-k<<endl;







return 0;
}


Measured memory_bytes: 256
while(True):
    ny,nx = map(int, input().split())
    if nx == 0 and ny == 0:
        break
    dic = {">":[1,0],"<":[-1,0],"^":[0,-1],"v":[0,1],".":[0,0]}
    poshist = []
    ma = [input() for i in range(ny)]
    px,py = 0,0
    poshist.append([px,py])
    while(True):
        px += dic[ma[py][px]][0]
        py += dic[ma[py][px]][1]
        if [px,py] in poshist:
            poshist.append([px,py])
            break
        else:
            poshist.append([px,py])
    if poshist[-1] == poshist[-2]:
        print(poshist[-1][0],poshist[-1][1])
    else:
        print('LOOP')


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


const int mod = 1e9+7;
const int N = 2e5 + 100;

int fac[N] , inv[N];

int mul(int a , int b){
  return a*1ll*b%mod;
}
int add(int a , int b){
   a += b;
   if(a >= mod) a -= mod;
   return a;
}
int power(int x , int y){
  int res = 1;
  while(y){
    if(y&1)
      res = mul(res , x);
    x = mul(x , x);
    y >>= 1;
  }
  return res;
}
void pre(){
  fac[0] = 1;
  for(int i = 1 ;i < N ; ++i)
    fac[i] = mul(fac[i-1] , i);
  inv[N-1] = power(fac[N-1] , mod-2);
  for(int i = N-2 ; i >= 0 ; --i){
    inv[i] = mul(inv[i+1] , i+1);
  }
  assert(mul(inv[100],fac[100]) == 1);
}
int nCr(int n , int r){
  if(r < 0 || r > n) return 0;
  return mul(fac[n] , mul(inv[r] , inv[n-r]));
}


int main(){
  int h, w, a, b;
  cin >> h >> w >> a >> b;
  a = h-a; 
  pre();
  int ans = 0;
  for(int i =1 ;i <= a ; ++i){
    ans = add(ans , mul( nCr(i+b-2 , b-1), nCr(h-i+w-b-1 , w-b-1)    )    );
  }
  cout << ans << endl;





  return 0;
}

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

#define mod 1000000007

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

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;

ll gcd(ll a, ll b){ // 最大公約数　ユークリッドの互除法　a > b
	if(b == 0)
		return a;
	else
		return gcd(b, a%b);
}

int main(void){
	
	int N, X, ans = 0;
	
	cin >> N >> X;
	
	rep(i, N){
		int x;
		cin >> x;
		ans = gcd(ans, abs(x - X));
		X = x;
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
s=input()
n=len(s)
a=s[:int((n-1)/2)]
b=s[int((n+3)/2)-1:]

if s.find(s[::-1])==0:
    if a.find(a[::-1])==0:
        if b.find(b[::-1])==0:
            print("Yes")
            exit()
print("No")


Measured memory_bytes: 38256
using System;

namespace A___Addition_and_Subtraction_Easy
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            if (input[1] =="+")
            {
                Console.WriteLine(int.Parse(input[0]) + int.Parse(input[2]));
            }
            else
            {
                Console.WriteLine(int.Parse(input[0]) - int.Parse(input[2]));
            }
        }
    }
}

Measured memory_bytes: 11092
def d_checker(N, K, Q):
    # マス(x,y)が白⇔マス(x,y+K)が黒なので、希望の色がすべて黒になるようにする
    # 市松模様の周期は2Kなので、x,y座標をそれぞれ2Kで剰余を取った座標と同一視できる
    mat = [[0]*(2*K+2) for _ in range(2*K+2)]
    total = [[0]*(4*K+2) for _ in range(4*K+2)]
    for x, y, c in Q:
        if c == 'W':
            y += K
        mat[(x % (2*K)) + 1][(y % (2*K)) + 1] += 1

    # 事前に累積和を取る
    for x in range(1, 4*K+1):
        for y in range(1, 4*K+1):
            total[x][y] = total[x][y-1] + \
                mat[((x-1) % (2*K)) + 1][((y-1) % (2*K)) + 1]
    for y in range(1, 4*K+1):
        for x in range(1, 4*K+1):
            total[x][y] += total[x-1][y]

    def get(x, y):
        # 市松模様の橋の黒の座標を決めたときに実現できる希望の数
        return total[x+K-1][y+K-1] + total[x-1][y-1] - total[x-1][y+K-1] - total[x+K-1][y-1]

    # 正方形の隅の座標を各々決めたときに実現できる希望の数を求め、最大値を得る
    ans = 0
    for x in range(1, 2*K+1):
        for y in range(1, 2*K+1):
            ans = max(ans, get(x, y)+get(x+K, y+K))
    return ans

N, K = [int(i) for i in input().split()]
Q = [(int(x), int(y), c)
    for x, y, c in [input().split() for i in range(N)]]
print(d_checker(N, K, Q))


Measured memory_bytes: 234072
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define MOD (int) (1e9+7)
#define INF (int) 2e9
#define LLINF (ll) 2e18

ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

ll modfact(ll n){
    ll ans = 1;
    for (ll i = 1; i <= n; i++){   
        ans *= i;
        ans %= MOD;
    }
    return ans;
}

ll modcomb(ll n, ll k){
    ll tmp = modfact(n);
    tmp *= modpow(modfact(n-k), MOD-2);
    tmp %= MOD;
    tmp *= modpow(modfact(k), MOD-2);
    tmp %= MOD;
    return tmp;
}

int main(){
    int n, m;
    cin >> n >> m;
    int M = m;
    map<int, int>ma;
    for (int i = 2; i*i<=M; i++){
        while(m %i == 0){
            ma[i]++;
            m /= i;
        }
    }
    if(m!=1) ma[m]++;

    ll ans = 1;
    for (auto mi : ma){
        ans *= modcomb(mi.second+n-1, min(mi.second, n-1));
        ans %= MOD;
    }

    cout << ans << endl;
    // printf("%d\n", N);
    return 0;
}

Measured memory_bytes: 384
#[allow(dead_code)]
const MOD: usize = 1_000000000 + 7;

fn main() {
    let mut cin = Scanner::new();
    let n = cin.next_isize();
    let k = cin.next_isize();
    let mut ans = 1;
    for _ in 0..n {
        ans = std::cmp::min(ans * 2, ans + k);
    }
    println!("{}", ans);
}


struct Scanner {
    reader: std::io::Stdin,
    tokens: std::collections::VecDeque<String>,
}

impl Scanner {
    fn new() -> Self {
        Scanner {
            reader: std::io::stdin(),
            tokens: std::collections::VecDeque::new(),
        }
    }

    fn next(&mut self) -> String {
        if self.tokens.is_empty() {
            let mut s = String::new();
            loop {
                self.reader.read_line(&mut s).ok();
                let s = s.trim();
                if s.len() != 0 {
                    for it in s.split_whitespace() {
                        self.tokens.push_back(it.into())
                    }
                    break;
                }
            }
        }
        self.tokens.pop_front().unwrap()
    }

    fn next_generics<T>(&mut self) -> T where
        T: std::str::FromStr + std::marker::Copy,
        <T as std::str::FromStr>::Err: std::fmt::Debug
    {
        self.next().parse().unwrap()
    }
    
    #[allow(dead_code)] fn next_i32(&mut self) -> i32 { self.next_generics::<i32>() }
    #[allow(dead_code)] fn next_i64(&mut self) -> i64 { self.next_generics::<i64>() }
    #[allow(dead_code)] fn next_u64(&mut self) -> u64 { self.next_generics::<u64>() }
    #[allow(dead_code)] fn next_usize(&mut self) -> usize { self.next_generics::<usize>() }
    #[allow(dead_code)] fn next_isize(&mut self) -> isize { self.next_generics::<isize>() }
}



Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll n;
  cin >> n;
  string s;
  cin >> s;
  string v = s;
  v.erase(n / 2);
  string t = v;
  string u = t + t;
  if (s == u){
    print("Yes");
  }
  else{
    print("No");
  }
}

Measured memory_bytes: 256
//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

using i8 = ::std::int_least8_t;
using i32 = ::std::int_least32_t;
using i64 = ::std::int_least64_t;
using u8 = ::std::uint_least8_t;
using u32 = ::std::uint_least32_t;
using u64 = ::std::uint_least64_t;
using isize = ::std::ptrdiff_t;
using usize = ::std::size_t;

class rep {
	const usize f, l;

public:
	class itr {
		friend rep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { ++i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	rep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(f); }
	itr end() const noexcept { return itr(l); }
};
class revrep {
	const usize f, l;

public:
	class itr {
		friend revrep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { --i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	revrep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(l - 1); }
	itr end() const noexcept { return itr(f - 1); }
};
template <class T> bool maxi(T &a, const T &b) {
	return a <= b ? (a = b, 1) : 0;
}
template <class T> bool mini(T &a, const T &b) {
	return b <= a ? (a = b, 1) : 0;
}
template <class T> bool smaxi(T &a, const T &b) {
	return b <= a ? 0 : (a = b, 1);
}
template <class T> bool smini(T &a, const T &b) {
	return a <= b ? 0 : (a = b, 1);
}
template <class T> using vec_alias = ::std::vector<T>;
template <class T> auto md_vec(usize n, const T &value) {
	return ::std::vector<T>(n, value);
}
template <class... Args> auto md_vec(usize n, Args... args) {
	return ::std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> const T &as_const(const T &v) noexcept { return v; }

#include <algorithm>
#include <iostream>
#include <utility>

int main() {
	usize n;
	u32 m;
	::std::cin >> n >> m;
	u32 ans = 1;
	for (u32 i = 1;i*i <= m;++i) {
		if (!(m%i)) {
			if (m / i >= n)
				smaxi(ans, i);
			if (i >= n)
				smaxi(ans, m / i);
		}
	}
	::std::cout << ans << std::endl;
	return 0;
}


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

public class Main {
	
	final boolean isDebug = false;
	String fileName = "input.txt";
	FastScanner sc;
	//PrintWriter out;
	final int MOD = 1000000007;
	final int INF = Integer.MAX_VALUE / 2;
	
	/* solve */
	void solve(){
		double T = sc.nextDouble();
		int X = sc.nextInt();
		System.out.println(T/X);
		
	}
	/* end solve */
	
	/* main */
	public static void main(String[] args) throws IOException {
		new Main().m();
	}
	
	void m() throws IOException {
		long S = System.currentTimeMillis();
		sc = (isDebug) ? new FastScanner(new FileInputStream(fileName)) : new FastScanner(System.in);
		//out = new PrintWriter(System.out);
		solve();
		//out.flush();
		long G = System.currentTimeMillis();
		if(isDebug){
			System.out.println("---Debug---");
			System.out.printf("%7d ms", (G-S));
		}
	}
	/* end main */
}
/* end Main */

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    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: 23252
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll INF = 1LL<<60, MOD = 1e9 + 7;
const double EPS = 1e-9, PI = 3.141592653589793;
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define all(v) (v).begin(), (v).end()
#define first fi
#define second se

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string s;
  cin >> s;
  rep(i,3){
    if(s[i]==s[i+1]){
      cout << "Bad" << endl;
      return 0;
    }
  }
  cout << "Good" << endl;
  return 0;
}

Measured memory_bytes: 256
h,w = gets.split.map(&:to_i)
arr = []
row = Array.new(h)
line = Array.new(w)
j = 0
h.times do
  a = gets.chomp.split('')
  checkr = 0
  arr << a
  a.each.with_index do |b,i|
    if b == "#"
      checkr = 1
      line[i] = 1
    end
  end
  row[j] = checkr
  j += 1
end
j = 0
arr.each do |a|
  if row[j] == 1
    a.each.with_index do |b,i|
      if line[i] == 1
        print "#{b}"
      end
    end
    puts ''
  end
  j += 1
end

Measured memory_bytes: 2684
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep2l(i, s, n) for (ll i = (ll)(s); i < (ll)n; i++)

int main() {
    ll a, b, c;
    cin >> a >> b >> c;
    ll d = c-a-b;
    if (d*d <= 4*a*b || d < 0) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h,w;cin >> h >> w;
	vector<string> s(h);
	rep(i,h) cin >> s.at(i);
	rep(i,h){
		cout << s.at(i) << endl;
		cout << s.at(i) << endl;
	}
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
    
    size_t mod = 1000000007;
    long long sum = 0,Answer = 0;

    size_t T; cin >> T;
    
    
    for(size_t t = 0; t < T; t++) { 
        long long temp;
        cin >> temp;
        temp %= mod;
        Answer += (temp*sum) % mod;
        Answer %= mod;
        sum += temp;
        sum %= mod;
    }
    
    cout<<Answer;
    
    return 0;
}

Measured memory_bytes: 3596
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	out := ""
	switch text := stdin.Text(); text {
	case "A":
		out = "T"
	case "C":
		out = "G"
	case "G":
		out = "C"
	case "T":
		out = "A"
	}
	fmt.Println(out)	
}

Measured memory_bytes: 640
use std::env;
use std::io::*;
use std::str::*;
use std::mem;
use std::collections::HashMap;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}
fn read_char() -> char {
    let c = read::<String>();
    let c = c.chars().collect::<Vec<char>>();
    c[0]
}
fn read_String_Vec() -> Vec<char> {
    let S = read::<String>();
    S.chars().collect::<Vec<char>>()
}

fn vecchar_to_String(Vs: Vec<char>) -> String {
    let mut S = String::new();
    for i in 0..Vs.len() {
        S.push(Vs[i]);
    }
    S
}

/*
A : 65
Z : 90
a : 97
z : 122
*/

/*
let N = read::<i32>();
let S = read::<String>();
let S = read_String_Vec();
let C = read_char();
*/

/*
 .to_string() : * -> String
 &*S          : String -> &str
*/

fn minidist((x, y): (i32, i32), chkpnt: & Vec<(i32, i32)>) -> i32 {
    let len = chkpnt.len();
    let mut minimumpoint: i32 = -1;
    let mut minimumdistance = <i32>::max_value();
    for i in 0..len {
        let (px, py) = chkpnt[i];
        let dist = (x - px).abs() + (y - py).abs();
        if dist < minimumdistance {
            minimumdistance = dist;
            minimumpoint = i as i32;
        }
    }
    minimumpoint+1
}

fn main() {
    // main の引数
    /*
        引数なしのときargs.len() = 1;
    */
    let args: Vec<String> = env::args().collect();

    let N = read::<usize>();
    let M = read::<usize>();
    let mut student: Vec<(i32, i32)> = Vec::new();
    let mut checkpnt: Vec<(i32, i32)> = Vec::new();

    for n in 0..N {
        let x = read::<i32>();
        let y = read::<i32>();
        student.push( (x, y) );
    }

    for m in 0..M {
        let x = read::<i32>();
        let y = read::<i32>();
        checkpnt.push( (x, y) );
    }
    for n in 0..N {
        let tmp = minidist(student[n], & checkpnt);
        println!("{}", tmp);
    }

}


Measured memory_bytes: 4352
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	sa = list(S())
	sb = list(S())
	sc = list(S())
	field = 0
	s_list = [sa,sb,sc]
	while True:
		s = s_list[field]
		if len(s) == 0:
			abc = ['A','B','C']
			print(abc[field])
			break
		else:
			field_text = s.pop(0)
			abc_text = ['a','b','c']
			field = abc_text.index(field_text)


if __name__ == '__main__':
    main()

Measured memory_bytes: 14172
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace ABC129
{
    class Program
    {
        public static void Main()
        {
            int[] P = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            Array.Sort(P);
            Console.WriteLine(P[0] + P[1]);
        }
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
using Int = long long int;
template<typename T> void swap(T *t1, T *t2){ T* tmp=t1; t1=t2; t2=tmp;}


vector<Int> m[300002];
Int stts[300002];
Int arr[300002];

void dfs(Int u, Int val) {
    stts[u] = 1;
    arr[u] += val;
    for(Int i=0; i<m[u].size(); i++){
        if(stts[m[u][i]] == 0){
            dfs(m[u][i], arr[u]);
        }
    }
}

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

    Int n, q, a, b;
    cin >> n >> q;
    Int p, x;

    // init
    for(Int i=0; i<n; i++){
        arr[i] = 0;
        stts[i] = 0;
    }

    for(Int i=0; i<n-1; i++){
        cin >> a >> b;
        m[a-1].push_back(b-1);
        m[b-1].push_back(a-1);
    }
    for(Int i=0; i<q; i++){
        cin >> p >> x;
        arr[p-1] += x;
    }
    dfs(0, 0);
    for(Int i=0; i<n; i++){
        cout << arr[i] << " ";
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 29312
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	r := "No"
SOTO:
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			if i*j == n {
				r = "Yes"
				break SOTO
			}
		}
	}
	fmt.Println(r)
}


Measured memory_bytes: 512
#include <stdio.h>

int main(void)
{
  int i,j,k,L,tmp,d,def,end,aj,max,min;
  
  for(;;){
    int an[20],a1[6],a2[6];
    scanf("%d %d", &an[0], &L);
    if(!L) break;
    
    aj=an[0]; end=0;
    for(k=1;k<21;k++){
      for(i=L-1;i>=0;i--,aj/=10){
	a1[i]=aj%10; a2[i]=aj%10;
      }
      for(i=1;i<L;i++){
	for(j=1;j<L;j++){
	  if(a1[j-1]<a1[j]){
	    tmp=a1[j-1]; a1[j-1]=a1[j]; a1[j]=tmp;
	  }
	  if(a2[j-1]>a2[j]){
	    tmp=a2[j-1]; a2[j-1]=a2[j]; a2[j]=tmp;
	  }
	}
      }
      d=1; max=0; min=0;
      for(i=L-1;i>=0;i--,d*=10){
	max+=(a1[i]%10)*d;
	min+=(a2[i]%10)*d;
      }
      def=max-min;
      for(i=0;i<k;i++){
	if(def==an[i]){
	  printf("%d %d %d\n", i, def, k-i);
	  end=1; break;
	}
      }
      if(end==1) break;
      an[k]=def; aj=def;
    }
  }
    
  return 0;
}
  


Measured memory_bytes: 600
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define LL long long
using namespace std;
int main()
{
    int a[200],n,m[200][200],i;
    cin>>n;
    for (i=1; i<=n; i++)
    {
        cin>>a[i-1]>>a[i];
        m[i][i]=0;
    }
    for (int l=2; l<=n; l++)
    {
        for (int i=1; i<=n-l+1; i++)
        {
            int j=i+l-1;
            m[i][j]=(1<<21);
            for (int k=i; k<=j-1; k++)
            {
                m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+a[i-1]*a[k]*a[j]);
            }
        }
    }
    cout<<m[1][n]<<endl;
    return 0;
}



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

double a, b;

int main() {
	cin >> a >> b;
	a = a*pow(10,floor(log10(b) + 1)) + b;
	if (sqrt(a)==floor(sqrt(a))) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define For(i,l,r) for(int i = (l),i##end = (r);i <= i##end;i++)
#define Fordown(i,r,l) for(int i = (r),i##end = (l);i >= i##end;i--)
#define debug(x) cout << #x << " = " << x << endl

using namespace std;

typedef long long ll;

template <typename T> inline bool chkmin(T &x,T y) { return y < x ? x = y,1 : 0; }
template <typename T> inline bool chkmax(T &x,T y) { return x < y ? x = y,1 : 0; }

const int INF = 0x3f3f3f3f;
const int N = 2e5 + 10;

vector <int> Pos[N];

inline int read() {
	int x = 0,flag = 1;
	char ch = getchar();
	while(!isdigit(ch) && ch != '-')ch = getchar();
	if(ch == '-')flag = -1,ch = getchar();
	while(isdigit(ch))x = (x << 3) + (x << 1) + (ch - '0'),ch = getchar();
	return x * flag;
}

int main() {

	int n = read(),m = read(),cnt = read();
	For(i,1,cnt) {
		int x = read(),y = read();
		Pos[x].push_back(y);
	}

	int Max = 1;
	For(i,1,n) {
		bool flag = true;
		For(j,0,Pos[i].size() - 1) {
			int val = Pos[i][j];
			if(val < Max) return printf("%d\n",i - 1),0;
			if(val == Max) flag = false;
		}
		Max += flag;
	}

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

	return 0;
}

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

int main () {
  string S, T;
  cin >> S >> T;
  
  int ans = 0;
  for (int i=0; i<3; i++) {
    if (S[i] == T[i]) ans++;
  }
  cout << ans;
  return 0;
}

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

#define step(i, s, n, d) for(int i=s; i<n; i+=d)
#define FOR(i,s,n) step(i,s,n,1)
#define rep(i,n) FOR(i,0,n)
#define gets(x) x; cin >> x;
#define puts(x) x; cout << x << endl;
#define list_input(x, n) x[n]; rep(i,n){ gets(x[i]);}
#define ll long long
typedef pair<int, int> P;

int main(){
  int N, ans = 0;
  cin >> N;
  int usagi[N];
  rep(i, N){
    cin >> usagi[i];
  }
  rep(i, N){
    if (usagi[usagi[i]-1] == i+1) {
      ans += 1;
    }
  }
  cout << ans/2 << endl;
}


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

int main(){
  int n;
  int k;
  int i;
  int s;
  std::cin >> n >> k;
  std::vector<int> v(n);
  for(i=0;i<n;i++)
    std::cin >> v.at(i);
  sort(v.begin(),v.end());
  s=0;
  for(i=0;i<k;i++)
    s += v.at(i);
  
  std::cout << s;
}

Measured memory_bytes: 3540
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

int main()
{
        string S;
        cin >> S;
        if (S[0] == S[2]) {
                cout << "Yes" << endl;
        }
        else {
                cout << "No" << endl;
        }


}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;
long long mod = 1e9 +7;
long long int dp[100010][4];

int main(){
  long long i,j,k;
  string s;
  cin >> s;
  dp[0][0]=1;
  for(i=0;i<=s.size();i++){
    for(j=0;j<=3;j++){
      if(dp[i][j]==0)continue;
      else if(j<3 && (s[i]=="ABC"[j]||s[i]=='?'))dp[i+1][j+1]+=dp[i][j]%mod;

      if(s[i]=='?')dp[i+1][j]+=(3*dp[i][j])%mod;
      else dp[i+1][j]+=dp[i][j]%mod;
    }
  }
  cout << dp[s.size()][3]%mod << endl;
  return 0;
}


Measured memory_bytes: 3584
S = input()
N = len(S) + 1
 
A = [0] * N
 
if S[0] == '<':
    A[0] = 0

if S[-1] == '>':
    A[-1] = 0

for i in range(1, N-1):
    if S[i-1] == '>' and S[i] == '<':
        A[i] = 0

for i in range(N-1):
    if S[i] == '<':
        A[i+1] = A[i] + 1

for i in range(N-1)[::-1]:
    if S[i] == '>':
        A[i] = max(A[i], A[i+1] + 1)

print(sum(A))

Measured memory_bytes: 23336
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}
int main() {
    ll n; cin >> n;
    vector<ll> a(n+1, 0);
    REP(i, n) {
        cin >> a[i+1];
    }

    vector<ll> res(n+1, 0);
    ll num = 0;
    FORD(i, n, 1) {
        if (i * 2 > n) {
            res[i] = a[i];
        } else {
            ll tot = 0;
            for (ll j=i+i; j<=n; j+=i) {
                if (res[j] == 1) {
                    tot += res[j];
                }
            }
            if (tot % 2 != a[i]) {
                res[i] = 1;
            } else {
                res[i] = 0;
            }
        }
    }
    vector<ll> ans;
    FOR(i, 1, res.size()-1) {
        if (res[i] == 1) {
            ans.push_back(i);
        }
    }
    cout << ans.size() << endl;
    REP(i, ans.size()) {
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 7184
//...Bismillahir Rahmanir Rahim...
// Code by    Asad Bin Saber

#include <bits/stdc++.h>

using namespace std;

// typedefs...
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;

// constants...
const double PI = acos(-1);
const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const int INF = 1e9+5;

// defines...
#define MP make_pair
#define PB push_back
#define fi first
#define se second
#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%lld", &a)
#define sll(a, b) scanf("%lld%lld", &a, &b)
#define slll(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

// chess moves...
// int dx[] = {+0, +0, -1, +1}; ///Up-down, Left-Right
// int dy[] = {+1, -1, +0, +0};
// int dx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's Move
// int dy[] = {-1,+1,+0,+0,+1,+1,-1,-1};
// int dx[] = {-2, -2, -1, -1,  1,  1,  2,  2}; ///Knight's Move
// int dy[] = {-1,  1, -2,  2, -2,  2, -1,  1};

// structs...
struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
}; 

// functions...
ll gcd(ll a, ll b) {
    while (b) {
        a %= b;
        swap(a, b);
    }
    return a;
}
ll lcm(ll a, ll b)
{
    return (a/gcd(a, b)*b);
}
ll comb(ll a, ll b)
{
    ll x = max(a-b, b), ans=1;

    for(ll K=a, L=1; K>=x+1; K--, L++){
        ans *= K;
        ans /= L;
    }

    return ans;
}


void task()
{
	// Code here...
	
	int n, x, y;
	
	cin >> n;
	int a[n+5], b[n+5];
	for(int K=1; K<=n; K++){
		cin >> x >> y;
		a[K] = x;
		b[K] = y;
	}
	
	sort(a+1, a+n+1);
	sort(b+1, b+n+1);
	
	if(n%2==0){
	    //int ans1 = b[n/2] - a[n/2] + 1;
	    //int ans2 = b[n/2+1] - a[n/2+1] + 1;
	    int ans1 = b[n/2] + b[n/2+1];
	    int ans2 = a[n/2] + a[n/2+1];
	    
	    //cout << ans1 << ' ' << ans2 << "\n";
	    
	    cout << ans1-ans2+1 << "\n";
	}
	else{
		int ans = b[(n+1)/2] - a[(n+1)/2] + 1;
		
		cout << ans << "\n";
	}
}

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

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
	
	task();

    return 0;
}



Measured memory_bytes: 5216
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define ull unsigned long long
#define N 100005
#define mod 1000000007
//#define mod 1e18
#define boost ios_base::sync_with_stdio(false);cin.tie(0)
#define prec(n) fixed<<setprecision(n)

#define tr(it,c) for(it = c.begin() ; it!=c.end() ; it++)
int inf = INT_MAX ;
ll modulo(ll num,ll MOD=mod){ return ((num%MOD)+MOD)%MOD;} // for negative integer
ll power(ll b,ll e,ll MOD=mod){ll ans=1; while(e){if(e%2) ans=(ans*b)%MOD; b=(b*b)%MOD; e/=2;} return ans;}
ll inv(ll num,ll MOD=mod){ return power(modulo(num),MOD-2,MOD); }
ll gcd(ll a,ll b){ return ((b==0) ? a:gcd(b,a%b));}
ll fac[2*N];

ll sub(ll a,ll b){
	return (a-b+mod)%mod;
}

ll mul(ll a,ll b){
	return (a*b)%mod;
}

ll binomial(ll a,ll b){
	if(a<0||b<0||b>a)
		return 0;
	
	ll temp = (fac[a]*inv(fac[b]))%mod;
	temp = (temp*inv(fac[a - b]))%mod;
	return temp;
}

ll f(ll a,ll b){
	return binomial(a+b,b);
}

int main(){
	boost;
	fac[0] = 1;
	for(int i = 1;i<2*N;i++){
		fac[i] = (fac[i-1]*i)%mod;
	}
	
	ll h,w,n;
	cin>>h>>w>>n;
	vector<pair<int,int>> v(n);
	
	for(int i = 0;i<n;i++){
		ll a,b;
		cin>>a>>b;
		v[i] = make_pair(a,b);
	}
	
	v.push_back(make_pair(h,w));
	sort(v.begin(),v.end(),[&](pair<int,int> a,pair<int,int> b){
		return a.first + a.second < b.first + b.second;
	});
	
	//debug() << imie(v);
	vector<int> dp(n+1);
	
	for(int i = 0;i<n+1;i++){
		ll ans = binomial(v[i].first + v[i].second - 2, v[i].first - 1);
		//debug()<< imie(ans);
		for(int j = i-1;j>=0;j--){
			if(v[j].first<=v[i].first&&v[j].second<=v[i].second)
				ans = sub(ans,mul(dp[j],f(v[i].first - v[j].first, v[i].second - v[j].second)));
		}
		dp[i] = ans;
	}
	//debug() << imie(dp);
	cout<<dp[n]<<endl;
	return 0;
}



Measured memory_bytes: 5164
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;

int n,m;
vector<int> d;
vector<bool> e;
vector<vector<P>> G;

bool dfs(int s,int a,int b){
    bool res=false;
    rep(i,G[s].size()){
        if (e[G[s][i].first]) continue;
        int t=G[s][i].second;
        e[G[s][i].first]=true;
        if (t==b) return false;
        if (t==a) return true;
        res=res|dfs(t,a,b);
    }
    return res;
}

void solve(){
    cin >> n >> m;
    d.resize(n,0);
    e.resize(m,false);
    G.resize(n,{});
    rep(i,m){
        int a,b;
        cin >> a >> b;
        G[a-1].push_back(P(i,b-1));
        G[b-1].push_back(P(i,a-1));
        d[a-1]+=1;
        d[b-1]+=1;
    }
    int num4=0,ma=0;
    rep(i,n){
        if (d[i]%2==1) {
            cout << "No" << endl;
            return;
        }
        ma=max(ma,d[i]);
        if (d[i]==4) num4+=1;
    //     cout << d[i] << endl;
    //     rep(j,G[i].size()) cout << G[i][j].first << " " << G[i][j].second << endl;
    }

    if (ma>=6 or num4>=3) {
        cout << "Yes" << endl;
        return;
    }
    if (num4==2){
        int A=-1,B=-1;
        rep(i,n){
            if (d[i]==4) {
                if (A==-1) A=i;
                else B=i;
            }
        }
        //cout << A << " " << B << endl;
        bool t=dfs(A,A,B);
        if (t) cout << "Yes" << endl;
        else cout << "No" << endl;
        return;
    }
    cout << "No" << endl;
    return;

}

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

Measured memory_bytes: 7680
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace AtCoder
{
	public class ABC
	{
		static int mod = 1000000007;  // 10^9+7

		static void Main(string[] args)
		{
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });


			int n = int.Parse(Console.ReadLine());
			string s = Console.ReadLine();
			//int[] vs = Console.ReadLine().Split().Select(int.Parse).ToArray();
			//long[] vs = Console.ReadLine().Split().Select(long.Parse).ToArray();

			int ans = 0;
			char[] c = new char[3];
			for (int i = 0; i < 10; i++) {
				c[0] = (char)(i + 0x30);
				for (int j = 0; j < 10; j++) {
					c[1] = (char)(j + 0x30);
					for (int k = 0; k < 10; k++) {
						c[2] = (char)(k + 0x30);
						int d = 0;
						for (int l = 0; l < s.Length; l++) {
							if (c[d] == s[l]) {
								d++;
								if (d == 3) {
									//System.Diagnostics.Debug.WriteLine(string.Join("", c));
									ans++;
									break;
								}
							}
						}
					}
				}
			}
			Console.WriteLine(ans);


			Console.Out.Flush();
		}
	}
}


Measured memory_bytes: 13140
# include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
template<typename T>vector<T> make_v(size_t a){ return vector<T>(a); }
template<typename T,typename... Ts>auto make_v(size_t a, Ts... ts){ return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V>typename enable_if<is_class<T>::value==0>::type fill_v(T &t, const V &v){ t = v; }
template<typename T,typename V>typename enable_if<is_class<T>::value!=0>::type fill_v(T &t, const V &v){ for(auto &e : t) fill_v(e, v); }
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int a, b, c;

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

Measured memory_bytes: 256
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------

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

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

    ll ans = 1;
    ll cnt[3] = {0};
    for(int i = 0; i < n; i++){
        ll tmp = 0;
        bool f = false;
        for(int j = 0; j < 3; j++){
            if(a[i] == cnt[j]){
                tmp++;
                if(!f){
                    cnt[j]++;
                    f = true;
                }
            }
        }
        ans *= tmp;
        ans %= MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 1024
S = input()

if S == 'SUN':
    print('7')

if S == 'MON':
    print('6')

if S == 'TUE':
    print('5')

if S == 'WED':
    print('4')

if S == 'THU':
    print('3')

if S == 'FRI':
    print('2')

if S == 'SAT':
    print('1')


Measured memory_bytes: 8912
#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>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    vector<int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    int ans = 0;
    rep(i,3) {
        int now = a[0]+a[1]+a[2]+a[i]*9;
        ans = max(ans, now);
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
	int N, A[100001] = { 0 };
	int ans = 0;

	cin >> N;

	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	sort(A, A + N);

	int count = 1;
	for (int i = 0; i < N; i++)
	{
		if (A[i] == A[i + 1])
			count++;
		if(A[i+1] == 0 || A[i] != A[i + 1])
		{
			if (count % 2 == 1)
				ans++;
			count = 1;
		}
	}
	cout << ans << endl;

	return 0;
}


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

int main(){
    ll M,D;
    cin >> M >> D;
    ll count = 0;
    for(ll m=1;m<=M;m++){
        for(ll d=1;d<=D;d++){
            ll d_1,d_10;
            d_1 = d % 10;
            d_10 = d / 10;
            if((d_1 >=2) && (d_10>=2) && (d_1*d_10==m)){
                count++;
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int N,l,r;
  	int sum = 0;
 	cin >> N;
  	for(int i = 0; i<N;i++){
     cin >> l >> r; 
      sum += r - l + 1;
    }
  	cout << sum << endl;
}

Measured memory_bytes: 256