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

public class Main {

	static int[][] map;
	static int[][] directions8 = { { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1 }, { 1, -1 }, { 1, 0 },
			{ 1, 1 } };
	static int[][] directions4 = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } };
	static int ans;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while (true) {

			int N = sc.nextInt();
			int M = sc.nextInt();
			if ((N | M) == 0) {
				break;
			}

			int[][] studentLogin = new int[M + 1][721];
			int[][] studentLogout = new int[M + 1][721];
			int r = sc.nextInt();
			int[] t = new int[r];
			int[] n = new int[r];
			int[] m = new int[r];
			// int[] s = new int[r];

			for (int j = 0; j < r; j++) {
				t[j] = sc.nextInt();
				n[j] = sc.nextInt();
				m[j] = sc.nextInt();

				if (sc.nextInt() == 1) {
					studentLogin[m[j]][t[j] - 540]++;
				} else {
					studentLogout[m[j]][t[j] - 540]++;
				}
			}

			int q = sc.nextInt();
			int[] fromTime = new int[q];
			int[] toTime = new int[q];
			int[] qStudent = new int[q];

			for (int i = 0; i < q; i++) {
				fromTime[i] = sc.nextInt();
				toTime[i] = sc.nextInt();
				qStudent[i] = sc.nextInt();
				int studentLoginPC = 0;
				int studentAns = 0;

				for (int j = 0; j <= toTime[i] - 540; j++) {
					if (j > fromTime[i] - 540 && studentLoginPC > 0) {
						studentAns++;
					}
					studentLoginPC += studentLogin[qStudent[i]][j];
					studentLoginPC -= studentLogout[qStudent[i]][j];
				}
				System.out.println(studentAns);
			}

		}

	}

	// BFS用に二つの配列を足し算する
	static int[] addArrayElms(int[] a, int[] b) {
		int[] c = new int[a.length];
		for (int i = 0; i < a.length; i++) {
			c[i] = a[i] + b[i];
		}
		return c;
	}

	// //二分探索
	// k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray) {
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedArray[mid] <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	// 二分探索
	// k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList) {
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedList.get(mid) <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	// aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	public static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}
}



Measured memory_bytes: 313652
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A;
  cin >> A;
  int B=0,C;
  vector<int> vec(A);
  for(int i=0;i<A;i++){
    cin >> vec.at(i);
    B += vec.at(i);
  }
    if(B%2==0){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
}

Measured memory_bytes: 640
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
#define tc int t;cin>>t;while(t--)
#define get cin>>
#define geta ll a[n];for (int i = 0; i < n; ++i){cin>>a[i];}
#define puta for (int i = 0; i < n; ++i){cout<<a[i];}
#define put cout<<
ll maxi=LLONG_MIN;
ll mini=LLONG_MAX;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
//shaaar
int main() 
{
	
 	int a,b,c;cin>>a>>b>>c;
 	cout<<c<<" "<<a<<" "<<b;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1000000000
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
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;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	int N;
	cin>>N;

	ll ans=1LL;
	REP(i,N){
		ll T;
		cin>>T;
		ans=lcm(ans,T);
	}
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int read(){
	int w=0,f=1;
	char c=' ';
	while(c<'0'||c>'9')c=getchar(),f=c=='-'?-1:f;
	while(c>='0'&&c<='9')w=w*10+c-48,c=getchar();
	return w*f;
}
int n;
int a[N], b[N];
int ca[N], cb[N];
signed main(){
	n = read();
	for(int i = 1; i <= n; i++) a[i] = read(), ca[a[i]]++;
	for(int i = 1; i <= n; i++) b[i] = read(), cb[b[i]]++;
	for(int i = 1; i <= n; i++) if(ca[i] + cb[i] > n) return printf("No\n"), 0;
	reverse(b + 1, b + n + 1);
	vector<int> t;
	int cnt = 0, val = 0, len = 0;
	for(int i = 1; i <= n; i++)
	{
		if(b[i] == a[i])
		{
			cnt++;
			val = b[i];
			t.push_back(i);
		}
	}
	len = cnt;
	vector<int> s;
	for(int i = 1; i <= n; i++)
	{
	 if(a[i] == b[i]) continue;
	 if(cnt == 0) break;
	 if(a[i] != val && b[i] != val)
	 {
	 	s.push_back(i);
	 	cnt--;
	 }		
	}
	for(int i = 0; i < len; i++)
	{
		swap(b[s[i]], b[t[i]]);
	}
	printf("Yes\n");
	for(int i = 1; i <= n; i++) printf("%d ", b[i]);
	cout<<("\n");
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<pair<ll, ll>> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); ++i)
#define FI first
#define SE second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define TS to_string
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define endl "\n"


ll INF = 1e9;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "Yes" << endl;}
void no(){ cout << "No" << endl;}

//-----------------------------------------
const ll infi = ((ll)1 << 31) -1;
class segment_tree{
  private:
    ll N = 1;
    vector<ll> data;
    ll inf = infi;
  public:

