TCS CodeVita Season 13 Complete Guide:
This page includes:
- CodeVita Round Details
- How to Prepare for CodeVita
- Important Topics
- CodeVita Syllabus
- Practice Questions with Solutions
- Previous Year Questions with Solutions
- Handling Status Messages in CodeVita
TCS CodeVita Coding Answers will be uploaded in this telegram channel for Free: https://telegram.me/+_hn3cBQVbGliYTI9
TCS CodeVita Discussion Group: https://telegram.me/+oZ4x3k1RtXdkNWU1
TCS CodeVita Coding Solutions will be uploaded in this WhatsApp channel for Free: https://whatsapp.com/channel/0029Vb67dZr4o7qMrkr3x70h
Must Join All the Groups !
Telegram: @PLACEMENTLELO
CodeVita Rounds Details:
TCS CodeVita Season 13 is conducted in three rounds.
Round 1: Pre-Qualifier
- This round is divided into 2 sub-rounds e.,
- Round 1 Zone 1
- Round 1 Zone 2
- This is the first round of the competition. In this round the participants have to solve 6 questions within a time-limit of 6 hours. The difficulty level of this round is lowest with comparison to other round of the competition.
- It is not compulsory for the participants to solve all the questions. There maybe a case that you may proceed to the next round, even if you have solved half of the questions.
Round 2: Qualifier
- This is the second round of the competition. In this round the participants have to solve 6 questions but the difficulty level of this round is pretty high than the previous one. If you clear this round, than you can surely get a job in TCS if you want so, and that too at a pretty good package.
Latest Jobs and Internships are regularly uploaded on our WhatsApp Channel:
https://whatsapp.com/channel/0029Va4bojk90x2rq1LgdD1a
Round 3: Final Round
- This is a new Round introduced by TCS Codevita this year, it is an additional round to get the top 3 finalist of the These 3 students will be awarded in the next round with is Grand Finale Ceremony.
Round 4: Grand Finale Ceremony
- This is the final round of the competition. And being so, it is the most difficult round too. The previous two rounds are online rounds, but this round takes place at a particular venue decided by TCS.
- In this round the participants have to solve 10 problems.
- Clearing this round will give you a pleasing cash price, and a delightful job offer in TCS.
- It is not that easy to reach upto this round. According to previous year stats, there were more than 200k participants, but only 25 reached up to this round.
- The finalists stand a chance to travel to India for the Season 13 LIVE Grand Finale experience.
Latest Jobs and Internships are regularly uploaded on our WhatsApp Channel:
https://whatsapp.com/channel/0029Va4bojk90x2rq1LgdD1a
Important Exam Dates:
Round | Description | Date | Time |
M1 | MockVita 1 [ All Regions ] |
29th – 30th August 2025 | 03:00 PM to 03:00 PM IST(24 hrs) |
M2 | MockVita 2 [ All Regions ] |
12th – 13th September 2025 | 03:00 PM to 03:00 PM IST(24 hrs) |
R1Z1 | Round 1 Zone 1 | 10th – 11th October 2025 | 03:00 PM to 03:00 PM IST(24 hrs) |
R1Z2 | Round 1 Zone 2 | 31st Oct – 1st Nov 2025 | 03:00 PM to 03:00 PM IST(24 hrs) |
R2 | Round 2 ( Qualifier ) | 14th – 15th November 2025 | 03:00 PM to 03:00 PM IST(24 hrs) |
F | Final Round | To be Declared | To be Declared |
GFC | Grand Finale Ceremony | To be Declared | To be Declared |
TCS CodeVita Apply Link – Click Here
Latest Jobs and Internships are regularly uploaded on our WhatsApp Channel:
https://whatsapp.com/channel/0029Va4bojk90x2rq1LgdD1a
What is TCS CodeVita?
What excites us to crack CodeVita?
- Global Ranking to Top Coders
- Top 3 Coders to win total prize money of US$20,000/-
- A chance to explore an exciting career with one of the world’s most
- A chance to compete with some of The Best Coders in the world
- A Platform to showcase programming skills
- Students who progressed to the Finals get an opportunity to travel toIndia for the Grand
How to prepare for TCS CodeVita?
In order to prepare for TCS CodeVita, it is necessary to develop immense programming skills.
Understanding the question:
To understand the problem statement, do follow the below guidelines.
- Try to read and understand the problem
- Try to analyse the problem statement whether it requires Logical, Mathematical, or some Algorithmic Techniques to be
- Frame the format of Input and the
- Check for the Constraints to pick out the apt logic or algorithms
- Be strong in Algorithmic
Identify the Optimal Logic:
Write the pseudocode:
Code:
Language allowed and good offline compilers
Language | Compiler / Interpreter Versions |
C | gcc 9.3.0 |
C++ | g++ 9.3.0 |
C# | Mono 6.12.0.122 |
Java | Open jdk 11.0.11 |
Perl | 5.30.0 |
PHP | 7.4.3 |
Python | Python 3.8.10 |
Ruby | 3.0.0 |
Tips to Pass the Test Cases
- Do write the program that solves both the public and the private test
- The program should be able to handle as much as data it can
- Ensure that it follows time and space
Notes
- Once you start the test, you will not be able to pause the test
- The coding test exactly consists of 6 coding questions to be solved in 6 hours.
- Do check the internet connection before getting into the
- Read the questions carefully and start solving the questions you are familiar with.
- Avoid
TCS CodeVita Syllabus by PLACEMENTLELO |
Scenario-based questions |
Mathematics Oriented |
Recursion |
Dynamic Programming |
Arrays |
Pattern programming |
TCS CodeVita Syllabus by PLACEMENTLELO |
Greedy Approach |
String-based |
Searching |
TCS CodeVita Important Topics
Here are some of the important topics from the above syllabus.
Recurrence |
Optimal Interleaving |
Permutation |
All Direction Traversal |
Optimal parenthesis |
Recursion stack holding the result |
Pointer holding result |
All Direction Traversal with constraints |
Searching |
Exhaustive nested searching |
Binary Search |
BS Variants |
Maths |
Time |
Circumference |
Concatenate numbers |
Arithmetic expression |
Module/remainder pattern |
Dijikstra’s |
Dynamic Programming |
Subsequence |
Table Building |
Memorization |
Strings |
Subsequence |
Interleaved access |
Stat |
Parsing |
Reversal kind |
Pattern Matching |
Here are a few easy topics and their logic to get practiced.
TCS CodeVita Questions | Previous Year Questions & Solutions
Important topics
TCS CodeVita Questions
Here are some of the TCS CodeVita questions from previous year’s papers with detailed solutions.
TCS CodeVita Questions #Q1
Given 3xN matrix comprising of { #, *, . } character, find the galaxy and stars within them.
Note: Please pay attention to how vowel A is denoted in a 3×3 block in the examples section below.
Constraints
Input
Input consists of a single integer N denoting the number of columns.
Output
Example 1 Input
* . * # * * * # * * * # * * * . * .
* . * # * . * # . * . # * * * * * *
* * * # * * * # * * * # * * * * . *
Output
Explanation
As it can be seen that the stars make the image of the alphabets U, O, I, E, and A respectively.
Example 2 Input
Output
Explanation
As it can be seen that the stars make the image of the alphabet U, I, and A.
Possible solution:
#include <iostream> using namespace std; int main()
char x[3][n]; for(inti=0;i<3;i++)
if(x[0][i]==’#’ && x[1][i]==’#’ && x[2][i]==’#’)
else if(x[0][i]==’.’ && x[1][i]==’.’ && x[2][i]==’.’)
char a,b,c,a1,b1,c1,a2,b2,c2; x1 = i;
if(a==’.’ && b==’*’ && c==’.’ && a1==’*’ && b1==’*’ && c1==’*’ && a2==’*’
if(a==’*’ && b==’*’ && c==’*’ && a1==’*’ && b1==’*’ && c1==’*’ && a2==’*’ && b2==’*’ && c2==’*’)
if(a==’*’ && b==’*’ && c==’*’ && a1==’.’ && b1==’*’ && c1==’.’ && a2==’*’ && b2==’*’ && c2==’*’)
if(a==’*’ && b==’*’ && c==’*’ && a1==’*’ && b1==’.’ && c1==’*’ && a2==’*’ && b2==’*’ && c2==’*’)
if(a==’*’ && b==’.’ && c==’*’ && a1==’*’ && b1==’.’ && c1==’*’ && a2==’*’ && b2==’*’ && c2==’*’)
import java.util.*; publicclass Main {
public static void main(String[] args) throws Exception {
Scanner sc=new Scanner( System.in ); int n=sc.nextInt();
char gal[][] = new char [3][n]; for(int i=0;i<3;i++){
for(int j=0;j<n;j++) gal[i][j]=a.charAt(j);
if(gal[0][i]==’#’)//||gal[0][i+1]==’#’)
System.out.print(“#”); i++; continue;
if(gal[0][i]==’.’ && gal[1][i]==’.’ && gal[2][i]==’.’)
if(gal[0][i]==’.’ && gal[0][i+2]==’.’ && gal[2][i+1]==’.’) System.out.print(“A”);
else if(gal[1][i]==’.’ && gal[1][i+2]==’.’) System.out.print(“I”);
// System.out.println(“XXXXXXXX”);
from collections import deque def initialize():
s = ”.join(map(str, q)) vowels[s] = ‘A’
q.append([‘*’, ‘*’, ‘*’]) s = ”.join(map(str, q)) vowels[s] = ‘E’
q.append([‘*’, ‘.’, ‘*’]) s =”.join(map(str, q)) vowels[s] = ‘I’
q.append([‘*’, ‘*’, ‘*’]) s = ”.join(map(str, q)) vowels[s] = ‘O’
q.append([‘*’, ‘*’, ‘*’]) s = ”.join(map(str, q)) vowels[s] = ‘U’
vowels = initialize() n = int(input())
for i in range(n): x.append([‘.’, ‘.’, ‘.’])
l = list(input()) for jin range(n):
x[j][i] = l[j] constellation = “”
star = deque() for iin range(n):
s = ”.join(map(str, star)) if s in vowels:
constellation += vowels[s] star.clear()
star.clear() constellation += ‘#’ continue
star.append(x[i]) if len(star)==3:
s = ”.join(map(str, star)) if s in vowels:
constellation += vowels[s] print(constellation, end=””)
TCS CodeVita Questions #Q2
duration since the start of the daypart. For example, 1 hour in the first
part of the day is equivalent to 13, which is 1 hour into the second part of the day.
hours per part (D/P) should be a natural number. Calculate the
Output: 3 (We have 3 instances of equivalent prime hours: 5~17, 7~19, and 11~23.)
Constraints
Input
The single line consists of two space-separated integers, D and P
corresponding to the number of. hours per day and number of parts in a day respectively
Output
Example 1Input
Output
Explanation
In the given test case D = 36 and P = 3 Duration of each daypart = 12 2~14~X
5~17~29 – an instance of equivalent prime hours
7~19~31 – an instance of equivalent prime hours11~23~X
Possible solution:
#include<bits/stdc++.h> using namespace std; bool isprime(int n)
for(int i=2;i<=(int)sqrt(n);i++)
int D,P,i,j,p,t=1;cin>>D>>P; p=D/P;
int time[p][P]; for(i=0;i<P;i++)
bool flag=true; for(j=0;j<P;j++)
import java.util.*; publicclass Main {
public static boolean isprime(int n)
for(int i=2;i<=(int) Math.sqrt(n) ; i++){if(n%i==0)
public static void main(String[] args) throws Exception {
Scanner sc= new Scanner(System.in);
// System.out.println(“XXXXXXXX”); int i,j,D,P,p,t=1;
int time[][] = new int [p][P]; for(i=0;i<P;i++){
for(j=0;j<p;j++){ time[j][i]=t++;
boolean flag=true;for(j=0;j<P;j++)
d, p = map(int, input().split()) generate(d)
for i in range(inv): if i in primes:
if (j*inv+i) not in primes: x = 0
TCS CodeVita Questions #Q3
The rules for distributing the gifts are:
Each employee must receive at least one gift.
Employees having higher ranking get a greater number of gifts than their neighbours.
What is the minimum number of gifts required by the company?
Constraints
Input
First line contains integer T, denoting the number of test cases. For each test case:
First line contains integer N, denoting the number of employees.
Second line contains N space separated integers, denoting the rank of each employee.
Output
For each test case print the number of minimum gifts required on a new line.
Example 1 Input
Output
Explanation
For test case 1, adhering to the rules mentioned above, Employee # 1 whose rank is 1 gets one gift
Employee # 2 whose rank is 2 gets two gifts Therefore, total gifts required is 1 + 2 = 3
Possible solution:
#include<bits/stdc++.h> using namespace std; long long arr[100010];
long long brr[100010]; int main()
int test_case; cin>> test_case;
for(int i = 1; i <= test_case; i++)
long long gift = 0, temp = 0; cin >> n;
gift = gift + max(temp, brr[i]); brr[i] = temp;
import java.util.Scanner; public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in); int T = sc.nextInt();
int n = sc.nextInt(); int[] ar = new int[n]; for (int i= 0; i < n; i++)
ar[i] = sc.nextInt(); int[]gifts = new int[n]; gifts[0] = 1;
// Left to Right Neighbors for (int i = 1; i < n; i++) {
gifts[i] = gifts[i – 1] + 1;else
// Right to Left Neighbors for(int i = n – 2; i >= 0; i–) {
if (ar[i] > ar[i + 1] && gifts[i] <= gifts[i + 1]) gifts[i] = gifts[i + 1] + 1;
for (int gift : gifts) total += gift;
a = list(map(int, input().split())) gifts = [1]
#gifts.append(1) for iin range(1, n):
if a[i] > a[i-1]: gifts.append(gifts[i-1]+1) else:
gifts[i] = max (1 + gifts[i+1], gifts[i]) g = 0
TCS CodeVita Questions #Q4
Consider any 1 element from the array, arr[i]. Replace arr[i] by floor(arr[i]/2).
Perform next operations on the updated array.
The task is to minimize the sum after utmost K operations.
Constraints
Input
Second line contains N space separated integers denoting the elements of the array, arr.
Output
Print a single integer denoting the minimum sum of the final array.
Input
Output
Explanation
Operation 1 -> Select 20. Replace it by 10. New array = [10, 7, 5, 4]
Operation 2 -> Select 10. Replace it by 5. New array = [5, 7, 5, 4].
Operation 3 -> Select 7. Replace it by 3. New array = [5,3,5,4].
Possible Solution
#include<bits/stdc++.h> using namespace std; int main()
long int n,k,temp,sum=0; cin>>n;
vector<int> v; for(inti=0;i<n;i++)
cin>>temp; sum=sum + temp; v.push_back(temp);
make_heap(v.begin(),v.end()); long int maxi = 0,res = 0; for(int i=0;i<k;i++)
pop_heap(v.begin(), v.end()); v.pop_back();
res = maxi / 2; sum+=res; v.push_back(res);
import java.util.*; publicclass Main {
public static void main(String[] args) throws Exception {
Scanner sc= new Scanner(System.in);
// System.out.println(“XXXXXXXX”) int n,k,i,s=0;
for(i=0;i<n;i++) a[i]=sc.nextInt(); while(k– > 0)
int mx=0,p=0; for(i=0;i<n;i++){ if(a[i]>mx) {
for(i=0;i<n;i++) s+=a[i]; System.out.println(s);
n, k = map(int, input().split()) frequency = []
for i in range(100000): frequency.append(0)
a = list(map(int, input().split())) for i in range(n):
while frequency[j]!=0 and k>0: k -= 1
for i in range(100000): sum+= i*frequency[i]
TCS CodeVita Questions #Q5
Constraints
Input
First line contains N denoting number of trains.
Next N line contain 2 integers, a and b, denoting the arrival time and stoppage time of train.
Output
Single integer denoting the minimum numbers of platforms needed to accommodate every train.
Example 1 Input
Output
Explanation
= 13 will arrive at platform# 2.
Example 2 Input
Output
Explanation
Platform #1 can accommodate train 1.
Platform #2 can accommodate train 2.
Possible Solution
#include<bits/stdc++.h> using namespace std; int main()
int a[n],b[n]; for(inti=0;i<n;i++)
int p=1,r=1,i=1,j=0; while(i<n && j<n)
import java.util.Arrays; import java.util.Scanner; public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in); int n = sc.nextInt();
int[] arr = new int[n]; int[] dep = new int[n]; for (int i= 0; i < n; i++) {
int stoppage = sc.nextInt(); dep[i] = arr[i] + stoppage;
Arrays.sort(arr); Arrays.sort(dep);
int i = 1, j = 0, currPlatforms = 1, ans = 1; while (i < n && j < n) {
ans = Math.max(ans, currPlatforms);
a, d = map(int, input().split()) d += a
arr.append(a) dep.append(d) arr.sort() dep.sort()
maxplf = max ( maxplf, plf ) continue
TCS CodeVita Questions #Q6
Given an array of integers A, and an integer K find number of happy elements.
Constraints
Input
Output
Print a single integer denoting the total number of happy elements.
Example 1 Input
Output
Explanation
Example 2 Input
Output
Explanation
Possible Solution
#include <bits/stdc++.h> using namespace std;
int pairs(int elementlst[],int n,int z){ int count=0;
for(int i=0;i<n;i++){ inta=elementlst[i]; int id1=i;
while(elementlst[id2+1]==a) id2+=1;
if(elementlst[id2+1]<=a+z && elementlst[id2+1]>=a-z) count+=1;
while(elementlst[id2+1]==a) id2+=1;
while(elementlst[id1-1]==a) id1-=1;
while(elementlst[id1-1]==a) id1-=1;
if(elementlst[id1-1]<=a+z && elementlst[id1-1]>=a-z) count+=1;
int elementlst[n]; for(inti=0;i<n;i++){
sort(elementlst,elementlst+n); cout<<pairs(elementlst,n,z); return 0;
import java.util.*; publicclass Main {
public static int pairs(int a[], int n , int z)
if(a[id2+1]<=aa+z && a[id2+1]>=aa-z) c++;
if(((a[id1-1]<=aa+z) && (a[id1-1]>=aa-z)) || (
(a[id2+1]<=aa+z) && (a[id2+1]>=aa-z))) c+=1;
if(a[id1-1]<=aa+z && a[id1-1]>=aa-z) c+=1;
public static void main(String[] args) throws Exception {
Scanner sc= new Scanner(System.in);
// System.out.println(“XXXXXXXX”) int n,k,i,s=0;
n=sc.nextInt(); k=sc.nextInt();
for(i=0;i<n;i++) a[i]=sc.nextInt(); Arrays.sort(a);
System.out.print(pairs(a,n,k));
n, k = map(int, input().split()) a = set()
a = set(map(int, input().split())) a = list(a)
if a[i]-a[i-1]>k and a[i+1]-a[i]>k : c += 1
if a[len(a)-1]-a[len(a)-2]>k: c +=1
TCS CodeVita Questions #Q7
Constraints
Input
Output
Time Limit
Example 1 Input
Output
Explanation
Example 2 Input
Output
Explanation
Possible Solution:
#include <bits/stdc++.h> typedef long long int lli; #define pb push_back using namespace std;
int visited[100001] , in[100001] ,low[100001]; int timer;
in[node] = low[node] = timer; timer++;
low[node] = min(low[node] , in[i]);
dfs(i , node); if(low[i] >in[node])
s.insert(node) , s.insert(i); low[node]= min(low[node] , low[i]);
int edge, vertex , a , b; cin >> edge >> vertex; for(inti = 0;i < edge;i++)
static List<List<Integer>> graph;
static TreeSet<Integer> criticalPlanets; static boolean[] visited;
static int[] inTime; static int[] low; staticint timer = 0;
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = sc.nextInt();
criticalPlanets = new TreeSet<>(); for (int i = 0; i < m; i++) {
int u = sc.nextInt(); int v = sc.nextInt(); graph.get(u).add(v);
for (int i : criticalPlanets) System.out.println(i);
public static void dfs(int node, int parent) { visited[node] = true;
inTime[node] = low[node] = timer++; for (int neighbour : graph.get(node)) { if (neighbour == parent)
low[node] = Math.min(low[node], inTime[neighbour]); else {
if (low[neighbour] > inTime[node]) { criticalPlanets.add(neighbour); criticalPlanets.add(node);
low[node] = Math.min(low[node], low[neighbour]);
def dfs (cur, par, timer):vis[cur]=1
low[cur] = trav[cur] = trav[par] + 1
low[cur] = min ( low[cur], trav[i] ) else:
if low[i]>low[cur]: defend.add(i) defend.add(cur)
low[cur] = min (low[cur], low[i])
e, n = map(int, input().split()) g = []
vis.append(0) low.append(0) trav.append(0) g.append(l)
a, b = map(int, input().split()) g[a].append(b)
g[b].append(a) defend = set() dfs(0, -1, timer)
defend = list(defend) defend.sort()
TCS CodeVita Questions (Previous Years)
Q1. Consecutive Prime Sum
Input Format: First line contains a number N
Output Format: Print the total number of all such prime numbers which are less than or equal to N.
Constraints: 2<N<=12,000,000,000
Sample Possible solution:
#include <stdio.h> int prime(int b)
int i,j,n,cnt,a[25],c,sum=0,count=0,k=0;scanf(“%d”,&n);
Output:
EMI = loanAmount * monthlyInterestRate / ( 1 – 1 / (1 + monthlyInterestRate)^(numberOfYears * 12))
Constraints:
Input Format:
- First line: P principal (Loan Amount)
- Second line: T Total Tenure (in years).
- Third Line: N1 is the number of slabs of interest rates for a given period by Bank A. First slab starts from the first year and the second slab startsfrom the end of the first slab and so
- Next N1 line will contain the interest rate and their
- After N1 lines we will receive N2 the number of slabs offered by the second bank.
- Next N2 lines are the number of slabs of interest rates for a given period by Bank The first slab starts from the first year and the second slab starts from the end of the first slab and so on.
- The period and rate will be delimited by single white
Output Format: Your decision either Bank A or Bank B.
Explanation:
Example 2
Q3. Counting Rock Samples
Input Format:
Output Format:
Constraints: 10 ? S ? 10000 1 ? R ? 1000000 1?size of each sample (in ppm) ? 1000
345 604 321 433 704 470 808 718 517 811
Explanation:
921 107 270 631 926 543 589 520 595 93 873 424 759 537 458 614
Explanation:
Q4. kth largest factor of N
Input Format: The input is a comma-separated list of positive integer pairs (N, k)
Output Format: The kth highest factor of N. If N does not have k factors, the output should be 1.
Q5. Collecting Candies
Input Format:
- The first line of input is the number of test case T
- Each test case is comprised of two inputs
- The first input of a test case is the number of boxes N
- The second input is N integers delimited by whitespace denoting the number of candies in each box
Constraints:
Sample Input and Output:
1 | ||
1 |
The explanation for sample input-output 1:
The explanation for sample input-output 2:
5 boxes, each containing 1, 2, 3, 4, and 5 candies respectively.Adding 1
Possible Solution:
c[j]) { temp=c[i]; c[i]=c[j]; c[j]=temp; } } } sum=0; k=0; for(i=0;i<n;i++) { sum=sum+c[i]; s[k]=sum; k++; } s1=0; for(i=1;i<k;i++) s1=s1+s[i]; printf(“%dn”,s1); } return 0; } ” v:shapes=”Textbox_x0020_432″>
If Goal Difference(GD) is the same, the team with higher Goals For is ranked ahead
More than 2 matches of same teams, should be considered as Invalid Input.
A team can’t play matches against itself, hence if team names are same
for a given match, it should be considered Invalid Input
- T1 Name of the first team
- T2 Name of the second team
- S1 Goals scored by the first team
- S2 Goals scored by the second team
Output Format: Team names in order of their rankings, one team per
line OR Print “Invalid Input” where appropriate.
Constraints: 0< N <=10,000 0<=S1,S2
Example: Consider 5 teams Spain, England, France, Italy, and Germany with the following fixtures:
- Match 1: Spain vs. England (3-0) (Spain gets 2 points, England gets 0)
- Match 2: England France (1-1) (England gets 1 point, France gets 1)
- Match 3: Spain France (0-2) (Spain gets 0 points, France gets 2)
Table 1. Points Table after 3 matches
Spain | 2 | 3 | 2 | 1 |
England | 2 | 1 | 4 | -3 |
France | 2 | 3 | 1 | 2 |
Italy | 0 | 0 | 0 | 0 |
Germany | 0 | 0 | 0 | 0 |
Q7. Sorting Boxes
The objective is to reposition the boxes as required with minimum effort.
Constraints: N<=50 and Weights <= 1000
Sample Input-output:
- If it goes from a point to another point on the same face (say X to Y), it goes in an arc of a circle that subtends an angle of 60 degrees at the center of the circle
- If it goes from one point to another on a different face, it goes by the shortest path on the surface of the cube, except that it never travels along the bottom of the cube
Q9. Coins Distribution Question (or Coins RequiredQuestion)
Problem Description
Input Format
Output Format
Four Space separated Integer Values 1st – Total Number of coins
2nd – number of 5 Rupee coins. 3rd – number of 2 Rupee coins. 4th – number of 1 Rupee coins.
Constraints
Sample Input:
Sample Output:
Explanation:
The minimum number of coins required is 6 with in it: minimum number of 5 Rupee coins = 1
minimum number of 2 Rupee coins = 3 minimum number of 1 Rupee coins = 2
For 1 = one 1 Rupee coin For2 = one 2 Rupee coin
For 3 = one 1 Rupee coin and one 2 Rupee coins For 4 = two 2 Rupee coins
For 6 = one 5 Rupee and one 1 Rupee coins For 7 =one 5 Rupee and one 2 Rupee coins
For 8 = one 5 Rupee, one 2 Rupee and one 1 Rupee coins For 9 = one 5 Rupee and two 2 Rupee coins
For 10 = one 5 Rupee, two 2 Rupee and one 1 Rupee coins
Q10. Philaland Coins Question
Problem Description
Input Format
Output Format
Constraints
Sample Input 1:
Sample Output 1:
Sample Input2:
Sample Output2:
Explanation:
For test case 2, N=5.
Frequently Asked Questions (FAQs)
Q1. I’m getting the message “User already logged in. Please try after 15 minutes”.What do I do?
Q2. “How to log in and take part in the contest?”
A2. Taking part in CodeVita Season 13 is a three-part activity.
- One qualifies as per the eligibility
- One has registered and has achieved 100% Profile completion status
- On the day of the contest, participants can directly log in to the contest site https://codevita.tcsapps.com They can use their registered Email ID orUsername to login, once they have entered Username or Email ID they will be prompted to enter the One-Time Code (OTC) from the Microsoft AuthenticatorApp that they have configured during the registration for authentication. Once into the
Q3. “Can I submit solution in any language?”
Q4. “What does attribution of code mean?”
declare the actual web URL. This is referred to as ‘Attribution of Code’
Q5. “Where do I mention the attributed code?”
Q6. “What is proper attribution of Code?”
Generic entries like ‘Google.com’, ‘www.codechef.com’, ‘stackoverflow’,
‘stackoverflow.com’, ‘Friend’s Code’, ‘Internet’, and other incomplete entries will notbe accepted.
Q7. “What happens if I do not attribute the code I have referred to?”
This will lead to code getting tagged as plagiarized and the participant will not be
Q9. “Can I take personal breaks in between the contest?”
otherwise there will be a waiting period of 15 minutes to log-in again.
A10. Please crosscheck this troubleshooting checklist:
‒ Ensure you are using a wired/reliable network. Mobile network usage is not
recommended, as there can be network fluctuations.
‒ Compatible browsers are Chrome and Firefox.
‒ Browser being used should be updated to the latest versions.
‒ Ensure that JavaScript is enabled on your browser.
‒ Ensure that any org/institute/system level proxy is not blocking any content of CodeVita site.
‒ Clear the browser cache and download files, then try again.
Q11. “Since I have logged in, my clock is showing my time as 00:00:00.”
Q12. “I want the answers to all the questions asked in the contest”
A12. Please note that we do not reveal the answers to the CodeVita questions.
You must successfully solve the question in the system to know the correct answer.
ABOUT US:
Latest Jobs and Internships are regularly uploadedhere: Telegram: https://telegram.me/PLACEMENTLELO
Whatsapp:
https://whatsapp.com/channel/0029Va4bojk90x2rq1LgdD1a
Youtube: https://www.youtube.com/@placementleloInstagram: https://www.instagram.com/placementlelo
Linkedin: https://www.linkedin.com/company/placementlelo
Handling various status messages foundin CodeVita:
1. Compile Time Error:
A successful compilation simply returns silently. Hence your aim shouldbe that your
program is so agreeable with the compiler that the compiler happily returns silently.
If you get a CTE, do as follows.
- First and foremost, you must ensure that you use the sameversions of compilers that the server-side A list of compilersis provided here.
- If you are using the same compiler, then mentally you musttreat Warnings as errors because warnings prevent thecompilers from returning silently. So, get rid of all Warnings in your compilation
- If you have meticulously followed the above, it is highly unlikelythat you will get CTE.
- In extremely rare cases, a negligibly small possibility exists that under heavy load, the servers and hence the compilers malfunction and hence your compilation fails. The probability of this happening is less than 0.01% because CodeVita engineering is now mature enough to handle thousands of concurrent compilations. In your thinking you should simply discount thepossibility that the compiler has malfunctioned, but if you have good enough reason to suspect that this is what might have happened, then simply resubmit the code after some time. This kind of behavior is temporal and the probability of CTE vanishing on its own is high.
- Finally, whenever a CTE occurs the CodeVita Judge providesthe exact error message that the compiler has Using this message as a clue you should be able totroubleshoot past your compilation problems.
2. Runtime Error (RTE):
A Runtime error is caused because either your program or the runtime has thrown some
exception. Since RTE could be caused because of N number of reasonsit is difficult to pin-
point and hence provide a crisp error message unlike CTE.
Let us divide RTE into two parts
because of any reasons, but not limited to those stated below:
- Failure to adhere to input and output specifications is thenumber one cause of RTE.
- Known programming violations like Illegal memory access orNull Pointer Exception etc. results in RTE.
- RTE are more common to languages like C and C++ wherestatic time type checking is lenient and hence faults manifest only at
- Any logical mistake that leads to throwing an exception receivesan RTE. If you have participated in previous seasons of CodeVita, I request you share your stories on how you got past RTEs.
3. Time Limit Exceeded (TLE):
performance. However, no matter how well a platform is engineered,
This will drastically reduce the sorting time and the program can finish within thresholds.
- It is good practice to insert timestamps in your code to knowhow much time is spent in different parts of your So, incase you get a TLE, you already know where your bottlenecks are.
- Your choice of data structure and algorithm plays a critical rolein assessing whether you will or will not receive a TLE.
- Keep a profiler handy and more importantly know how to use itso that in case of TLE you may get insights into the runtime of your
- With TLE, some good programmers have a reverse gripe i.e., they write so optimized code that they feel that the thresholds are too lenient. Such programmers are advised to have patience. May be with a few questions, few programmers can get away even with sub-optimal code, but it cannot happen always. Keep up the good habit of writing optimized There will come a question where only optimal code will pass, and the rest will receive TLE. It’s just that not all questions are geared towards figuring out if the
4. Memory Limit Exceeded (MLE):
Just like TLE appears due to longer than allowed runtime execution times,
‒ how you handle memory allocation / deallocation in your code
5. Wrong Answer:
6. Accepted: