akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ld eps = 1e-10;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h, w; cin >> h >> w;
  vector<string> A(h);
  map<char, int> mp;
  rep(i, h) {
    cin >> A[i];
    rep(j, w) mp[A[i][j]]++;
  }
  int nOdd = 0;
  int nEven = 0;
  int nFour = 0;
  for(auto ele: mp) {
    if(ele.second%2) nOdd++;
    else if(ele.second%4==0) nFour++;
    else nEven++;
  }
  if(h%2==0 && w%2==0) {
    if(nOdd>0 || nEven>0) cout << "No" << "\n";
    else cout << "Yes" << "\n";
  } else if(h%2==0) {
    if(nOdd>0 || nEven>h/2) cout << "No" << "\n";
    else cout << "Yes" << "\n";
  } else if(w%2==0) {
    if(nOdd>0 || nEven>w/2) cout << "No" << "\n";
    else cout << "Yes" << "\n";
  } else {
    if(nOdd!=1 || nEven>h/2+w/2) cout << "No" << "\n";
    else cout << "Yes" << "\n";
  }
  return 0;
}


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

const int MAX_N=55555;
int prime[MAX_N];
int is_prime[MAX_N+1];

int sieve(int n){
  int p=0;
  for(int i=0;i<=n;i++) is_prime[i]=1;
  is_prime[0]=is_prime[1]=0;
  for(int i=2;i<=n;i++){
    if(is_prime[i]){
      prime[p++]=i;
      for(int j=2*i;j<=n;j+=i) is_prime[j]=0;
    }
  }
  return p;
}

int main(){
  sieve(MAX_N);
  int N; cin>>N;
  vector<int> v;
  int ind=5;
  rep(i,N){
    while(1){
      if(is_prime[ind]&&(ind%5)==1) break;
      else ind++;
    }
    v.push_back(ind);
    ind++;
  }
  rep(i,N-1) cout<<v[i]<<" ";
  cout<<v[N-1]<<endl;
  return 0;
}


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


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

	ll t=1;	//cin>>t;
	while(t--){
		ll n; cin>>n;
		vector<int> b(n-1);
		for(int i=0; i<n-1; i++){
			cin>>b[i];
		}
		ll sum=0;
		sum+=b[n-2];
		for(int i=n-2; i>=0; i--){
			sum=sum+min(b[i], b[i-1]);
		}
		sum+=b[0];
		cout<<sum;
	}

	
 
    return 0;
}

Measured memory_bytes: 256
import math
def diff(l):
    c = 0
    ans = []
    for i in l:
        try:
            ans.append(abs(i-l[c+1]))
            c+=1
        except:
            continue
    return ans
def multiGCD(l):
    ans = 0
    for i in l:
        ans = math.gcd(ans, i)
    return ans
n, x = map(int, input().split())
l = list(map(int, input().split()))
l.append(x)
l.sort()
l2 = diff(l)
print(multiGCD(l2))

Measured memory_bytes: 20340
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define repb(i, a, n) for (int i = (a); i >= (n); i--)
#define all(x) x.begin(), x.end()
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
inline void fastio() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
}

void co_elem(vector<int> &A, int N) {
    rep(i, 0, N) {
        if (i < N - 1) {
            cosp(A[i]);
        } else {
            co(A[i]);
        }
    }
}

ll maximumProfit(int n, vector<ll> &R) {
    ll maxv = -1e10 + 7;
    ll minv = R[0];
    rep(i, 1, n) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    return maxv;
}

int main() {
    int N, r;
    cin >> N;
    vector<ll> R(N);
    rep(i, 0, N) {
        cin >> R[i];
    }
    co(maximumProfit(N, R));
    return 0;
}


Measured memory_bytes: 4400
s=input()
count=0
s1=str()
s2=str()
for _ in range(int(input())):
  l=list(map(str,input().split()))
  
  if l[0]=='1':
    count+=1
  elif count%2==0:
    if l[1]=='1':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
  else:
    if l[1]=='2':
      s1=l[2]+s1
    else:
      s2=s2+l[2]
s=s1+s+s2
if count%2!=0:
  s=s[::-1]
print(s)

Measured memory_bytes: 4412
#include<stdio.h>

