| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| TEST 3 | Prodip Datta | 1542. Автодополнение | 11 сен 2018 15:52 | 1 |
TEST 3 Prodip Datta 11 сен 2018 15:52 WA On TEST#3 .. any help plz ??? Edited by author 11.09.2018 15:53 Edited by author 11.09.2018 15:53 |
| this problem should really have lower complexity | imaginary friend | 2091. Естественный отбор | 11 сен 2018 05:11 | 1 |
it's just about implementation, the complexity is too high for these problem, imho |
| Some hint | Adilbek_ | 1671. Паутина Ананси | 11 сен 2018 04:16 | 2 |
|
| What can it be on the 4-th test? | Soul Reaver | 1203. Научная конференция | 9 сен 2018 17:28 | 5 |
5 1 8 2 3 4 5 6 7 9 10 Answer: 4. I have answer 4 on this test! Why WA? Try this: 3 1 5 2 5 3 5 Answer: 1 Check when completion time is equal,then sort it in increasing order of arrival time |
| Accepted using incorrect Ford-Bellman with queue | adamant | 1871. Сейсмические волны | 9 сен 2018 01:04 | 1 |
In submission #8011723 I allocate queue of size only n, while for correct Ford-Bellman with a queue it should be up top m. Please, take a look into issue. |
| C++ Help!!! | Владимир | 1785. Трудности локализации | 8 сен 2018 20:15 | 2 |
Я не понимаю, что здесь не правильного??? #include <iostream> #include <string> using namespace std; int main() { string name[] = { "few", "several", "pack", "lots", "horde", "throng", "swarm", "zounds", "legion" }; int input; cin >> input; if (input >=1 && input <= 4) cout << name[0]; if (input > 4 && input <= 9) cout << name[1]; if (input > 9 && input <= 19) cout << name[2]; if (input > 19 && input <= 49) cout << name[3]; if (input > 49 && input <= 99) cout << name[4]; if (input > 99 && input <= 249) cout << name[5]; if (input > 249 && input <= 499) cout << name[6]; if (input > 499 && input <= 999) cout << name[7]; if (input > 1000) cout << name[8]; return 0; } Подскажите, пожалуйста! у тебя случай n=1000 никуда не включен. you forgot n=1000 case. |
| Some facts about the test | Myrcella | 1034. Ферзи в мирной позиции | 6 сен 2018 19:57 | 1 |
All the X of the input are difference. (Maybe Y are different too. I haven't tried That means, the following test won't exist: ----- 4 1 1 2 3 2 2 4 4 ----- This may be important for you to solve this question more easily (at least for me, my code won't work that situation and get AC in 0.031s though) Good luck! |
| describe 128*1024 ? about memory management | Noushad Bhuiyan | 1001. Обратный корень | 3 сен 2018 13:30 | 2 |
I tried hard and hard but was getting runtime error: access violation again and again because of not taking proper size of array. at last I used a[128*1024] by a solution of a discussion. and it worked. but how it was done? I mean I didn't get the clue line of question " A size of the input stream does not exceed 256 KB. " can you help me? 256KB of chars - like "1.2 11 1". Here are 3 numbers take 8 bytes. Size of minimal double representation is 2 bytes - "1 ". So 256K chars can be 128K doubles. |
| Hint for WA#1 | ruX | 1067. Структура папок | 2 сен 2018 23:11 | 1 |
Make sure you don't have spaces after any line |
| To admins: please specify precision | Fyodor Menshikov | 1602. Лифт | 1 сен 2018 23:15 | 1 |
Current tests contain max 2 digits after decimal point. Could you specify it in the problem statement? Else there is no solution to this problem. Without this limit specified a test can have a lot of digits after decimal point so that it is even impossible to read it within time limit. |
| Hint. | jk_qq | 1580. Долги декана | 1 сен 2018 17:01 | 2 |
Hint. jk_qq 15 окт 2017 01:25 Every connected component have to contain cycle of odd length (prove it). Find such a cycle and solve. Proof that a system of linear equation has a unique solution if the corresponding cycle is of an odd length. system of LE x1 + x2 = y1 x2 + x3 = y2 ... x_{n-1} + x_n = y_{n - 1} x1 + x_n = y_n Is written in matrix form (i'll skip the last column) 1 1 0 ... 0 0 1 1 0 ... 0 0 0 1 1 0 ... 0 . . . 0 ... 0 1 1 1 0 ... 0 1 It's determinant can be computed as follows det( 1 1 .. 0 0 1 1 .. 0 . 0 0 .0 1 1 0 ... 0 1 ) +-(!!!) det ( 1 0 .. 0 1 1 0 .. 0 . . 1 0 0 ... 0 1 1 ) I took entries (1, 1) and (n, 1) to form these two. The sign (+-) depends on dimention and is equal to (-1)^(n + 1). The two determinans are equal as the first one is equal to 1 1 0 1 which can be seen if you keep choosing entry (n, n) to form determinant and the second one is equal to 1 0 1 1 keep choosing (1, 1) So, the determinant of initial matrix is equal to 2 if the number of variables odd which means the system has a unique solution. The system can't have one in the case of zero determinant which is when the number of variables is even. Edited by author 01.09.2018 17:02 |
| if wa2 | tishinilia | 1210. Добрые духи | 1 сен 2018 16:53 | 1 |
if wa2 tishinilia 1 сен 2018 16:53 use max=10**9 maybe, i'm just silly |
| ACCEPTED!!!! PASCAL SOLUTION | mNT | 1524. Men in Black | 1 сен 2018 16:34 | 1 |
|
| test 3 | [TDUweAI] daminus | 1837. Число Исенбаева | 1 сен 2018 00:51 | 6 |
test 3 [TDUweAI] daminus 25 июн 2013 19:21 input file: 1 Isenbae Isen Isenbaeva and, what what is your answer? Edited by author 25.06.2013 19:22 Edited by author 25.06.2013 19:22 Edited by author 25.06.2013 19:23 Isen undefined Isenbae undefined Isenbaeva undefined Love you bro <3 that me helped input file: 1 Isenbae Isen Isenbaeva and, what what is your answer? Edited by author 25.06.2013 19:22 Edited by author 25.06.2013 19:22 Edited by author 25.06.2013 19:23 Thanks a lot... :) I have been struggling hard to overcome WA 3 ... And this test helped me to pass WA-3. good hint for a beginners as me. It's better to be careful with reading a problem) |
| I got stuck in test 4, any idea? | phantomape | 1934. Чёрная метка | 31 авг 2018 11:26 | 1 |
#include <iostream> #include <vector> #include <cstring> #include <queue> using namespace std; int N, M, S, T, A, B, P; int total = 0; struct Edge { int to, next; double prob; } edges[100010]; int head[100010]; int parent[100010], dist[100010]; double prob[100010]; void addEdge(int start, int end, int p) { edges[total].to = end; edges[total].next = head[start]; edges[total].prob = 1.0 - (double)p / 100.0; head[start] = total++; } // The most tricky part is the probability, we are looking for the probability // of meeting Kraken in any route so it should be P(A|B), which equals to // P(A) + P(B) - P(AB) int main() { memset(head, -1, sizeof head); memset(parent, -1, sizeof parent); memset(dist, -1, sizeof dist); cin >> N >> M >> S >> T; for (int i = 0; i <= N; i ++) prob[i] = 0.0; for (int i = 1; i <= M; i ++) { cin >> A >> B >> P; addEdge(A, B, P); addEdge(B, A, P); } queue<int> q; q.push(S); dist[S] = 0 ; prob[S] = 1.0; while (!q.empty()) { int u = q.front(); q.pop(); for (int idx = head[u]; idx != -1; idx = edges[idx].next) { int v = edges[idx].to; double p = edges[idx].prob; if (dist[v] == -1 || (dist[v] == dist[u] + 1 && prob[v] < prob[u] * p)) { if (dist[v] == -1) { q.push(v); } dist[v] = dist[u] + 1; prob[v] = prob[u] * p; parent[v] = u; } } } vector<int> path; for (int i = T; i != S; i = parent[i]) { path.push_back(i); } path.push_back(S); cout << path.size() << " "; printf("%.7f\n", 1.0 - prob[T]); for (int i = path.size() - 1; i >= 1; i --) cout << path[i] << " "; cout << path[0] << endl; return 0; } |
| useful test case!!!! | jlcastrillon | 1244. Джентльмены | 30 авг 2018 18:19 | 7 |
5 4 1 3 6 1 answer:3 Edited by author 29.05.2011 11:06 thanks for your test, it helped me thanks ! Edited by author 18.04.2014 19:54 |
| Nice problem. | beastsl | 1037. Управление памятью | 29 авг 2018 22:24 | 1 |
Done with queue + segment tree, AC in 0.265 on Visual C++ 2017 |
| Could anyone help with Test 16? | Alflex | 1436. Рекламный щит | 29 авг 2018 19:38 | 2 |
I have WA, but I don't guess at the feature of this test. Does anyone have a problem with this test? Please comment your trick. You should be careful with the point (X, 0) that lies on line A + (B - A). The angle should be 0 there, but because of precision issues we all love this case can break ternary search. |
| AC in 6 line !!! | hoan | 1243. Развод семи гномов | 29 авг 2018 01:51 | 12 |
#include <cstdio> char ch, res; int main (){ while(scanf(" %c", &ch)!= EOF||(printf("%d\n", res)&0)) res= (res*10+ ch-'0')%7; } I'm too!!! import java.math.BigInteger; import java.util.Scanner; public class T_1243 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger n = sc.nextBigInteger(); System.out.print(n.mod(new BigInteger("7"); )); }} 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))); } } you used long arithmetic, it is not best solution, read first post more accurately, it doesn't using any long arythmetic and arrays, collections, etc. I used the same algoritm! But on Pascal it takes a litle more lines(11 to be exact). But on Pascal my program works 0.015 seconds, but yours on C - 0.031 Edited by author 25.03.2011 22:55 My C solution works the same time as yours, but it used 104 КB memory instead of 154 КB in your case. #include <stdio.h> int main(void){ int c,a=0; for(;(c=getchar())!='\n';a=(a*10+c-'0')%7); printf("%u\n",a); return 0; } #include <iostream> int main(void){ int c,a=0; for(;(c=getchar())!='\n';a=(a*10+c-'0')%7); printf("%u\n",a); return 0; } 0.015s. Why does it work? I just don't understand the logic. AC in 2 lines: n = int(input()) print(n%7) Just 1 line :) print(int(input())%7) Edited by author 29.08.2018 01:51 |
| WA#1 TEST | TShT | 1102. Странный диалог | 28 авг 2018 23:32 | 1 |
outputon YES Edited by author 28.08.2018 23:32 |