You are not logged in. Please login at www.codechef.com to post your questions!

×

CIELAB -any missing test case here?

include <iostream>

include <bits stdc++.h="">

using namespace std;

int main() { int a ,b; cin>>a>>b; int t=a-b; int k=t%10; if(k==0) { t+=1; // cout<<t; } else { t=t-1; } cout<<t;

// cout << "Hello world!" << endl; return 0; }

asked 14 Sep, 12:42

djeet_123's gravatar image

2★djeet_123
11
accept rate: 0%


Yes. As it stands you can end up with an answer that is zero, which is not a positive integer as specified.

This is also specifically mentioned in the Editorial for this problem. Search the discussion board for "CIELAB" to find it.

link

answered 14 Sep, 22:38

joffan's gravatar image

5★joffan
4186
accept rate: 9%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×10

question asked: 14 Sep, 12:42

question was seen: 32 times

last updated: 14 Sep, 22:38