Show all threads Hide all threads Show all messages Hide all messages |
Page 6 |
Hint | So Sui Ming | 1820. Ural Steaks | 8 Jan 2024 19:29 | 1 |
Hint So Sui Ming 8 Jan 2024 19:29 Consider 2 cases: (1) K >= N (2) K < N and fry one side of each steak first. Try cases like: N=7,K=1; N=7,K=2; up to N=7,K=6 and find the pattern. |
Page 5 |
Пояснение по условию | Роман Спиркин | 1820. Ural Steaks | 22 Jul 2023 17:07 | 2 |
Не совсем понял тестовый пример 3 2 то есть 3 котлеты и можно максимум 2 котлеты жарить в моменте вначале положим 2 котлеты с одной стороны потом эти же с другой стороны потом остается 1 котлета мы ее можем пожарить с одной стороны это 1 минута и ее же с другой то есть на нее необходимо 2 минуты значит всего необходимо 4 минуты почему ответ 3 ? как так пожарить Edited by author 11.06.2023 16:57 Edited by author 11.06.2023 16:57 Представь вот мы сначала жарим две котлеты с одной стороны, первую меняем на третью, а вторую переворачиваем. Жарим еще минуту и теперь у нас есть одна готовая котлета и две наполовину готовые, и дожариваем их еще минуту. Вот и получается всего три минуты. |
please help python | Pundit | 1820. Ural Steaks | 30 Oct 2022 08:58 | 2 |
n = int(input()) k=int(input()) n=n*2 if n % k ==0: print(n/k) else: a=int(n/k)+1 print(a) I can't find my mistake. It keep telling me "Runtime error" the "only" input line contains... |
please help python | Pundit | 1820. Ural Steaks | 25 Oct 2022 06:42 | 1 |
n = int(input()) k=int(input()) n=n*2 if n % k ==0: print(n/k) else: a=int(n/k)+1 print(a) I can't find my mistake. It keep telling me "Runtime error" |
Подскажите, пожалуйста, что не так с кодом? Wrong answer, тест 3. | Юля | 1820. Ural Steaks | 9 Oct 2022 18:51 | 1 |
Подскажите, пожалуйста, что не так с кодом? Wrong answer, тест 3. Edited by author 09.10.2022 19:48 Edited by author 09.10.2022 19:48 |
WA 33. What is this wrong? | Vsevolod | 1820. Ural Steaks | 23 Jun 2022 08:57 | 1 |
a,b=map(int, input().split()) if a==1: print(2) exit() if (a*2)//b<a*2/b: print(a*2//b+1) else: print(a*2//b) |
Помогите понять мою ошибку | Romanchillihotpepper | 1820. Ural Steaks | 8 Oct 2021 11:40 | 1 |
Почему так не проходит(ошибка на 13): #include <iostream> int main() { int n,k; std::cin>>n>>k; if(n<=k) std::cout<<2; else std::cout<<n*2/k+n*2%k; return 0; } А так проходит: #include <iostream> int main() { int n,k; std::cin>>n>>k; if(n<=k) std::cout<<2; else{ if(n*2 % k == 0) std::cout<<n*2/k; else std::cout<<n*2/k+1; } return 0; } Ну или тернар(тоже не проходит - ошибка на 13): #include <iostream> int main() { int n,k; std::cin>>n>>k; (n<=k)?std::cout<<2:std::cout<<n*2/k+n*2 % k; return 0; } Может я чего не понимаю, может всё-таки где-то приоритет потерял, но ведь идентично же. Edited by author 08.10.2021 11:51 Теперь понял, %k может вернуть и больше, чем 1 Edited by author 08.10.2021 12:00 Edited by author 08.10.2021 12:02 C++ ответ: #include <iostream> int main() { int n,k; std::cin>>n>>k; (n<=k)?std::cout<<2:(n*2%k==0)?std::cout<<n*2/k:std::cout<<n*2/k+1; return 0; } Edited by author 08.10.2021 12:03 |
Why wrong answer? Is author crazy? Code is all right! В чём неправильный ответ? Автор шизик? Код нормальный, и всё правильно. | Vlad Polukarov | 1820. Ural Steaks | 2 Feb 2021 19:39 | 1 |
|
1820 Ural Steaks Explained - Simply - Accepted Solution - Read it before you start | Manoj Pathak | 1820. Ural Steaks | 13 Nov 2020 14:50 | 3 |
Lets say there are 5 Steaks and capacity of pan is 4. Step 1: Cook first 4 one side for 1 minute. Step 2: Replace 1 one sided cooked steak with completely uncooked (remaining) one and cook for next 1 minute. Step 3: Now the chef has 3 completely cooked and 2 Half cooked. Cook the remaining 2 half cooked for another one minute. so 1 minute at each step, hence 3 minutes total minimal time. However, story doesn't end here :-). Lets take another example Now, Lets say there are 7 Steaks and capacity of pan is 4. Step 1: Cook first 4 one side for 1 minute. Step 2: Replace 3 one sided cooked steak with completely uncooked (remaining) three and cook for next 1 minute. Step 3: Now the chef has 1 completely cooked and 6 Half cooked. Cook 4 steaks from half cooked six for another one minute. Step 4: Last cook final 2 half cooked one for another one minute So total minimum time take is 4 minute. 1 minute at each step. Please keep in mind the scenarios where 0 steaks or steaks less then cooking capacity of pan. Edited by author 08.06.2017 20:19 Edited by author 08.06.2017 20:20 the scenario with n == 0 or k == 0 won't happen as in the statements it says 1 <= n, k <= 1000 |
answer/ответ Java | Vinchester | 1820. Ural Steaks | 4 Apr 2017 19:00 | 1 |
import java.util.Scanner; public class Zadachi { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = 2; if(n<=k){ System.out.print(x); }else{
if (n*2 % k == 0){ System.out.print(n*2/k); }else{ System.out.print(n*2/k+1); } }
} } |
C ++ error in test's, but code is correct | polskyLIDER | 1820. Ural Steaks | 5 Mar 2017 13:15 | 1 |
#include "iostream" using namespace std; int main() { int a, b, rz; cin >> a >> b; if (b == 2 && a != 1 || b == 1 && a != 1) { rz = 2 * a / b; } else { if (a % b != 0) { rz = 2 * (a / b + 1); } else { rz = 2 * a / b; } } cout << rz; return 0; } i tested it a lot, pleas help may be i am so silly.... |
WA java8 | Faizulinda | 1820. Ural Steaks | 1 Mar 2017 18:04 | 1 |
public class Pan { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int k = scanner.nextInt(); int m = 2*n; if (m%k == 0){ System.out.println(m/k); } else{ System.out.println(m/k+1); } } } why Wrong Answer? |
34 WA | Vadimzzz | 1820. Ural Steaks | 15 Dec 2016 12:56 | 2 |
34 WA Vadimzzz 15 Dec 2016 12:50 |
what is the 30 test | Bekzat | 1820. Ural Steaks | 6 Feb 2018 23:31 | 3 |
|
Problem 1820 Ural Steaks has been rejudged | Vladimir Yakovlev (USU) | 1820. Ural Steaks | 24 Oct 2016 12:31 | 1 |
New tests have been added to the problem, all accepted solutions have been rejudged. 490 authors have lost their AC. |
Java 1.8 | Riot | 1820. Ural Steaks | 15 Sep 2016 16:32 | 2 |
Компилятор вычисляет все верно, но здесь задача не проходит. Подскажите, знатоки, в чем проблема? import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); double n = in.nextDouble(); double k = in.nextDouble(); if(n>=1&&n<=1000&&k>=1&&k<=1000){ double a = ((n/k)*2); int b = (int)Math.round(a); System.out.println(b); } } } |
Where is error? test 17 | DSamokhina | 1820. Ural Steaks | 29 May 2016 23:59 | 1 |
import java.io.*; import java.util.*; public class t1820 { public static void main(String[] args){ Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = in.nextInt(); int k = in.nextInt(); int rez = 2; if (n>k){ if (n % k == 0) { rez = 2*n; } else{ if (n % k > k / 2) { rez = (n/k+1)*2; } else { rez = (n/k-1)*2+3; } } } out.println(rez); out.flush(); } } |
Test #13 (Java 1.8) | Landsknecht | 1820. Ural Steaks | 7 Mar 2016 13:59 | 2 |
Guys, I have no idea why it doesn't pass this test. Any suggestions? public static int getMinutes(int n, int k) { if (k == 1){ return n * 2; } else if ( k >= n) { return 2; } else if (n > k) { return n - k + 2; } return 0; } |
Wrong set of test | g00d | 1820. Ural Steaks | 22 Nov 2015 20:22 | 1 |
[n ,k] = [int(x) for x in input().split()] if n >= k: ans = 2 * n // k if 2*n%k > 0: ans += 1 print(ans) else: print(2) and [n ,k] = [int(x) for x in input().split()] if n >= k: ans = 2 * n // k if 2*n%k > 1: ans += 1 print(ans) else: print(2) Both is accepted. But second is worng. Need test: 5 3 |
What is in 30 test? | Philipp Lugovoy | 1820. Ural Steaks | 3 Oct 2015 14:49 | 1 |
All ok!) Edited by author 03.10.2015 14:49 Edited by author 03.10.2015 14:49 Edited by author 05.10.2015 18:55 |