From 295f67917f045b1547be0b74067488cb432f5c5d Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Tue, 12 Dec 2023 20:08:29 +0600 Subject: [PATCH] added 421A --- 421A Pasha and Hamsters/421A.cpp | 85 ++++++++++++++++++++++++++++++++ Readme.md | 1 + 2 files changed, 86 insertions(+) create mode 100644 421A Pasha and Hamsters/421A.cpp diff --git a/421A Pasha and Hamsters/421A.cpp b/421A Pasha and Hamsters/421A.cpp new file mode 100644 index 0000000..f1bd7f5 --- /dev/null +++ b/421A Pasha and Hamsters/421A.cpp @@ -0,0 +1,85 @@ +#include +using namespace std; + +// Short forms +#define int long long +#define ll long long +#define endl '\n' +#define ff first +#define ss second +#define pb push_back +#define all(x) x.begin(), x.end() +#define sz(x) (int)(x).size() + +// Outputs +#define yes cout<<"YES"< void _print(pair p); +template void _print(vector v);template void _print(set v); +template void _print(map v);template void _print(multiset v); +template void _print(pair p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";} +template void _print(vector v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(set v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(multiset v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int n,a,b; + cin>>n>>a>>b; + vector v(n+1); + for(int i=0;i>x; + v[x] = 1; + } + for(int i=1; i<=n; ++i) + { + if(v[i]==0) + cout<<2<<" "; + else + cout<<1<<" "; + } +} + +int32_t main() +{ + FAST_IO; + int TC = 1; + // cin >> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index 8c0199a..01b96ca 100644 --- a/Readme.md +++ b/Readme.md @@ -57,6 +57,7 @@ Feel free to check these codes out. | 344A | Magnets | [Question](https://codeforces.com/problemset/problem/344/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/344A%20Magnets/344A.cpp) | 349A | Cinema Line | [Question](https://codeforces.com/problemset/problem/349/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/349A%20Cinema%20Line/349A.cpp) | 411A | Password Check | [Question](https://codeforces.com/problemset/problem/411/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/411A%20Password%20Check/411A.cpp) +| 421A | Pasha and Hamsters | [Question](https://codeforces.com/problemset/problem/421/A) | [Solution] | 456B | Fedya and Maths | [Question](https://codeforces.com/problemset/problem/456/B) | [Solution] | 460 | Plural Form of Nouns | [Question](https://codeforces.com/problemsets/acmsguru/problem/99999/460) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/460%20Plural%20Form%20of%20Nouns/99999460.cpp) | 486A | Calculating Function | [Question](https://codeforces.com/contest/486/problem/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/486A%20Calculating%20Function/486A.cpp)