int main(){
	int n, a, count=0, now=1;
	scanf("%d", &n);
	for(int i=0;i<n;i++){
		scanf("%d", &a);
		if(a==now){
			now++;
		}else{
			count++;
		}
	}
	if(now==1){
		printf("-1");
	}else{
		printf("%d", count);
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

void c()
{
    int n;
    cin >> n;
    vector<pair<int, int>> x(n);
    for(int i = 0; i < n; i++)
    {
        int temp;
        cin >> temp;
        x[i] = {temp, i};
    }
    sort(x.begin(), x.end());
    vector<int> result(n);
    for(int i = 0; i < n; i++)
    {
        if(i < n / 2)
        {
            result[x[i].second] = x[n / 2].first;
        }else{
            result[x[i].second] = x[(n / 2) - 1].first;
        }
    }
    for(auto e : result)
    {
        cout << e << endl;
    }
}

int main() {
    int n;
    cin >> n;
    vector<long long int> a(n);
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    /*for(auto e : a)
    {
        cout <<e << " ";
    }
    cout << endl;*/
    vector<pair<long long int, long long int>> comb(n - 1);
    for(int i = 0; i < n - 1; i++)
    {
        int r = i;
        int l = n - 1;
        long long int base = (a[i] * 10) / 2;
        while (l - r > 1)
        {
            int m = (r + l) / 2 ;
            long long int diff = (a[m] * 10) - base;
            if(diff >= 0)
            {
                r = m;
            }else{
                l = m;
            }
        }
        //cout << "r = " << r << " l = " << l << endl;
        long long int diffr = base - a[r] * 10;
        long long int diffl = base - a[l] * 10;
        if(abs(diffl) <= abs(diffr))
        {
            comb[i] = {a[i], a[l]};
        }else{
            if(r == i)
            {
                comb[i] = {a[i], a[l]};
            }else{
                comb[i] = {a[i], a[r]};
            }
        }
    }
    int index = 0;
    /*long long int max_num = comb.front().first - comb.front().second;
    if(comb.front().second == 0)
    {
        max_num = 0;
    }
    int index = 0;
    for(int i = 0; i < n - 1; i++)
    {
        long long int temp = comb[i].first - comb[i].second;
        if(comb[i].second == 0){
            temp = 0;
        }
        if(temp > max_num)
        {
            max_num = temp;
            index = i;
        }
    }*/
    cout << comb[index].first << " " << comb[index].second << endl;
    return 0;
}


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

int main() {
  int n, l;
  cin >> n >> l;
  vector<string> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  string ans;
  for (int i = 0; i < n; i++) {
    ans += v[i];
  }
  cout << ans << endl;
}


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

int main(){
  int i,N;
  cin >> N;
  string tmpS;
  map<string,int> S;
  for(i=0; i<N; i++){
    cin >> tmpS;
    S[tmpS] = 1;
  }
  cout << S.size();
  return 0;
}

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

#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n)  for(int i=0;i<(n);++i)
#define REPr(i, n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m, n) for(int i = (n);i >=(m);--i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x, y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const ll MOD = 1e9+7;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

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;
}
///////////////////////////////////////////////
/*(._.)*/

ll dp[100005][13] = {};
int ctoi(char c){
	if (c == '?') return -1;
	if (c == '0') return 0;
	if (c == '1') return 1;
	if (c == '2') return 2;
	if (c == '3') return 3;
	if (c == '4') return 4;
	if (c == '5') return 5;
	if (c == '6') return 6;
	if (c == '7') return 7;
	if (c == '8') return 8;
	if (c == '9') return 9;
}

int main(){
	ll B = 1;
	string S; cin >> S;
	int L = S.length();
	dp[0][0] = 1;
	reverse(ALL(S));

	REP(i,L){
		int c = ctoi(S[i]);
		REP(k,13){
			FORq(l,0,9){
				if ((c != -1) and (c != l)) continue;
				dp[i+1][(k + B * l) % 13] += dp[i][k];
				dp[i+1][(k + B * l) % 13] %= MOD;
			}
		}

		B *= 10;
		B %= 13;
	}

	cout << dp[L][5] << endl;

}


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

int main() {

  long long int n, r;

  while( true ) {

    cin >> n >> r;

    if ( n == 0 ) break;

    vector< long long int > m;

    for ( long long int i = 0; i < n; i++ ) {
      m.push_back( i+1 );
    }

    long long int p, c;

    for ( long long int i = 0; i < r; i++ ) {

      cin >> p >> c;
      for ( long long int j = 0; j < c; j++ ) {

	m.push_back( m[ n - p - c + 1 ] );
	vector<long long int>:: iterator it = m.begin() + n - p - c + 1;
	it = m.erase( it );

      }

    }

    cout << m[n-1] << endl;

  }

  return 0;

}

Measured memory_bytes: 1216
N, M = gets.split.map(&:to_i)
as = gets.split.map(&:to_i)

hash = Hash.new(0)
hash[0] = 1
ans = 0
sum = 0
N.times do |i|
    sum = (sum + as[i]) % M
    ans += hash[sum]
    hash[sum] += 1
end
puts ans

Measured memory_bytes: 12164
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    n = int(readline())
    x1 = n//1.08
    x2 = x1+1
    if (x1*1.08)//1==n:
        print(int(x1))
    elif (x2*1.08)//1==n:
        print(int(x2))
    else:
        print(":(")

if __name__ == "__main__":
    main()


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

const int maxn=3005;
int dp[3005][3005][4];

int num[3005][3005];
int n,m;
//int all[3005];
int dfs(int i1,int j1,int start)
{

  //0 ->1 ->2 ->3

    if(i1>n || j1>m || start>=3)
      return 0;


    int &res=dp[i1][j1][start];
    if(res!=-1)return res;
    res=-1e9;



    //if()
    if(num[i1][j1]>0){
      res=max(res,num[i1][j1]+dfs(i1+1,j1,0));
      res=max(res,num[i1][j1]+dfs(i1,j1+1,start+1));
      res=max(res,dfs(i1,j1+1,start));
    }
    else
    {
      res=max(res,dfs(i1+1,j1,0));
      res=max(res,dfs(i1,j1+1,start));
    }
   

    dp[i1][j1][start]=res;
   // cout<<i1<<" "<<j1<<" "<<res<<endl;
    return dp[i1][j1][start];


}




signed main() {
   
  
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int k;
  cin>>n>>m>>k;
  for(int i=0;i<3005;i++)
  {
    for(int j=0;j<3005;j++)
    {
      for(int k=0;k<=3;k++)
         dp[i][j][k]=-1;
        num[i][j]=0;
    }
    //all[i]=0;
  }
  for(int i=0;i<k;i++)
  {
    int first,second,third;
    cin>>first>>second>>third;
    num[first][second]=third;
  }
  int total=dfs(1,1,0);
  cout<<total<<endl;
  return 0;
  }

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

class Program {
    static long MOD = 1000000007;
    static void Main (string[] args) {
        long N = int.Parse (Console.ReadLine ());

        long ans = (ModPow (10, N) - (2 * (ModPow (9, N)) % MOD)) % MOD + (ModPow (8, N) % MOD);
        ans = ans % MOD;
        if (ans < 0) {
            ans += MOD;
        }

        Console.WriteLine (ans);

    }

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

//dotnet run --project test

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

int main(){
    long long i, j, k;
    long long N, M, K;
    cin >> N >> M >> K;
    vector<long long> A(N);
    for(i=0; i<N; i++) cin >> A[i];

    long long ans = 0;
    vector<long long> dp(N, 0);
    for(j=1; j<=K; j++){
        deque<long long> deq = {};
        vector<long long> ndp(N);
        for(i=0; i<N; i++){
            if(i>=j-1){
                long long m = deq.empty() ? 0 : dp[deq.front()];
                ndp[i] = m + j * A[i];
            }else{
                ndp[i] = 0;
            }
            if(!deq.empty() && deq.front() == i-M) deq.pop_front();
            while(!deq.empty() && dp[deq.back()] < dp[i]) deq.pop_back();
            deq.push_back(i);
        }
        dp = ndp;
    }
    cout << *max_element(dp.begin(), dp.end()) << endl;
    return 0;
}


Measured memory_bytes: 3456
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int a = num[0];
        int b = num[1];
        double rad = 2 * Math.PI * num[2] / 360;

        double h = b * Math.Sin(rad);
        double S = a * h / 2;
        double L = a + b + Math.Sqrt(a * a + b * b - 2 * a * b * Math.Cos(rad));
        Console.WriteLine(string.Join("\n", S, L, h));
    }
}


