Tough TCS Codevita: Zone 2

yes
Code-
`
#include<bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
#define ll long long
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define mod 1000000007
#define pb push_back
#define S second
#define F first
#define P pair<ll,ll>
#define PI 3.1415926535897932384626433832795028
//#define ordered_set tree<ll, null_type,less_equal<>, rb_tree_tag,tree_order_statistics_node_update>

int32_t main()
{
fast
// #ifndef ONLINE_JUDGE
// freopen(“input.txt”, “r”, stdin);
// freopen(“output.txt”, “w”, stdout);
// #endif
ll n, m;
cin >> n >> m;
ll a[500][500];
for (ll i = 0; i < n; i++) {
for (ll j = 0; j < m; j++) {
cin >> a[i][j];
}
}
vector r;
ll c;
while (cin >> c) {
r.pb©;

}
ll layer = r.size();
for (ll i = 0; i < layer; i++) {
	ll rotL = r[i];
	//	cout << rotL << endl;

	vector<ll> rot;
	for (ll j = i; j < m - i; j++)
		rot.pb(a[i][j]);
	for (ll j = i + 1; j < n - i; j++)
		rot.pb(a[j][m - i - 1]);
	for (ll j = m - i - 2; j >= i; j--)
		rot.pb(a[n - i - 1][j]);
	for (ll j = n - i - 2; j > i; j--)
		rot.pb(a[j][i]);
	// for (auto x : rot)
	// 	cout << x << " ";
	// cout << endl;
	rotL = rotL % rot.size();
	if (i % 2 == 0) {
		// left
		rotate(rot.begin(), rot.begin() + rotL, rot.end());
		// for (auto x : rot)
		// 	cout << x << " ";
		// cout << endl;
		ll kk = 0;
		for (ll j = i; j < m - i; j++)
			a[i][j] = rot[kk++];
		for (ll j = i + 1; j < n - i; j++)
			a[j][m - i - 1] = rot[kk++];
		for (ll j = m - i - 2; j >= i; j--)
			a[n - i - 1][j] = rot[kk++];
		for (ll j = n - i - 2; j > i; j--)
			a[j][i] = rot[kk++];


	}
	else {
		// right
		rotate(rot.begin(), rot.begin() + rot.size() - rotL, rot.end());
		// for (auto x : rot)
		// 	cout << x << " ";
		ll kk = 0;
		for (ll j = i; j < m - i; j++)
			a[i][j] = rot[kk++];
		for (ll j = i + 1; j < n - i; j++)
			a[j][m - i - 1] = rot[kk++];
		for (ll j = m - i - 2; j >= i; j--)
			a[n - i - 1][j] = rot[kk++];
		for (ll j = n - i - 2; j > i; j--)
			a[j][i] = rot[kk++];
	}
}
for (ll i = 0; i < n; i++) {
	for (ll j = 0; j < m; j++)
		cout << a[i][j] << " ";
	cout << endl;
}

}
`

I was also too unfortunate to have this set in my login :imp::imp::imp::imp::imp:

Election
Single lane highway
Corona virus
String Pair
Zoo
Count Palindrome

hii, is goldman sachs result has been released, if yes then from where to check it??

Is there no one here, who solved any one of the questions of my set?

Codevita 2020 zone 2 experience!
1. Spend 2 hours on figuring out how to give 45 as output, fortyfive/ forty five/ Forty Five/ forty-five or something else :thinking:
2. Tried all, still WA :neutral_face:
3. Spend 1 hour waiting for the website to work properly. It keeps ending the session automatically and also takes around 5 minutes to open completely :tired_face:
4. Went to sleep :sleeping:

“Years of academy training wasted!” :poop:

6 Likes

I wasted 2-3 hrs in fill cube question bcz i was pretty sure that my answer is correct but still not cleared the private test cases.

yes,exactly

I have Election and corona virus problem in common. I solved them both.

Does somebody knows rank list of zone-2? They released rank list of zone-1 quickly. @ssrivastava990 do you know about this?

Nope , I don’t have any information regarding this.

Where can we find the ranklist?
Please do share the source.

Easy ones had errors in test cases or some ambiguity. So I just slept after not being able to solve any after the first 2.5 hours. And thank god I did sleep.

Seems like someone is very frustrated. :joy:
Found it on telegram, while searching through groups.

1 Like

send your questions name please

Where you find ranklist for zone 1?

It happens with me also but in codevita 08 .

No, till this date there is not acknowledgement regarding test.

1 Like

Fill the Cube
Elections
Odd Even
Corona Virus
Subnetting
Secret Word

1 Like

Link of Zone 1 rank list please.

Don’t feel bad about it…this is just a shitty contest… in my question paper 3 questions were wrong as they didn’t have any submissions.

Fill the cube and Odd Even were totally wrong. I have solved Odd-Even multiple times before as it is one of the standard problem however found out that the problem statement was itself wrong…


And the saddest part is when I told them about this the CTO of TCS replied to me angrily as if I stole something. And they say that they will give us the title of the best coder of the world… Google Code Jam and ICPC might be crying after listening to this. :sweat_smile: :sweat_smile: :sweat_smile:

2 Likes