    segment_tree(vector<ll> vec){
      ll m = vec.size();
      while(N < m) N *= 2;
      data.resize(2*N, inf);

      for(int i=0;i<m;i++) update(i,vec[i]);
    }

    void update(ll k, ll a){
      k += N - 1;
      data[k] = a;
      while(k > 0){
        k = (k-1) / 2;
        data[k] = min(data[k * 2 + 1], data[k * 2 + 2]);
      }
    }

    // [a,b) のクエリを処理する
    int query_(ll a, ll b, ll k, ll l, ll r){
      // [a,b)　と [l,r) が交差しない時
      if(r <= a || b <= l) return inf; 

      // 完全に含まれている時
      if(a <= l && r <= b) return data[k];
      else{
        ll mid = (l + r) / 2;
        // 2つの子の最小値
        ll vl = query_(a,b,k*2+1,l,mid);
        ll vr = query_(a,b,k*2+2,mid,r);
        return min(vl, vr);
      }
    }

    int query(ll a, ll b){
      return query_(a, b, 0, 0, N);
    }
};

//-----------------------------------------

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  ll n;
  cin >> n;
  vll v(n,infi);
  segment_tree tree(v);
  ll q;
  cin >> q;
  REP(i,q){
    ll com;
    cin >> com;
    if(com == 0){
      ll x, y;
      cin >> x >> y;
      tree.update(x,y);
    }
    else{
      ll x, y;
      cin >> x >> y;
      cout << tree.query(x,y+1) <<endl;
    }
  }

  return 0;
}




Measured memory_bytes: 6568
#include <bits/stdc++.h>
using namespace std;
#define int long long
void run();
signed main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(13); run(); return 0; }
mt19937 rng(random_device{}());

void run() {
   int n;
   cin >> n;
   int r;
   cin >> r;
   if (n >= 10)
       cout << r << endl;
   else
       cout << r + 100 * (10 - n) << endl;
}


Measured memory_bytes: 256
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    int ans = 0;
    for (int i = 0; i < n - 2; i++) {
        if ((p[i] < p[i + 1] and p[i + 1] < p[i + 2])
                or (p[i] > p[i + 1] and p[i + 1] > p[i + 2])) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/


Measured memory_bytes: 256
package main

import(
    "fmt"
)



func main() {
    var a,b int
    fmt.Scan(&a,&b)
    ans := "Impossible"
    if a%3==0 || b%3==0 || (a+b)%3==0{
        ans = "Possible"
    }
    fmt.Println(ans)
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#define ll long long int

using namespace std;

string s;
stack <string> stk;

int main()
{
    ///freopen("INA.txt","r",stdin);
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>> s;
    for(int i=0;i<s.length();i++){
        if(s[i]=='0'){ stk.push("0"); }
        else if(s[i]=='1'){ stk.push("1"); }
        else{
            if(!stk.empty()){
                stk.pop();
            }
        }
    }
    string ans="";
    while(!stk.empty()){
        string c = stk.top();
        ans += c;
        stk.pop();
    }
    reverse(ans.begin(),ans.end());
    cout<< ans << endl;
    return 0;
}



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

int main(){
  int n;
  cin>>n;
  vector<int>vec(n);
  for(int i=0;i<n;i++){
    cin>>vec[i];
  }
  int sum=0;
  sort(vec.begin(),vec.end());
  for(int i=0;i<n-1;i++){
    sum+=vec[i];
  }
  sum+=vec[n-1]/2;
  cout<<sum<<endl;
}

Measured memory_bytes: 764
#include<iostream>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	for(int i=1;i<=b;i++)
	{
		if(a*i>=b&&a*i<=c)
		{
			cout<<"OK";
			return 0;
		}
	}
	cout<<"NG";
	return 0; 
}

Measured memory_bytes: 3548
#![allow(unused_imports)]
use std::io;
use std::cmp::*;
use std::collections::*;
#[allow(dead_code)]
const M: i64 = 1e9 as i64 + 7;

fn read_line() -> String {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).unwrap();
    buf
}
#[allow(dead_code)]
fn read<T>() -> T where T: std::str::FromStr, T::Err : std::fmt::Debug {
    read_line().trim().parse().unwrap()
}
#[allow(dead_code)]
fn readv<T>() -> Vec<T> where T: std::str::FromStr, T::Err : std::fmt::Debug {
    read_line().split(' ').map(|a| a.trim().parse().unwrap()).collect()
}

