Common BoardEileen Behbood SOS 17 May 2012 17:05 zzz Edited by author 17.05.2012 17:06 Edited by author 17.05.2012 17:06 give me wrong test, please {$n+} [be ili ne be] spasibo toliany Edited by author 10.01.2006 02:12 test 2 1 1 1 2 3 3 3 1 Answer 0, 1 You mistake on this line s2:=sqr(r[i]+r[t]); Understand What wrong? But you again got Wa1. :) i find test where you program with strange output 4 1 1 1 1 5 6 3 2 3 4 2 5 1 3 5 2 Answer: "no comments" sqr(r[i]+r[t]) - this ok zamena h:=m[i]; m[i+1]:=m[i]; m[i]:=h; :)) wa52:) Why answer is 0, 1??? Distance between centers of planets is bigger then sum of radiuses! answer 0 1 sqrt(4+4+4)>2+1 tolian lol:) ofCouse Answer is 0 1 I Write When s2:=sqr(r[i]+r[t]); <=Mistake here correct s2:=r[i]+r[t]; <=it correct. At last you have received AC. P.S. My code only 775 bytes.
And don't use squareRoot. Compute in sqr =) I get WA 1 because I forgot to sort stars in each archipelago when I output stars. =) Edited by author 17.05.2012 16:19 Edited by author 17.05.2012 16:20 Help!!! import java.util.*; public class Ll { public static class Line implements Comparable{ int a,b; Line(int x, int y){ a = x; b = y; } public int compareTo(Object obj){ Line tmp = (Line)obj; if (this.b>tmp.b) return 1; if (this.b<tmp.b) return -1; return 0; } } public static void main(String args[]){ Scanner stream = new Scanner(System.in); short M = stream.nextShort(); ArrayList<Line> arL = new ArrayList<Line>(); arL.add(new Line(stream.nextInt(), stream.nextInt()) ); while(true){ int a=stream.nextInt(), b=stream.nextInt(); if ((a==0)&&(b==0)) break; if((b>0)&&(a<M)) for (int i=0;i<arL.size();i++){ if ((arL.get(i).a>=a) && (arL.get(i).b<=b)){ arL.set(i,new Line(a,b)) ;} else {if (!((arL.get(i).a<=a) && (arL.get(i).b>=b))) arL.add(new Line(a,b));} break; } } if(arL.size()==0) { System.out.println("No solution"); return; } arL.trimToSize(); Collections.sort(arL); ArrayList<Integer> arV= new ArrayList<Integer>(); int i=arL.size()-1,F =0; while ((i>=0)&&(arL.get(i).b>0)){ if (arL.get(i).a<=F){ F=arL.get(i).b; arV.add(i); i = arL.size(); } if (F>=M){ System.out.println(arV.size()); for (int g= 0;g<arV.size();g++){ System.out.println(arL.get(arV.get(g)).a + " "+ arL.get(arV.get(g)).b); } return; } i--; } System.out.println("No solution"); } } ЦЕЛЬ КУПСОВОЙ РАБОТЫ: проанализировать предметную область, составить алгоритм решения зада¬чи, реализовать алгоритм средствами Visual Studio 2005 в виде программного Windows-приложения. Задачи курсовой работы: разработать программное Windows-приложение, реализовать средствами Visual Studio 2005, которое содержит удобный и понятный интерфейс взаимодействия с пользовате¬лем. Результаты курсовой работы: Результатом работы над темой должна быть программа, полностью соответствующая заданию, а также отчет. ОПИСАНИЕ: На обёртке шоколадки фирма-производитель обязана указать все продукты, из ко¬торых шоколадка сделана. Строго говоря, производителю следовало бы указывать также и массо¬вую долю каждого из продуктов, однако, по понятным соображениям, многие этого не делают — в самом деле, надпись «Вода — 80%» вполне способна отпугнуть покупателей. Однако же, некото¬рые процентные доли производители все же любят указывать, полагая, что надпись «Цельные орехи — 90%» покупателей привлечйт. Подобное рвение может, впрочем, привести и к об¬ратному эффекту, обернувшись антирекламой. Дело в том, что список продуктов, из которых сдела¬на шоколадка, обязательно должен быть упорядочен по невозрастанию массовых долей. Соот¬ветственно, красивая надпись «Какао-масло, Вода, Какао-порошок— 40%» позволяет уличить производителя в недобросовестности: либо он неверно указал содержание какао-порошка, йибе*- неверно указал порядок следования продуктов... Напишите программу, которая позволила бы определять недобросовестные надписи на шоколадках. ИСХОДНЫЕ ДАННЫЕ: В первой строке записано натуральное число N (1 < N < 5000) - количество продуктов, из которых сделана шоколадка. Далее следуют N строк, каждая из которых содержит описание одного продукта: название,(названия всех продуктов различны), после пробела в каждой из этих строк следует цифра 0 или 1 — первая обозначает, что производитель не указал массо¬вую долю продукта, а вторая— что после ещё одного пробела в строке записана массовая доля в сотых долях процента. Массовые доли, как реальные, так и указанные на обёртке, являются целыми числами от 1 до; 10000 (в сотых долях процента). РЕЗУЛЬТАТ: Следует определить правильность информации has simple geometrical solution!!! try rotate perpendikulayr with 'theta' angle, and find optimal 'theta'. This 'theta' angle equal angle of two lines!!!!!! #include<stdio.h> #include<math.h> int main(void){ int A[10000]; int i,k,j; i=0; while(scanf("%d",&k)!=EOF){ A[i]=k; i++; } for(j=i-1;j>=0;j--) printf("%.4f\n",sqrt(A[j])); return 0; } INT <32767 OR 4294967296 . wile 876652098643267843 is much larger . Edited by author 14.05.2012 00:31 скиньте пожалуйста кто нибудь код данной задачи,вы меня очень сильно выручите,мне не нужен код для этого сайта,он мне нужен для учебы,я ее решаю почти месяц и ничего не получается,ПОЖАЛУСТА мой майл www.max_boy93@mail.ruмой скайп maks1mka11 вы меня очень выручите Отправь смс с кодом задачи (в данном случае - 1411) на короткий номер 1278, и в течение суток на твою почту придет решение. Hi, can anyone tell me what this test looks like? I always get WA 7 :( Me too We brute-forced the judge on all the 5 given outputs for test 7, none of them worked. There are 6 possible outputs for each test :) But in English version of the problem there's nothing said about "not a poem"-output. Edited by author 15.10.2011 22:06 @bsu.mmf.team There're 6 possible outputs in Russian version and 5 in English version ! Yes, I saw now. It is the total fail of judges ))) Phrase about "not a poem" was lost somewhere while copying problems to timus. Fixed already. if 'not a poem' was absent all we had to do is scan first line only and then easily determined. that's what i did during contest. sad, there was no clars :( Submits from the online constest will be rejudged. All submits from the online contest were rejudged on the all tests without "not a poem" answer. Submits from the problem set are judged on the full set of tests, because now english statement is correct. Try to check 'not a poem' like [a] b b b [a] [b] [b] [b] I have WA7. But now AC. I think Every word have only one accent(stress,emphasis) but it is not correct. Every word can have many accent(stress,emphasis)!!! ~~~~~~~~~~~~~~~~ Tests: 1 [sam]-o-[let] go [down] answer: trochee 4 par-[o]-hod [ob] bereg [byetcha] kapitan [krichit] vpered kak [ta]-ko-[my] razebau doveryaut [par]-o-[hod] answer: iamb Can anyone explain me, why this code got WA20: program Project1; {$APPTYPE CONSOLE} uses SysUtils; var f : array[1..21] of extended; d, c : array[-1..21, -1..21] of extended; res : extended; i, j, k, n : integer; begin readln(n); res := 0; f[1] := 1; for i := 2 to n do f[i] := f[i - 1] * i; c[0][0] := 1; for i := 1 to n do for j := 0 to i do c[i][j] := c[i - 1][j] + c[i - 1][j - 1]; for i := 2 to n do res := res + c[n][i] * f[i]; writeln(res:0:0); readln;readln; end. But this code got AC: program Project2; {$APPTYPE CONSOLE} uses SysUtils; var n : integer; s : array[1..21] of string; begin s[1] := '0'; s[2] := '2'; s[3] := '12'; s[4] := '60'; s[5] := '320'; s[6] := '1950'; s[7] := '13692'; s[8] := '109592'; s[9] := '986400'; s[10] := '9864090'; s[11] := '108505100'; s[12] := '1302061332'; s[13] := '16926797472'; s[14] := '236975164790'; s[15] := '3554627472060'; s[16] := '56874039553200'; s[17] := '966858672404672'; s[18] := '17403456103284402'; s[19] := '330665665962403980'; s[20] := '6613313319248079980'; s[21] := '138879579704209680000'; readln(n); writeln(s[n]); end. In spite of the fact, that answers for second programm I took as the results of the first program :) Edited by author 08.05.2012 00:24 Simple school maths. Just one formula from combinatorics. Without any precalc. Edited by author 08.05.2012 23:38 This is not my question.I couldn't understend why writeln(res:0:0) got WA, but on all my tests it's OK.Now I think it's becouse of old version of compiler here. киньте пожалуйста код задачи,для школы учитель попросил try do it yourself you can find some hints in forum I really need to, please, I have little time left to write in a skype-maks1mka11 I understand that it is useful to me, but I do not have time гуд дрим!!! Edited by author 12.05.2012 20:47 Edited by author 12.05.2012 20:47 Edited by author 12.05.2012 20:47 #include<stdio.h> int function(char,int); int main(void){ int i,b,n; int arr[1001]; char a; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%1s",&a); scanf("%d",&b); arr[i]=function(a,b); } for(i=1;i<=n;i++) printf("%d\n",arr[i]); return 0; } int function(char a, int b){ int kil; if(a>='c' && a<='f' && b>=3 && b<=6) kil=8; else if(((b==2 || b==7) && a>='c' && a<='f') || (b>=3 && b<=6 && (a=='b' || a=='g'))) kil=6; else if((a=='a' || a=='h') && (b==1 || b==8)) kil=2; else if(((a=='a' || a=='h') && (b==7 || b==2 )) || ((a=='b' || a=='g') && (b==1 || b==8 ))) kil=3; else kil=4; return kil; } скиньте пожалуйста код этой программы на с++ или паскал,не могу сделать задачу в универе. throw off please a code of this program on with ++ or Paskal, I can not make a task in University. Edited by author 10.05.2012 18:03 я не могу решить задачу рыцари 40 островов,помогите,пишите на майл >> www.max_boy93@mail.ru,скайп>>maks1mka11 I can not solve the problem-рыцари 40 островов...mail>> www.max_boy93@mail.ruskype>>maks1mka11 Edited by author 10.05.2012 15:46Кто небудь решил эту задачу на java?Если да то не затруднит ли прислать исходник? Address to F.Menshikov Edited by author 25.06.2007 18:42 Edited by author 25.06.2007 18:42 public class Timus_1243 { public static void main(String[] args) { System.out.print(new java.util.Scanner(System.in).nextBigInteger().mod(java.math.BigInteger.valueOf(7))); } } give me some hints please! i used set<_int64> from STL Edited by author 28.08.2009 19:43 Use hash instead of set. How use the hash_set ?? i write in C++. try to write your own hash_set, it is not so difficult however you don't need any hash or set there My prog passes all tests what I found, but still WA1. Surely, output format is right. Sorry, stupid fault, forgot to delete extra lines of code. Got AC :) But why too few AC solutions? Problem is so easy. Edited by author 08.05.2012 22:47 New tests were added. Time limit was decreased from 1 sec to 0.5 sec. 71 authors lost AC after rejudge. Could anyone give me a test case for line painting problem for WA #1 1) Don't forget, that you have a directed graph! 2) Also don't forget, that standard C++ streams(cin and cout) are very slow! Use scanf and printf. 3) And just use Bellman–Ford algorithm. It works by O(n*m) - in the worst case. Edited by author 08.05.2012 13:16 |
|