Measured memory_bytes: 16376
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <climits>
#include <map>
#include <queue>
#include <cmath>

using namespace std;

using int64 = long long;
using P = pair<char,int>;


int main() {
    string s;
    cin >> s;

    vector<P> len;
    len.emplace_back(s.front(), 0);
    for (auto c : s) {
        if (len.back().first == c) len.back().second++;
        else len.emplace_back(c, 1);
    }

    cout << len.size() - 1 << endl;
}

Measured memory_bytes: 3792
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define pint pair<int,int>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;	cin>>n;
	string a,b,c;	cin>>a>>b>>c;
	int i,ans=0;
	for(i=0;i<n;i++){
		if(a[i]==b[i] && b[i]==c[i])	continue;
		if(a[i]==b[i] || a[i]==c[i] || b[i]==c[i])	ans+=1;
		else	ans+=2;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N = int(input())
A = [int(input()) for _ in range(N)]

B0 = set()
for i in range(N):
    if i % 2 == 0:
        B0.add(A[i])

A.sort()

ans = 0
for i in range(N):
    if i%2 == 0:
        if not A[i] in B0:
            ans += 1

print(ans)

Measured memory_bytes: 9640
#include <iostream>
using namespace std;
typedef long long ll;
ll dp[100001];
int main(void){
    for(int i=1;i<100001;i++){
        dp[i]=(1LL<<60);
    }
    int n,w;
    cin>>n>>w;
    for(int i=0;i<n;i++){
        ll g,v;
        cin>>g>>v;
        for(int j=100000;j>=v;j--){
            if(dp[j-v]+g<=w){
                dp[j]=min(dp[j],dp[j-v]+g);
            }
        }
    }
    for(int i=100000;i>0;i--){
        if(dp[i]!=(1LL<<60)){
            cout<<i<<endl;
            return 0;
        }
    }
}


Measured memory_bytes: 1024
import fractions

n = int(input())
a_list = list(map(int,input().split()))

ans = a_list[0]
for i in range(1, n):
    ans = ans * a_list[i] // fractions.gcd(ans, a_list[i])

num = 0
for a in a_list:
    num += ans//a

print(num%1000000007)

Measured memory_bytes: 6112
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int A[200101];
    rep(i, N) cin >> A[i];
    sort(A, A + N);
    rep(i, N - 1) if (A[i] == A[i + 1]) {cout << "NO" << endl; return 0;}
    cout << "YES" << endl;

    return 0;
}


Measured memory_bytes: 1152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
           
                string[] input = Console.ReadLine().Split(' ');
                
                int A = int.Parse(input[0]);
                int B = int.Parse(input[1]);
                int C = int.Parse(input[2]);
                int ans;//残りの水

                ans = A - (B + C);

                if (ans > 0)
                {
                    Console.WriteLine("0");
                }
                else if (ans <= 0)
                {
                    Console.WriteLine(-1*ans);
                }

            
        }
    }
}

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

