Общий форум| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | | analysis | OvO | 1082. Иванушка-дурачок | 24 мар 2014 02:02 | 4 | let sequence be 1,2,3,...,n I. in each P( l, r ) there will be 1 + r-l+1 times ++ c. II. in each Q( l, n ) = Q( l, l ) there will be 0 time ++ c. III. in each Q( n, r ) = Q( n+1, r ) + P( n, r ). IV. Let F( n ) is the total times of ++ c, so we get F( n ) = F( n-1 ) + n + 1 and F( 1 ) = Q( r, r ) = 0; the sum of ++ c is 3 + 4 +... + n+1 = n*(n-1)/2 + 2*(n-1) = (n-1)*(n+4)/2 = (n*n+3*n-4)/2 Edited by author 24.05.2011 11:12 Edited by author 24.05.2011 11:13 What the fucking analysis do you do? Simply solve the quadratic equation in the IF condition "if(c==(N*N+3*N-4)/2)", and you will see that with any nonnegative value of "c" the program will print out "Beutiful Vasilisa". The variable "c" will be nonnegative in any case, because of the initial value = 0, and increment operator. I guess u read "if(c=(N*N+3*N-4)/2)" instead of "if(c==(N*N+3*N-4)/2)" Я вывел формулу по другому: n*(n+1)/2 - 1 + (n - 1) = n*(n+1)/2 + (n - 2) = (n*n + 3*n - 4) / 2 n*(n+1)/2 - кол-во проверок на возрастание -1 - вычитаем один случай, когда остался один элемент (n - 1) - кол-во проверок на убывание | | What's in test 5? | _Link | 1025. Демократия в опасности | 23 мар 2014 18:24 | 2 | What numbers could be in test 5? Everything is right. Why it doesn't accepted... Сомневаюсь, что кто-то ответит, но мало ли Ну же... Хоть кто нибудь Спать не могу | | nice task. There's a hint for those who want it. | jk_qq | 1247. Проверка последовательности | 23 мар 2014 08:26 | 1 | substract one from every element of sequence and search for prefix or suffix (I mean subsequence A_0, A_1, ..., A_j or A_k, A_{k+1}, ..., A_s) with negative sum. | | Runtime error (access violation) | shadowElkorchi | 1003. Чётность | 23 мар 2014 07:58 | 3 | I don't understand why it show me a Runtime error (access violation) when it s compiling and it works perfectly in my computer ??? Can you share your code please? There can be many reasons for this behavior. Try to define a bigger array! | | looks it's working but i get "Wrong answer" result can you help me? | Mekhriddin | 1001. Обратный корень | 23 мар 2014 01:26 | 3 | from math import sqrt f=list((int(x) for x in input().split())) f.reverse() j=list((sqrt(x) for x in f)) for x in j: print('%.4f'%x) i find it it's need replace input() with sys.stdin.read() from math import sqrt import sys f=list((int(x) for x in sys.stdin.read().split())) f.reverse() j=list((sqrt(x) for x in f)) for x in j: print('%.4f'%x) What programming language are you using? | | WA9 | Facundo | 1112. Покрытие | 22 мар 2014 20:04 | 2 | WA9 Facundo 18 янв 2013 04:19 What's Test 9? My algo is: Search the segment with more intersections and delete it (repeat while the segment got 0 intersections) Is it wrong? yes it is wrong 7 1 3 2 5 2 5 4 7 6 9 6 9 8 10 | | Wrong answer №8 help помогите | BAPEGKA | 1787. Поворот на МЕГУ | 22 мар 2014 17:00 | 1 | | | I got wa#16, help me please :( | Crash_access_violation | 1234. Bricks | 21 мар 2014 18:03 | 7 | tanx... Edited by author 07.11.2008 21:32 "a <= b" -> "a < b+eps" "a < b" -> "a < b-eps" eps = 1e-8 was enough for this prolem I use you hint... but I got wa#16 :( Some tests 10 10 1 9 6 NO 10 10 1 9 7 YES Can you explain why the second answer is YES. Need it badly | | cin/cout in 0.312s | ASK | 1107. Складская задача | 21 мар 2014 17:01 | 1 | #define I(x) int x; cin >> x #define F(i,n) for(int i = 0; i < (n); ++i) int main(){ cin.sync_with_stdio(false); I(n); I(k); I(m); cout << "YES" << endl; F(i,k){ I(s); F(i,s){ I(x); //... | | Some hint | svg2003 | 1167. Bicolored Horses | 21 мар 2014 05:53 | 1 | 1. Инициализация Начинайте с 1 конюшни Пусть нам надо поставить туда I лошадей (I = 1..N) Коэффициент несчастья для I лошадей будет при этом равен White * Black для Horses = 0..i По итогу этого у нас будут оптимальные (потому что единственные) коэффициенты для всех лошадей в случае 1 конюшни 2. Итерации (меняем J-ую конюшню) Надо рассчитать минимальный коэффициент несчастья если в 1..J конюшни поставить I лошадей Для этого переберём все варианты, поставив в J конюшню K лошадей (K = 1..I лошади) и оптимально заполнив первые J-1 конюшни I-K лошадьми (этот коэффициент у нас уже рассчитан на предыдущем шаге итерации) Перебрав все варианты у нас получится оптимальное заполнение первых J конюшен первыми I лошадьми Переходим к J + 1 конюшне и считаем заново все варианты заполнения уже для неё | | explain recent rejudge? | Vyacheslav Kim | 1389. Дорожные работы | 21 мар 2014 02:40 | 2 | Hi, I had an accepted solution 3 years ago and now I have no idea what was wrong/right. Looking at my previous solution that now gets TLE, it was Kuhn matching algorithm. Did the constraints change or did you just add better tests? OK, I have no idea how could I possibly come up with such solution and how come it passed the tests before :P | | Wa22... | [RSU_Tash]Shavkat_Khusanov | 1724. Тайна происхождения человека | 20 мар 2014 13:07 | 3 | Wa22... [RSU_Tash]Shavkat_Khusanov 12 дек 2010 00:39 I found my mistake. I have AC. Edited by author 12.12.2010 15:33 Test TTGgtAatTGgt 1 6 11 turned out to be helpful. | | statement | Vit Demidenko | 1738. Компьютерная безопасность | 20 мар 2014 07:29 | 1 | | | cin/cout is possible | ASK | 1992. CVS | 19 мар 2014 16:32 | 1 | I got AC with #define I(x) int x; cin >> x #define F(i,n) for(int i = 0; i < (n); ++i) int main(){ cin.sync_with_stdio(false); I(n); I(m); F(i,n){ string w; cin >> w; I(j); auto& c = clones[j-1]; if(w == "learn"){ // ... | | Tests | exwRabbits_AlMag(VNTU) | 1710. Борис, ты не прав! | 19 мар 2014 16:25 | 3 | Tests exwRabbits_AlMag(VNTU) 27 июл 2011 16:30 For wa#3: 4 0 0 3 0 0 YES For wa#4 0 0 5 0 6 5 YES For wa#5 0 0 4 0 2 3 The possible answer is: NO 0.00000000000000000000 0.00000000000000000000 4.00000000000000000000 0.00000000000000000000 0.46153846153846145000 0.69230769230769285000 But i still have have wa#31. I think, I have problem with precision. Can anyone tell me how to avoid this problem? UPD: Finaly AC. I think, it realy was a problem with precision, but I am not sure. Edited by author 27.07.2011 22:20 Edited by author 27.07.2011 23:58 Yes, problem in precision. EPS = 1e-10 AC EPS = 1e-11 WA#36 | | Visual C++ 2010, Runtime error (access violation) | Mario Pavlov | 1001. Обратный корень | 18 мар 2014 22:49 | 2 | Could someone help me ? #include <iostream> #include <iomanip> using namespace std; int main() { double outputNumbers[100000]; double number; int index; index = -1; while (cin.fail() == false) { cin >> outputNumbers[++index]; }
cout << fixed; cout << setprecision(4);
while (index > 0) { cout << sqrt(outputNumbers[--index]) << endl; } return 0; } I have rewrite the program, using vectors but now I receive wrong answer... #include <iostream> #include <iomanip> #include <vector> using namespace std; int main() { vector<double> myVector; double value; while (cin.fail() == false) { cin >> value; myVector.push_back(sqrt(value)); }
myVector.pop_back(); cout << fixed; cout << setprecision(4); for (int i = 0; i < myVector.size(); i++) { cout << myVector[i] << endl; } return 0; } | | Why I get WA? Pelase, help me!!!!!!! | Revenger and NSC | 1127. Кубики | 18 мар 2014 22:36 | 4 | My program: Program t1127; Const P:array[1..24,1..6]of integer= {all combinations} ( (6,4,3,1,5,2), (3,5,4,1,6,2), (4,6,5,1,3,2), (5,3,6,1,4,2), (6,4,5,2,3,1), (3,5,6,2,4,1), (4,6,3,2,5,1), (5,3,4,2,6,1), (1,2,6,3,4,5), (6,4,2,3,1,5), (2,1,4,3,6,5), (4,6,1,3,2,5), (1,2,4,5,6,3), (6,4,1,5,2,3), (2,1,6,5,4,3), (4,6,2,5,1,3), (1,2,3,4,5,6), (3,5,2,4,1,6), (2,1,5,4,3,6), (5,3,1,4,2,6), (1,2,5,6,3,4), (3,5,1,6,2,4), (2,1,3,6,5,4), (5,3,2,6,1,4) ); MaxN=1000; Var Cube :array[1..MaxN,1..6]of char; Tmp :array[1..6]of char; ACube :array[1..MaxN,1..24]of string[4]; yet :array[1..MaxN,1..24]of boolean; N,i,j,k :integer; max,ik,jk :integer; m :integer; ch :char; begin Read(n); for i:=1 to N do for j:=1 to 6 do begin read(ch); while (ch=#10)or(ch=#13)or(ch=#32) do read(ch); Cube[i,j]:=ch; end; for i:=1 to N do for j:=1 to 24 do begin for k:=1 to 6 do tmp[k]:=cube[i,p[j,k]]; ACube[i,j]:=''; ACube[i,j]:=tmp[1]+tmp[2]+tmp[3]+tmp[4]; end; m:=0; for i:=1 to N do for j:=1 to 24 do yet[i,j]:=true; for i:=1 to N do for j:=1 to 24 do if yet[i,j] then begin yet[i,j]:=false; max:=1; for ik:=1 to N do if ik<>i then for jk:=1 to 24 do if ((acube[i,j][1]=acube[ik,jk][1])and(acube[i,j][4]=acube[ik,jk] [4]))or ((acube[i,j][1]=acube[ik,jk][4])and(acube[i,j][4]=acube[ik,jk] [1])) then if ((acube[i,j][2]=acube[ik,jk][2])and(acube[i,j][3]=acube[ik,jk] [3]))or ((acube[i,j][2]=acube[ik,jk][3])and(acube[i,j][3]=acube[ik,jk] [2])) then begin yet[ik,jk]:=false; max:=max+1; break; end; if max>m then m:=max; end; writeln(m); end. Think there are more combinations, i did solve this problem, but i don't remind how much, if you want write me :), miguelangelhdz@hotmail.com Good Luck > Think there are more combinations, i did solve this problem, but i > don't remind how much, if you want write me :), > miguelangelhdz@hotmail.com > Good Luck | | AC Code | Paata Julakidze[GTU] | 1881. Длинное условие задачи | 18 мар 2014 14:37 | 1 | AC Code Paata Julakidze[GTU] 18 мар 2014 14:37 import java.util.Scanner; public class Problem_1881 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int h,w,n,i,p,ans,SL,h1; ans=SL=h1=0; p=-1; ..... Edited by author 22.03.2014 20:32 | | endless cycle | aprogrom (MUCTR) | 1378. Искусственный интеллект | 18 мар 2014 03:01 | 1 | Can you give me a test similar to the fifth test. Just i dont know where i have endless cycle? Sorry for my english. | | WA Test 6 | Mikle | 1438. Time Limit Exceeded | 18 мар 2014 01:37 | 1 | Why? My code works correctly when it is no "end" in the end and with != |
|
|