|
|
#include <stdio.h> int main() { int t1,t2,n; int c=0; scanf("%d %d", &t1, &t2); for (int i=0; i<=9; i++) { scanf("%d", &n); c+=(n*20); } t2-=c; if (t2<t1) { printf("Dirty debug :("); } else { printf("No chance."); } } Если я не ошибаюсь, вам стоит подключить пространство имён. using namespace std; can you give some tests? for example: 10 10 0 0 0 0 0 0 0 0 0 0 in this test wright answer is "No chance.", but not "Dirty debug :(" 10 30 1 0 0 0 0 0 0 0 0 0 True answer No chance. (При равенстве штрафного времени команды сортируются по алфавиту, а значит, команда ZZZ в этом случае всё равно оказалась бы на втором месте. ) It is test 4. Also, Test 5 is related with the decision of 4 test. var t1,t2,i,k,q:integer; a:array [1..10000000] of integer; begin read(t1,t2); for i:=1 to 10 do read(a[i]); for i:=1 to 10 do begin if a[i]>0 then k:=k+a[i]; end; if t1<t2 then begin q:=(k*20)+t1; if q<=t2 then write('No chance.') else if q>t2 then write('Dirty debug :('); end else if t1>=t2 then begin write('No chance.'); end; end. Edited by author 01.11.2014 13:12 Edited by author 01.11.2014 13:12 Why SUCH BIG MASSIVE if 10 elements will be used What is "k" initial value? Can anybody give me test 8? Code on python2: a, b = map(int, raw_input().split(' ')) k = 0 c = map(int, raw_input().split(' ')) for x in xrange(1,10): k = k+c[x]*20 if b-k>a: print('No chance.') elif b-k<a: print('Dirty debug :(') elif b-k==a: print('No chance.') xrange(1, 10) only takes array elements 1-9. You need to use xrange(0, 10) to get elements 0-9 var m:array [1..10] of integer; q,z,i,s:integer; begin read(q); write(' '); read(z); readln(m[1]); s:=m[1]; for i:=2 to 10 do begin write(' '); read(m[i]); s:=s+m[i]; end; s:=s*20; if z-s>=q then write('No chance.') else write('Dirty debug :('); end. "Насколько я понял чем меньше сумма штрафных минут которые прибавляются по 20 за попытку, тем выигрышнее позиция, но почему в примере у комманды ЗЗЗ 719 минут а еще и 21 попыток и при этом ответ dirty debug :(" Please explain! 21*20=420 719-420=299 299<300 я так понял import java.util.Scanner; public class _1636 { public static void main(String args[]) { Scanner s = new Scanner(System.in); int n, sum = 0; int a, b; a = s.nextInt(); b = s.nextInt(); for (int i = 1; i < 10; i++) { n = s.nextInt(); sum = sum + (n * 20); } a = a + sum; if (b < a) { System.out.println("Dirty debug :("); } else { System.out.println("No chance."); } } } please, change the task! firstly, the first number is time of ZZZ.secondly, if the commands have the same time, the right aswer is 'no chance'. дайте плиз тест номер 2 Test 2 is a second test from the problem statement. Обьясните подробней как штрафное время влияет на проигрыш/победу команды. Read the problem statements carefully 搞什么P东西打乱码火星文啊 In the very best case, the team can get the penalty time as less as many penalty submissions it did (each one adds 20 minutes). "Dirty debug :(" message means that if the team had no penalty submissions at all, it would be the first rated. Another words, it would have the penalty time less than "QXX" has at the moment. Good luck! SFMBE First, i sent my solution in Pascal and i got WA2 and then i wrote it in C++ and i got Accepted. I want to know my mistake in my Pascal solution. Here's my code in Pascal : [code deleted] Edited by moderator 17.11.2019 18:35 readln(n); You should read, not readln. [code deleted] Edited by moderator 17.11.2019 18:35 you forgot to put space after word "debug" change printf("Dirty debug:("); to printf("Dirty debug :("); and u'll get AC Be attentive please... Edited by author 27.10.2008 15:44 pls explain it me Its easy. First line shows the total time taken by each team. Second line shows the number of failed test runs. If it passes first time, its 0 otherwise it shows the number of failed runs. Each failed run costs 20 min extra time. You should find if second team would win if they had no failed runs. |
|
|