int main(){
    int n;
    std::cin >> n;
    int d[n];
    for(int i=0;i<n;i++){
        std::cin >> d[i];
    }
    std::sort(d,d+n);
    int sum=d[n/2]-d[n/2-1];
    std::cout << sum << std::endl;
    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 4000000;
const int mod = 998244353;
int a[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
   // freopen("input.txt", "r", stdin);
    int n, m;
    cin >> n >> m;
    int s = 0;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        s += a[i];
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++){
        if (a[i] * 4 * m >= s) cnt++;
    }
    if (cnt >= m){
        cout << "Yes";
    } else{
        cout << "No";
    }
}


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

long long n, a, b;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> a >> b;
	long long cnt = n / (a + b) * a;
	n %= a + b;
	if(n >= a) cnt += a;
	else cnt += n;
	cout << cnt << "\n"; 
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<ll, int> mp;
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	int sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	int ans = -1;
	int tmp = MOD;
	for (int i = 0; i < n; i++) {
		if (abs(a[i] * n - sum) < tmp) {
			tmp = abs(a[i] * n - sum);
			ans = i;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<vector>
using namespace std;



int main(){
    int n, ans = 0;
    cin >> n;
    int v[n], c[n];
    for(int i = 0; i < n; i++){
        cin >> v[i];
    }
    for(int i = 0; i < n; i++){
        cin >> c[i];
    }
    for(int i = 0; i < n; i++){
        if(v[i] - c[i] > 0) ans += v[i] - c[i];
    }
    cout << ans << endl;
}

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

using namespace std;

typedef long long ll;

#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x
#define bit(n) (1<<(n))

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

int main(){
	char s[3];
	cin >> s;

	if(strlen(s) == 2){
		cout << s;
	}else{
		cout << s[2] << s[1] << s[0];
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int main(){
    int n;
    cin >>n;
    cout << (n-1)/2 << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;

int main() {
    string S; cin >> S;
    int N = S.length();
    int cnt1 = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            if (S[i] == '0') {
                cnt1++;
            }
        } else {
            if (S[i] == '1') {
                cnt1++;
            }
        }
    }
    
    int cnt0 = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            if (S[i] == '1') {
                cnt0++;
            }
        } else {
            if (S[i] == '0') {
                cnt0++;
            }
        }
    }

    int ans = min(cnt0, cnt1);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void){
  int n,i,actotal=0,watotal=0;
  int m,p[200000],ac[200000]={0},wa[200000]={0};
  char s[200000][5];
  
  scanf("%d", &n);
  scanf("%d", &m);
  for(i=0;i<m;i++){
     scanf("%d",&p[i]);
     scanf("%s",s[i]);
  }
  for(i=0;i<m;i++){
    if(strcmp(s[i],"AC")==0){
      if(ac[p[i]]==0){
        watotal += wa[p[i]];
        actotal++;
      }
      ac[p[i]]=1;
    }else{
      if(ac[p[i]]==0){
        wa[p[i]]++;
      }
    }
  }
  printf("%d %d",actotal,watotal);
  
  return 0;
}


Measured memory_bytes: 3072
a,b,k = map(int,input().split())
ans = []
if (a+k) < b:	
	for i in range(a, a+k):
		ans.append(i)
else:
	for i in range(a, b):
		ans.append(i)
if (b-k) > a:
	for l in range(b-k+1,b+1):
		ans.append(l)
else:
	for l in range(a,b+1):
		ans.append(l)
ans = set(ans)
ans = sorted(ans)

for a in ans:
	print(a)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define DEBUG_ARR(x, a, b) for(int i=a; i<=b; i++) cerr<<x[i]<<" "; cerr<<endl;
#define DEBUG_STR(x, a, b) for(int i=a; i<=b; i++) cerr<<x[i]; cerr<<endl;
#define TEST(x) int x; cin>>x; while(x--)
#define ITR(type, var) type::iterator var;
#define ALIAS(type, alias) using alias = type;
#define ALIAS_M(container, A, B, alias) using alias = container<A,B>;

using namespace std;
using ii = pair<int,int>;
using vii = vector<ii>;
using vi = vector<int>;
using vvi = vector<vi>;
using hmapii = unordered_map<int,int>;
using hmapsi = unordered_map<string, int>;
using hmapss = unordered_map<string, string>;
using ll = long long;
using llu = unsigned long long;


const int md = 1000000007;

inline void add(int &a, int b) {
  a += b;
  if (a >= md) {
    a -= md;
  }
}

inline int mul(int a, int b) {
  return (long long)a * b % md;
}

inline int power(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    b >>= 1;
    a = mul(a, a);
  }
  return res;
}

inline int inv(int a) {
  return power(a, md - 2);
}

const int N = 200010;

int fact[N], invfact[N], der[N];

inline int C(int n, int k) {
  return mul(fact[n], mul(invfact[k], invfact[n - k]));
}

int main() {
	FIO;
	fact[0] = invfact[0] = 1;
	for (int i = 1; i < N; i++) {
		fact[i] = mul(fact[i - 1], i);
		invfact[i] = mul(invfact[i - 1], inv(i));
	}
	int n,k;
	cin>>n>>k;
	n++;
	int ans = 0;
//	int i2 = inv(2);
	ll tt = 1LL*(n)*(n-1);
	tt /= 2;
	int ttl = tt%md;
	for(int i=k; i<=n; i++){
		ll ssk = (1LL*i*(i-1)); ssk /= 2;
		int sk = ssk%md;
		ll l = (n - i);
		ll llt = (l*(l-1)); llt /= 2;
		int lt = llt%md;
		int sl = (ttl%md - lt%md)%md;
		int diff = (sl%md - sk%md + 1%md)%md;
//		cerr<<ttl<<" "<<sk<<" "<<l<<" "<<lt<<" "<<sl<<" "<<diff<<endl;
		ans = (ans%md + diff%md)%md;
		if(ans < 0) ans += md;
	}
	cout<<ans;	
	return 0;
}


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