use std::time::Instant;
fn main() {
    let _ = read::<usize>();
    let aa = readv::<usize>();
    let bb = readv::<usize>();
    let x = aa.iter().fold(0, |acc, &a| acc ^ a);
    let (mut aa, bb): (Vec<_>, Vec<_>) = aa.iter().zip(bb.iter()).filter(|&(&a, &b)| a != b).unzip();
    let n = aa.len();
    aa.push(x);
    let mut nums = HashMap::with_capacity(n + 1);
    for &a in &aa {
        *nums.entry(a).or_insert(0) += 1;
    }
    // let mut nums: HashMap<_, i32> = aa.iter()
    //     .fold(HashMap::with_capacity(n + 1), |mut acc, &a| { *acc.entry(a).or_insert(0) += 1; acc });
    for &b in &bb {
        *nums.entry(b).or_insert(0) -= 1;
        if nums[&b] < 0 {
            println!("{}", -1);
            return;
        }
    }

    let mut dests = bb.iter().enumerate()
        .fold(HashMap::new(), |mut acc, (a, b)| { (acc.entry(b).or_insert(Vec::new())).push(a); acc });
    let mut q: VecDeque<_> = std::iter::once(n).collect();
    let mut rems: BTreeSet<_> = (0..n + 1).collect();
    let mut r2: HashSet<_> = (0..n + 1).collect();
    let mut ans = n;
    #[cfg(local)] println!("{}: {:?}", "(aa, bb)", (&aa, &bb));
    while !rems.is_empty() {
        while let Some(s_idx) = q.pop_front() {
            r2.remove(&s_idx);
            if !rems.remove(&s_idx) { continue; }
            let s_num = aa[s_idx];
            // if let Some(destv) = dests.remove(&s_num) {
            //     for dest in destv {
            //         q.push_back(dest);
            //     }
            // }
            if let Some(destv) = dests.get_mut(&s_num) {
                for &dest in destv.iter() {
                    q.push_back(dest);
                }
                destv.clear();
            }
        }
        if let Some(&rem) = rems.iter().next() {
            q.push_back(rem);
            ans += 1;
        }
        if let Some(&_) = r2.iter().next() {
        }
    }
    println!("{}", ans);
    std::process::exit(0);
}


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

using namespace std;

#define llong long long 
typedef pair<long int, int> P;
long int d[10001];
bool Dec[10001];
vector<P> edges[10001];
priority_queue<P, vector<P>, greater<P> > q;

void solve(){
	fill_n(d, 10001, 9999999);
	d[0] = 0;
	fill_n(Dec, 10001, false);
	q.push(P(0,0));

	while(!q.empty()){
		P p = q.top(); q.pop();
		if(Dec[p.second] == true) continue;
		Dec[p.second] = true;
		d[p.second] = p.first;

		for(int i = 0; i < edges[p.second].size(); i++){
			P e = edges[p.second][i];
			if(d[e.second] > p.first + e.first){
				q.push(P(p.first + e.first, e.second));
			}
		}
	}

	return;
}

int main(){
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		int num;
		int howedge;
		cin >> num >> howedge;
		for(int j = 0; j < howedge; j++){
			int to;
			long int cost;
			cin >> to >> cost;
			edges[num].push_back(P(cost, to));
		}
	}

	solve();

	for(int i = 0; i < N; i++){
		cout << i << " " << d[i] << endl;
	}

	return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto it : v)
#define mod 1000000007
#define all(v) (v).begin(),(v).end()
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vv vector<vector<int>>
using namespace std;

main()
{
        int a,b,c; cin>>a>>b>>c;
        int cnt;
        if(a+b>=c)cnt=b+c;
        else if(a+b+1==c)cnt=b+c;
        else cnt=b*2+a+1;
        cout<<cnt<<endl;
}


Measured memory_bytes: 256
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_rpw_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    a, b, c, k = i_map()

    if a >= k:
        print(k)
        exit()

    k -= a

    k -= b

    if k <= 0:
        print(a)
        exit()

    print(a-k)


if __name__ == '__main__':
    main()


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

typedef long long ll;

