akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

template<typename T>
void cout_vec(vector<T> &vec){
    for(int i=0; i<vec.size(); i++){
        if (i!=0){
            cout << ' ';
        }
        cout << vec[i];
    }
    cout << endl;
}

int main(){
    int H, W, N;
    cin >> H >> W >> N;
    int sr, sc;
    cin >> sr >> sc;
    string S, T;
    cin >> S >> T;

    vector<vector<int> > dpLR(N+1,vector<int>(2,0));
    dpLR[N]={1,W};
    vector<vector<int> > dpUD(N+1,vector<int>(2,0));
    dpUD[N]={1,H};

    for(int i=N; i>0; i--){
        if(T[i-1]=='L'){
            dpLR[i][1]=min(W, dpLR[i][1]+1);
        }else if(T[i-1]=='R'){
            dpLR[i][0]=max(1, dpLR[i][0]-1);
        }else if(T[i-1]=='U'){
            dpUD[i][1]=min(H, dpUD[i][1]+1);
        }else if(T[i-1]=='D'){
            dpUD[i][0]=max(1, dpUD[i][0]-1);
        }

        if(S[i-1]=='L'){
            dpLR[i-1][0]=dpLR[i][0]+1;
            dpLR[i-1][1]=dpLR[i][1];
            dpUD[i-1]=dpUD[i];
        }else if(S[i-1]=='R'){
            dpLR[i-1][1]=dpLR[i][1]-1;
            dpLR[i-1][0]=dpLR[i][0];
            dpUD[i-1]=dpUD[i];
        }else if(S[i-1]=='U'){
            dpUD[i-1][0]=dpUD[i][0]+1;
            dpUD[i-1][1]=dpUD[i][1];
            dpLR[i-1]=dpLR[i];
        }else if(S[i-1]=='D'){
            dpUD[i-1][1]=dpUD[i][1]-1;
            dpUD[i-1][0]=dpUD[i][0];
            dpLR[i-1]=dpLR[i];
        }

        //cout << i << ' ' << endl;;
        //cout_vec(dpLR[i-1]);
        //cout_vec(dpUD[i-1]);

        if(dpLR[i-1][0]>dpLR[i-1][1]){
            cout << "NO" << endl;
            return 0;
        }else if(dpUD[i-1][0]>dpUD[i-1][1]){
            cout << "NO" << endl;
            return 0;
        }
    }
    if(dpLR[0][0]<=sc && sc<=dpLR[0][1] && dpUD[0][0]<=sr && sr<=dpUD[0][1]){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}

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

int main(){
  int h,w;
  cin >>h >>w;
  string s[h];
  rep(i,h) cin >>s[i];
  vector<bool> row(h, false);
  vector<bool> col(w, false);
  rep(i,h){
    rep(j,w){
      if(s[i][j]=='#') {
        row[i] = true;
        col[j] = true;
      }
    }
  }
  rep(i,h){
    if(row[i]){
      rep(j,w){
        if(col[j]) cout <<s[i][j];
      }
      cout << endl;
    }
  }
  return 0; 
}

Measured memory_bytes: 3596
import java.util.*;
import java.lang.*;
 
class Main{
  public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = Long.parseLong(sc.next());
      long M = Long.parseLong(sc.next());
      if(N == 1 && M == 1) System.out.println(1);
      else if( N == 1) System.out.println(M-2);
      else if( M == 1) System.out.println(N-2);
      else if(N == 2 || M == 2) System.out.println(0);
      else System.out.println((N-2)*(M-2));
  }
}

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

using namespace std;

int main()
{
	long arr[100005];
	int n;
	long x;
	cin >> n >> x;
	for(int i = 0; i < n; i++) {
		cin >> arr[i];
   	}
   	long long ans = 0;
   	if(arr[0] > x) {
   	 	ans += arr[0] - x;
   	 	arr[0] = x;
   	}
   	for(int i = 1; i < n; i++) {
   		if((arr[i] + arr[i - 1] - x ) > 0) {
   		 	ans += (arr[i] - x + arr[i - 1]);
   		 	arr[i] -= (arr[i] - x + arr[i - 1]) ;
   		}
   	}
   	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
/*
   AUTHOR :- Gaurang_Kothiya
   
   Quote:-" Great things never come from comfort zones."                                                                                                                
*/
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> data_set; 
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long  
#define ld long double
#define f(i,x,n) for(ll i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(ll i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define b_s(a,b)   binary_search( all(a),b)
#define lb(v,n)  lower_bound(all(v) ,n )
#define ub(v,n)  upper_bound( all(v) , n)
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define RE rend()
#define RB rbegin()
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
#define MOD 1000000007

void Solve()
{
	ld r;
	cin>>r;
	
	cout<< 2*PI*r;
	
}


signed main() 
{
	speed		
	
	int q=1;
	//cin>>q;
	
	while(q--)
	Solve();
	
	//cout << "\n\n"<<"Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";
	return 0;
}

 
 

Measured memory_bytes: 3804
def main():
    n = int(input())
    inlis = list(map(int, input().split()))

    total = sum(inlis)

    tmp = 0

    for i in range(n):
        total -= inlis[i]
        tmp += inlis[i] * total 
        tmp %= (10**9 + 7)
    
    ans = tmp % (10**9 + 7)
    print(ans)


if __name__ == "__main__":
    main()

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

int X[102], Y[102], H[102];

int func(int x, int y, int N)
{
    int h = -1;
    
    for(int i=1; i<=N; i++)
    {
        if(H[i] == 0)
            continue;
        
        int currH = H[i] + abs(X[i]  - x) + abs(Y[i] - y);
        
        if(currH == h || h == -1)
            h = currH;
        else
            return -1;
    }
    
    for(int i=1; i<=N; i++)
        if(H[i] == 0)
        {
            if(h - abs(X[i] - x) - abs(Y[i] - y) > 0)
                return -1;
        }
    
    return h;
}

int main() {

    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);
    
    int N;
    cin >> N;
    
    for(int i=1; i<=N; i++)
        cin >> X[i] >> Y[i] >> H[i];
    
    for(int i=0; i<=100; i++)
        for(int j=0; j<=100; j++)
        {
            int h = func(i, j, N);
            
            if(h == -1)
                continue;
            
            cout << i << " " << j << " " << h << "\n";
            return 0;
        }
    
    return 0;
}

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

