akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

static const int N = 100;
static int M[N + 1][N + 1] = {}, p[N + 1] = {};

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

  int number, count, value;
  for (int i = 0; i < n; i++) {
    cin >> number >> count;
    for (int j = 0; j < count; j++) {
     cin >> value;
     M[number - 1][value - 1] = 1; 
    }
  }

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {    
      if (j != 0) {
        cout << " ";
      }
      cout << M[i][j];
    } 
    cout << endl;
  }

  return 0;
}



Measured memory_bytes: 3120
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) {
    cin >> a[i][j];
    a[i][j]--;
  }
  vector<int> at(n);
  vector<bool> alive(m, true);
  int result = n;
  for (int step = 0; step < m; ++step) {
    vector<int> count(m);
    for (int i = 0; i < n; ++i) count[a[i][at[i]]]++;
    int bestI = 0;
    for (int i = 0; i < m; ++i) if (count[i] > count[bestI]) bestI = i;
    result = min(result, count[bestI]);
    alive[bestI] = false;
    for (int i = 0; i < n; ++i) {
      int j = at[i];
      while (j < m && !alive[a[i][j]]) ++j;
      at[i] = j;
    }
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#pragma warning(disable:4996)
using namespace std;
using ll = long long;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
#define int long long
const ll mod = 1e9 + 7;
ll func(ll n, ll value) {
	vector<vector<ll>>dp(n + 1, vector<ll>(value+1,0));
	for (ll i = 0; i <= n;i++) {
		dp[i][0] = 1;
	}
	for (ll i = 0; i < n; i++) {
		for (int j = 1; j <= value; j++) {
			dp[i + 1][j] = (dp[i + 1][j - 1]%mod + dp[i][j]%mod)%mod;
		}
	}
	return dp[n][value]%mod;
}
map<int, int> prime_factor(int n) {
	map<int, int>res;
	for (int i = 2; i*i <= n; i++) {
		while (n%i == 0) {
			++res[i];
			n /= i;
		}
	}
	if (n != 1)res[n] = 1;
	return res;
}
int n, m;//nが長さ　mは値
signed main() {
	cin >> n >> m;
	map<int,int> ma = prime_factor(m);
	int ans = 1;
	for (auto e : ma) {
		int key, value;
		tie(key, value) = e;
		ans *= func(n, value)%mod;
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}


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

const long long INF = 1LL << 60;

template<class T> inline void chmin(T &a,T b) {
	a = a < b ? a : b;
}

int main() {
	int n{};
	cin >> n;
	long long* h = new long long[n];
	long long* dp = new long long[n];
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		dp[i] = INF;
	}
	dp[0] = 0;
	dp[1] = abs(h[0] - h[1]);

	for (int i = 2; i < n; i++) {
		chmin(dp[i], abs(h[i] - h[i - 1])+dp[i-1]);
		chmin(dp[i], abs(h[i] - h[i - 2])+dp[i-2]);
		//cout << dp[i]<<" ";
	}
	//cout << endl;
	cout << dp[n - 1] << endl;
	delete[] h, dp;
}

Measured memory_bytes: 1792
#include <iostream>

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


string table[8];


void dfs(int x,int y){
	table[y][x]='0';
	//cerr << "check" << endl;
	for(int dx=-3;dx<=3;dx++){
		if(0<=x+dx&&x+dx<8&&table[y][x+dx]=='1'){
			table[y][x+dx]='0';
			dfs(x+dx,y);
		}
	}
	for(int dy=-3;dy<=3;dy++){
		if(0<=y+dy&&y+dy<8&&table[y+dy][x]=='1'){
			table[y+dy][x]='0';
			dfs(x,y+dy);
		}
	}
	return ;
}

int main(void){
	int t;
	cin >> t;
	rep(loop,t){
		rep(y,8) cin >> table[y];
		int bx,by;
		cin >> bx >> by;
		dfs(bx-1,by-1);
		cout << "Data " << loop+1 << ":" << endl;
		rep(y,8)
			cout <<  table[y] << endl;
	}
	return 0;
}

Measured memory_bytes: 1204
#include<bits/stdc++.h>
using namespace std;
#define  ll  long long  //define a macro variable of long long type
# define  loop(x,n)  for(int x = 0; x < n; ++x)  // define a for loop
#define   constloop(x,a,n) for(int x = a; x < n; ++x)  //define a for loop with start a const
#define  revloop(x,a,n)  for(int x = a; x > n; x--) // rev for loop
//#define   vect vector<ll>  // define a vector of longlong type;


const int N=5e+5;
const int M=5e+5;

struct Query
{
  int l,r,index;




}Queries[N];

int arr[N],h[M];



int  main() {

//
//#ifndef ONLINE_JUDGE
//
//   freopen("input.txt", "r", stdin);
//
//   freopen("output.txt", "w", stdout);
//   #endif

   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
int n,m;
cin>>n>>m;
if(m>=n)
{
    cout<<"unsafe "<<endl;
}
else
    cout<<"safe "<<endl;

   return 0;

}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
#define mkp make_pair
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b)for(int i=a;i<b;i++)
#define repre(i,a,b)for(int i=a;i<=b;i++)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp map<int,int>
#define ump unordered_map<int,int>
#define st set<int>
#define mst multiset<int>
#define pq priority_queue
#define mpq priority_queue<int,vector<int>,greater<int> >
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> orderedSet;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> orderedMSet;
//*p.find_by_order(index) return value at index
//p.order_of_key(key) return index
int32_t main()
{
   fastio
   int a,p;
   cin>>a>>p;
   a=a*3;
   cout<<(a+p)/2<<endl;

   return 0;
}


