Show all threads Hide all threads Show all messages Hide all messages |
Page 2 |
Ac Pythoh 3.9 | eremeev.me.2012@gmail.com | 1283. Dwarf | 8 Mar 2024 18:55 | 1 |
a , b , c = list(map(int , input().split())) y = 0 if a <= b: print(0) exit(0) while True: y+=1 if a - (a / 100 *c) > b: a-= a / 100 *c else: break print(y)
|
Что курил, автор, лол? :DDD | D4nick | 1283. Dwarf | 13 Oct 2020 01:25 | 1 |
|
If you have WA3(C++) | Vikono | 1283. Dwarf | 2 Jul 2020 00:41 | 1 |
Just use double type instead int |
What's wrong? | Markfryazino | 1283. Dwarf | 7 Dec 2018 21:58 | 2 |
Here is the code (python 3.6). Can anyone explain, why it fails on test 9? import math string = input().split() start = int(string[0]) end = int(string[1]) commission = int(string[2]) if start <= end: n = 0 else: q = 1 - commission / 100 n = math.log((end / start), q) n = round(n) print(n) Use float / double instead of int ! |
accepted | Mikhail | 1283. Dwarf | 12 May 2018 20:39 | 1 |
//#pragma GCC optimize("Ofast,no-stack-protector") //#pragma GCC target("avx") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds; using namespace std;
#define re return #define pb push_back #define eb emplace_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define sqrt(x) sqrt(abs(x)) #define mp make_pair #define pi (3.14159265358979323846264338327950288419716939937510) #define fo(i, n) for(int i = 0; i < n; ++i) #define ro(i, n) for(int i = n - 1; i >= 0; --i) #define unique(v) v.resize(unique(all(v)) - v.begin())
template <class T> T abs (T x) { re x > 0 ? x : -x; } template <class T> T sqr (T x) { re x * x; } template <class T> T gcd (T a, T b) { re a ? gcd (b % a, a) : b; } template <class T> int sgn (T x) { re x > 0 ? 1 : (x < 0 ? -1 : 0); }
typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<string> vs; typedef double D; typedef long double ld; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef unsigned long long ull; typedef tree <pair<int, char>, null_type, less<pair<int, char>>, rb_tree_tag, tree_order_statistics_node_update> _tree; int main() { ld a, b, c; cin >> a >> b >> c; c = (100 - c) / 100; int ans = 0; while (a > b) { a *= c; ++ans; } cout << ans << endl; //cout << a * pow(1 - (ld) c / 100, 687) << endl; } /////////// Однако я вывел более умное решение если дано M N x, то через k дней количество денег будет равно M * (1 - x / 100) ^ (k - 1) можно написать бинарный поиск, но похоже из-за точности это падает Edited by author 12.05.2018 20:40 |
Easy problem if you just know formulas with percentages | IlushaMax | 1283. Dwarf | 18 Apr 2017 21:43 | 1 |
|
test 11 ......sad.... | xinxin | 1283. Dwarf | 8 Oct 2016 19:08 | 1 |
#include<iostream> using namespace std; int main() { double a,b,c,d,e,f=0; cin>>a>>b>>c; d=a*c*0.01; e=a-d; a=e; if(a<=b) { cout<<f; return 0; } f++; while(a>b) { d=a*c*0.01; e=a-d; a=e; f++; } cout<<f; return 0;} |
Что не правильно? паскаль | Lena | 1283. Dwarf | 7 Dec 2018 22:02 | 2 |
var a,b,c,i,k:real; begin read(a,b,c); while a>b do begin a:=a-(a*c/100); I:=i+1; end; write(i); end. variable i should be integer ! |
Page 1 |
Can it be solved using integers only? | Outermeasure | 1283. Dwarf | 12 Aug 2014 13:04 | 1 |
|
wa 7 | Mikron | 1283. Dwarf | 4 Sep 2013 01:11 | 2 |
wa 7 Mikron 12 Jul 2013 19:08 why wa #7 please help( #include <stdio.h> int main(void) { int s; int p; float zo; int t = 0; scanf("%f",&zo); scanf("%d",&s); scanf("%d",&p); while(zo>s){ zo -= zo*p/100; ++t; } printf("%d",t);
return 0; } use float instead of int for s and you will get AC |
Why the answer is wrong??? | Kamaldinov Dmitry | 1283. Dwarf | 13 Oct 2012 22:18 | 1 |
#include <iostream> using namespace std; int main() { int a, c, b, year; double a1, b1, c1; cin >> a >> b >> c; a1=static_cast <double>(a); if(a1<=1024*1024*1024*2-1 && b<=1024*1024*1024*2-1 && c>=1 && c<=100 && a>0 && b>0) { for(year=1; a1=a1*(100-c)/100; year++) { if (a1<=b) { cout << year; break; } } } cin.get(); cin.get(); return 0; }
|
question2 | sklyack | 1283. Dwarf | 14 Mar 2012 16:32 | 2 |
What output on test like this: 10 0 50 ? In this case it seems the dwarf will never die. They can't live without gold. :))I think that the limit is at least 1. :D |
note for WA#1 | hoan | 1283. Dwarf | 7 Aug 2013 18:36 | 3 |
use ( > ), and don't use ( >= ). GOOD LUCK |
Main Loop. Solution is AC | [kernel_panic] | 1283. Dwarf | 31 Oct 2009 23:20 | 1 |
/*...code...*/ while(N>=M) { N=((100-c)/100)*N; age++; } /*...code...*/ |
Please correct problem statement | Fyodor Menshikov | 1283. Dwarf | 2 Jan 2009 00:16 | 2 |
Первое число — количество золота в гномьем горшочке в начальный момент времени (целое, в граммах). Второе число — количество золота, при котором жизнь гномика лишается смысла (целое, в граммах, не превышает 2^31 − 1). Ограничение для первого числа (2^31 − 1) хорошо бы задать так же, как сейчас задано для второго. Это относится как к русской, так и к английской версии. |
Why this idea gives WA#1!! | Bobur | 1283. Dwarf | 13 Oct 2008 03:28 | 1 |
this is geometrik progress. read(s, min, p); q := 1-p/100; then.. B[n]=b[1]*q^(n-1) that's why min < s*q^(n-1) q^(n-1)>min/s q < 1 then ln(q)<0 n-1 < ln(min/s)/ln(q); n < ln(min/s)/ln(q)+1 |
WA #3 Where is my mistake????? | enick | 1283. Dwarf | 11 Apr 2008 21:08 | 2 |
#include <string.h> #include <stdio.h> __int64 N,M; int i,j; __int64 k; double CGB,temp; int main() { scanf("%I64d%I64d%lf",&N,&M,&CGB); if (N<=M) { printf("0\n"); return 0; } k=0; while (N>=M) { temp=(CGB/100)*N; N-=temp; k++; } printf("%I64d\n",k); return 0; } SORRY,EXCOURSE ME FOR MY ENGLISH AND STUPID MISTAKE! Now I have AC with 0.001 sec and 136 kb. Edited by author 11.04.2008 21:10 |
If you get WA#1 | TimoX | 1283. Dwarf | 9 Oct 2008 16:34 | 2 |
See there: Sum of gnom's money must be bigger!!! bigger that sum when hi die. Not equal. Good luck! ;) Thank you very much! I got WA 1 and then, when I exchanged the symbol >= to > I got AC :D |
can anybody me explain what is meaning>> | CHIDEMYAN SERGEY | 1283. Dwarf | 19 Apr 2007 17:03 | 3 |
can anybody me explain what is meaning: Третье число — комиссия ЦГБ Edited by author 19.04.2007 01:22 Edited by author 19.04.2007 01:23 комиссия Центрального Галактического Банка в процентах. т.е. столько процентов золота нужно отдать Банку за проверку золота на подлинность огромное спасибо!!!а то я не понимал задания!!!AC now! Edited by author 19.04.2007 17:47 |
Wrong Russian text again | Fyodor Menshikov | 1283. Dwarf | 7 Oct 2009 18:44 | 5 |
In English: When the amount of gold in a pot becomes less than or equal to a certain level In Russian: Kogda u gnomika ostayotsya menshe opredelyonnogo kolichestva zolota Of course "<=" is not the same as "<". Why should I watch the forum for clarification after wa1? Why the statement can't include the clarification? In the worst case Timus team must change English statement to make it equal to Russian. But much better is to change Russian one. Only one word "menshe" should be changed to "ne bol'she". I agree with Fyodor Menshikov. I also had WA at test #1, then I watched the forum and saw this message. After changing "<" to "<=" I got AC. Judges, change russian text, please! i have got wa in my program was this code if (a<b) { printf("0\n"); return 0; } if (a==b) { printf("1\n"); return 0; } when i change it to if (ai<=bi) { printf("0\n"); return 0; } A have got AC. Russian text of statement is wrong! Yeap! I used '<' and got WA#1. Later, I sent writeln(0) and got WA#3! See this: 1462633 17:46:11 Alexander Kouprin 1283 Pascal Accepted 0.015 212 Kb 1462628 17:42:07 Alexander Kouprin 1283 Pascal Wrong answer 3 0.001 212 Kb 1462627 17:42:00 Alexander Kouprin 1283 Pascal Wrong answer 1 0.015 212 Kb 1462626 17:41:52 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 212 Kb 1462625 17:40:33 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 212 Kb 1462605 17:09:50 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 208 Kb 1462604 17:09:40 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 208 Kb 1460473 00:27:36 Alexander Kouprin 1283 Pascal Wrong answer 1 0.015 188 Kb 1460469 00:26:48 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 188 Kb 1460465 00:23:58 Alexander Kouprin 1283 Pascal Wrong answer 1 0.015 184 Kb 1460464 00:22:51 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 184 Kb 1460463 00:22:38 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 184 Kb 1447763 21:15:09 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 204 Kb 1447760 21:11:38 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 204 Kb 1441129 01:43:11 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 200 Kb 1441127 01:42:55 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 200 Kb 1441059 23:55:39 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 200 Kb 1441058 23:55:25 Alexander Kouprin 1283 Pascal Wrong answer 1 0.001 200 Kb ----------------- I tried to solve it more than 15 days!!! http://acm.timus.ru/status.aspx?space=1&num=1283&author=49370 Edited by author 23.03.2007 20:08 |