class Program
{
    static void Main(string[] args)
    {
        var sol = new Solve();
        sol.Exec();
    }
}

class Solve
{
    public void Exec()
    {
        var card = new int[3][];
        for (var i = 0; i < 3; i++)
            card[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

        var N = int.Parse(Console.ReadLine());
        for (var i = 0; i < N; i++)
        {
            var x = int.Parse(Console.ReadLine());
            for (var j = 0; j < 3; j++)
            {
                for (var k = 0; k < 3; k++)
                {
                    if (card[j][k] == x) card[j][k] = 0;
                }
            }
        }

        var bingo = false;
        for (var i = 0; i < 3; i++)
        {
            if (card[i].Sum() == 0)
                bingo = true;
        }

        for (var i = 0; i < 3; i++)
        {
            var sum = 0;
            for (var j = 0; j < 3; j++)
                sum += card[j][i];

            if (sum == 0)
                bingo = true;
        }

        if (card[0][0] == 0 && card[1][1] == 0 && card[2][2] == 0) bingo = true;
        if (card[0][2] == 0 && card[1][1] == 0 && card[2][0] == 0) bingo = true;

        Console.WriteLine(bingo ? "Yes" : "No");
    }
}

public class Util
{
}


Measured memory_bytes: 13396
#include<stdio.h>
#include<stdlib.h>
long long fun(long long ,long long );
long long fun(long long n,long long m)
{
    if(2*n>=m)
    {
        return m/2;
    }
    m=m-n*2;
    m=m/4;
    return m+n;
}
int main()
{
    long long n,m;
    scanf("%lld%lld",&n,&m);
    printf("%lld\n",fun(n,m));
    return 0;
}

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

using namespace std;

void solve() {
    int N, M;
    cin >> N >> M;
    vector<int> L(M, 0);
    for (int i = 0; i < M; i++) {
        int k, s;
        cin >> k;
        for (int j = 0; j < k; j++) {
            cin >> s;
            L[i] |= (1 << (s-1));
        }
    }
    vector<int> p(M);
    for (int i = 0; i < M; i++) {
        cin >> p[i];
    }
    
    int ans;
    ans = 0;
    for (int bit = 0; bit < (1<<N); ++bit) {
        int cnt;
        cnt = 0;
        for (int i = 0; i < M; i++) {
            if(__builtin_popcount(bit & L[i])%2 == p[i]){
                cnt++;
            }
        }
        if(cnt == M) {
            ans ++;
        }
    }
    
    cout << ans << endl;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 3580
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<math.h>
#include<map>
#include<bitset>
#include<iomanip>
#include<queue>
#include<functional>
#include<stack>
#include<tuple>
#include<cassert>
using namespace std;

#define rep(i, n) for (long long i = 0; i < (long long)(n); ++i)
using P = pair<long long, long long>;

int main() {
  long long N, K;
  cin >> N >> K;
  long long s = N % K;
  long long t = K - s;
  long long ans = min(s, t);
  cout << ans << endl;
  return 0;
}


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

int nlist[10010];

int parent(int i){
  if(nlist[i] == i) return i;
  return (nlist[i]=parent(nlist[i]));
}

int main(){
  int n,q;
  cin>>n>>q;
  for(int i=0;i<n;i++){
    nlist[i]=i;
  }
  for(int i=0;i<q;i++){
    int com,x,y;
    cin>>com>>x>>y;
    int xp=parent(x);
    int yp=parent(y);
    if(com == 0){
      nlist[xp] = yp;
    }else{
      cout<<(xp == yp)<<endl;
    }
  }
  return 0;
}

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

int primes[30010];

int main() {
    memset(primes, 0, sizeof(primes));

    primes[0] = primes[1] = 1;
    for(int i=4; i<=30000; i+=2) primes[i] = 1;
    for(int i=3; i*i<=30000; i+=2)
        if(primes[i] == 0)
            for(int j=2; i*j<=30000; ++j)
                primes[i*j] = 1;

    int t;
    while(cin>>t, t) {
        int ans = 0;
        for(int i=2; i<=t; ++i) {
            if(primes[i]) continue;
            for(int j=i; i+j<t; ++j) {
                if(primes[j]) continue;
                int k = t - i - j;
                if(k <= 0) break;
                if(primes[k]) continue;
                if(!(i<=j && j<=k)) continue;
                if(i+j <= k) continue;
                ans++;
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 984
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cstring>
#include <string>
#include <stack>
#include <tuple>

using namespace std;
typedef long long ll;

ll ans = 0;
string s;

int main()
{
    string s;
    cin >> s;
    for (int i = 0; i < s.size() - 1; i++)
    {
        if (s[i] == s[i + 1])
        {
            cout << i + 1 << " " << i + 2 << endl;
            return 0;
        }
    }
    for (int i = 0; i < s.size() - 2; i++)
    {
        if (s[i] == s[i + 2])
        {
            cout << i + 1 << "  " << i + 3 << endl;
            return 0;
        }
    }
    cout << "-1 -1" << endl;
    return 0;
}

Measured memory_bytes: 512
a,b,c,d=map(int,input().split())

def gcd(x,y):
    if x<y:
        x,y=y,x
    #x>y
    if y==0:
        return x
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)

def lcm(x,y):
    return x*y//gcd(x,y)
ab = b-a+1
a= a-1
cd = lcm(c,d)
a_count = (a//c)+(a//d)-(a//cd)
b_count = (b//c)+(b//d)-(b//cd)

print(ab-(b_count-a_count))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;
int main(void){
    int h,w; cin>>h>>w;
    vector <vector<ll>> d(10 ,vector <ll>(10,INF));
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            cin>>d[i][j];
        }
    }
    
    for(int k=0;k<10;k++){
        for(int i=0;i<10;i++){
            for(int j=0;j<10;j++){
                chmin(d[i][j],d[i][k]+d[k][j]);
            }
        }
    }
    ll ans = 0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            int a;
            cin>>a;
            if(abs(a)==1) continue;
            else ans+= d[a][1];
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <memory.h>

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

#define mod 1000000007

int main() {
	int n;
	cin >> n;
	vector<vector<int> > graph(n * n);
	vector<int> indegree(n * n, 0);
	for (int i = 0; i < n; i++) {
		int preva = -1;
		for (int j = 0; j < n - 1; j++) {
			int a;
			cin >> a;
			a--;
			if (preva == -1) {
				preva = a;
				continue;
			}
			int prev = n * min(i, preva) + max(i, preva);
			int now = n * min(i, a) + max(i, a);
			graph[prev].push_back(now);
			indegree[now]++;
			preva = a;
		}
	}
	queue<int> qu;
	vector<int> result(n * n, -1);
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (indegree[n * i + j] == 0) {
				qu.push(n * i + j);
				result[n * i + j] = 1;
			}
		}
	}
	int ans = 1;
	while (!qu.empty()) {
		int now = qu.front();
		qu.pop();
		for (int i = 0; i < graph[now].size(); i++) {
			int next = graph[now][i];
			indegree[next]--;
			if (indegree[next] == 0) {
				qu.push(next);
				result[next] = result[now] + 1;
				ans = max(ans, result[next]);
			}
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (result[n * i + j] == -1) {
				cout << -1 << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
}

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

using namespace std;
typedef int64_t ll;
typedef uint64_t ull;
typedef long double ld;

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

	int a, b;
	cin >> a >> b;
	int res = 0;
	int outlet = 1;
	
	while(outlet < b) {
		--outlet;
		outlet += a;
		++res;
	}
	
	cout << res;

	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << " ms.\n";
}

// g++ o .cpp -O2 -std=c++11 -D cute -Wall -Wno-unused-result



Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main{
/// functions
static long gcd(long a,long b){if(b==0){return a;}return gcd(b,a%b);}
static long Modpow(long a,long p,long m){long res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}
static long Modmul(long a,long b,long m){return ((a%m)*(b%m))%m;}
static long ModInv(long a,long m){return Modpow(a,m-2,m);}
static long nck(int n,int r,long m){if(r>n){return 0l;}return Modmul(f[n],ModInv(Modmul(f[n-r],f[r],m),m),m);}
// end
static long[] f;
// taking inputs
static BufferedReader s;
static BufferedWriter out;
static String read() throws IOException{String line="";while(line.length()==0){line=s.readLine();continue;}return line;}
static int int_v (String s1){return Integer.parseInt(s1);}
static long long_v(String s1){return Long.parseLong(s1);}
static int[] int_arr() throws IOException{String[] a=read().split(" ");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}
static long[] long_arr() throws IOException{String[] a=read().split(" ");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}
static void assign(){s=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}
// ends
//......................................@uthor_Alx..............................................

public static void main(String[] args) throws  IOException{
       assign();
      int[] ab=int_arr();
      int x=1251; int res=-1;
      for(int i=1;i<x;i++){
      	int c1=(i*8)/100;
      	int c2=(i*10)/100;
      	if(c1==ab[0]&&c2==ab[1]){res=i;break;}
      }
     out.write(res+"\n");
             
        out.flush();
  }
}


Measured memory_bytes: 22740
N, K, S = map(int,input().split())
ans = []
for k in range(K):
    ans.append(S)
if S < 10**9:
    for k in range(K,N):
        ans.append(10**9)
else:
    for k in range(K,N):
        ans.append(10**9-1)
print(*ans)


Measured memory_bytes: 49264
function Main(input){
    //console.log(input.split("\n"));
    input = input.split("\n");
    //console.log(input);

    //console.log(typeof input[0] + " " + input[0]);

    var N = parseInt(input[0],10);
    //console.log(typeof N + " " + N);

    input.shift();
    //console.log(input);
    var w = input;

    for(var i = 0; i < N; i++){
        for(var j = i + 1; j < N; j++){
            if(w[i] === w[j]){
                console.log("No");
                return;
            }
        }
    }

    for(var i = 0; i < N - 1; i++){
        if(w[i].slice(-1) !== w[i + 1].slice(0,1)){
            console.log("No");
            return;
        }
    }

    console.log("Yes");

}

Main(require("fs").readFileSync("/dev/stdin","utf8"));

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

int main(){
    int n;
    cin >> n;
    vi a(n);
    rep(i,n) cin >> a[i];
    int sum = 0;
    rep(i,n) sum += a[i];
    int x = sum/n;
    int y = (sum+n-1)/n;
    ll X=0,Y=0;
    rep(i,n){
        X += (x-a[i]) * (x-a[i]);
        Y += (y-a[i]) * (y-a[i]);
    }
    cout << min(X,Y) << endl;
}

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

int N,S,T;
int A[3000],B[3000];

int dp[3001];
int main(){
    cin>>N>>T>>S;
    for(int i=0;i<N;i++)cin>>A[i]>>B[i];
    for(int i=0;i<N;i++){
        for(int j=T;j>0;j--){
            dp[j]=max(dp[j],dp[j-1]);
            if(j-B[i]<0||(j-B[i]<S&&j>S))continue;
            dp[j]=max(dp[j],dp[j-B[i]]+A[i]);
        }
    }

    cout<<*max_element(dp,dp+T+1)<<endl;
    return 0;
}

Measured memory_bytes: 1196
#define lp(i,n) for(int i=0;i<n;i++)
#define pau system("pause")
#include<bits/stdc++.h>

using namespace std;
int main() {
  int a[5],k;
  lp(i,5)
    cin>>a[i];
  cin>>k;
  for(int i=0;i<5;i++){
      for(int j=i+1;j<5;j++){
          if(abs(a[i]-a[j])>k){
                cout<<":("<<endl;
                return 0;
          }
      }
  }
  cout<<"Yay!"<<endl;
}


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

using namespace std;

#define int long long
int mod = 998244353;
int const maxn = 3005;
int a[maxn], dp[maxn][maxn];

main() {
#ifdef HOME
    freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, s;
    cin >> n >> s;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    dp[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= s; ++j) {
            if (j < a[i]) dp[i][j] = dp[i - 1][j] * 2 % mod;
            else {
                dp[i][j] = (dp[i - 1][j] * 2 + dp[i - 1][j - a[i]]) % mod;
            }
        }
    }
    cout << dp[n][s] << '\n';
    return 0;
}



Measured memory_bytes: 74048
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,k,h=0,ans=0;
    cin>>a>>b;
    k=1;
    while(k!=0)
    {
        k=max(a,b)%min(a,b);
        a=min(a,b);
        b=k;
    }
    k=a;
    if(k==1)
    {
        cout<<1;
        return 0;
    }
    if(k==2||k==3)
    {
        cout<<2;
        return 0;
    }
    for(int i=2;i<sqrt(a)+1;i++)
    {
        while(k%i==0)
        {
            k=k/i;
            h=1;
        }
        if(h==1)
        {
            ans++;
        }
        h=0;
    }
    if(k==1)
    {
        cout<<ans+1;
    }
    else
    {
        cout<<ans+2;
    }


}


Measured memory_bytes: 256
#include <stdio.h>

 
int main(void)
{
	int  a,b;
	
	scanf("%d" , &a);
	scanf("%d" , &b);
	
	if(a==b){
		printf("a == b\r\n");		
	}
	else if(a > b){
		printf("a > b\r\n");		
	}
	else{
		printf("a < b\r\n");		
	}


	 return 0;	 
}

Measured memory_bytes: 580
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main{
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(isr);
		String string;
		int n, a, b, max;
		
		while(!(string = reader.readLine()).equals("0")){
			n = Integer.valueOf(string);
			max = 0;
			int Caliburne[] = new int[]{0, 1 << 29};
			int cost[][] = new int[10][10];
			for(int i = 0; i < 10; i++){ Arrays.fill(cost[i], 1 << 29); }
			for(int i = 0; i < n; i++){
				String str[] = reader.readLine().split(" ");
				a = Integer.valueOf(str[0]);
				b = Integer.valueOf(str[1]);
				max = Math.max(max, Math.max(a, b));
				cost[a][b] = cost[b][a] = Integer.valueOf(str[2]);
			}
			for(int k = 0; k < 10; k++){
				for(int i = 0; i < 10; i++){
					for(int j = 0; j < 10; j++){
						cost[i][j] = Math.min(cost[i][j], cost[i][k] + cost[k][j]);
					}
				}
			}
			for(int i = 0; i <= max; i++){ cost[i][i] = 0; }
			int res[] = new int[max + 1];
			for(int i = 0; i <= max; i++){
				for(int j = 0; j <= max; j++){
					res[i] += cost[i][j];
				}
				if(res[i] < Caliburne[1]){
					Caliburne[1] = res[i];
					Caliburne[0] = i;
				}
			}
			System.out.println(Caliburne[0] + " " + Caliburne[1]);
		}
		reader.close();
	}
}

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

typedef long long int ll;
typedef pair<int,int> pi;
priority_queue<pi, vector<pi>, greater<pi> > pq; //min heap

ll mini(ll a,ll b){	return a<b?a:b;}
ll maxi(ll a,ll b){	return a>b?a:b;}
ll gcd(ll a,ll b){	if(b == 0)	return a;return gcd(b,a%b);}
ll binpow(ll n,ll x){	ll ans = 1;while(x){if(x & 1)	ans *= n;n *= n;x >>= 1;}return ans;}

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

    int n,k;
    cin>>n>>k;

    vector<int> A(n+4,0), cost(n+4,0);

    for(int i=1;i<=n;++i)   cin>>A[i];

    cost[0] = 1200000000;
    cost[1] = 0;
    cost[2] = abs(A[2]-A[1]);

    int curmin;

    for(int i=2;i<=n;++i){
        curmin = cost[i-1] + abs(A[i] - A[i-1]);
        for(int j=1;j<=k && i-j>=1; ++j) curmin = min(cost[i-j] + abs(A[i] - A[i-j]), curmin);
        cost[i] = curmin;
    }

    cout<<cost[n]<<"\n";

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define maxn -20000000000 //negative value to break code and force you to put right constraint
#define mod 1073741824
#define md(x) (x) % mod;
#define sc scanf
#define pr printf
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ps push
#define prt(x) cout << (#x) << " is " << (x) << endl
#define EPS 1e-9
#define INF 100000000000
#define INFd 1e9
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<double> vd;

vector<ll> adj[100005];
vector<ll> vis(100005,false);
vector<ll> dist(100005,0);
void dfs(ll s)
{
	vis[s]=true;
	for(ll i=0;i<adj[s].size();i++)
	{
		ll v=adj[s][i];
		if(!vis[v])
			dfs(v);
			dist[s]=max(dist[s],1+dist[v]);
		
	}
}

int main()
{
	ll n,m;
	cin>>n>>m;
	
	for(ll i=0;i<m;i++)
	{
		ll x,y;
		cin>>x>>y;
		adj[x].pb(y);
	}
	for(ll i=1;i<=n;i++)
	{
		if(!vis[i])
			dfs(i);
	}
	cout<<*max_element(dist.begin(),dist.end());
}

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

typedef long long int ll;
typedef long double ld;

#define Pb push_back
#define Mp make_pair

#define ff first
#define ss second

#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))

#define INF LONG_LONG_MAX
#define MINF LONG_LONG_MIN

#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define db1(x) cout<<#x<<" : "<<x<<endl;
#define db2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
#define db3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;


void solve()
{
  ll n,k;
  cin >> n >> k;
  ll a[n+1];
  for(ll i=1;i<=n;i++)  cin >> a[i];
  vector<ll> w;
  vector<bool> vis(n+5,0);
  w.Pb(1);
  vis[1]=1;
  ll i = 1;
  while(vis[a[i]] == 0)
  {
    vis[a[i]] = 1;
    w.Pb(a[i]);
    i = a[i];
  }
  ll val = a[i];
  //w.Pb(a[i]);
  //for(int xx : w) cout << xx << " ";
  //cout << endl;
  ll cnt = 0;
  //cout << w.size() << endl;
  vector<ll> per;
  for(int cn = 0;cn < w.size() ;cn++)
  {
    if(w[cn] == val)
    {
        for(int nw = cn;nw<w.size();nw++)per.Pb(w[nw]);
        break;
    }
    cnt++;
  }
  //per.Pb(val);
  //for(int xx : per) cout << xx << " ";
  int nn = per.size();
  //db2(val,cnt);
  //for(int xxx : per) cout << xxx << " ";
  //cout << endl;
  if(k<=(cnt))  cout << w[k];
  else
  {
    k-=(cnt);
    int idx = k%nn;
    //db2(k,idx);
    cout << per[idx];
  }
}

signed main()
{
  IOS;
  //freopen("input.txt", "rt", stdin);
  //freopen("output.txt", "wt", stdout);
  int t=1;
  //cin >> t;
  while(t--)
  {
    solve();
  }
  return 0;
}
/*==============================================================================================================================================================*/


Measured memory_bytes: 9256
#include <iostream>
#include <stdio.h>
#include <string>
#include <map>
#include <stack>
#include <vector>
#include <string.h>
#include <set>
#include <queue>
#include <cmath>
#include <algorithm>

using namespace std;

struct node
{
	int x;
	int y;
	int dist;

	node(int x , int y , int dist)
	{
		this -> x = x;
		this -> y = y;
		this -> dist = dist;
	}
};

bool vis[1010][1010];
char input[1010][1010];
int dx[4] = {- 1 , 0 , 1 , 0};
int dy[4] = {0 , 1 , 0 , - 1};
queue<node> q;

bool inArea(int x , int y , int n , int m)
{
	return x >= 0 && x < n && y >= 0 && y < m;
}

int solve(int sx , int sy , int h , int w , int n)
{
	while (!q.empty())
		q.pop();

	int value = 1;
	q.push(node(sx , sy , 0));
	vis[sx][sy] = true;

	while (!q.empty())
	{
		node no = q.front();
		q.pop();

		if (input[no.x][no.y] >= '0' && input[no.x][no.y] <= '9' && ((input[no.x][no.y] - '0') == value))
		{
			value ++;
			if (value == n + 1)
				return no.dist;

			while (!q.empty())
				q.pop();

			for (int i = 0;i < h;i ++)
				for (int j = 0;j < w;j ++)
					vis[i][j] = false;
			vis[no.x][no.y] = true;
		}
		for (int i = 0;i < 4;i ++)
		{
			int tx = no.x + dx[i];
			int ty = no.y + dy[i];
			if (inArea(tx , ty , h , w) && !vis[tx][ty] && input[tx][ty] != 'X')
			{
				vis[tx][ty] = true;
				q.push(node(tx , ty , no.dist + 1));
			}
		}
	}
	return - 1;
}

int main()
{
	int i , j , h , w , n;
	while (scanf("%d%d%d" , &h , &w , &n) != EOF)
	{
		for (i = 0;i < h;i ++)
			for (j = 0;j < w;j ++)
				vis[i][j] = false;

		int sx , sy;
		for (i = 0;i < h;i ++)
		{
			scanf("%s" , input[i]);
			for (j = 0;j < w;j ++)
			{
				if (input[i][j] == 'S')
				{
					sx = i;
					sy = j;
				}
			}
		}

		// ???S????§????
		printf("%d\n" , solve(sx , sy , h , w , n));
	}
	return 0;
}

Measured memory_bytes: 3192
program main
  
  implicit none
  integer,allocatable :: a(:)
  integer :: i,n
  real(8) :: tmp
  
  read(*,*) n
  allocate( a(n) )
  read(*,*) a
  
  tmp = 0e0
  do i = 1, n
    tmp = tmp + 1d0 / real( a(i), kind = 8)
  end do
  
  print*, 1d0/tmp
end program main


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, Q, S, T;
ll data[200006];
ll sa[200005] = {};
ll sum = 0;
 
inline ll calc(ll x, ll y)
{
    if(x > 0) {
        if(y > 0) return ((x - y) * S);
        else return (x * S - y * T);
    } else {
        if(y > 0) return (x * T - y * S);
        else return ((x - y) * T);
    }
}
int main()
{
    cin >> N >> Q >> S >> T;
     
    for(int i = 0; i <= N; i++) {
        scanf("%lld", &data[i]);
    }
    for(int i = 0; i < N; i++) {
        sa[i] = data[i + 1] - data[i];
        if(sa[i] > 0) {
            sum -= S * sa[i];
        } else {
            sum -= T * sa[i];
        }
    }
    while(Q--) {
        ll l, r, x;
        scanf("%lld %lld %lld", &l, &r, &x); l--;
        sum += calc(sa[l], sa[l] + x);
        sa[l] += x;
        if(r < N) {
            sum += calc(sa[r], sa[r] - x);
            sa[r] -= x;
        }
        printf("%lld\n", sum);
    }
    return (0);
}

Measured memory_bytes: 6344
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <tuple>

using namespace std;
using tiii = tuple<int, int, int>;

int main(){
	ios_base::sync_with_stdio(false);
	int a, b, c;
	cin >> a >> b >> c;
	set<tiii> s;
	s.emplace(a, b, c);
	int answer = 0;
	while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0){
		const int x = b / 2 + c / 2;
		const int y = a / 2 + c / 2;
		const int z = a / 2 + b / 2;
		if(s.find(tiii(x, y, z)) != s.end()){
			answer = -1;
			break;
		}
		a = x; b = y; c = z;
		++answer;
	}
	cout << answer << endl;
	return 0;
}



Measured memory_bytes: 256
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq as hq
import itertools as its
import operator as op


# globals
inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    s = get_str()
    a = 0
    i = 0
    ans = 0
    while i < len(s):
        if s[i] == 'A':
            a += 1
            i += 1
            continue
        if a > 0 and i < len(s) - 1 and s[i:i+2] == 'BC':
            ans += a
            i += 2
            continue
        a = 0
        i += 1
    print(ans)
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()


Measured memory_bytes: 65516
#include <iostream>
#include <string>
using namespace std;
#define ll long long
const ll mod = 1e9 + 7;
const ll N = 1e5 + 5;
ll dp1[N]; //dp1[i] 已经确定前k位 同时已知A+B<=L
ll dp2[N]; //dp2[i] 已经确定前k位 同时未知是否符合
string l;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> l;
    int len = l.length();
    dp1[0] = 0;
    dp2[0] = 1;
    for (int i = 0; i < len; i++)
    {
        if (l[i] == '0')
        {
            dp1[i + 1] = 3 * dp1[i] % mod;
            dp2[i + 1] = dp2[i];
        }
        else
        {
            dp1[i + 1] = (3 * dp1[i] + dp2[i]) % mod; // + 0 0
            dp2[i + 1] = (2 * dp2[i]) % mod;          //0 1  1 0
        }
    }
    cout << (dp1[len] + dp2[len]) % mod << endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 2248
from collections import Counter

def main():

  s=input()
  n=len(s)
  res=0
  t=[0]*(n+1)
  k=1
  for i in range(1,n+1):
      t[n-i]=(t[n-i+1]+int(s[n-i])*k)%2019
      k*=10
      k=k%2019
  d=Counter(t)
  for i in d.values():
      if i<2:
        continue
      res+=i*(i-1)/2
  print(int(res))

if __name__ == '__main__':
  main()


Measured memory_bytes: 16664
# coding:utf-8


def main():
    N = int(input())
    # N, M = map(int, input().split())
    D = list(map(int, input().split()))
    ans = 0

    if N % 2 == 1:
        print(0)
        return
    D.sort()
    if D[N//2] == D[N//2 - 1]:
        print(0)
        return

    # print(D)
    ans = len(range(D[N//2 - 1] + 1, D[N//2]+1))
    print(ans)
    return


if __name__ == "__main__":
    main()


Measured memory_bytes: 53332
#include <iomanip>
#include <iostream>
 
using namespace std;
 
int main()
{ 
	ios::sync_with_stdio(0);
	cin.tie(0);

	double a, b, c, d, e, f;

	while (cin >> a >> b >> c >> d >> e >> f)
	{
		// matrix
		double y = (d * c - a * f) / (d * b - a * e);
		double x = (c - b * y) / a;
		cout << setprecision(3) << fixed << x << " " << y << endl;
	}

	return 0;
}

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

void fnInput(int &rnElmCnt, vector<int> &rvnElm, int &rnTrgCnt , vector<int> &rvnTrg )
{
  cin >> rnElmCnt;

  rvnElm.resize(rnElmCnt);
  for (int i = 0; i < rnElmCnt; i++)
    cin >> rvnElm[i];

  cin >> rnTrgCnt;

  rvnTrg.resize(rnTrgCnt);
  for (int i = 0; i < rnTrgCnt; i++)
    cin >> rvnTrg[i];
}

int fnRcsSch(int nPos, int nTrg, const vector<int> &cnrvnElm, vector<vector<int>> &rvvnOK)
{
  if (!nTrg)                    return 1;
  if (nTrg < 0)                 return 0;
  if (nPos == cnrvnElm.size())  return 0;
  if (rvvnOK[nPos][nTrg] != -1) return rvvnOK[nPos][nTrg];

  if (fnRcsSch(nPos + 1, nTrg, cnrvnElm, rvvnOK))
    rvvnOK[nPos][nTrg] = 1;
  else if (fnRcsSch(nPos + 1, nTrg - cnrvnElm[nPos], cnrvnElm, rvvnOK))
    rvvnOK[nPos][nTrg] = 1;
  else
    rvvnOK[nPos][nTrg] = 0;

  return rvvnOK[nPos][nTrg];
}

void fnExhSch(const vector<int> &cnrvnElm, const vector<int> &cnrvnTrg)
{
  vector<vector<int>> vvnOK(21, vector<int>(2001, -1));
  
  for (int i = 0; i < cnrvnTrg.size(); i++)
  {
    int nTrg = cnrvnTrg[i];
    int nRtn;

    if (nRtn = fnRcsSch(0, nTrg, cnrvnElm, vvnOK))
      cout << "yes" << endl;
    else
      cout << "no" << endl;
  }
}

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

  int nElmCnt, nTrgCnt;
  vector<int> vnElm, vnTrg;

  fnInput(nElmCnt, vnElm, nTrgCnt, vnTrg);
  fnExhSch(vnElm, vnTrg);

  return 0;
}

Measured memory_bytes: 1344
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <fstream>

using namespace std;

#define ll long long
#define INF 2000000000
#define LINF 9000000000000000000
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define dum(x) cout<<#x<<'='<<x<<endl
#define dum2(x,y) cout<<#x<<'='<<x<<' '<<#y<<'='<<y<<'\n'<<endl
#define dum3(x,y,z) cout<<#x<<'='<<x<<' '<<#y<<'='<<y<<' '<<#z<<'='<<z<<'\n'<<endl
#define darr(arr,n) rep(i,(n-arr)){cout<<*(arr+i)<<' ';}cout<<endl
#define ddarr(arr,a,b) rep(i,a){rep(j,b){cout<<*(arr+i*b+j)<<' ';}cout<<endl;}
#define ddd ifstream in("Text.txt");cin.rdbuf(in.rdbuf());


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

    if (abs(N - M) > 1) {
        cout << 0 << endl;
        return 0;
    }


    ll ans = 1;
    for (int i = 1; i <= N; i++) {
        ans *= i;
        ans %= 1000000007;
    }
    for (int i = 1; i <= M; i++) {
        ans *= i;
        ans %= 1000000007;
    }
    if (N == M) {
        cout << ans * 2 % 1000000007 << endl;
    }
    else cout << ans << endl;

}

Measured memory_bytes: 256
n=int(input())
s=str(input())
ans=[]
e=s.count("E")
w=0
for i in range(n):
    if s[i]=="W":
        ans.append(w+e)
        w+=1    
    else:
        e-=1 
        ans.append(w+e)
print(min(ans))    
    

Measured memory_bytes: 15520
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long ll;
ll a[30005];
ll __gcd(ll a,ll b)
{
    if(a==0)
    {
        return b;
    }
    return __gcd(b%a,a);
}
ll __lcm(ll aa,ll bb)
{
    ll gg=__gcd(aa,bb);
    ll pdt=1LL*aa*bb;
    ll lcm=pdt/gg;
    return lcm;
}
int main()
{
    ll n;
    cin>>n;
    ll sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        a[i]--;
        sum+=a[i];
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using P = pair<int, int>;

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

int main() {
  int n;
  cin >> n;
  map<P, int> mp;
  vector<int> x(n), y(n), w(n);
  REP(i, n) {
    cin >> x[i] >> y[i] >> w[i];
    mp[P(x[i], y[i])] = w[i];
  }
  int ans = 0;
  REP(i, n) {
    REP(j, 4) {
      P cur = {x[i] + dx[j] - 1, y[i] + dy[j] - 1};
      int s = 0;
      REP(k, 4) {
        P nxt = {cur.first + dx[k], cur.second + dy[k]};
        s += mp[nxt];
      }
      ans = max(ans, s);
    }
  }
  cout << ans << " / 1" << endl;
}



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

using namespace std;

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

 
}

Measured memory_bytes: 3592
# Contest No.: M-SOLUTIONS Programming Contest 2020
# Problem No.: D
# Solver:      JEMINI
# Date:        20200725

import sys
import heapq

def main():
    n = int(input())
    nums = list(map(int, sys.stdin.readline().split()))

    money = 1000
    stock = 0
    minVal = nums[0]
    maxVal = nums[0]

    if n == 2:
        if nums[0] < nums[1]:
            money = 1000 - (1000 // nums[0]) * nums[0]
            stock = (1000 // nums[0])

            print(money + stock * nums[1])
        else:
            print(1000)
        return

    upFlag = False
    downFlag = False
    # if nums[0] < nums[1]:
    #     upFlag = True
    
    # elif nums[0] > nums[1]:
    #     downFlag = True
    money = 1000
    stock = 0
    for i in range(n - 1):
        # print(upFlag, downFlag)
        # print(money, stock)
        # local minimum
        if nums[i] < nums[i + 1]:
            if upFlag:
                continue
            else:
                # buy
                tempStock = money // nums[i]
                stock += tempStock
                money -= tempStock * nums[i]
                downFlag = False
                upFlag = True
        # local maximum
        if nums[i] > nums[i + 1]:
            if downFlag:
                continue
            else:
                # sell
                money += stock * nums[i]
                stock = 0
                downFlag = True
                upFlag = False
        # print(upFlag, downFlag)
        # print(money, stock)
    


    if stock:
        money += stock * nums[-1]

    print(money)
    return

if __name__ == "__main__":
    main()

Measured memory_bytes: 62484
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv) {
  int ans[3] = {-1, -1, -1};
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int s, c;
    scanf("%d %d", &s, &c);
    if (ans[s - 1] != -1 && ans[s - 1] != c) {
      printf("-1\n");
      return 0;
    }
    ans[s - 1] = c;
  }
  if (n > 1 && ans[0] == 0) {
    printf("-1\n");
    return 0;
  }
  if (n > 1 && ans[0] == -1)
    ans[0] = 1;
  for (int i = 0; i < n; i++) {
    printf("%d", ans[i] == -1 ? 0 : ans[i]);
  }
  printf("\n");
  return EXIT_SUCCESS;
}


Measured memory_bytes: 128
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    int n,p[30],sum=0;
    cin>>n>>p[0]>>p[1];

    for(int i=2;i<n;++i){
        cin>>p[i];
        if((p[i-1]-p[i])*(p[i-1]-p[i-2])<0)++sum;
    }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=998244353;

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

signed main(){
	int a,b;
	cin >> a >> b;
	if((b - a) % 2) cout << "IMPOSSIBLE" << endl;
	else cout << (a + b) / 2 << endl;
}

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

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

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

  int n = 0;  int current = 0;
  sort(d,d+N);
  for(int i=0; i<N; i++){
    if(d[i]>current)
      n++;
    current = d[i];
  }

  cout << n << endl;

  return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

/* ======IO====== */
var (
	InputString func() string
)

func init() {
	InputString = newInputString(os.Stdin)
}

func newInputString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("error scan")
		}
		return r.Text()
	}
}

func InputInt() int {
	return int(readInt64())
}
func InputInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func InputInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func InputInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(InputString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func InputIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = InputInt()
	}
	return b
}