int main() {
    string s; cin >> s;
    vector<int> c(s.length(), 0);
    for (int i = 0; i < s.length()-1; i++) {
        if (s[i] == 'A') {
            c[i] = 1;
        } else if (s[i] == 'B' && s[i+1] == 'C') {
            c[i] = 2;
            i++;
        } else {
            c[i] = -1;
        }
    }
    int n = 0;
    ll ans = 0;
    for (int i = 0; i < s.length(); i++) {
        if (c[i] == 1) {
            n++;
        } else if (c[i] == 2) {
            ans += n;
        } else if (c[i] == -1) {
            n = 0;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1412
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int inf=0x3f3f3f3f;
int n,m;
int a[1000];
int main()
{a[1]=300000,a[2]=200000;a[3]=100000;
	cin>>n;cin>>m;int ans=a[n]+a[m];if(n==m&&n==1)ans+=a[1]+a[3];cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <stdexcept>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define debug(a) cout << (a) << endl
namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;
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 (a > b)
	{
		a = b;
		return 1;
	}
	return 0;
}

ll M = 1000000007;
set<int> divisor(int n)
{
	set<int> value;
	for( int ite=1; (ll)ite*ite<=n;ite++)
	{
		
			if (n % ite == 0)
			{
				value.insert(ite);
				value.insert(n / ite);
				
			}
		
	}
	return value;
}
/*

set<ll> divisor(ll n)
{
	set<ll> value;
	for( ll i=1; i*i<=n;i++)
	{
		
			if (n % i == 0)
			{
				value.insert(i);
				value.insert(n / i);
				
			}
		
	}
	return value;
}
*/

void solve()
{
	int n;
	cin>>n;
	map<int,int>cnt;
	set<int>exist;
	vector<int>a(n);
	rep(i,n){
		cin>>a[i];
		exist.insert(a[i]);
		cnt[a[i]]++;
	}
	int ans=0;
	rep(j,n){
		set<int>div=divisor(a[j]);
		bool ok=true;
		for(auto i=div.begin();i!=div.end();i++){
			if(*i==a[j]){
				if(cnt[*i]>1){
					ok=false;
				}
			}
			else if(exist.count(*i)){
				ok=false;
			}
		}
		if(ok)ans++;
	}
	cout<<ans<<endl;

}

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


Measured memory_bytes: 22684
n, m = map(int, input().split())
info = [list(map(int, input().split())) for i in range(m)]

memo = {}
for i in range(m):
    if info[i][0] not in memo:
        memo[info[i][0]] = 1
    else:
        memo[info[i][0]] += 1
    if info[i][1] not in memo:
        memo[info[i][1]] = 1
    else:
        memo[info[i][1]] += 1
for i in memo:
    if memo[i] % 2 == 1:
        print("NO")
        exit()
print("YES")

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

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

const long long MOD = 1000000007;
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};


int main(){
  ll n;
  cin>>n;
  vector<ll> v(n);
  rep(i,n) cin>>v[i];
  ll ans = 1001001001001001;
  sort(v.begin(), v.end());
  ll l = v[0];
  ll r = v[n-1];
  for(int i=l; i<=r; i++) {
    ll tmp = 0;
    rep(j,n) {
      tmp += (v[j]-i)*(v[j]-i);
    }
    ans = min(ans, tmp);
  }
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<P> vp;

const int MAX_N = 102;

int mn[MAX_N];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vi t(n),v(n);
    rep(i,n){
        cin >> t[i];
    }
    rep(i,n){
        cin >> v[i];
    }
    int sm = accumulate(all(t),0);
    v.pb(0);
    mn[n-1] = sm+v[n];
    rrep(i,n-1){
        sm -= t[i+1];
        mn[i] = min(mn[i+1],sm+v[i+1]);
    }
    double pos = 0;
    double res = 0;
    double nw = 0;
    rep(i,n){
        rep(j,t[i]){
            rep(k,2){
                pos += 0.5;
                nw += 0.5;
                // show(nw);
                cmn(nw,min(pos,min((double)v[i],mn[i]-pos)));
                res += nw * 0.5;
            }
        }
    }
    printf("%.12f\n",res);
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if(n==0 && m==0)break;
			
			ArrayList<Integer> list = new ArrayList<Integer>();
			int[] a = new int[m];
			list.add(n);
			
			int b, c, d;
			int count = 0;
			while(true){
				count++;
				for(int i=0;i<m;i++){
					a[i] = n%10;
					n /= 10;
				}
				Arrays.sort(a);
				b=0;
				c=0;
				d=1;
				for(int i=0;i<m;i++){
					b += a[m-1-i]*d;
					c += a[i]*d;
					d *= 10;
				}
				n = c-b;
				if(list.indexOf(n)==-1){
					list.add(n);
				}else{
					int ansA = list.indexOf(n);
					System.out.println(ansA + " " + n + " " + (count-ansA));
					break;
				}
				
			}
		}
	
	}	
}

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

int main() {
  int N, K, p = 1;
  cin >> N >> K;
  
  for (int i = 0; i < N; i ++) {
    p += p * (p <= K) + K * (p > K);
  }
  
  cout << p << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#include <cstdint>



#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rrep(i, n) for(ll i = (ll)(n-1); i >= 0; i--)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rrepi(i,a,b) for(ll i=(ll)(b-1);i>=(ll)(a);i--)

#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;



template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  u64 &value() noexcept { return a; }
  u64 &value() const noexcept { return a; }
  modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
  modint pow(u64 exp){
    modint res=1,rhs=*this;
    while (exp) {
      if (exp % 2) {
        res *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return res;
  }

  friend ostream& operator<<(ostream& os,modint& rhs){
    os << rhs.value();
    return os;
  }

  friend istream& operator>>(istream &is,modint &rhs){
      is>>rhs.value();
      rhs.value()%=Modulus;
      return is;
  }

};

using mint=modint<(int)1e9+7>;
struct factorial{
  vector<mint>fact,inv;
  factorial(int n){
    fact.assign(n,0);
    inv.assign(n,0);
    fact[0]=1;
    for(int i=0;i<n-1;i++){
      fact[i+1]=fact[i]*(i+1);
    }
    inv[n-1]=(mint)1/fact[n-1];
    for(int i=n-1;i>=1;i--){
      inv[i-1]=inv[i]*i;
    }
  }
  mint comb(int a,int b){
    if(b>a||b<0)return 0;
    return fact[a]*inv[b]*inv[a-b];
  }

};
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,a,b;cin>>n>>a>>b;
  mint res=2;
  res=res.pow(n)-1;
  mint ta=1,tb=1;
  rep(i,a){
    ta*=n-i;
    ta/=a-i;
  }
  rep(i,b){
    tb*=n-i;
    tb/=b-i;
  }
  res-=ta+tb;
  cout<<res<<endl;


  return 0;

}


Measured memory_bytes: 256
import sys
range = xrange
input = raw_input

n,m = [int(x) for x in input().split()]

lmax = 0
rmin = 10**6
for _ in range(m):
    l,r = [int(x) for x in input().split()]

    lmax = max(l,lmax)
    rmin = min(r,rmin)

print max(rmin-lmax+1,0)


Measured memory_bytes: 33768
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <utility>
#define ll long long
#define ld long double
using namespace std;

ll fac[2010], finv[2010], inv[2010], mod=1000000007;
void prep(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2; i<2010; ++i){
        fac[i]=(fac[i-1]*i)%mod;
        inv[i]=mod-(inv[mod%i]*(mod/i))%mod;
        finv[i]=(finv[i-1]*inv[i])%mod;
    }
}

