| Show all threads Hide all threads Show all messages Hide all messages |
| Hint. | jk_qq | 1936. Roshambo | 15 Oct 2017 02:54 | 1 |
Hint. jk_qq 15 Oct 2017 02:54 If you think it in a way of dynamic programming it could help. Imagine we have N pirats. Calculate probability of draw for single round (either all N pirats has the same gesture or there's a pirat for every possible gesture). Then calculate average number of rounds to be played before someone lost (standard geometric sum). Now someone is lost and we have the same game but with less pirats. So we can use DP-approach with probabilities. Use doubles, it's enough to get AC. You would be happy to implement this problem (my impl is 30 lines with i/o on c++). |
| Did anyone derive the solution? | Aditya Paliwal | 1294. Mars Satellites | 14 Oct 2017 15:29 | 1 |
I just used some identities and solved some equations to get the answer. Pretty sure I wouldn't be able to solve if I did not have access to the net and that is pretty lame :/ Was anybody able to solve by deriving the solution themselves? If yes, then please share! I want to learn the approach! ^_^ |
| Bit of help | jk_qq | 1324. Extra Spaces | 13 Oct 2017 20:57 | 1 |
Nice problem. Playing out with small numbers and sample could help in sequence instantiation. My solution is only 30 lines of c++ code O(L) though. Hint: imagine we have sequence which can replace up to L spaces afterall. Then to enlarge our sequence we insert L/2 + 1 in the beginning. Maximum L could be computed via straightforward iteration starting from lax max_L Example: seq: 2 max_L: 2 seq: 2, 2/2 + 1 = 2, 2 max_L: 2, 4 seq: 2, 2, 4/2 + 1 = 2, 2, 3 max_L: 2, 4, 10 seq: 2, 2, 3, 10/2 + 1 = 2, 2, 3, 6 max_L: 2, 4, 10, 40 Etc. GL. |
| WA4 | 💻Evgeny Nemtsev [UrFU FT-17] | 1357. Teakettle 1.0 for Dummies | 12 Oct 2017 02:04 | 1 |
WA4 💻Evgeny Nemtsev [UrFU FT-17] 12 Oct 2017 02:04 |
| WA25 | bsu.mmf.team | 1793. Tray 2 | 9 Oct 2017 20:25 | 17 |
WA25 bsu.mmf.team 16 Oct 2010 16:10 people! who has any ideas? What about test 13? What is test ??!?!?! Check if the plate fits in the tray I check plate if in tray but WA 13 !!! Re: WA25 Oleg Strekalovsky [Retired] 17 Oct 2010 02:32 people! who has any ideas? Do you found test or reason for WA 25? I also had that problem but when I checked if big plate is placed in tray (2 * r > b here r is the radius of cone at the height d (d < h) and b is small side of tray). But now I have wa on test31 good luck Re: WA25 Oleg Strekalovsky [Retired] 17 Oct 2010 03:28 I also had that problem but when I checked if big plate is placed in tray (2 * r > b here r is the radius of cone at the height d (d < h) and b is small side of tray). But now I have wa on test31 good luck Thanks. I can add, that we must check: 0 <= x + r && x + r <= w && 0 <= x - r && x - r <= w && 0 <= y + r && y + r <= h && 0 <= y - r && y - r <= h; for both plate x,y - coordinates of plate center's, r - minimal radius of plate, w,h - max(a,b), min(a,b) Test: 2 10 1 1 3 1 3 2 Ans: NO Edited by author 17.10.2010 03:31thanks your test helped me a lot. Thanks again I've read all the advice: my code meets all of them. Any other suggestions on WA25? Maybe someone is ready to look at my code? My e-mail is in my info. Thanks for any help. I made a stupid mistake while reading the input data. First I read bottom sides and then top sides. Surprisingly, this solution bring me to WA25 and half-an-hour debugging. It turned out I had read data in the same wrong manner and also got WA25! MAK, your advice was the most useful in this discussion )) Edited by author 17.10.2010 03:39 Yes! It was a very stupid mistake! I checked if radius of plates on the height d is not greater than a and not grater than b. But I should check their diameter instead it! This fact costed me 13 fail submissions... Try this test: 9 15 1 1 2 1 5 1 Answer is NO. Why NO? First (d=2)koord: 2 2 Second (d=5) koord: 4 10 I think YES, but WA 25... This test helped me on WA25: 20 28 1 1 2 11 12 1 Answer: NO. |
| 1001 C# Can anyone explain why this is wrong? | Kris | 1001. Reverse Root | 9 Oct 2017 12:33 | 2 |
Can anyone explain why this is saying wrong answer? namespace Ex2 { class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); for (int a = input.Length - 1; a >= 0; a--) { double temp = Math.Sqrt(double.Parse(input[a])); if (temp == 0) { string zero = temp.ToString(); zero += ","; Console.WriteLine(zero.PadRight(6,'0')); } else { Console.WriteLine(temp); } } //Console.ReadLine(); } } } How many input lines are declared in the task? How many input lines in the example? How many lines your program expects? |
| Where is my fault ? | Nikolai | 1001. Reverse Root | 9 Oct 2017 12:32 | 2 |
import java.util.Scanner; public class main { public static void main(String[] args) throws Exception { Scanner scan = new Scanner(System.in); String a = scan.nextLine(); double b = Double.parseDouble(a); double c; double d = b; double mass[] = new double[(int)b]; while (b != 0) { c = Math.sqrt(scan.nextDouble()); mass[(int)(b - 1)] = c; b--; } for (double i = 0; i < d; i++) { System.out.printf("%.4f\n", mass[(int)i]); } } } Outputs "Runtime error" Edited by author 09.10.2017 00:50 Please look at example, try to find count of inputs you are reading into b. |
| Binary tree | Nikita Mogilevets | 2104. Game with a Strip | 8 Oct 2017 10:10 | 1 |
You can build binary tree Left child corresponds to inward fold Right child corresponds to outward fold Root is unfolded strip Build tree from root to leaves and before going deeper check winning conditions |
| Question about ' like ' parsing and apostrophe encoding | Mickkie | 1177. Like Comparisons | 8 Oct 2017 07:07 | 2 |
How to deal with case like this ' ' like ' like ' like ' like ' 'like ' it can be splitted as ( ) & ( like ' like ' like ' 'like ) or ( ' like ) & ( like ' like ' 'like ) or ( ' like ' like ) & ( like ' 'like ) or ( ' like ' like ' like ) & ( 'like ) Can you clarify this statement Inner entrance of apostrophe symbol (ASCII 39) into string or template is encoded by double apostrophe symbol And if it's true the case ''hi'' like ''hi'' will be changed to '"hi'' like '"hi' Am I right? Then how is this case possible? '''''' like '_''' The apostrophe symbol (ASCII 39) if appear in string or template will be double (now it becomes 2 successive apostrophe symbols). The English problem statement is wrong to me since it made us think that ASCII 39 is replaced by ASCII 34 or something. But in fact, ASCII 39 is replaced by two ASCII 39. At least, I got AC after using my above interpretation. |
| WA#8 | [TH0312]LeMinhTruyen | 1080. Map Coloring | 7 Oct 2017 01:39 | 2 |
WA#8 [TH0312]LeMinhTruyen 4 Dec 2012 13:27 Does anyone know about test number 8?. If you do, please upload some, thank you very much. Re: WA#8 Nikita Manovich 7 Oct 2017 01:39 I believe the test is simple. I had WA #8 and the only problem I had I forgot to initialize first vertix to RED color. Test: 1 0 result:0 |
| Wrong:1000A+N problem| C | sandalphon | 1000. A+B Problem | 6 Oct 2017 18:49 | 2 |
#include <stdio.h> int main() { int a,b; scanf("%d,%d",&a,&b); printf("a+b=%d\n",a+b); return 0; } Don't print unnecessarily information like "a+b=" |
| WA on test 10, ac on poj | tahara | 1162. Currency Exchange | 6 Oct 2017 18:21 | 1 |
please, how can I get test cases on this oj? |
| Problem 2094 was rejudged | ...†.†.†... Stigius ...†.†.†... | 2094. Thousand Imps | 6 Oct 2017 14:35 | 3 |
Error in jury solution was fixed, all test answers updated, few new tests added. Most authors lost their AC. Big thanks to the Winger for pointing out an issue and helping with fixing it. What error was fixed,maybe my code has the same error?? oh yeah Accepted.. with guess,and |
| AC in 0.015 sec | cosmicray001 | 2001. Mathematicians and Berries | 5 Oct 2017 19:54 | 1 |
#include <bits/stdc++.h> using namespace std; int main() { int a, a2, a3; int b, b2, b3; scanf("%d %d %d %d %d %d", &a, &b, &a2, &b2, &a3, &b3); int bb1 = a - a3; int bb2 = b - b2; printf("%d %d\n", bb1, bb2); return 0; } |
| Run time eror(Stack Overflow)why? | Chowdhury Md. Ishmam Rahman | 1001. Reverse Root | 5 Oct 2017 18:28 | 3 |
#include<stdio.h> #include<math.h> #include<stdlib.h> #define SIZE 128*1024 int main() { int i,n=0; long long int num[SIZE],N; printf("enter your aray value:\n"); while(scanf("%lld",&N)!=EOF) { num[n]=N; n++; } for(i=n-1;i>=0;i--){
printf("%0.4lf\n",(double)sqrt(num[i])); } return 0; } ohhh...thanks for your great suggestion. |
| who has wa4 | CoolBoy | 1588. Jamaica | 5 Oct 2017 17:13 | 4 |
4th test is: 3 0 0 9999 10000 9998 9999 So double should be used instead of float...When I replaced float with double my code passed this test... And, the answer should be 28283 thats wroung answer for that test ! - you shouldn't add to the sum same distance twice !! ans is 14141 ! No! Right answer is 28283, because the points are not placing on one line. Edited by author 05.10.2017 17:14 Edited by author 05.10.2017 17:14 |
| Python Что не так в коде? | FY0u11 | 1001. Reverse Root | 4 Oct 2017 22:17 | 4 |
from re import * from math import sqrt result = findall('[0-9]+', input()) result.reverse() for i in result: print('{:.4f}'.format(sqrt(int(i)))) Edited by author 14.03.2017 01:20 For the most tasks WA1 means your program can't even solve sample. Have you tried to run it locally? It's clearly visible it doesn't work. Here's my run: http://ideone.com/T9g8rU There is only 2 numbers in output so your program processed first input line only. Edited by author 17.03.2017 14:35Hey admins! His code works well as my, but it doesn't pass on your side. As the prove look bellow: " with open('/tmp/123.txt', 'r') as f: string = f.read()
from re import * from math import sqrt result = findall('[0-9]+', string) result.reverse() for i in result: print('{:.4f}'.format(sqrt(int(i)))) " Answer " runfile('/home/ant/.config/spyder-py3/temp.py', wdir='/home/ant/.config/spyder-py3') 2297.0716 936297014.1164 0.0000 37.7757 " You have mistakes in comparation analysis on your side. Hi, master8282 please, take a look at rules: В решениях задач запрещается: работа с любыми файлами; ... (Source: http://acm.timus.ru/help.aspx?topic=judge) here is the problem, since your code based on file reading. |
| Who had a Wrong Answer in 5 th test ? What mistake may be there ? | Escarabajo | 1369. Cockroach Race | 4 Oct 2017 14:14 | 3 |
Who had a Wrong Answer in 5 th test ? What mistake may be there ? Locally you can make straitforward solution M * N and check what line is wrong. as far as I remember test 5 is the case N==0, just output empty line.. |
| WA11 - please help | Mescalito | 1577. E-mail | 4 Oct 2017 12:17 | 1 |
Could someone provide tests for me? Thank you |
| If you have WA13 | shardex | 1145. Rope in the Labyrinth | 2 Oct 2017 22:07 | 1 |
Try this test: 4 3 #### #..# #### Answer is 1 :) |