×

# Can you tell me which test case it is failing?

 0 I am writing solution for http://codeforces.com/contest/768/problem/A but it is giving WA on 10th test case. Here is my code: #include #include #define ll long long int using namespace std; int main() { // your code goes here int n; cin>>n; int a[n]; for(int i=0;i>a[i]; cout<

 1 You have overlooked two important cases, I think. Firstly if N=1, your program will print N-2, which is equal to -1, while the answer should be 0. Another case that you haven't considered is that two or more stewards can have the same value. For example, if N=3, and the stewards have values: 4,4,4; your program will print 1, while the correct answer is 0. Hope this was helpful. answered 10 Jul '18, 01:11 681●12 accept rate: 14% 1 thanks for your time.. (10 Jul '18, 11:42) montycs0★
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×682

question asked: 09 Jul '18, 22:30

question was seen: 169 times

last updated: 11 Jul '18, 20:06