func InputFloat64() float64 {
	return float64(inputFloat64())
}

func inputFloat64() float64 {
	f, err := strconv.ParseFloat(InputString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func InputFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = InputFloat64()
	}
	return b
}

func InputRuneSlice() []rune {
	return []rune(InputString())
}

/* ======Math====== */
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

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

/* ======Util====== */

func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic("strtoi error")
	} else {
		return i
	}
}

//
//type sortable [][]int
//
//func (s sortable) Len() int { return len(s) }
//
//func (s sortable) Less(i, j int) bool { return s[i][0] < s[j][0] }
//
//func (s sortable) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

func main() {
	N, K, Q := InputInt3()
	as := make([]int, N)
	for i, _ := range as {
		as[i] = 0
	}

	for i := 0; i < Q; i++ {
		a := InputInt()
		as[a-1] += 1
	}

	for _, x := range as {
		makeCount := Q - x
		if makeCount >= K {
			fmt.Println("No")
		} else {
			fmt.Println("Yes")
		}
	}
}


Measured memory_bytes: 3968
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF=20000000000;
//setprecision(2) <<

const int MOD = 1000000007;

long long max(long long a,long long b){
	if(a<b)return b;
	else return a;	
}
long long min(long long a,long long b){
	if(a>b)return b;
	else return a;	
}
long long gcd(long long a,long long b){
	if(a<b)swap(a,b);
	if(a%b==0)return b;
	else return gcd(a%b,b);
}

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