Measured memory_bytes: 256
let () =
  let num = Array.make 100001 0 in
  let sum = ref 0 in
  Scanf.scanf "%d\n" @@ fun n ->
  for i = 0 to n - 1 do
    Scanf.scanf "%d " @@ fun d ->
    num.(d) <- num.(d) + 1; sum := !sum + d
  done;
  Scanf.scanf "%d\n" @@ fun q ->
  for i = 0 to q - 1 do
    Scanf.scanf "%d %d\n" @@ fun b c ->
    sum := !sum + (c - b) * num.(b); num.(c) <- num.(c) + num.(b); num.(b) <- 0;
    Printf.printf "%d\n" !sum
  done;

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

using namespace std;

int main(){
int N; cin >> N; int cnt = 0;
  
  for(int i = 1; i <= N; i++){
    if( 1 <= i && i <= 9){ cnt++;}
    else if( 100 <= i && i <= 999){ cnt++;}
    else if( 10000 <= i && i <= 99999){ cnt++;}
    
  }
  
  cout << cnt << endl; return 0;}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

struct sct
{
	char s;
	int s1;
	int s2;
};

int main()
{
	while(true)
	{
		sct info[5], max;

		for(int i = 0; i < 5; i++)
		{
			cin >> info[i].s1 >> info[i].s2;
			info[i].s = 65 + i;

			if(info[0].s1 == 0 && info[0].s2 == 0)
			{
				return false;
			}
		}

		max = info[0];

		for(int i = 1; i < 5; i++)
		{
			if(max.s1 + max.s2 < info[i].s1 + info[i].s2)
			{
				max = info[i];
			}
		}

		cout << max.s << ' ' << max.s1 + max.s2 << endl;
	}
}

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

using namespace std;

using ll = long long;

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

    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    pair<int, int> max_v(0, 1);

    for (int y1 = 0; 100 * a * y1 <= f; ++y1) {
        int res1 = f - 100 * a * y1;
        for (int y2 = 0; 100 * b * y2 <= res1; ++y2) {
            int res2 = res1 - 100 * b * y2;
            for (int x1 = 0; c * x1 <= res2; ++x1) {
                int res3 = res2 - c * x1;
                for (int x2 = 0; d * x2 <= res3; ++x2) {
                    int x = c * x1 + d * x2;
                    int y = y1 * 100 * a + y2 * 100 * b;

                    if (x <= 0.01 * e * y) {
                        if (max_v.first * (x + y) <= x * max_v.second) {
                            max_v.first = x;
                            max_v.second = x + y;
                        }
                    }
                }
            }
        }
    }

    cout << max_v.second << ' ' << max_v.first << endl;


    return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
