Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
What's wrong? Runtime error | gkd002 | 2066. Простое выражение | 24 мар 2025 21:05 | 2 |
a, b, c = map(int, input().split(" ")) a = int(a) b = int(b) c = int(c) lst = [a, b, c] lst.sort() d = lst[0]-lst[1]*lst[2] e = lst[0]-lst[1]-lst[2] if d<e: min = d else: min = e print(min) You have a 3-line input,but you entered everything in one line |
What's in the 2nd test? | Glumaks | 2066. Простое выражение | 6 июл 2024 19:45 | 3 |
#include <stdio.h> int main(void) { int a, b, c, max, min, med; scanf("%d %d %d", &a, &b, &c); max = a >= b && a >= c? a: b >= a && b >= c? b: c; min = a <= b && a <= c? a: b <= a && b <= c? b: c; med = a + b + c - min - max; if (med == 0) printf("%d", - max); else printf("%d", min - max * med); return 0; } I'd assume something like 0 1 2 |
What 3rd test | Vsevolod | 2066. Простое выражение | 23 ноя 2023 17:01 | 1 |
|
Hint | Takanashi Rikka | 2066. Простое выражение | 4 ноя 2021 06:32 | 3 |
Hint Takanashi Rikka 23 фев 2016 12:50 Answer is a - b - c or a - b * c Re: Hint Minos Skistonrak 4 апр 2018 18:50 Is this answer after sort? |
Primitive enumeration of all options c++ | Mikhail | 2066. Простое выражение | 15 авг 2020 13:17 | 1 |
//We need to sort out 3 in the second power of the options for the arrangement of signs #include <iostream> using namespace std; int main() { int a, b, c, min; cin >> a >> b >> c; min = a + b + c; if(a + b - c < min) min = a + b - c; if(a - b + c < min) min = a - b + c; if(a - b - c < min) min = a - b - c; if(a - b + c < min) min = a - b + c; if(a - b * c < min) min = a - b * c; if(a * b * c < min) min = a * b * c; if(a * b + c < min) min = a * b + c; if(a * b - c < min) min = a * b - c; cout << min; return 0; } |
Where's wrong? | Farrux | 2066. Простое выражение | 28 апр 2020 14:13 | 2 |
import java.util.Scanner; public class Test{ public static void main(String[] args) {
Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if(a>=0 && b>=0 && c>=0 && a<=100 && b<=100 && c<=100 && a<=b && b<=c ){ if(a==0 && b==0 || a==0 && b==1|| b==0||c==0||(a==1&& b==1&&c==1)){ System.out.println(a-b-c); } else System.out.println(a-b*c); } } } import java.util.Scanner; public class Test{ public static void main(String[] args) {
Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if(a>=0 && b>=0 && c>=0 && a<=100 && b<=100 && c<=100 && a<=b && b<=c){ if(a==0 && b==0 || a==0 && b==1|| a==1&& b==1|| b==0||c==0||(a==1&& b==1&&c==1)){ System.out.println(a-b-c); } else System.out.println(a-b*c); } } } |
I think my solution is right but they don't accept it , help? | Ore Sama | 2066. Простое выражение | 25 мар 2020 14:01 | 2 |
#include <stdio.h> int main(){ int a,b,c; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if (a>b){ if (b>c){ printf("%d",c-(a*b)); } else{ printf("%d",b-(a*c)); } } if(b>a){ if (a<c){ printf("%d",a-(c*b)); } } return 0; } 1) a,b,c sequence is already sorted. 2) Try "1 1 1" input. Answer is -1. |
I assume that the Input text is not clear. | gtpt | 2066. Простое выражение | 10 мар 2020 13:52 | 1 |
"The numbers are arranged in non-decreasing order (0 ≤ a ≤ b ≤ c ≤ 100)." I my opinion, reading this we assume that the input will already be sorted. |
If input is 1, 2, 5 | Sofiullah Iqbal Kiron | 2066. Простое выражение | 4 мар 2020 22:43 | 1 |
The minimal output is: 1-2*5 = -9. Edited by author 04.03.2020 22:45 |
ПОМАГИТЕ!ВСЕ ПРАВИЛЬНО НО НЕПРАВИЛЬНО!!!!!! | Yarik0514 | 2066. Простое выражение | 15 дек 2019 12:53 | 2 |
import java.util.Arrays; import java.util.Scanner; public class ppppp { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int g = in.nextInt(); if (0 <= n && n <= k && k <= g && g <= 100){ int[] mas = {n, k, g}; boolean isSorted = false; int buf; while (!isSorted) { { isSorted = true; for (int i = 0; i < mas.length - 1; i++) { if (mas[i] > mas[i + 1]) { isSorted = false; buf = mas[i]; mas[i] = mas[i + 1]; mas[i + 1] = buf; } } } } int da = mas[0] - mas[1] * mas[2]; System.out.println(da); } } } Да тут есть ошибка!В коде есть ошибка нужно посмотреть код заново!И выявить ошибку! ОТВЕТ ДЛЯ ЭТОЙ ЗАДАЧИ a-b-c or a-b*c это нужно вписать в код и все получится! |
i am | Yarik0514 | 2066. Простое выражение | 15 дек 2019 12:50 | 1 |
i am Yarik0514 15 дек 2019 12:50 lol Edited by author 15.12.2019 12:57 Edited by author 15.12.2019 12:57 Edited by author 15.12.2019 12:57 |
Wrong answer help me pls Pascal | Levchuk | 2066. Простое выражение | 18 сен 2017 19:22 | 1 |
var a,b,c,s: longint; begin readln(a,b,c); if (a > b) or (a > c) then if (b > c) then s:= c - a * b else s:= b - a * c; if (b > a) or (b > c) then if a > c then s:= c - a * b else s:= a - b * c; if (c > a) or (c > b) then if a > b then s:= b - a * c else s:=a - b * c; writeln(s); end. |
Just for interest | IlushaMax | 2066. Простое выражение | 25 май 2016 18:45 | 3 |
[code deleted] This code Accepted so A can be 0 or 1; B can be 0 or 1; C can be 0 or 1 in tests. But if we will see on combinatons then there are only 4 combinations (if a<=b<=c) and there are 8 tests as min. The paradox Edited by author 14.03.2016 01:18 Edited by moderator 24.11.2019 13:45 Please do not writeln your code there. > This code Accepted so So no run-time checks if a, b, c are in [0-1] interval. Example: [code deleted] Edited by author 25.05.2016 18:45 Edited by moderator 24.11.2019 13:45 |
Hint | DiG | 2066. Простое выражение | 9 фев 2016 11:06 | 1 |
Hint DiG 9 фев 2016 11:06 little hint: if n=m=0 or n=m=1 or n=0 and m=1 you should use n-m-l expression ;) |
No subject | Safayet Islam Anonn'o | 2066. Простое выражение | 6 янв 2016 00:03 | 11 |
No subject Safayet Islam Anonn'o 18 окт 2015 16:00 Can I get some test inputs please? But in problem description "You are not allowed to use unary minus and parentheses in the expression", so 1-1-2 is not correct Edited by author 21.10.2015 16:37 Unary minus and usual minus are different things... [code deleted] Edited by moderator 24.11.2019 13:46 5 2 1 answer: 5-2-1 = 2 your program would say 3 For 5 2 1, it's -9. Numbers can be placed in any order. input numbers are nondecressing order so you can't put 5 2 1 |