int main() {
	double W, H, x, y;
	cin >> W >> H >> x >> y;
	cout << (W * H) / 2 << " ";
	if(x == W / 2 && y == H / 2){
		cout << "1" << endl;
	}
	else{
		cout << "0" << endl;
	}
	return 0;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<ll> a(n), b(n);
    vector<ll> c(m), d(m);
    for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
    for(int i = 0; i < m; i++) cin >> c[i] >> d[i];
    for(int i = 0; i < n; i++) {
        ll min_dist = 1e9;
        int argmin = 0;
        for(int j = 0; j < m; j++) {
            ll dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if (dist < min_dist) {
                min_dist = min(dist, min_dist);
                argmin = j + 1;
            }
        }
        cout << argmin << endl;
    }
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
int D[401][401][401][2];
long long F[410], InvF[410], Res;
int Mod = 998244353, n, A[401], B[410];
long long Pow(long long a, long long b) {
	long long r = 1;
	while (b) {
		if (b & 1)r = r * a%Mod;
		a = a * a%Mod; b >>= 1;
	}
	return r;
}
int main() {
	int i, j, k, l, s = 0;
	scanf("%d", &n);
	for (i = 1; i <= n; i++) {
		scanf("%d%d", &A[i], &B[i]);
		s += A[i];
	}
	F[0] = InvF[0] = 1;
	for (i = 1; i <= 400; i++) {
		F[i] = F[i - 1] * i%Mod;
		InvF[i] = Pow(F[i], Mod - 2);
	}
	D[0][0][0][0] = 1;
	int s1 = 0, s2 = 0;
	for (i = 1; i <= n; i++) {
		for (j = 0; j <= s1; j++) {
			for (k = 0; k <= s2; k++) {
				for (int ck = 0; ck < 2; ck++) {
					long long t = D[i - 1][j][k][ck];
					D[i][j][k][ck] = (D[i][j][k][ck] + t) % Mod;
					for (l = 0; l < B[i]; l++) {
						D[i][j + l][k + A[i]][!ck] = (D[i][j + l][k + A[i]][!ck] + t * InvF[l]) % Mod;
						t = t * A[i] % Mod;
					}
				}
			}
		}
		s1 += B[i] - 1;
		s2 += A[i];
	}
	for (i = 0; i <= s1; i++) {
		for (j = 0; j <= s2; j++) {
			for (int ck = 0; ck < 2; ck++) {
				if (j == 0)continue;
				long long t = D[n][i][j][ck];
				if (i) {
					t = t * Pow(Pow(j, i), Mod - 2) % Mod * F[i] % Mod;
				}
				t = t * s%Mod*Pow(j, Mod - 2) % Mod;
				if (ck & 1)Res = (Res + t) % Mod;
				else Res = (Res + Mod - t) % Mod;
			}
		}
	}
	printf("%lld\n", Res);
}

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

char swi(int x){
  switch(x){
    case 1:return 'a';
    case 2:return 'b';
    case 3:return 'c';
    case 4:return 'd';
    case 5:return 'e';
    case 6:return 'f';
    case 7:return 'g';
    case 8:return 'h';
    case 9:return 'i';
    case 10:return 'j';
    case 11:return 'k';
    case 12:return 'l';
    case 13:return 'm';
    case 14:return 'n';
    case 15:return 'o';
    case 16:return 'p';
    case 17:return 'q';
    case 18:return 'r';
    case 19:return 's';
    case 20:return 't';
    case 21:return 'u';
    case 22:return 'v';
    case 23:return 'w';
    case 24:return 'x';
    case 25:return 'y';
    case 26:return 'z';
  }
}


int main(){
  string S; cin >> S;
  int k=S.size();
  int count=0;
  int MAX=0;
  int ans=1e9;
  for(int i=1;i<=26;i++){
    char cha=swi(i);
    MAX=0;
    count=0;
    for(int j=0;j<k;j++){
      if(S[j]==cha){
        count=0;
      }
      else{
        count++;
        MAX=max(MAX,count);
      }
    }
    ans=min(MAX,ans);
  }
  cout << ans << endl;
}
      

Measured memory_bytes: 256
def input_from_console():
    s = input()
    t = input()
    return s, t


def solve(s, t):
    min_count = len(t)
    for i in range(len(s)-len(t) + 1):
        temp_count = 0
        for j in range(len(t)):
            if s[j+i] != t[j]:
                temp_count += 1
        min_count = min(min_count, temp_count)
    return min_count


def main():
    s, t = input_from_console()
    print(solve(s, t))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()


Measured memory_bytes: 9124
using System;
 
namespace Sample
{
  class Sample
  {
    static void Main(string[] args)
    {
      string str=Console.ReadLine();
      if(str=="SUN"){
        Console.WriteLine("7");
      }else if(str=="MON"){
        Console.WriteLine("6");
      }else if(str=="TUE"){
        Console.WriteLine("5");
      }else if(str=="WED"){
        Console.WriteLine("4");
      }else if(str=="THU"){
        Console.WriteLine("3");
      }else if(str=="FRI"){
        Console.WriteLine("2");
      }else if(str=="SAT"){
        Console.WriteLine("1");
      }
    }
  }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
    using namespace std;
    #define rep(i,n) for(int i=0; i<n; i++)
     
    char board[110][110];
    int main() {
    int H, W; cin >> H >> W;
    rep(i,H) rep(j,W) cin >> board[i][j];
    rep(i,H) {
    rep(j,W) cout << board[i][j];
    cout << endl;
    rep(j,W) cout << board[i][j];
    cout << endl;
    }
    return 0;
    }

Measured memory_bytes: 256
#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	int N;
	
	cin >> N;

	int p[N];
	rep(i, N)
	{
		cin >> p[i];
	}

	ll a[N];
	ll b[N];
	rep(i, N)
	{
		a[i] = (i+1) * N;
		b[i] = (N-i) * N; 
	}


	rep(i, N)
	{
		a[p[i]-1] += i;
	}

	rep(i, N)
	{
		cout << a[i] << " ";
	}
	cout << endl;
	
	rep(i, N)
	{
		cout << b[i] << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 1024
S = input()

ans = 0

def dfs(i, s):
    global ans
    if i == 1:
        ans += eval(s)
        return
    dfs(i-1, s)
    dfs(i-1, s[:i-1]+'+'+s[i-1:])
    return

dfs(len(S),S)
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long N,A[10000000],max = 0,MID = 0;
  cin >> N;
  for(int i = 0;i < N;i++){
    cin >> A[i];
    if(max < A[i]){max = A[i];}
  }
  int mid = abs((max/2)-A[1]);
  for(int i = 0;i<N;i++){
    if(abs((max/2)-A[i])<mid){
      if(A[i] != max){
      mid = abs((max/2)-A[i]);
      MID = A[i];
      }
    }
  }
  cout << max << " " << MID << endl;
  return 0;
}


Measured memory_bytes: 2816
n, m, X, Y = map(int, input().split())

enpire_A = input().split()
enpire_B = input().split()

enpire_Ai = [int(enpire_A[i]) for i in range(n)]
enpire_Bi = [int(enpire_B[i]) for i in range(m)]

enpire_Ai.append(X)
enpire_Bi.append(Y)


if max(enpire_Ai) < min(enpire_Bi):
    print('No War')
    exit()

print('War')


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

typedef long long ll;
#define ten5 100000+10
#define MOD 1000000007
#define rep(i,a,n) for (int i=a;i<n;i++)
#define iif(c,t,f) ((c)?(t):(f))
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair

int intcmp(const void *v1,const void *v2){return *(int *)v1-*(int *)v2;}

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


Measured memory_bytes: 256
a,b=list(map(int,input().split()))
result=['#'*100 for j in range(100)]
for i in range(50):
    result[i]='.'*100
hup=(b-1)//50
hdown=(a-1)//50
wup=(b-1)%50
wdown=(a-1)%50
for i in range(hup):
    result[i*2]='.#'*50
result[hup*2]='.#'*wup+'.'*(100-2*wup)
for i in range(hdown):
    result[i*2+51]='#.'*50
result[hdown*2+51]='#.'*wdown+'#'*(100-2*wdown)
print(100,100)
for i in range(100):
    print(result[i])

Measured memory_bytes: 3064
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	h := nextInt()
	n := nextInt()
	//必殺技を1回ずつ使った時に与えるダメージの総和vsモンスターの体力
	sum := 0
	for i := 0; i < n; i++ {
		sum += nextInt()
	}
	if sum < h {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define MOD (1000000007)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define all(a)  (a).begin(),(a).end()

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

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

const ll INF = 1LL << 60;

int main(){
  string s; cin >> s;
  ll k; cin >> k;
  int n = s.size();
  if (n == 1) {
    std::cout << k/2 << '\n';
    return 0;
  }
  for (int i = 1; i < n; i++) {
    if(s[i] != s[i-1]) break;
    if (i == n-1) {
      std::cout << (n*k)/2 << '\n';
      return 0;
    }
  }
  ll cnt=0;
  int i = 1;
  while (i < n) {
    if(s[i] == s[i-1]){
      int tmp = 1;
      while (s[i] == s[i-1]){
        tmp++;
        i++;
      }
      cnt += tmp/2;
    }
    else i++;
  }
  ll ans = cnt*k;

  if (s[0] == s[n-1]){
    int cnt_front = 1, cnt_back = 1;
    int i = 1;
    while (s[i] == s[i-1]) {
      cnt_front++;
      i++;
    }
    i = n-1;
    while (s[i] == s[i-1]) {
      cnt_back++;
      i--;
    }
    if((cnt_back*cnt_front)%2 == 1) ans += k-1;
  }
  std::cout << ans << '\n';
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	ll a, b;cin >> a >> b;
	cout << (a == b ? "Yes" : "No") << endl; 

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[15];
int c[15];
int d[15][15];
int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n, m, x;
    cin>>n>>m>>x;
    int ans = 1e9;
    for(int i=0;i<n;i++) {
        cin>>c[i];
        for(int j=0;j<m;j++) {
            cin>>d[i][j];
        }
    }
    for(int i=0;i<(1<<n);i++) {
        int sum = 0;
        memset(a, 0, sizeof(a));
        for(int j=0;j<n;j++) {
            if(i&(1<<j)) {
                for(int k=0;k<m;k++) a[k] += d[j][k];
                sum += c[j];
            } 
        }
       // cout<<sum<<endl;
        bool flag = false;
        for(int t=0;t<m;t++) {
            if(a[t]<x) {
                flag = true;
                break;
            }
        }
        if(!flag) ans = min(sum, ans);
    }
    cout<<((ans==1e9)?-1:ans)<<endl;
	return 0;
}


Measured memory_bytes: 3648
n = int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
ps = {}
def primes(x, k):
    cnt = 0
    for i in range(1,x+1):
        while i % k == 0:
            cnt += 1
            i = i / k
    return cnt
for i in prime:
    ps[i] = primes(n, i)
sevfo = 0
twefo = 0
fot = 0
four = 0
two = 0
for value in ps.values():
    if value >= 74:
        sevfo += 1
        twefo +=1
        fot += 1
        four += 1
        two += 1
    elif value >= 24:
        twefo += 1
        fot += 1
        four += 1
        two += 1
    elif value >= 14:
        fot += 1
        four += 1
        two += 1
    elif value >= 4:
        four += 1
        two += 1
    elif value >= 2:
        two += 1
if (four >= 2 and two >= 3) or sevfo >= 1 or (twefo >= 1 and two >= 2) or (fot >= 1 and four >= 2):
    a = int(((four-1)*four / 2)*(two-2))
    b = fot * (four -1)
    c = twefo * (two-1)
    d = sevfo
    print(a+b+c+d)
else:
    print(0)

Measured memory_bytes: 3064
/*
 * AOJTotalTime.cxx
 * 
 * Copyright 2016 Tom Tanaka <torumu@Tom-no-MacBook-Pro.local>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 * 
 * 
 */


#include <iostream>

int main(int argc, char **argv)
{
	int input;
	int totaltime = 0;
	std::cin >> input;
	totaltime += input;
	std::cin >> input;
	totaltime += input;
	std::cin >> input;
	totaltime += input;
	std::cin >> input;
	totaltime += input;
	int sec = 0;
	int time = 0;
	sec = totaltime % 60;
	time = totaltime / 60;
	std::cout << time << std::endl << sec << std::endl;
	return 0;
}

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

int main() {
  ll K;
  string S;
  cin >> K >> S;
  if (S.size() <= K){
    cout << S << endl;
  }
  if (S.size() > K){
    rep(i, K) cout << S.at(i);
    cout << "..." << endl;
  }
}


Measured memory_bytes: 3628
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int tarou=0,hanako=0;
        int r;
        for(int i=0;i<n;i++){
            r=sc.next().compareToIgnoreCase(sc.next());
            if(r<0)hanako+=3;
            else if(r==0){
                tarou++;
                hanako++;
            }else tarou+=3;
        }
        System.out.printf("%d %d\n",tarou,hanako);
    }
}



Measured memory_bytes: 31200
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#define RG register
using namespace std;
int n;
char s[101],t[101];
void dfs(int st)
{
	for(RG int i=st,j=1;i<=n;i++,j++) if(s[i]!=t[j]) return dfs(st+1);
	printf("%d\n",st+n-1);
	exit(0);
}
int main()
{
	//freopen("Encyclopedia of Permutations.in","r",stdin);
	scanf("%d%s%s",&n,s+1,t+1);
	dfs(1);
	return 0;
}

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

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int l=in.nextInt();
		int r=in.nextInt();
		if(r-l>2019)
		{
			System.out.println(0);
		}
		else
		{
			int p=l%2019;
			r=r%2019;
			if(r<p)
			{
				r=r+2019;
			}
			int min=2019;
			for(int i=p;i<=r;i++)
			{
				for(int j=i+1;j<=r;j++)
				{
					int ans=(i*j)%2019;
					if(ans<min)
					{
						min=ans;
					}
				}
			}
			System.out.println(min);
		}
	}
}
	

