diff --git a/Codes/1956 A - Nene's Game/1956A.cpp b/Codes/1956 A - Nene's Game/1956A.cpp new file mode 100644 index 0000000..7d9ebce --- /dev/null +++ b/Codes/1956 A - Nene's Game/1956A.cpp @@ -0,0 +1,72 @@ +#include +using namespace std; + +#define FAST_IO (ios_base:: sync_with_stdio(false),cin.tie(NULL)); +#define ll long long +#define ull unsigned 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() +#define yes cout<<"YES"<>= 1; } return ans; } +bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; } + +#ifndef ONLINE_JUDGE +#define dbg(x...) cerr << #x << " : "; _print(x) +#else +#define dbg(...) +#endif +void __print(int x) {cerr << x;}void __print(long x) {cerr << x;} void __print(long long x){cerr << x;} +void __print(unsigned x){cerr << x;} void __print(unsigned long x){cerr << x;} void __print(unsigned long long x){cerr << x;} +void __print(float x){cerr << x;} void __print(double x){cerr << x;} void __print(long double x){cerr << x;} +void __print(char x){cerr << x;} void __print(const char *x){cerr << x;} void __print(const string &x){cerr << x;} +void __print(bool x){cerr << (x ? "true" : "false");} void _print() { cerr << "\n"; } +template void __print(const A &x); template void __print(const pair &p); +template void __print(const A &x) {bool f=1; cerr << '['; for (const auto &i : x) {cerr << (f ? "" : ","), __print(i); f = 0;} cerr << ']';} +template void __print(const pair &p) {cerr << '('; __print(p.first); cerr << ','; __print(p.second); cerr << ')';} +template void _print(const Head &H, const Tail &...T) { __print(H); if (sizeof...(T)) cerr << ", "; _print(T...);} +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int k,q; + cin>>k>>q; + vectorkick(k),player(q); + for(auto &i:kick) cin>>i; + for(auto &i:player) cin>>i; + for(auto x:player) + { + if(x> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Codes/1956 B - Nene and the Card Game/1956B.cpp b/Codes/1956 B - Nene and the Card Game/1956B.cpp new file mode 100644 index 0000000..4ec8459 --- /dev/null +++ b/Codes/1956 B - Nene and the Card Game/1956B.cpp @@ -0,0 +1,74 @@ +#include +using namespace std; + +#define FAST_IO (ios_base:: sync_with_stdio(false),cin.tie(NULL)); +#define ll long long +#define ull unsigned 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() +#define yes cout<<"YES"<>= 1; } return ans; } +bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; } + +#ifndef ONLINE_JUDGE +#define dbg(x...) cerr << #x << " : "; _print(x) +#else +#define dbg(...) +#endif +void __print(int x) {cerr << x;}void __print(long x) {cerr << x;} void __print(long long x){cerr << x;} +void __print(unsigned x){cerr << x;} void __print(unsigned long x){cerr << x;} void __print(unsigned long long x){cerr << x;} +void __print(float x){cerr << x;} void __print(double x){cerr << x;} void __print(long double x){cerr << x;} +void __print(char x){cerr << x;} void __print(const char *x){cerr << x;} void __print(const string &x){cerr << x;} +void __print(bool x){cerr << (x ? "true" : "false");} void _print() { cerr << "\n"; } +template void __print(const A &x); template void __print(const pair &p); +template void __print(const A &x) {bool f=1; cerr << '['; for (const auto &i : x) {cerr << (f ? "" : ","), __print(i); f = 0;} cerr << ']';} +template void __print(const pair &p) {cerr << '('; __print(p.first); cerr << ','; __print(p.second); cerr << ')';} +template void _print(const Head &H, const Tail &...T) { __print(H); if (sizeof...(T)) cerr << ", "; _print(T...);} +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int n; + cin>>n; + mapm; + for(int i=0; i>x; + m[x]++; + } + int ct=0; + for(auto x:m) + { + if(x.ss%2==0) + ct++; + } + cout<> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Codes/1956 C - Nene's Magical Matrix/1956C.cpp b/Codes/1956 C - Nene's Magical Matrix/1956C.cpp new file mode 100644 index 0000000..a6bf258 --- /dev/null +++ b/Codes/1956 C - Nene's Magical Matrix/1956C.cpp @@ -0,0 +1,76 @@ +#include +using namespace std; + +#define FAST_IO (ios_base:: sync_with_stdio(false),cin.tie(NULL)); +#define ll long long +#define ull unsigned 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() +#define yes cout<<"YES"<>= 1; } return ans; } +bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; } + +#ifndef ONLINE_JUDGE +#define dbg(x...) cerr << #x << " : "; _print(x) +#else +#define dbg(...) +#endif +void __print(int x) {cerr << x;}void __print(long x) {cerr << x;} void __print(long long x){cerr << x;} +void __print(unsigned x){cerr << x;} void __print(unsigned long x){cerr << x;} void __print(unsigned long long x){cerr << x;} +void __print(float x){cerr << x;} void __print(double x){cerr << x;} void __print(long double x){cerr << x;} +void __print(char x){cerr << x;} void __print(const char *x){cerr << x;} void __print(const string &x){cerr << x;} +void __print(bool x){cerr << (x ? "true" : "false");} void _print() { cerr << "\n"; } +template void __print(const A &x); template void __print(const pair &p); +template void __print(const A &x) {bool f=1; cerr << '['; for (const auto &i : x) {cerr << (f ? "" : ","), __print(i); f = 0;} cerr << ']';} +template void __print(const pair &p) {cerr << '('; __print(p.first); cerr << ','; __print(p.second); cerr << ')';} +template void _print(const Head &H, const Tail &...T) { __print(H); if (sizeof...(T)) cerr << ", "; _print(T...);} +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +void solve() +{ + ll n; + cin>>n; + int sum=0; + for(int i=1; i<=n; ++i) + sum+=i*(2*i-1); + cout<=1; --i) + { + cout<<1<<" "<> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index cf85556..b2a6d4c 100644 --- a/Readme.md +++ b/Readme.md @@ -297,6 +297,9 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 285 | 1955 D | Inaccurate Subsequence Search | [Question](https://codeforces.com/problemset/problem/1955/D) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20D%20-%20Inaccurate%20Subsequence%20Search) | 286 | 1955 E | Long Inversions | [Question](https://codeforces.com/problemset/problem/1955/E) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20E%20-%20Long%20Inversions) | 287 | 1955 F | Unfair Game | [Question](https://codeforces.com/problemset/problem/1955/F) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20F%20-%20Unfair%20Game) +| 288 | 1956 A | Nene's Game | [Question](https://codeforces.com/problemset/problem/1956/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1956%20A%20-%20Nene's%20Game) +| 289 | 1956 B | Nene and the Card Game | [Question](https://codeforces.com/problemset/problem/1956/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1956%20B%20-%20Nene%20and%20the%20Card%20Game) +| 290 | 1956 C | Nene's Magical Matrix | [Question](https://codeforces.com/problemset/problem/1956/C) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1956%20C%20-%20Nene's%20Magical%20Matrix)