ll COM(int n, int k){
    if(n<k) return 0;
    if(n<0 || k<0) return 0;
    return (fac[n]*((finv[k]*finv[n-k])%mod))%mod;
}

int main() {
    int N, K;
    cin >> N >> K;
    prep();
    for(int i=1; i<=K; ++i){
        cout << (COM(N-K+1, i)*COM(K-1, i-1))%mod << endl;
    }
    return 0;
}


Measured memory_bytes: 256
/*

                                  In the name of Allah, Most Gracious, Most Merciful


*/
#include<bits/stdc++.h>
#include<numeric>
using namespace std;

//*** constant value ***
const long double PI = 3.141592653589793238;
const double EPS = 1e-6 ;
//*** constant value ***

//****** define ********
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define dd double
#define vll vector<ll>
#define vs vector<string>
#define fn(i,n) for(ll i = 0; i<n; i++)
#define f(i,a,b) for(i=a;i<b;i++)
#define f1(i,a,b) for(i=b-1;i>=a;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pls pair<ll,string>
#define vpl vector<pll>
#define pb push_back
#define mk make_pair
#define x first
#define y second
#define tt cout<<"Came here"<<endl;
//****** define ********
void solve()
{
  ll x,y;
  bool flag = 0;
  cin>>x>>y;
  if(y%2 == 0){
     if(y <= x*4 && x*2<= y)
         flag = 1;
  }

  if(flag)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;

}

int main()
{
    IOS;
    ll tc = 1;
    while(tc--)
    {
        solve();
    }


return 0;
}



Measured memory_bytes: 3560
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//
const ll MAX_SIZE = 150005;
ll N;
vvc<ll> G(MAX_SIZE);
ld dp[MAX_SIZE], ans[MAX_SIZE];
ll T[MAX_SIZE];

void dfs1(ll now, ll parent){
    ll nowsize = 1;
    ld tmpv = 0;
    ld deg = (parent == -1 ? G[now].size() : G[now].size() - 1);
    for(auto& to: G[now]){
        if (parent == to) continue;
        
        dfs1(to, now);
        nowsize += T[to];

        //遷移させる値の処理
        tmpv += (dp[to] + 1);
    }

    if(deg!=0) tmpv /= deg;
    dp[now] = tmpv;
    T[now] = nowsize;
    return;
}
 
void dfs2(ll now, ll parent, ld pv){ //pv:親から受け取る値
    ll nowsize = T[now];
    ld tmpv = pv, degsize = G[now].size();

    if (parent != -1) tmpv = (tmpv + (degsize - 1) * dp[now]) / (ld)degsize;

    ans[now] = tmpv;
    
    for(auto& to: G[now]){
        if(to!=parent){
            dfs2(to, now, (degsize * ans[now] - dp[to] - 1)/max(1.0L,(degsize-1))+1);
        }
    }
 
    return;
}

int main() {
    init();
    ll N;
    cin >> N;
    rep(i,N-1){
        ll a, b;
        cin >> a >> b;
        a--, b--;
        G[a].eb(b), G[b].eb(a);
    }

    dfs1(0, -1);
    dfs2(0, -1, dp[0]);

    rep(i, N) cout << ans[i] << "\n";

}

Measured memory_bytes: 25216
def main():
    n,a,b,c,d=map(int, input().split())
    s = input()

    if("##" in s[a-1:c] or "##" in s[b-1:d]):return 0
    if(d>c):
        return 1
    else:
        if("..." in s[b-2:d+1]):
            return 1
        else:
            return 0