#define rep(i,s,n) for(int i=s;i<n;i++)
typedef long long ll;
#define N 100010
#define K 20
ll d[N][K];
int main(){
    rep(i,0,N)rep(j,0,K)d[i][j]=(j==1);
    rep(i,1,N)rep(j,1,K-1)for(ll r=i*2;r<N;r+=i){
	d[r][j+1]+=d[i][j];
    }
    ll n,k;cin>>n>>k;
    if(k>=K){
	cout<<0<<endl;
	return 0;
    }
    ll ans=0;
    rep(i,1,n+1)ans+=d[i][k];
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 18748
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {

    int w,h,x,y,r;
    int flag1 = 0,flag2 = 0;

    cin >> w >> h >> x >> y>> r;

    if((x-r) >= 0 && (x+r) <= w)
        flag1 = 1;
    
    if((y-r) >= 0 && (y+r) <= h)
    flag2 = 1;

    if(flag1 == 1 && flag2 == 1)
    printf("Yes\n");

    else
    printf("No\n");

	return 0;
}


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

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

ll lcm(ll a, ll b){
    ll ret = a / gcd(a,b) * b;
    return ret;
}

bool is_prime(ll a){
    if(a == 1) return false;
    for(ll i=2; i*i<=a; i++){
        if(a%i == 0) return false;
    }
    return true;
}

int main(){
    ll n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    if(n < m){
        swap(n, m);
        swap(s, t);
    }
    ll l = lcm(n, m);
    map<ll, char> ans;
    rep(i, 0, n) ans[(l / n) * i] = s[i];
    rep(i, 0, m) {
        if(ans.count((l / m) * i) == 0) continue;
        if(ans[(l / m) * i] != t[i]) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << l << endl;
    return 0;
}

Measured memory_bytes: 9776
#include <stdio.h>
#include <string.h>
int chang(char* S, char* T)
{

	int cnt = 0;
	char tmp[1024];

	for (int i = 0; i <= strlen(S); i++)
	{
	
		if (S[i] != T[i])
		{
			//S[i] = T[i];
			cnt++;
		}
	}

	return cnt;
}
int main(void)
{
	char S[210000];
	char T[210000];
	
	//printf("S=  ");
	scanf("%s", S);

	//printf("\nT=  ");
	scanf("%s", T);
	
	if (strlen(S) != strlen(T))
	{
		//printf("駄目だよ\n");
	}
	else if (strlen(S) == strlen(T))
	{
		printf("%d", chang(S, T));
	}
	else if (strlen(S) < 1)
	{
		//("駄目だよ\n");
	}
	return 0;
}

Measured memory_bytes: 2492
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define MAX 510000
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;



int main(){
    ll n,m; cin >> n >> m;
    ll ans = 0;
    if(n==1 && m==1){
        puts("1");
        return 0;
    }
    if(n==1 || m==1){
        cout << max({n-2,m-2,0LL}) << endl;
        return 0;
    }
    ans += max(0LL, (n-2)*(m-2));
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main() {
	int a[20000], b[20000];
	char op[100];
	int i;

	for (i = 0;; i++) {
		scanf("%d %c %d", &a[i], &op[i], &b[i]);
		if (op[i] == '?')
			break;
	}

	for (int j = 0;i>0; j++,i--) {
		switch (op[j]) {
		case '+':printf("%d\n", a[j] + b[j]);	 break;
		case '-':printf("%d\n", a[j] - b[j]);	 break;
		case '*':printf("%d\n", a[j] *b[j]);	 break;
		case '/':printf("%d\n", a[j] / b[j]);	 break;
		}
	}

	return 0;
}

Measured memory_bytes: 1824
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	String[] values = sc.nextLine().split(" ");
      	int countFor7 = 0;
      	int countFor5 = 0;
      	
      	for(String value: values) {
      		if ("7".equals(value)) {
				countFor7++;
			}else if("5".equals(value)) {
				countFor5++;
			}
      	}
      	
      	System.out.println((countFor5 == 2 && countFor7 == 1)? "YES": "NO");
      
	}

}


Measured memory_bytes: 21204
#include <stdio.h>

int main(void){
	int money = 0;
	int maxhappy = 0;

	scanf("%d", &money);
	int happy1 = money/500;
	maxhappy = happy1 * 1000;

	money = money - happy1 * 500;
	int happy2 = money/5;
	maxhappy += happy2 * 5;

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

	return 0;
}

Measured memory_bytes: 128
import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); }
void log()(){ writeln(""); } void log(T, A ...)(T t, lazy A a){ if(DEBUG) write(t, " "), log(a); } bool DEBUG = 0; 
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- //
void solve(){
	int n = read.to!int;
	int k = read.to!int;
	
	int x = n * (n - 1) / 2 - (n - 1);
	if(k > x){
		"-1".writeln;
		return;
	}
	
	int y = x - k;
	int m = (n - 1) + y;
	
	m.writeln;
	foreach(i; 1 .. n){
		writeln("1 ", i + 1);
	}
	foreach(i; 1 .. n) foreach(j; 1 .. i){
		if(y == 0) return;
		writeln(i + 1, " ", j + 1);
		y -= 1;
	}
	
}

/*
連結なので少なくともn - 1本の辺がある。
その意味で C(n, 2) - (n - 1) が最大
これは、うにグラフのときに実現される

少なくするためには、うにの枝をつなげばよい
つないだ枝は距離1になる
他への影響はない
*/


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


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

	int v1 , a1 , v2 , a2;
	cin >> v1 >> a1 >> v2 >> a2;
	int in = 0;
	while (v1 > 0 && v2 > 0)
	{
		if (in % 2 == 0)
		{
			v2 -= a1;
		}
		else
		{
			v1 -= a2;
		}
		in++;

	}
	if (v1 <= 0)
	{
		cout<<"No\n";
	}
	else
	{
		cout<<"Yes\n";
	}
}

Measured memory_bytes: 3664
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    if sum([a[i][j] * b[j] for j in range(m)]) + c > 0:
        ans += 1
print(ans)


Measured memory_bytes: 3060
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