long long com(long long n,long long k){
	
}
long long getDigit(long long n){
	if(n==1)return 1;
	else return log10(n)+1;
}
class G{
	long long node;
	long long w;
	
};
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	long long N;
	cin>>N;
	long long X1,X2,X3,X4,X6,X5;
	X1=0;
	X2=0;
	X3=(N / (pow(10,9)) )+1;
	X6=pow(10,9);
	
	long long d=(X3*X6-N);
	X4=1;
	X5=d;
	if(N==(long long)pow(10,18)){
		X1=0;
		X2=0;
		X3=pow(10,9);
		X4=0;
		X5=0;
		X6=pow(10,9);
	}
	cout<<X1<<endl;
	cout<<X2<<endl;
	cout<<X3<<endl;
	cout<<X4<<endl;
	cout<<X5<<endl;
	cout<<X6<<endl;
	//cout<<pow(10,18);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>//懒人专用头文件
#define rpt(n) for(register int ttxyc=0;ttxyc<n;++ttxyc)//宏定义
using namespace std;
inline int read()//快读
{
	register int x=0,t=0;register char c=getchar();
	for(;c<'0'||c>'9';t|=c=='-',c=getchar());
	for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+(c^48),c=getchar());
	return t?-x:x;
}
int n,k,a[200000],b,ans;map<int,int>mmp;
main()
{
	n=read();k=read();
	rpt(n)++mmp[read()];
	for(map<int,int>::iterator i=mmp.begin();i!=mmp.end();++i)a[b++]=i->second;
	if(b<=k){puts("0");return 0;}
	sort(a,a+b);
	rpt(b-k)ans+=a[ttxyc];
	printf("%d",ans);
}/**/

Measured memory_bytes: 10368
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);


    string s;
    cin>>s;

    
    if((s[0]=='7'||s[1]=='7') || s[2] == '7')
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;
   
//    int t;
//    cin>>t;

//    while(t--)
//    {

//    }

    
}

Measured memory_bytes: 3640