| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| New here, compilation error I do not understand what I have done wrong | Ali Hassan | | 26 апр 2014 19:21 | 1 |
Edited by author 26.04.2014 19:40 |
| TEST 6 example | Adhambek | 1654. Шифровка | 26 апр 2014 15:17 | 3 |
input : tatu!.?.?.!utat output : "" Edited by author 20.06.2013 00:20 Edited by author 20.06.2013 00:21 Edited by author 20.06.2013 00:35 Штирлиц же "Убирает все пробелы и знаки препинания." That's a totally wrong test cases. The AC program won't give "". It is still original string. Besides there are NOT punctuation inside string. |
| No subject | Sunnat | 1001. Обратный корень | 26 апр 2014 15:13 | 1 |
object _1001 { def main(args: Array[String]): Unit = { println(scala.io.Source.stdin.getLines.flatMap(_.split(" ").filter(!_.isEmpty())).toArray.reverse.map(t => math.sqrt(t.toDouble)).mkString("\n")) } } |
| WA 12 | Kirill_Khapov | 1876. Утро сороконожки | 26 апр 2014 10:15 | 2 |
WA 12 Kirill_Khapov 26 апр 2014 10:13 #include <iostream> using namespace std; main() { int a, b; cin >> a >> b; if (39+2*a>a+2*b) cout << 39+2*a; else cout << 40+2*b; } my code is wrong :CC where is error? Edited by author 26.04.2014 10:14 |
| This Problem more looks like a joy! - Careful - telling you why. | BillSu | 1723. Книга Сандро | 25 апр 2014 16:35 | 1 |
One single letter count! Of course, Any substring would include one letter. |
| here my c code | Sunnat | 1149. Танцы синуса | 25 апр 2014 13:26 | 2 |
#include<stdio.h> main() { int n,i,j; scanf("%i",&n); for(i=1;i<n;i++) printf("("); for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { if(j>1) printf((j&1)?"+":"-"); printf("sin(%i",j); } for(j=1;j<=i;j++)printf(")"); printf("+%i",n+1-i); if(i!=n)printf(")"); } } A concise code. Much better than mine. |
| Why this is not correct? | Mes | 1710. Борис, ты не прав! | 24 апр 2014 14:04 | 1 |
I keep getting wrong answer at the 2 example. Isn't it from the examples provided? If so, why for 0 0 4 3 6 0 the solution NO 0 0 5 0 1.6 1.2 is not correct? A1B1 is equal to A2B2, B1C1 is equal to B2C2, C1A1 is different from C2A2, the cosine is the same, therefore the angle is the same. |
| How do you know this sequence is fibonucci ???? | . : : m 3 r L i N : : . | 1225. Флаги | 24 апр 2014 13:24 | 5 |
m = f(n) = f(n-1) + f(n-2) why f(n-1) :- put W and [R,...(n-1)] or R and [W,...(n-1)] why f(n-2) :- put R,B and [W,..(n-2)] or W,B and [R,...(n-2)] HTH How supernatural it is~~ ^_^ ! 哇靠~~这么科幻~~~ Looking Good! That's it! Why I got stuck! |
| Can't decrease program time (c#) | bulka94 | 1209. 1, 10, 100, 1000... | 24 апр 2014 08:33 | 2 |
using System; namespace TestOfCSharp { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int[] output = new int[N]; for (int c = 0; c < N; c++) { int K = int.Parse(Console.ReadLine()); int counter = 0; for (int j = 1; j <= K; j += counter, counter++) if (j == K) output[c] = 1; } foreach (int c in output) Console.Write("{0} ", c); } } } Use formula wisely, not for... |
| i'm sad | Two-Eight-Nine [[ §289]] | 1987. Вложенные отрезки | 24 апр 2014 04:06 | 9 |
i'm sad Two-Eight-Nine [[ §289]] 2 янв 2014 15:27 Algo O(nm) works for 1.046 sec, but O(2n) uses more than 65536kb. Edited by author 02.01.2014 15:28 Re: i'm sad Evgeniy_Chernobrovkin(MUCTR-2013) 21 янв 2014 06:15 1.031 for O(NxM) with pre-exit after left coordinate of segment > coordinate of point. Any idea for modifications? 0.625 for O(mlogn) solution using C++ STL set... I think the problem is harder, than its difficulty score if there is no easier solution. Well, okay, there is a O(mlogn) solution with sorting only and 0.125s execution time. Can you please write some more details for sorting based algorithm? I think you can search for red-black trees algo, it has O(nlogm) but its realy hard as for me. This problem can be solved fast, if you'll try not to consider common solution, but only this ( there is some useful limits in statement, also order is very convenient ) case. Small hint, that I promised: Imagine a big-length wall, like in old platformers, where segments are vertical levels and segment's coords are horizontal coords. Example: 4 2 10 2 3 5 7 6 7 00000011000 00110111000 00111111111 1 are bricks in our wall. Edited by author 14.03.2014 11:03 Re: i'm sad Dmytro Dziuma (DixonD) [Lviv NU] 24 апр 2014 04:06 Since the input is sorted already, there is a O(n+m) solution |
| C# Bug, Time limit exceeded with 0.375 s. | Davor Zdralo | 1100. Таблица результатов | 24 апр 2014 03:25 | 1 |
As the title says, I get time limit exceeded error with 0.375 seconds execution time. There is something definitely wrong here. My solution works just fine, the problem isn't that difficult. But on test 11, I time out for unknown reason. |
| wa #1 | hyesun | 1709. Пингвин-Авиа | 22 апр 2014 16:25 | 2 |
wa #1 hyesun 22 апр 2014 13:21 I am wondering why i got wa on test #1. I use dfs to color the edges. when one edge is not colored it means it makes a cycle and thus should be deleted. Next, every time I make dfs with a vertex, I connect it to a vertex processed before, which means the current vertex is connected to a component marked before. Lastly I used long long to store the result. But I just got wa on test #1. Can anybody please tell me sth about test #1 ? Lots of thanks Oh damn it. My first version of code is: int d, a, countd, counta; ...... long long money = d * countd + a * counta; But I didn't realize that d * countd may have already overflowed. So my AC version is: long long d, a, countd, count; ...... long long money = .....; Thus if anyone got WA at test #1 and you are sure you have the right algo, you may have failed due to the same reason as mine. |
| Tests (to admins) | Razdolbay from SIS | 1569. Сети в Исети | 21 апр 2014 21:58 | 2 |
Am I right that some AC solutions will be failed on these tests? ) 5 10 2 1 3 1 4 2 5 2 3 5 4 5 2 4 5 5 2 2 5 1 10 19 2 1 3 2 4 2 5 1 6 3 7 4 8 6 9 8 10 4 5 2 10 5 8 10 2 7 10 1 7 9 3 6 10 10 10 3 5 3 16 20 2 1 3 1 4 3 5 3 6 2 7 2 8 7 9 8 10 8 11 10 12 8 13 11 14 10 15 12 16 3 9 1 15 2 2 13 2 1 7 15 This network layout is guaranteed to be connected, and there are no links connecting a node with itself. |
| How to do it faster than 0.4 seconds | WhiteMan | 1102. Странный диалог | 21 апр 2014 21:43 | 1 |
My solution using DFA works half a second. In the ranking of many solve the problem for 0.1 second. How? |
| a + b | Straider | 1000. A+B Problem | 21 апр 2014 20:37 | 4 |
a + b Straider 10 фев 2014 23:46 import java.util.Scanner; public class firstexercise{ public static void main(String[]args){ Scanner scanner=new Scanner(System.in); int c=0; System.out.println("Введите первое число."); int a=scanner.nextInt(); System.out.println("Введите второе число."); int b=scanner.nextInt(); c=a+b; System.out.println("Ответ = " + c); } } There should be no prompt message and output only answer: import java.util.Scanner; public class firstexercise{ public static void main(String[]args){ Scanner scanner=new Scanner(System.in); int c=0; int a=scanner.nextInt(); int b=scanner.nextInt(); c=a+b; System.out.println(c); } } |
| To admins | Spatarel Dan Constantin | 1343. 12 месяцев | 20 апр 2014 13:13 | 2 |
To admins Spatarel Dan Constantin 19 апр 2014 15:06 I just submitted the same code with: * G++ 4.7.2 C++11 (5626316) and got WA3 * Visual C++ 2010 (5626319) and got AC Can you please tell me what works wrong when compiling with G++? Thank you %lld works as %d when you use it in g++ in windows. You should use %I64d instead. |
| I solved it in one BFS | ძამაანთ [Tbilisi SU] | 1325. Грязь | 20 апр 2014 04:02 | 1 |
But still AC in 0.171s :D even with super many optimizations (like not reading matrix, thus reading when needed; putting x's and y's in one integer and so on) come on :D slower than 2 BFS and even slower than dijkstra : \\ I suspect that I heavily use deque is the main reason. How can I replace deque with some other decent data structure that will let me quickly add and remove items? list<> in STL is dumbly slow for little objects ( dafaq who would have thought ?! ) |
| AC Java using Reg expression | Paata Julakidze[GTU] | 1612. Трамвайный форум | 19 апр 2014 17:26 | 1 |
"-|[.|,|!|?|-|:|\t|\n|\r|\\s]" |
| some tests | Roks | 1382. Игра с карточками | 18 апр 2014 23:54 | 9 |
4 2 4 3 2 4 4 2 1 1 2 3 4 // 2 1 2 2 4 3 2 1 2 1 1 4 4 4 2 3 1 // 1 1 2 2 2 2 2 2 1 1 1 // 1 1 3 1 2 1 2 3 2 3 1 3 // 1 1 1 Edited by author 24.01.2009 20:24 Hint: Try to build bipartite graph with 2*N edges. Then iteratively find vertice with only one connected edge. This edge will be "true" anyhow, so its pair from the guy's statement is "false". Also "false" are all edges, connected to both vertices of current one, and then you can mark their pairs as "true" ans so on... What residue graph after this procedure. Can it have vertices with deg>2? Logically it must be union of separeted edges(matched vertices) and disjoint circles. But My Ac prog says that in 9 test residue graph has vertice with deg>2. Edited by author 20.06.2009 09:17 I'm not sure how do you build that "residue graph", but the answer is most likely to be "no")) I would not mind helping you, but don't want to post ideas in forum. Edited by author 19.06.2009 13:37 What if there is no such edge? 5 5 4 5 5 1 5 4 1 5 4 4 3 4 1 5 5 2 5 4 4 5 1 3 4 3 3 5 5 1 5 5 I hope they can help~ o(∩_∩)o... Both of these tests are incorrect. My AC program fails on them. input: 6 1 2 4 2 3 5 3 1 6 1 5 4 5 6 5 6 4 6 output: 1 1 1 2 2 2 hope can help you. GOOD LUCK!!! |
| WHOIS | shad | 1740. А олени лучше! | 18 апр 2014 23:18 | 1 |
WHOIS shad 18 апр 2014 23:18 Chucha - Pupyrev or Auzenstein? |