if __name__ == '__main__':
    k=main()
    if(k):
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 9448
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  int b[m];
  for(int i=0; i<m; i++){
    cin >> b[i];
  }
  vector<vector<int> > vec(n, vector<int>(m));
  for(int i=0; i<n; i++){
    for(int j=0; j<m; j++){
      cin >> vec.at(i).at(j);
    }
  }
  int cnt=0;
  for(int i=0; i<n; i++){
    int sum=c;
    for(int j=0; j<m; j++){
      sum += vec.at(i).at(j) * b[j];
    }
    if(sum > 0){
      cnt++;
    }
  }
  cout << cnt << endl;
}

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

int n, c;
int a[40];
int b[40];

int bitcount(uint bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >> 16);
}

int main() {
    while (true) {
        cin >> n >> c;
        
        if (n==0 && c==0) {
            break;
        }
        
        for (int i=0; i<n; i++) {
            a[i] = 0, b[i] = 0;
        }
        
        for (int i=0; i<n; i++) {
            for (int j=0; j<16; j++) {
                int aij; cin >> aij;
                a[i] += aij<<j;
            }
        }
        
        for (int i=0; i<c; i++) {
            for (int j=0; j<16; j++) {
                int bij; cin >> bij;
                b[i] += bij<<j;
            }
        }
        
        int dp[n+1][1<<16];
        
        for (int i=0; i<=n; i++) {
            for (int j=0; j<(1<<16); j++) {
                dp[i][j] = -INF;
            }
        }
        
        dp[0][0] = 0;
        
        for (int i=0; i<n; i++) {
            for (int j=0; j<(1<<16); j++) {
                int now = j|a[i];
                
                for (int k=0; k<c; k++) {
                    int score = bitcount(now&b[k]);
                    int next = now-(now&b[k]);
                    dp[i+1][next] = max(dp[i+1][next], dp[i][j]+score);
                }
            }
        }
        
        int ans = 0;
        
        for (int i=0; i<(1<<16); i++) {
            ans = max(ans, dp[n][i]);
        }
        
        cout << ans << endl;
    }
}


Measured memory_bytes: 10944
# include <bits/stdc++.h>
# define INF 1e9
using namespace std;

int main(){

  int N;
  cin >> N;
  string s = to_string(N);
  int v = 0;
  for(int i=0; i<s.size(); i++){
    v += (int) s[i] - (int) '0';
  }
  if(N % v == 0){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}

Measured memory_bytes: 256
xy=[]
invxy=[]
n=int(input())
for i in range(n):
    x,y = map(int,input().split())
    xy.append([x,y])
    invxy.append([x,-y])
ma=-10**20
mi=10**20
for i in xy:
    if ma<(i[0]+i[1]):
        ma=i[0]+i[1]
    if mi>(i[0]+i[1]):
        mi=i[0]+i[1]
invma=-10**20
invmi=10**20
for i in invxy:
    if invma<(i[0]+i[1]):
        invma=i[0]+i[1]
    if invmi>(i[0]+i[1]):
        invmi=i[0]+i[1]
k=abs(ma-mi)
t=abs(invma-invmi)
print(max(k,t))

Measured memory_bytes: 131828
#include <iostream>
#include <vector>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <queue>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#define ll long long
#define fr(i,k,N) for(ll i=k; i<N;i++)
#define rep(i,N) for(ll i=0; i<N;i++)
#define ALL(v) v.begin(),v.end()
#define mp make_pair
using namespace std;
template <class X> void pr(X test){cout<<test<<endl;}
template <class X> void prr(X test){for(auto it:test){cout<<it<<endl;}}
template <class X> void prrr(X test){int f=0;for(auto it:test){cout<<(f++!=0?" ":"")<<it;}cout<<endl;}
template<typename X>
istream&operator>>(istream&i,vector<X>&v){for(X&x:v)i>>x;return i;}

class UF { // union find from https://github.com/kartikkukreja/blog-codes (MIT)
    // [usage]
    // auto uf = new UF(n);
    // uf->merge(l, r); // 0 <= l, r <= n-1
    // ...
public:
    int *id; // inner id
    int cnt; // number of all vartices
    int *sz; // sz[i] means size of i's set
    UF(int N)   {
        cnt = N;
        id = new int[N];
        sz = new int[N];
        for(int i=0; i<N; i++) {
            id[i] = i;
            sz[i] = 1;
        }
    }
    ~UF() {
        delete [] id;
        delete [] sz;
    }
    int find(int p) {
        int root = p;
        while (root != id[root]) root = id[root];
        while (p != root) {
            int newp = id[p];
            id[p] = root;
            p = newp;
        }
        return root;
    }
    void merge(int x, int y) {
        int i = find(x);
        int j = find(y);
        if (i == j) return;
        
        if (sz[i] < sz[j]) {
            id[i] = j;
            sz[j] += sz[i];
        } else {
            id[j] = i;
            sz[i] += sz[j];
        }
        cnt--;
    }
    bool connected(int x, int y) {
        return find(x) == find(y);
    }
    int count() {
        return cnt;
    }
};

// return sorted 約数list 1 <= x <= n
vector<ll> divv(ll n) {
  vector<ll> v;
  for(ll i = 1; i*i <= n; i++) {
    if(n%i == 0) {
      v.push_back(i);
      if(i*i != n) v.push_back(n/i);
    }
  }
  sort(ALL(v));
  return v;
}


int main() {
    string s;
    cin>>s;
    ll sum = 0;
        string y ="";
    string last = "";
    rep(i, s.size()){
        y.push_back(s[i]);
        if (y != last)
        {
            sum++;
            last = y;
            y = "";
        }
        else{
            y.push_back(s[i]);
        }
    }
    pr(sum);
}

Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <iterator>
#include <limits>
#include <numeric>
#include <utility>
#include <cmath>
#include <cassert>
#include <cstdio>
 
// #include <unordered_set>
// #include <unordered_map>
 
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
 
#define pb push_back
#define mp make_pair
 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
 
typedef std::pair<int, int> P;
typedef long long ll;
typedef long double ld;
 
const int MOD = 1000000007;
const int INF = 1e9;
const ll LINF = INF * 1ll * INF;
const ld DINF = 1e200;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
using namespace std;
 
// #define int long long


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cin高速化

    int ans;
    int n;
    cin>>n;

    if(n==1){
        cout<<1<<endl;
        return 0;
    }
    for(int i=1;i<=n;i++){


        // cout<<i*i<<endl;

        ans=(i-1)*(i-1);

        if(i*i>n){
            // cout<<"ans:"<<ans<<endl;
            cout<<ans<<endl;
            break;
        }


    }

    return 0;
 
}

