Posted: Sun Jul 29, 2007 9:44 am
I removed double and got Accpted
Thanks emotional blind

Thanks emotional blind
I don't think so.sclo wrote:even if v==m, the solution v is still valid.
According to problem statement, v must bigger than m.Given the value of m and x, you will have to find the value of the maximum income v, which is effectively (after deducting the tax) less than someone earning less than v.
Code: Select all
if(n<=m)
puts("Not found");
Code: Select all
if(n<m)
puts("Not found");
exist a problemif(n*100%(100-x)==0)
n--;
sorry, you are right.emotional blind wrote:even if v==m its effective income may less then m-1,
so solution v is valid as i think.
Thanks, it really help meWei-Ming Chen wrote:To hi!man!
For input "100 67", your code outputs 300
But I think the answer is 299
by the way, I thinkexist a problemif(n*100%(100-x)==0)
n--;
Hope it helps
Code: Select all
#include <iostream>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <cctype>
#include <set>
#include <cmath>
#include <climits>
#include <sstream>
#include <fstream>
#include <list>
#include <functional>
#include <utility>
#include <iomanip>
#include <ctime>
using namespace std;
#define SZ size()
#define pp push_back
typedef long long LL;
typedef vector <int> vi;
typedef vector <double> vd;
typedef vector <vi> vvi;
typedef vector <string> vs;
typedef pair<int,int> pii;
typedef vector <LL> vll;
int main () {
int n,m;
while (scanf("%d %d",&n,&m) != EOF) {
if (!n && !m) return 0;
if (m==100 || m == 0 || n == 1) { printf("Not Found\n"); continue;}
double temp = (double)m/100.0;
temp = 1.0-temp;
temp = (n-1) / temp;
int ret = (int) temp;
ret++;
if (ret < n) { printf("Not Found\n"); continue;}
bool stat = false;
while (true) {
double t = (ret*((double)1-m/100.0));
//cout << ret << " " << t << "\n";
if (t < ((double)n-1) && ret >= n) { printf("%d\n",ret); stat = true; break;}
ret--;
if (ret < n) break;
}
if (!stat) printf("Not Found\n");
}
return 0;
}
Code: Select all
Remove after AC