Measured memory_bytes: 23124
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;
 
int calc(int x,int y){
    if(y == 0){
        return x;
    }else{
        return calc(y,x%y);
    }
}
 
int main(){
 
    int W,H,C,common;
    scanf("%d %d %d",&W,&H,&C);
 
    if(W >= H)common = calc(W,H);
    else{
        common = calc(H,W);
    }
 
    printf("%d\n",W*H*C/(common*common));
 
    return 0;
}


Measured memory_bytes: 2768
#include<bits/stdc++.h>
#define INF 9223372036854775807LL
#define mod 998244353
#define SYOU(x) fixed<<setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  lol n,m,a,b,c,d;
  string s,w;
  cin >>s;
  if(s[2]==s[3]&&s[4]==s[5]) cout <<"Yes\n";
  else cout <<"No\n";
  return (0);
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
long long int x[100001];
int M;
long long int K;
long long int a[100001];
long long int d[100001];
//int Map[100001];
int one[100001],original[100001];
void doubling(){
  int temp[100001];
  for(int i=1;i<N;i++)one[i]=original[i]=i;
  for(int i=1;i<=M;i++)swap(one[a[i]],one[a[i]-1]);

  while(K>0){
    if(K%2==1){
      for(int i=1;i<N;i++)temp[i]=one[original[i]];
      for(int i=1;i<N;i++)original[i]=temp[i];
    }   
    K/=2;
    for(int i=1;i<N;i++)temp[i]=one[one[i]];
    for(int i=1;i<N;i++)one[i]=temp[i];
  }
}
int main(){
  scanf("%d",&N);
  for(int i=1;i<=N;i++)scanf("%lld",&x[i]);
  for(int i=1;i<=N;i++){a[i]=i;}
  scanf("%d %lld",&M,&K);
  for(int i=1;i<=M;i++)  scanf("%lld",&a[i]);
  
  doubling();
  for(int i=1;i<N;i++)d[i]=x[i+1]-x[i];
  long long int ans=x[1];
  printf("%lld.0\n",ans);
  for(int i=1;i<N;i++){
    ans+=d[original[i]];
    printf("%lld.0\n",ans);
  }
  return 0;
}