Measured memory_bytes: 256
// ~zaletaet~

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>

#define fi first
#define se second
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define pb push_back

using namespace std;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

const ll N = 1e5 + 123, MOD = 1e9 + 7, oo = 1e9 + 9, INF = 1e18 + 9;
const double EPS = 1e-9, PI = acos(-1); // 3.14159265358979323846
const int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

    long long n, m;
    cin >> n >> m;

    long long ans = 1;
    for (long long i = 2; i * i <= m; i++) {
        if (m % i != 0) continue;
        if (m / i >= n)
            ans = max(ans, i);
        if (i >= n)
            ans = max(ans, m / i);
    }
    if (n == 1) ans = max(ans, m);
    cout << ans;

    return 0;
}

/*
  Raise your standard.
*/

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <vector>
using namespace std; 
#define ll long long
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define rep2(i,a,b) for(ll i=a;i>=b;i--)
int a[33]={0,1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int main(int argc, char** argv) {
	int k;
	cin>>k;
	printf("%d",a[k]);
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;


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

    int n, i = 1;
    cin >> n;
    ll sol = 0;
    n--;
    while (i <= n)
    {
        int j = n / (n / i);
        sol += (ll) n / i * (j - i + 1);
        i = j + 1;
    }
    cout << sol << "\n";
}


Measured memory_bytes: 3592
import math
a , b , h , m  = map(int , input().split())

rad_c = abs(h*30-m*5.5)
if rad_c > 180:
    rad_c = 360 - rad_c
c =  math.sqrt(a**2 + b ** 2 - (2 * b * a  * math.cos(math.radians(rad_c))))
print(c)

Measured memory_bytes: 9504
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
  void Solve()
  {
    var S = Console.ReadLine();
    var T = Console.ReadLine();
    int ret = 0;
    for (int i = 0; i < 3; i++)
    {
      if (S[i]==T[i])
        ret++;
    } 
    Console.WriteLine(ret); ;
  }
  static int[] ToInts()
  {
    var ss = Console.ReadLine().Split();
    var ret = new /**/int[ss.Length];
    for (int i=0;i<ss.Length ;i++)
    {
      ret[i] = /**/int.Parse(ss[i]);
    }
    return ret;
  }

  static void Main(string[] args)
  {
    new Program().Solve();
  }
}



Measured memory_bytes: 11092
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
 
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
 
using namespace std;
 
typedef long long ll;

