Codechef Problems: Time Penalty (WAPEN)
Problem Statement:
You are participating in CodeChef Starters 173, which has a time penalty of minutes for every incorrect submission you make.
That is, the total penalty for a problem equals the number of minutes from the start of the contest till your submission receives the AC verdict, plus minutes for every incorrect submission made before that.
You solved a problem minutes after the start of the contest, and made incorrect submissions while doing so.
What's the total time penalty for this problem?
Input Format
- The first and only line of input will contain two space-separated integers and — the number of minutes after which you solved the problem, and the number of wrong submissions you made.
Output Format
Output a single integer: the total time penalty for the problem.
Constraints
Solution:
Given,
X - Time from the start of the contest
Y - Number of Incorrect Submissions
To find - Total Time Penalty for the problem
Total time penalty = time to solve the problem + Incorrect submission penalty
= X + ( 10 * Y )
Code Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
cout << x + 10 * y << endl;
return 0;
}
Comments
Post a Comment