Measured memory_bytes: 4992
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    vvi dp(10,vi(5000,0));
    /*dp[i][j] := i????????°???(0,1000)?????´??°??§j???????????´????????°*/
    rep(i,1001)dp[1][i]=1;
    for(int i=1; i<3;i++)rep(j,2001)rep(k,2001)dp[i+i][j+k]+=dp[i][k]*dp[i][j];//??´??°
    int n;
    while (cin>>n)cout<<dp[4][n]<<endl;
}

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

int main(void) {
	int N;
	scanf("%d", &N);
	int V[20], C[20];
	for (int i = 0; i < N; i++) {
		scanf("%d", &V[i]);
	}
	for (int i = 0; i < N; i++) {
		scanf("%d", &C[i]);
	}
	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (V[i] > C[i]) ans += V[i] - C[i];
	}
	printf("%d\n", ans);
	return 0;
}


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

ll A[300005];

int main(int argc, char *argv[]) { ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

  ll mod = pow(10,9) + 7;
  ll n;cin>>n;
  for(ll i=0;i<n;i++){
    cin>>A[i];
  }
  ll ans=0;
  ll t=1;
  for(int i=0;i<=60;i++){
    ll a=0,b=0;
    for(int j=0;j<n;j++){
      if((1ll<<i)&A[j])a++;
      else b++;
    }
    ans += (a*b)%mod*t%mod;
    ans %= mod;
    // cout<<a<<':'<<b<<':'<<ans<<endl;
    t = t*2%mod;
  }
  cout<<ans<<endl;
  
  return 0;
}


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