int main(int argc, char const *argv[])
{
  ll n,y;
  cin >> n >> y;
  REP(i,n+1){
    REP(j,n+1){
      ll h = n-i-j;
      if (h < 0) continue;
      if (i+j+h == n && i*10000+j*5000+h*1000 == y) {
        cout << i << " " << j << " " << h<< endl;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1" << endl;
  return 0;
}


Measured memory_bytes: 256
I=lambda:list(map(int,input().split()));n,m=I();d=[0]+[9**9]*2**n
while m:
 m-=1;a=I()[0];s=sum(1<<c-1for c in I())
 for j in range(2**n):d[s|j]=min(d[s|j],d[j]+a)
print(d[-2]%9**9or-1)

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

int main(){

  int N, T; cin >> N >> T;
  vector<int> c(N, 0);
  vector<int> t(N, 0);

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

  int min = 9999999;
  for(int i = 0 ; i < N ; ++i){
    if(t[i] > T) continue;
    min = std::min(min, c[i]);
  }
  
  int ans = min;

  if(ans == 9999999){
    cout << "TLE" << endl;
    return 0;
  }

  cout << ans << endl;


}

Measured memory_bytes: 256
X, Y, n, m, rm, ans['   '];
main() {
  scanf("%d%d", &n, &m);
  for (; ~scanf("%d%d", &X, &Y);) {
    int b = Y + 1;
    for (int j = 1; j * j <= m; j++) {
      int tx = (X + j - 1) / j, ty = Y / j;
      ans[tx]++;
      ans[ty + 1 < b ? ty + 1 : b]--;
      b = tx;
    }
    for (int i = 1; i < b; i++) {
      if ((X - 1) / i < Y / i) {
        ans[i]++;
        ans[i + 1]--;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    ans[i] += ans[i - 1];
    printf("%d\n", ans[i]);
  }
}

Measured memory_bytes: 1280
require "bigdecimal"
require "bigdecimal/util"

def gi() gets.to_i end
def gs() gets.chomp end
def gim() gets.split.map(&:to_i) end
def gsm() gets.split.map(&:chomp) end
def YesNo1(bool, yes="Yes", no="No") puts (bool ? yes : no) end
def YESNO2(bool, yes="YES", no="NO") puts (bool ? yes : no) end

#####
d,n = gim
if n == 100
  n = 101
end
puts (100 ** d)*n

Measured memory_bytes: 1916
#include <stdio.h>
#include <math.h>
#define INF 1E9
int main(void){
  int n,k,h[100001],dp[100001];
  dp[0]=0;
  scanf("%d%d",&n,&k);
  int i,j;
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  for(i=1;i<n;i++) dp[i]=INF;
  for(i=1;i<n;i++){
    for(j=1;j<=k;j++){///j<i/////////////
      if(i-j<0) break;
      dp[i]=fmin(dp[i],dp[i-j]+abs(h[i]-h[i-j]));
    }
  }
  printf("%d",dp[n-1]);
  return 0;
}

Measured memory_bytes: 896
((input) => {
  let [a,b,c,d] = input.split(' ').map(BigInt);
  let max = [a*c,a*d,b*c,b*d].reduce((a,b)=>a>b?a:b);
  console.log(max.toString());
})(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29644
import scala.io.StdIn._
object Main extends App {

  val n = readInt()
  val num = readLine.trim.split(' ').map(_.toLong)
  val max = num.map(math.abs)
  val parity = num.count{_ < 0} % 2
  println(
    if (parity == 0) max.sum
    else max.sum - max.min * 2
  )
}


Measured memory_bytes: 53012
#include<iostream>
#include<string>
#include<cmath>

using std::cout;
using std::cin;
using std::endl;
using std::pow;

int main(){
    int A,B,C,K,count=0;
    cin >> A >> B >> C >> K;
    if(A > 0){
        if(A < K){
            count += A;
            K -= A;
        }else{      // A > K
            count += K;
            K = 0;
        }
    }
    if(K > 0 && B > 0){
        K -= B;
    }
    if(K > 0 && C > 0){
        count -= K;
    }
    cout << count;
}

Measured memory_bytes: 3676
# 14-Structured_Program_II-Matrix_Multiplication.py

# ????????????

# n??m????????? AA ??¨ m??l????????? B ?????\??????????????????????????§?????? n??l ????????? C ???????????????
# ????????°????????????????????????????????????
# ?????? C ??????????´? cij ????¬?????????§??????????????????

# cij=???{k=1,m}aik bkj
# ????????§???A???B???C ??????????´???????????????? aij???bij???cij ??¨????????????

# Input
# ???????????? n???m???l ????????????????????§?????????????????????
# ?¶?????????? n??m ????????? A ??¨ m??l ????????? B ????????????????????????

# Output
# n??l ????????? C ???????´? cij ??????????????????????????????
# ???????????£?????????????´?????????????????????§????????£??????????????????

# Constraints
# 1???n,m,l???100
# 0???aij,bij???10000
# Sample Input
# 3 2 3
# 1 2
# 0 3
# 4 5
# 1 2 1
# 0 3 2
# Sample Output
# 1 8 5
# 0 9 6
# 4 23 14

n,m,l = map( int,input().split() )
# print(n,m,l)


a = []
b = []
c=[[0 for i in range(l)] for j in range(n)]

for i in range(n):
	a.append(  list(map( int,input().split() ))  )
for i in range(m):
	b.append(  list(map( int,input().split() ))  )


for i in range(n):
	# print("i:{0}".format(i))
	for j in range(l):
		# print("j:{0}".format(j))
		for k in range(m):
			c[i][j] += a[i][k]*b[k][j]


for i in range(n):
	for j in range(l):
		if j==l-1:
			print("{0}".format(c[i][j]))
		else:
			print("{0} ".format(c[i][j]), end="")

Measured memory_bytes: 9152