My issue
Everything I have written in my code seems to be correct though it is throwing errors. Please help me realize my mistake in the code.
My code
/*
?O?w?n?e?r? ?S?l?y?g?r?i?n?
*/
#include <iostream>
#include <string>
using namespace std;
int main() {
int t;
cin >> t;
cin.ignore();
while (t--) {
string n_str;
getline(cin, n_str);
int no_of_applications = 0;
int remaining_applications = 0;
if (n_str.length() > 18) {
no_of_applications = 1;
remaining_applications = 19;
} else {
long long n = stoll(n_str);
no_of_applications = n / 20;
remaining_applications = n - no_of_applications * 20;
}
cout << remaining_applications << "\n";
}
return 0;
}
Problem Link: EPANLNK Problem - CodeChef