Skip to content

Commit

Permalink
7 March Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Vzenun committed Mar 7, 2023
1 parent 2388812 commit 6f6a5fe
Show file tree
Hide file tree
Showing 38 changed files with 2,234 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: 1220A_Cards","url":"/Users/vidurgoel/Codeforces/1220A_Cards.cpp","tests":[{"id":1676992092557,"input":"4\nezor\n","output":"0"},{"id":1676992101982,"input":"10\nnznooeeoer\n","output":"1 1 0"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/1220A_Cards.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: 141A_Amusing_Joke","url":"/Users/vidurgoel/Codeforces/141A_Amusing_Joke.cpp","tests":[{"id":1678157279510,"input":"SANTACLAUS\nDEDMOROZ\nSANTAMOROZDEDCLAUS\n","output":""},{"id":1678157296673,"input":"PAPAINOEL\nJOULUPUKKI\nJOULNAPAOILELUPUKKI\n","output":""},{"id":1678157304171,"input":"BABBONATALE\nFATHERCHRISTMAS\nBABCHRISTMASBONATALLEFATHER\n","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/141A_Amusing_Joke.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: 1631A_Min_Max_Swap","url":"/Users/vidurgoel/Codeforces/1631A_Min_Max_Swap.cpp","tests":[{"id":1677692074769,"input":"3\n6\n1 2 6 5 1 2\n3 4 3 2 2 5\n3\n3 3 3\n3 3 3\n2\n1 2\n2 1","output":"18\n9\n2"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/1631A_Min_Max_Swap.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"Local: 1692B_All_Distinct","url":"/Users/vidurgoel/Codeforces/1692B_All_Distinct.cpp","tests":[{"id":1676911484982,"input":"4\n6\n2 2 2 3 3 3\n5\n9 1 9 9 1\n4\n15 16 16 15\n4\n10 100 1000 10000\n","output":"2\n1\n2\n4\n"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/1692B_All_Distinct.cpp","group":"local","local":true}
{"name":"Local: 1692B_All_Distinct","url":"/Users/vidurgoel/Codeforces/1692B_All_Distinct.cpp","tests":[{"id":1676911484982,"input":"4\n6\n2 2 2 3 3 3\n5\n9 1 9 9 1\n4\n15 16 16 15\n4\n10 100 1000 10000","output":"2\n1\n2\n4"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/1692B_All_Distinct.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: 1776H_Beppa_and_SwerChat","url":"/Users/vidurgoel/Codeforces/1776H_Beppa_and_SwerChat.cpp","tests":[{"id":1677160131850,"input":"4\n5\n1 4 2 5 3\n4 5 1 2 3\n6\n1 2 3 4 5 6\n1 2 3 4 5 6\n8\n8 2 4 7 1 6 5 3\n5 6 1 4 8 2 7 3\n1\n1\n1","output":"2\n0\n4\n0"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/1776H_Beppa_and_SwerChat.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: 540A_Combination_Lock","url":"/Users/vidurgoel/Codeforces/540A_Combination_Lock.cpp","tests":[{"id":1677240917035,"input":"5\n82195\n64723","output":"13"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/540A_Combination_Lock.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: 702A_Maximum_Increase","url":"/Users/vidurgoel/Codeforces/702A_Maximum_Increase.cpp","tests":[{"id":1677080639924,"input":"5\n1 7 2 11 15\n","output":"3\n"},{"id":1677080649311,"input":"6\n100 100 100 100 100 100\n","output":"1\n"},{"id":1677080655711,"input":"3\n1 2 3","output":"3"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/702A_Maximum_Increase.cpp","group":"local","local":true}
1 change: 1 addition & 0 deletions .cph/.Div.7.cpp_550285b26ca1fafae63b58ae476328a3.prob
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: Div","url":"/Users/vidurgoel/Codeforces/Div.7.cpp","tests":[{"id":1677346530087,"input":"3\n42\n23\n377","output":"42\n28\n777"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/Div.7.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: EDU_Binary_Search","url":"/Users/vidurgoel/Codeforces/EDU_Binary_Search.cpp","tests":[{"id":1678180171889,"input":"10 10\n1 61 126 217 2876 6127 39162 98126 712687 1000000000\n100 6127 1 61 200 -10000 1 217 10000 1000000000","output":"NO\nYES\nYES\nYES\nNO\nNO\nYES\nYES\nNO\nYES"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/EDU_Binary_Search.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: EDU_Closest_number","url":"/Users/vidurgoel/Codeforces/EDU_Closest_number.cpp","tests":[{"id":1678180831134,"input":"5 5\n3 3 5 8 9\n2 4 8 1 10\n","output":"0\n2\n4\n0\n5\n"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/EDU_Closest_number.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: EDU_Closest_number_to_left","url":"/Users/vidurgoel/Codeforces/EDU_Closest_number_to_left.cpp","tests":[{"id":1678183266555,"input":"5 5\n3 3 5 8 9\n2 4 8 1 10","output":"0\n2\n4\n0\n5"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/EDU_Closest_number_to_left.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: EDU_Closest_number_to_right","url":"/Users/vidurgoel/Codeforces/EDU_Closest_number_to_right.cpp","tests":[{"id":1678183350507,"input":"5 5\n3 3 5 8 9\n2 4 8 1 10","output":"1\n3\n4\n1\n6"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/EDU_Closest_number_to_right.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: EDU_Fast_Search","url":"/Users/vidurgoel/Codeforces/EDU_Fast_Search.cpp","tests":[{"id":1678183808480,"input":"5\n10 1 10 3 4\n4\n1 10\n2 9\n3 4\n2 2","output":"5 2 2 0"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/EDU_Fast_Search.cpp","group":"local","local":true}
2 changes: 1 addition & 1 deletion .cph/.k.cpp_7e8442e5400f79ab42600bbcba0766fc.prob
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"Local: k","url":"/Users/vidurgoel/Codeforces/k.cpp","tests":[{"id":1672989939178,"input":"1101\n0111","output":"14\n16\n19"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/k.cpp","group":"local","local":true}
{"name":"Local: k","url":"/Users/vidurgoel/Codeforces/k.cpp","tests":[{"id":1672989939178,"input":"14 1 2 3 1\n4 5 6 7 2 4 2 34 2 2 5 4 5 10","output":"30"},{"id":1676922141263,"input":"8 1 2 3 1\n4 5 6 7 2 4 2 34","output":"18"},{"id":1676922241763,"input":"8 1 2 3 1\n4 5 6 7 2 4 2 3","output":"17"},{"id":1676923303678,"input":"4 1 2 3 1\n5 6 7 3","output":"9"},{"id":1676969295206,"input":"4 2 8 3 3\n8 1 1 5","output":"26"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/vidurgoel/Codeforces/k.cpp","group":"local","local":true}
Binary file added 1220A_Cards.bin
Binary file not shown.
210 changes: 210 additions & 0 deletions 1220A_Cards.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
// Vidur Goel

//Codeforcees Handle: Vidurcodviz

#include<iostream>
#include<string>
#include<cmath>
#include<climits>
#include<algorithm>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<stack>
#include<chrono>
#include<random>
#include<cassert>
#include<array>
#include<bitset>
#include<complex>
#include<cstring>
#include<functional>
#include<iomanip>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<utility>
#include<string_view>
#include<deque>
#include<iterator>
#include<sstream>

using namespace std;
using namespace chrono;

void solve_array();
void solve_single();
void solve_mul();

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double lld;
typedef pair<ll,ll> pll;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vector<ll> > vvl;

#define make_it_fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define rept(i, a, n) for (ll i = (a); i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define sor(x) sort(all(x))
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define MOD 1000000007
#define MOD1 998244353
#define PI 3.141592653589793238462
#define vec vector<ll>
#define nn endl

ll seiv[1000001]={0};

string yup="YES";
string nope="NO";

ll minar(ll * arr,ll n){return *min_element(arr,arr+n);}
ll maxar(ll * arr,ll n){return *max_element(arr,arr+n);}

ll fibonacci(ll n){ll a=0;ll b=1;ll c;if(n==0 || n==1){return n;}for(ll i=2;i<n+1;i++){c=a+b;a=b;b=c;}return c;}

void copy_array(ll * &arr,ll * &brr,ll n){copy(arr,arr+n,brr);}
void read_array(ll * &arr,ll n){for(ll i=0;i<n;i++){cin>>arr[i];}return;}
void print_array(ll * &arr,ll n){for(ll i=0;i<n;i++){cout<<i<<" "<<arr[i]<<endl;}return;}
//void print_array(ll arr[],ll n){for(ll i=0;i<n;i++){cout<<i<<" "<<arr[i]<<endl;}return;}
void print_array(vec &arr,ll n){for(ll i=0;i<n;i++){cout<<i<<" "<<arr[i]<<endl;}return;}

bool prime(ll n){for(int i=2;i*i<=n;i++){if(n%i==0){return false;}}return true;}
void seive(){seiv[0]=0;seiv[1]=1;for(ll i=2;i*i<1000001;i++){if(seiv[i]==0){seiv[i]=i;for(ll j=i*i;j<1000001;j=j+i){if(seiv[j]==0){seiv[j]=i;}}}}}

ll gcd(ll a,ll b){if(b==0){return a;}if(a>=b){return gcd(b,a%b);}else{return gcd(b,a);}}
ll expo(ll num,ll coef){ll res=1;while(coef!=0){if(coef%2==0){coef=coef/2;num=num*num;}else{coef=coef-1;res=res*num;}}return res;}
ll expo_mod(ll a,ll n,ll m){ll res=1;while(n!=0){if(n%2==0){a=a*a;a=a%m;n=n/2;}else{res=res*a;res=res%m;n--;}}return res;}

ll add_mod(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a + b) % m) + m) % m;}
ll mul_mod(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a * b) % m) + m) % m;}
ll sub_mod(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a - b) % m) + m) % m;}

/*
sqrt() in built function to give the square root in float/double
cbrt() in built function to give the cube root in float/double
abs() is used for the absolute value of a number
sort() inbuilt function in cpp
swap() function in c++ used to swap value of two elements of the same data type.
toupper() This function is used for converting a lowercase character to uppercase.
tolower() This function is used for converting an uppercase character to lowercase.
ceil() and floor() function
vector<ll> vect(arr, arr+n) used to make a vector containg same elements as that of the array arr
sort(vect.begin(),vect.end(), greater<int>());
sort(arr,arr+n, greater<ll>()) sort in the decreasing order
reverse(vect.begin(), vect.end());
reverse(arr,arr+n);
accumulate(first_iterator, last_iterator, initial value of sum) – Does the summation of vector elements eg: accumulate(arr,arr+n,0) will give summation of the array
count(first_iterator, last_iterator,x) – To count the occurrences of x in vector.
find(first_iterator, last_iterator, x) – Returns an iterator to the first occurrence of x in vector and points to last address of vector ((name_of_vector).end()) if element is not present in vector
find(vect.begin(), vect.end(),5) != vect.end()?
cout << "\nElement found":
cout << "\nElement not found";
maximium value long long can take 9, 223, 372, 036, 854, 775, 807
2^63-1
i.e, length of 19 only
maximium value long long can take 18, 446, 744, 073, 709, 551, 615
2^64-1
i.e, length of 20 only
reverse(s.begin(), s.end()); to reverse the string.(in built function)
set<int, greater<int> > s1;
s1.insert(10);
set<int> a;
by default the sets are sorted in the ascending order
this is how we are going to use the pair here
vector< pair<ll,ll> > v;
ll count=1;
for(ll i=0;i<n-1;i++){
if(arr[i]!=arr[i+1]){
v.push_back(make_pair(count,arr[i]));
count=1;
}
if(arr[i]==arr[i+1]){
count++;
}
}
v.pb(make_pair(count,arr[n-1]));
sort(v.begin(),v.end(),mycompare);
*/

bool mycompare(pair<ll, ll> p1 ,pair<ll, ll> p2){
if(p1.first<p2.first){
return true;
}
else if(p1.first==p2.first){
return p1.second<p2.second;
}
else{
return false;
}
}

void solve_mul(){
ll test;
cin>>test;
for(ll i=0;i<test;i++){

}
}

void solve_single(){
ll n;
cin>>n;
string s;
cin>>s;
ll a[5]={0};
for(ll i=0;i<n;i++){
if(s[i]=='z'){
a[0]++;
}
else if(s[i]=='e'){
a[1]++;
}
else if(s[i]=='r'){
a[2]++;
}
else if(s[i]=='o'){
a[3]++;
}
else if(s[i]=='n'){
a[4]++;
}
}
while(a[4]!=0){
cout<<1<<" ";
a[4]-=1;
a[3]-=1;
a[1]-=1;
}
while(a[0]!=0){
cout<<0<<" ";
a[0]-=1;
}
cout<<nn;
}

void solve_array(){
ll n;
cin>>n;
ll * arr=new ll[n];
read_array(arr,n);
}

int main(){
make_it_fast();
//seive();
//solve_mul();
//solve_array();
solve_single();
return 0;
}
Binary file added 141A_Amusing_Joke.bin
Binary file not shown.
Loading

0 comments on commit 6f6a5fe

Please sign in to comment.