int main() {
  vector<int> x(5);
  for (int i = 0; i < 5; i++) {
    cin >> x.at(i);
  }
  int count = 0;
  for (int i = 0; i < 5; i++) {
    count++;
    if (x[i] == 0) {
      cout << count << endl;
    }
  }
}

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

int main() {
	int N, K;
	cin >> N >> K;
	vector<int> H(N);
	for (int i = 0; i < N; i++) cin >> H[i];
	vector<int> Cost(N,1000000001);
	Cost[0] = 0;
	for (int i = 1; i < N; i++) {
		for (int j = max(0, i - K); j < i; j++) Cost[i] = min(Cost[i], Cost[j] + abs(H[i] - H[j]));
	}
	cout << Cost[N - 1] << endl;
}


Measured memory_bytes: 4008
#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <complex>

#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; //10^15
typedef long long ll;
typedef unsigned long long ull;


ll powMod(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll t = powMod(x, n/2, mod);
  t = t * t % mod;
  if (n & 1) return t * x % mod;
  return t;
}

ll gcd(ll a, ll b) {
  if (a == 0 || b == 0) return a + b;
  if (b > a) return gcd(b, a);
  return gcd(b, a % b);
}



int main(void) {

  ll x;
  cin >> x;
  ll y = 100;
  int k = 0;

  while (true) {
    k++;
    y += y/100LL;
    if (y >= x) {
      cout << k << endl;
      return 0;
    }
  }
}


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

int main() {
    long long  n;
    cin>>n;
    map<string, long long > cnt;
    for(long long  i = 0;i<n;i++){
        string t1;
        cin>>t1;
        sort(t1.begin(), t1.end());
        cnt[t1]++;
    }
    long long  ans = 0;
    map<string, long long > :: iterator it;
    for(it = cnt.begin();it != cnt.end();it++){
        ans += ((it->second) * (it -> second - 1))/2;
    }
    cout<<ans<<endl;
    return 0;
}

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


int main(){
  int N, cnt;
  string S;
  cin >> N >> S;
  for (int i = 0; i < 1000; i++){
    int c[] = {i/100, (i/10)%10, i%10};
    int f = 0;
    for (int j = 0; j < N; j++){
      if (S[j] == ('0' + c[f])){
        f++;
      }
      if (f == 3) break;
    }
    if (f == 3) cnt++;
	}
	cout << cnt << endl;
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  char answer;
  bool A = false;
  for(int i = 0;i < 26;i++) {
    bool B = false;
    for(int j = 0;j < S.size();j++) {
      if('a' + i == S.at(j)) {
        B = true;
        break;
      }
    }
    if(B == false) {
      A = true;
      answer = 'a' + i;
      break;
    }
  }
  if(A == true) {
    cout << answer << endl;
  }
  else {
    cout << "None" << endl;
  }
}

Measured memory_bytes: 512