class Main implements Runnable {
	public static final long MOD = 1000000007;
	private final FastScanner sc;
	private final PrintWriter out;
	int a,b,k;

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 16L * 1024 * 1024).start();
	}

	Main() {
		sc = new FastScanner();
		out = new PrintWriter(System.out);
	}

	private void init() throws Exception {
		a = sc.nextInt();
		b = sc.nextInt();
		k = sc.nextInt();
	}

	private void solve() throws Exception{
		for(int i=a;i<Math.min(a+k,b);i++){
			out.println(i);
		}
		for(int i=Math.max(b-k+1, Math.min(a+k,b));i<b+1;i++){
			out.println(i);
		}
	}

	/*
	 * private void exit(int status){ out.flush(); out.close();
	 * System.exit(status); } //
	 */
	public void run() {
		try {
			init();
			solve();
		} catch (Exception e) {
			e.printStackTrace();
		}
		out.flush();
		out.close();
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean read() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
			return true;
		}
	}

	private boolean hasNext() {
		while (read() && !isVisibleChar(buffer[ptr]))
			ptr++;
		return read();
	}

	private int getNextChar() {
		if (read()) {
			ptr++;
			return buffer[ptr - 1];
		} else {
			return -1;
		}
	}

	private static boolean isVisibleChar(int code) {
		return code >= 33 && code <= 126;
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = getNextChar();
		while (isVisibleChar(b)) {
			sb.appendCodePoint(b);
			b = getNextChar();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean sign = true;
		int b = getNextChar();
		if (b == '-') {
			sign = false;
			b = getNextChar();
		}
		if (b < '0' || b > '9') {
			throw new NumberFormatException();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isVisibleChar(b)) {
				return sign ? n : -n;
			} else {
				throw new NumberFormatException();
			}
			b = getNextChar();
		}
	}

	public int nextInt() {
		long n = nextLong();
		if (n < Integer.MIN_VALUE || n > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) n;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public void close() {
		try {
			in.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

class IntQueue {
	protected int[] a;
	protected int head, tail;

	public IntQueue(int max) {
		a = new int[max];
	}

	public void offer(int x) {
		a[tail++] = x;
	}

	public int poll() {
		return a[head++];
	}

	public int peek() {
		return a[head];
	}
}


Measured memory_bytes: 27860
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
      n: usize,
      abs: [[i64;2]; n],
      cds: [[i64;2]; n],
    }
    let mut cds = cds;
    cds.sort_by_key(|v| v[0]);
    let mut used = vec![false; n];
    let mut cnt = 0;
    for i in 0..n {
        let mut m = -1;
        let mut mj = 0;
        for j in 0..n {
            if used[j] { continue }
            if abs[j][0] < cds[i][0] && abs[j][1] < cds[i][1] {
                if m <= abs[j][1] {
                    m = abs[j][1];
                    mj = j;
                }
            }
        }
        if m != -1 {
            used[mj] = true;
            cnt += 1;
        }
    }
    println!("{}", cnt);
}


Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
    int n, m, k;

    cin >> n >> m >> k;

    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            if (i*(m-j)+j*(n-i)==k) {
                cout << "Yes" << endl;
                return (0);
            }
        }
    }

    cout << "No" << endl;
}
    


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
	int a,b,i,z=0;
	char s[12];
	scanf("%d%d%s",&a,&b,s);
	for(i=0; i<a; i++){
		if(s[i]>='0' && s[i]<='9'){
		}else{
			z=1;
		}
	}
	if(s[a]!='-'){
		z=1;
	}
	for(i=a+1; i<a+b+1; i++){
		if(s[i]>='0' && s[i]<='9'){
		}else{
			z=1;
		}
	}
	if(z==1){
		printf("No\n");
	}else{
		printf("Yes\n");
	}
	return 0;
}

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

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int L = scan.nextInt();
        int R = scan.nextInt();
        int d = scan.nextInt();
        int ans = 0;
        for (int i = L; i <= R; i++) {
            if (i % d == 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 35656
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
#define OUT(n) cout << (n) << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    string a, b;
    cin >> a >> b;
    int x = stoi(a+b);
    int y = sqrt(x);
    ATYN(y*y == x)

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
const ll INF = 1LL<<61;
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; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll jou(ll N, ll P){if(P==0) return 1;
  if(P%2==0){ll t = jou(N, P/2);return t*t % mod;
  }return (N * jou(N, P-1)) % mod;}  //jou(n,mod-2)で逆元
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる



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

  int ki=0;
  int yo=0;
  rep(i,n){
    int x;
    cin>>x;
    if(x%2==1) ki++;
    if(x%4==0) yo++;
  }

  bool ok=true;
  if(n%2==0){
    if(ki>yo) ok=false;
  }
  if(n%2==1){
    if(ki==(n+1)/2 && yo<(n/2)) ok=false;
    if(ki!=(n+1)/2 && ki>yo) ok=false;
  }

  cout << (ok?"Yes":"No") << endl;
}

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

using namespace std;

bool isCheck(int num[4],char op[3])
{
    int sum = num[0];
    for(int i = 0;i < 3;i++) {
        if(op[i] == '+') {
            sum += num[i+1];
        } else {
            sum -= num[i+1];
        }
    }
    return sum == 7;
}

void create(char op[3],int sgn)
{
    int x = 1;
    for(int i = 0;i < 3;i++) {
    if(sgn & x) {
        op[i] = '+';
    } else {
        op[i] = '-';
    }
    x <<= 1;
    }
}
int main(void)
{
    string n;
    cin>>n;
    int sgn = 0;
    int num[4];
    char op[3];

    for(int i = 0;i < 4;i++) {
        num[i] = n[i] - '0';
    }

    create(op,sgn);
    
    do {
        if(isCheck(num,op)) {
            cout<<num[0]<<op[0]<<num[1]<<op[1]<<num[2]<<op[2]<<num[3]<<"="<<7<<endl;
            
            break;
        } else {
            sgn++;
            create(op,sgn);
        }
    }while(true);

    return 0;
}


Measured memory_bytes: 256
///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

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

const int N = 1005; 
const int mod = 1e9 + 7;

#define mul(a, b) ((ll) (a) * (b) % mod)

int f[N][N], n, a, b, c, d, fact[N], inv[N][N];

inline int Pow(int a, int p) {
    int ret = 1; while(p) {
        if(p & 1) ret = mul(ret, a); 
        a = mul(a, a); 
        p >>= 1;
    } return ret;
}

void precalc() {
    fact[0] = 1; 
    for(int i = 1; i < N; ++i) 
        fact[i] = mul(fact[i - 1], i); 
    inv[N - 1][1] = Pow(fact[N - 1], mod - 2); 
    for(int i = N - 2; i >= 0; --i) 
        inv[i][1] = mul(inv[i + 1][1], i + 1); 
    for(int i = 0; i < N; ++i) {
        inv[i][0] = 1; 
        for(int j = 2; j < N; ++j) {
            inv[i][j] = mul(inv[i][j - 1], inv[i][1]); 
        }
    }
}


int main(int argc, char const *argv[]) {
    precalc();
    scanf("%d %d %d %d %d", &n, &a, &b, &c, &d); 

    for(int i = 0; i <= n; ++i) f[0][i] = 1;  
    for(int i = 1; i <= n; ++i) {
        for(int j = a; j <= b; ++j) {
            f[i][j] = f[i][j - 1]; 
            for(int k = c; k <= d && j * k <= i; ++k) {
                f[i][j] += mul(fact[i], mul(f[i-j*k][j-1], mul(inv[i-j*k][1], mul(inv[j][k], inv[k][1])))); 
                if(f[i][j] >= mod) f[i][j] -= mod; 
            } 
        }
    }
    printf("%d\n", f[n][b]);
}


Measured memory_bytes: 8064
#import string,itertools,fractions,heapq,re,array,bisect
#from math import *
from collections import Counter
def rl(s): return xrange(len(s))


INF = 2147483647


import sys
stdin = sys.stdin

N =        int( stdin.readline().strip() )

dists = map(int, stdin.readline().strip().split())

counts = Counter(dists)

if counts[1] == 2 and N == 2:
    print "Possible"
elif counts[1] >= 2:
    print "Impossible"
else:
    m = max(dists)
    good = True
    if counts[m] < 2:
        good = False
    if m % 2 == 0 and counts[m//2] != 1:
        good = False
    if m % 2 == 1 and counts[m//2 + 1] != 2:
        good = False
    for i in range(m//2 + 1, m):
        if counts[i] < 2:
            good = False
    if good:
        print "Possible"
    else:
        print "Impossible"




Measured memory_bytes: 2940
N=int(input())
x=list(map(int,input().split()))
mod=10**9+7

ans=0
for i in range(0,N-1):
    ans+=pow(i+1,mod-2,mod)*(x[-1]-x[i])
    ans%=mod

for i in range(1,N):
    ans*=i
    ans%=mod
print(ans)


Measured memory_bytes: 62576
#include <algorithm>
#include <bitset>
#include <boost/dynamic_bitset.hpp>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <vector>
#include <numeric>

#define DEBUG(x) cout << #x << ": " << x << endl
#define INFILE() freopen("input.txt", "r", stdin)
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define REPC(i, a) REP(i, 0, a)
#define RREP(i, a, b) for (int i = (a); i >= (b); i--)
#define RREPC(i, a) RREP(i, a, 0)
#define ALL(s) begin(s), end(s)
#define RALL(s) rbegin(s), rend(s)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_i = pair<ll, int>;
using i_ll = pair<int, ll>;
using d_i = pair<double, int>;
using ll_ll = pair<ll, ll>;
using d_d = pair<double, double>;

static constexpr ll LL_MOD = 1000000009;
static constexpr int I_MOD = 1000000007;
static constexpr double EPS = numeric_limits<double>::epsilon();
static constexpr double PI = 3.14159265358979323846264338327950288;

template <class T> static void scan(vector<T> &v);
static void scan(vector<string> &v, bool isWord = true);
static boost::dynamic_bitset<> scan(char trueValue = 'o');

int main(int argc, char *argv[]) {
  // INFILE();
	int a, b, c;
	cin >> a >> b >> c;

	vector<int> v(100);
	v[a - 1] = v[b - 1] = v[c - 1] = 1;
	cout << accumulate(ALL(v), 0) << endl;
  return 0;
}

template <class T> static void scan(vector<T> &v) {
  map<type_index, const char *const> m = {{typeid(int), "%d"},
                                          {typeid(ll), "%lld"},
                                          {typeid(double), "%lf"},
                                          {typeid(char), "%c"}};

  auto tFormat = m[typeid(T)];

  for (T &n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string> &v, bool isWord) {
  if (isWord) {
    for (auto &n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

static boost::dynamic_bitset<> scan(char trueValue) {
  string s;
  getline(cin, s);

  if (s.size() == 0) {
    getline(cin, s);
  }

  for_each(begin(s), end(s),
           [trueValue](char &c) { c = (c == trueValue) ? '1' : '0'; });
  return boost::dynamic_bitset<>(string(rbegin(s), rend(s)));
}


Measured memory_bytes: 504
#include<iostream>
#include<cmath>
using namespace std;
long long counter(long long rest){
	if(rest==1){
      return 1;
    }else{
      return 2*counter((rest-(rest%2))/2)+1;
    }
}
int main(void){
  long long h;
  long long count = 0;
  cin >> h;
  count = counter(h);
  cout << count;
}

Measured memory_bytes: 256
// failed to generate code

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

vector<int> g[100010];

int MOD = 1e9 + 7;
int dp[100010][2];

int dfs(int root, int parColor,int parent){
    if( dp[root][parColor] != -1) return dp[root][parColor];
    long long ans = 0;
    int f = 0;

    {
        long long sub = 1;
        for (auto c : g[root]) {
            if (c == parent) continue;
            sub = sub * (dfs(c, 0, root)) % MOD;
            f = 1;
        }
        ans += sub;
    }

    if(parColor == 0){
        long long sub = 1;
        for( auto c : g[root]){
            if( c == parent) continue;
            sub = sub * dfs(c, 1, root) % MOD;
            f = 1;
        }
        ans += sub;
    }
    return dp[root][parColor] = ans;
}
int main(){
    memset(dp, -1, sizeof(dp));
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    for(int i = 0 ; i < n-1 ; i++){
        int x,y;
        cin >> x >> y;
        --x, --y;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    cout << dfs(0, 0, -1) % MOD << endl;

}


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

#define fo(i,n)         for(int i=0;i<n;i++)
#define Fo(i,k,n)       for(int i=k;i<n;i++) 
#define endl            "\n"
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define vec(x)          vector<x>
#define matrix(x)       vector<vector<x>>
#define mem(a,b)        memset(a, b, sizeof a)
#define vii             vector<pair<int,int>>
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define MOD             998244353
#define deb(x)          cerr <<#x<<" = "<<x<<"\n"
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define rep(i,a,b)      for (int i = a; i<b; ++i)
#define len(s)          s.length()
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
 
int power(int a,int b,int m=mod)
{int ans=1;while(b>0){if(b&1)ans=(ans*a)%m;a=(a*a)%m;b>>=1;}
return ans;}

void angshuGod()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

const int N = 1e5+1;
const double pi = acos(-1);

void solve(){    

    int n,x;
    cin>>x>>n;
    bool visited[105];
    mem(visited,false);
    fo(i,n){
    	int a;
    	cin>>a;
    	visited[a] = true;
    }
    vi res;
    fo(i,105){
    	if(!visited[i]) res.pb(i);
    }
    sort(all(res));
    auto it = upper_bound(all(res),x);
    int small = res[it-res.begin()-1];
    int big = res[it-res.begin()];
    if((abs(small-x))<=abs(big-x))
    	cout<<small;
    else if((abs(small-x))>abs(big-x))
    	cout<<big;
}

 
int32_t main()
{
    angshuGod();

    int t;

    t = 1;
    //cin>>t;

    while(t--){
        solve();
    }
    
    return 0;
}

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

int main() {
  
  int n, k;
  cin >> n >> k;
  int i = 100;
  
  while (true){
    if (pow(k, i) <= n){
      break;
    }
    i--;
  }
  cout << i+1 << endl;
}

Measured memory_bytes: 384
#if 0

#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int T, N, K, X[100000+10], A[100000+10];
int main() {
  cin >> T; // データセットの数を読み込む
  for (int t=0; t<T; ++t) {
    cin >> N >> K;
    for (int i=0; i<N; ++i) cin >> X[i]; // 家の位置を入力
    for (int i=0; i+1<N; ++i) A[i] = X[i+1]-X[i]; // 家と家の間
    sort(A, A+N-1);
    cout << accumulate(A, A+max(0,N-1-(K-1)), 0) << endl; // 配列A の先頭max(0,N-1-(K-1)) 個の和を出力する
  }
}



Measured memory_bytes: 3808
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
 
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; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()

int main(){
  string s;cin>>s;
  int cnt[26]={};
  rep(i,s.size()){
    cnt[(int)s[i]-'a']++;
  }
  ll ans=0;
  rep(i,26){
    rep(j,i+1,26){
      ans+=1ll*cnt[i]*cnt[j];
    }
  }
  cout<<ans+1<<endl;
}
      

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <stack>
#include <tuple>
using namespace std;

int main()
{
  vector<tuple<int, int, int>> v;
  int h, w;
  cin >> h >> w;
  for (auto i = 1; i <= h; i++) {
    if (i % 2 != 0) {
      for (auto j = 1; j <= w; j++) {
	int a;
	cin >> a;
	v.emplace_back(make_tuple(i, j, a));
      }
    } else {
      stack<tuple<int, int, int>> s;
      for (auto j = 1; j <= w; j++) {
	int a;
	cin >> a;
	s.push(make_tuple(i, j, a));
      }
      for (auto j = 0; j < w; j++) {
	v.emplace_back(s.top());
	s.pop();
      }
    }
  }
  int pa = 0;
  int pi;
  int pj;
  int move_count = 0;
  vector<tuple<int, int, int, int>> ans;
  for (auto&& e : v) {
    if (pa % 2 == 0) {
      pi = get<0>(e);
      pj = get<1>(e);
      pa = get<2>(e);
    } else {
      ans.emplace_back(make_tuple(pi, pj, get<0>(e), get<1>(e)));
      move_count++;
      pa = get<2>(e) + 1;
      pi = get<0>(e);
      pj = get<1>(e);
    }
  }
  cout << move_count << endl;
  for (auto&& e : ans) {
    cout << get<0>(e) << " "
	 << get<1>(e) << " "
	 << get<2>(e) << " "
	 << get<3>(e) << endl;
  }
}


Measured memory_bytes: 9200
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    i64 h, n;
    std::cin >> h >> n;
    i64 s = 0;
    for (int i = 0; i < n; i++) {
        i64 a;
        std::cin >> a;
        s += a;
    }

    std::cout << (s >= h ? "Yes" : "No") << std::endl;

    return 0;
}
	

Measured memory_bytes: 256
a = [int(c) for c in input().split()]
N=a[0]
M=a[1]
X=a[2]
A = [int(c) for c in input().split()]
A2 = [0]*(N+1)
for i in range(M):
    A2[A[i]] = 1

cnt = X
cost1 = 0
while cnt < N+1:
    cost1+=A2[cnt]
    cnt+=1

cnt = X
cost2 = 0
while cnt > 0:
    cost2+=A2[cnt]
    cnt-=1

if cost1<cost2:
    print(cost1)
else:
    print(cost2)


Measured memory_bytes: 9100
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using P = pair<int,int>;
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;}




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

    double pi = 3.1415926535897;




    cout << N * 2 * pi << endl;

    return 0;
}
//Ctrl+Shift+Bでコンパイルと実行を行ってデバッグすること

Measured memory_bytes: 3780
import java.util.Scanner;

//Split Up!
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			int s = 0;
			int[] a = new int[n];
			for(int i=0;i<n;i++){
				a[i] = sc.nextInt();
				s+=a[i];
			}
			int m = s;
			for(int i=0;i<(1<<n);i++){
				int r = 0;
				for(int j=0;j<n;j++){
					if((i&(1<<j))==0)continue;
					r += a[j];
				}
				m = Math.min(m, Math.abs(s-r*2));
			}
			System.out.println(m);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

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


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

    string s;
    cin >> s;
    int ans = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '+')
            ans++;
        else
            ans--;
    }
    cout << ans << endl;



    return 0;
}



Measured memory_bytes: 256
N, W = map(int, input().split())

dp = [0] * (W+1)
for i in range(N):
    vi, wi = map(int, input().split())
    ndp = [0] * (W+1)
    for j in range(W+1):
        if j < wi:
            ndp[j] = dp[j]
        else:
            ndp[j] = max(dp[j-wi] + vi, dp[j])
    dp = ndp
print(dp[W])



Measured memory_bytes: 6328
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define hell  1000000007
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb   push_back


int main()
{
	ios;
	ll n,ans=0;
	cin>>n;
	ll h[n+10];
	map<ll,ll> mp;
	for(ll i=1;i<=n;i++)
	{
		cin>>h[i];
		ans+=mp[i-h[i]];
		mp[h[i]+i]++;
	}
	cout<<ans;
}

Measured memory_bytes: 27840
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  ll n,m,k;
  cin >> n >> m >> k;
  vector<ll>a(n+1),b(m+1);
  a[0]=0;
  b[0]=0;
  rep(i,n){
    ll x;
    cin >> x;
    a[i+1]=a[i]+x;
  }
  rep(i,m){
    ll x;
    cin >> x;
    b[i+1]=b[i]+x;
  }
  
  ll ans=0;
  rep(i,n+1){
    ll t=a[i];
    if(t>k)break;
    ll l=0,r=m+1;
    while(abs(r-l)>1){
      ll mid = (l+r)/2;
      if(t+b[mid]>k)r=mid;
      else l=mid;
    }
    ans=max(ans,i+l);
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
  int N;
  cin>>N;
  vector< vector<int> > v(N, vector<int>(3,0));
  vector<int> point(N,0);
  for(int i=0; i<N; i++) {
    for(int j=0; j<3; j++){
      cin>>v[i][j];
    }
  }
  for(int j=0; j<3; j++){
    vector<int> b(101,0);
    for(int i=0; i<N; i++) {
      b[v[i][j]]++;
    }
    for(int i=0; i<N; i++) {
      if(b[v[i][j]]>1)continue;
      point[i] += v[i][j];
    }
  }

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

Measured memory_bytes: 1224
#include<bits/stdc++.h>
#define ll long long
#define getc(x) scanf("%s",x+1);
using namespace std;
const int N=15;
char s[N],c[N]; 
inline int read()
{
	int x=0,ff=1;
	char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-') ff=-1;ch=getchar();}
	while(isdigit(ch)) {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
	return x*ff;
}
int main()
{
	//freopen("1.in","r",stdin);
	getc(s);getc(c);
	int n=strlen(s+1);
	for(int i=1;i<=n;++i) if(s[i]!=c[i]) {puts("No");return 0;}
	puts("Yes");
	return 0;
}


Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;

#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back

const long double PI = acos(-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;}
ll GetDigit(ll num) {return log10(num)+1;}

int main(){
    ll h;
    cin >> h;
    ll ans = 1;
    ll cnt = 1;
    for(ll i = h; i > 1; i /= 2){
        ans += pow(2, cnt); 
        cnt++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define DUMMYKEY 0
using namespace std;

void Output(const vector<int>& Heap)
{
	for(int i = 1; i < Heap.size(); i++){
		cout << "node "  << i       << ": ";
		cout << "key = " << Heap[i] << ", ";
		if(i/2 >= 1){
			cout << "parent key = " << Heap[i/2]  << ", ";
		}
		if(2*i <= Heap.size()-1){
			cout << "left key = "   << Heap[2*i]  << ", ";
		}
		if(2*i+1 <= Heap.size()-1){
			cout << "right key = "  << Heap[2*i+1] << ", ";
		}
		cout << endl;
	}
}

int main()
{
	int H;
	cin >> H;
	vector<int> Heap(H+1);
	Heap[0] = DUMMYKEY;
	for(int i = 1; i <= H; i++){
		cin >> Heap[i];
	}
	Output(Heap);
	return 0;
}

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

#include <math.h>
#include <stdlib.h>


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

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

//INT_MAX	2,147,483,647 = 2*1.0e9

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int N, M;
    cin >> N >> M;

    vector<pair<int, int>> ab(M);

    for(int i = 0; i < M; i++){
        int a, b; cin >> a >> b;
        ab[i] = make_pair(b, a);
    }

    sort(ab.begin(), ab.end());

    int cnt = 1;
    int prev = ab[0].first-1;
    for(int i = 1; i < M; i++){
        if(prev >= ab[i].second) continue;
        else{
            cnt++;
            prev = ab[i].first -1;
        }
    }
    cout << cnt << endl;

    return 0;
}


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

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


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = 10e10;
const ll MINF = -10e10;
//const int INF = INT_MAX;
#define mins(x, y) x = min(x, y)
#define maxs(x, y) x = max(x, y)

typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;
const int mod = 1000000007;
//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;

vector<vector<ll>> sum;

void buildSumTable(ll n, ll m, vector<ll> &ls, vector<ll> &rs) {
    sum = vector<vector<ll>>(n + 1, vector<ll>(n + 1, 0));
    for (ll i = 0; i < m; i++) {
        sum[ls[i]][rs[i]]++;
    }

    for (ll i = 1; i <= n; i++) {
        for (ll j = 1; j <= n; j++) {
            sum[i][j] += sum[i - 1][j];
            sum[i][j] += sum[i][j - 1];
            sum[i][j] -= sum[i - 1][j - 1];
        }
    }
}

ll getSumTable(ll l, ll r) {
    ll ans = sum[r][r] - sum[r][l - 1] - sum[l - 1][r] + sum[l - 1][l - 1];
    return ans;
}

int main() {
    ll n, m, q;

    cin >> n >> m >> q;

    vector<ll> ls;
    vector<ll> rs;

    rep(i, m) {
        ll l, r;
        cin >> l >> r;
        ls.push_back(l);
        rs.push_back(r);
    }

    vector<ll> qls;
    vector<ll> qrs;
    rep(i, q) {
        ll l, r;
        cin >> l >> r;
        qls.push_back(l);
        qrs.push_back(r);
    }

    buildSumTable(n, m, ls, rs);

    for (ll i = 0; i < q; i++) {
        ll ans = getSumTable(qls[i], qrs[i]);
        cout << ans << endl;
    }


}

Measured memory_bytes: 7652
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

//mod演算ライブラリ
//mod=1000000007

LL add(LL a,LL b){
  return (a+b)%mod;
}

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

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

LL power(LL x,LL y){//繰り返し二乗法 単品利用可
  if(y==0)return 1;
  else if(y==1)return x%mod;
  else if(y%2==0){
    LL tmp=power(x, y/2) % mod;
    return tmp*tmp%mod;
  }else {
    LL tmp=power(x, y/2) % mod;
    return ((tmp*tmp)%mod)*x%mod;
  }
}

LL dvs(LL a,LL b){
  return mul(a,power(b,mod-2));
}

const int SIZE_mod=200005;
int invfact[SIZE_mod];
int fact[SIZE_mod];

LL factset(int a){//aまでの階乗%mod表を作成
  fact[0]=1;
  FORQ(i,1,a){
    fact[i]=mul(fact[i-1],i);
  }
}

LL cmbset(int a){//1~aまでの階乗と階乗数の逆元のmod(mod)を用意 O(a)
  factset(a);
  invfact[a]=power(fact[a],mod-2);
  invfact[0]=1;
  FORD(i,a,1){
    invfact[i]=mul(invfact[i+1],i+1);
  }

}

LL cmb(int n,int r){//nCr%mod  (cmbset後に使用)
  if(n<r||r<0||n<0)return 0;
  return mul(fact[n],mul(invfact[r],invfact[n-r]));
}

LL prm(int n,int r){//nPr%mod
    return mul(cmb(n,r),fact[n]);
}

LL homo(int n,int r){//nHr%mod
  return cmb(n+r-1,r);
}


int main(){
	int n,k;
	cin>>n>>k;
	vector<int> a(n+1);
	vector<vector<LL>> dp(n+3,vector<LL>(k+111,0LL));
	FORQ(i,1,n){
		cin>>a[i];
	}
	//sort(a.begin(),a.end());
	dp[0][0]=1;
	dp[0][1]=-1;
	FORQ(i,0,n+1){
		FOR(j,1,k+2){
			dp[i][j]=add(dp[i][j],dp[i][j-1]);
			//cerr<<dp[i][j-1]<<" ";
		}
		//cerr<<endl;
		FOR(j,0,k+1){
			dp[i+1][j]=add(dp[i+1][j],dp[i][j]);
			dp[i+1][min(j+a[i],k)+1]=sub(dp[i+1][min(j+a[i],k)+1],dp[i][j]);
		}
	}

	cout<<dp[n+1][k];
    return 0;
}


Measured memory_bytes: 81792
#include <cstdio>
#include <set>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

int a[110];

int main() {
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    int ans = 0;
    sort(a, a + n);
    for(int i = 0; i < n; i++) {
        for(int j = i + 1; j < n; j++) {
            if(a[i] == a[j]) continue;
            for(int k = j + 1; k < n; k++) {
                if(a[j] == a[k] || a[i] == a[k]) continue;
                if(a[i] + a[j] > a[k]) ans++;
            }
        }
    }
    printf("%d\n", ans);

    return 0;
}


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

#define pb       push_back
#define all(a)   a.begin(), a.end()
#define mp       make_pair
#define ll	long long

using namespace std;
const int MAX = 1e5+9;
int n;
ll sum=0,val;
int main(){
	cin >> n;
  for(int i=0; i<n; i++){
    cin >> val;
    sum += val;
  }
  cout << abs(sum- n) << endl;
	return 0;
}

Measured memory_bytes: 256