Show all threads Hide all threads Show all messages Hide all messages | WA4 | MyRoot | 1871. Seismic Waves | 23 Jul 2023 01:14 | 3 | WA4 MyRoot 22 Oct 2018 19:29 I am using Dijkstra's algorithm(and skip first vertex). I output a list of names whose shortest distance is less 141. I can't find the tests that crack my solution... Give me tests, please) When a user retweets, It is NOT their name that is added to the line! Re: WA4 InstouT94 23 Jul 2023 01:14 OMG, I had the same stupid mistake! | WA 20 With Dijkstra. What to do? | Kogut.Ivan'` | 1871. Seismic Waves | 12 Nov 2018 18:27 | 1 | I can't understand problem in my algorithm. Can it be solved with just Dijkstra? | Accepted using incorrect Ford-Bellman with queue | adamant | 1871. Seismic Waves | 9 Sep 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. | Accepted using Ford-Bellman | Mahilewets | 1871. Seismic Waves | 20 Jul 2017 14:42 | 1 | Рассчитывал я две величины. (1) dp[i] -- минимальное количество символов, которое должен прочесть i-й человек для того, чтобы узнать о землетрясении (2) len[i] -- минимальное количество символов, которое необходимо для того, чтобы ретвитнуть сообщение i-го человека. | What is right answer for test? | Felix_Mate | 1871. Seismic Waves | 9 Aug 2016 12:11 | 5 | Who can give right answer on test? 11 0000000000000000000000000 2 444444444444444444444444 777777 2 0 11111111111111111111111 3 55 777777 8888 22222222 3 11111111111111111111111 444444444444444444444444 8888 3333 1 444444444444444444444444 444444444444444444444444 3 2 55 8888 55 3 3333 444444444444444444444444 6 6 2 22222222 444444444444444444444444 777777 3 444444444444444444444444 6 55 8888 3 11111111111111111111111 22222222 777777 999999999999999999999999 2 444444444444444444444444 55 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX My prog print: 10 0000000000000000000000000 444444444444444444444444 777777 11111111111111111111111 55 8888 22222222 3333 6 999999999999999999999999 0000000000000000000000000: 444444444444444444444444: from 0000000000000000000000000 777777: from 0000000000000000000000000 11111111111111111111111: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 55: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 8888: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 6: from 777777 (RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) 22222222: from 6 3333: from 6 999999999999999999999999: from 55 (RT @777777: RT @0000000000000000000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) Edited by author 07.08.2016 20:51 Mine gives 10 0000000000000000000000000 2 11111111111111111111111 22222222 3333 444444444444444444444444 55 6 777777 8888 Why you not print 999999999999999999999999? 777777 retwitt 0000000000000000000000000, 55 retwit 777777: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (len=128<140). And what your answers on these tests? 1) 4 JaneSoboleva 2 FelixMate Try FelixMate 1 JaneSoboleva Try 0 SumSu 1 FelixMate Why Jane Soboleva not solve problems on Timus Online? Her count of problems is 784. It's not beautiful number! She must solve for >=800 problems!!! 2) 4 JaneSoboleva 2 FelixMate Try FelixMate 1 SumSu Try 0 SumSu 0 Why Jane Soboleva not solve problems on Timus Online now?Her count of problems is 784.She must solve minimum 16 problems! Gimme some break... 1) 0 (upd: should be 1 i guess, but anyway this test is incorrect since the text length > 140) 2) 4 JaneSoboleva FelixMate Try SumSu As of your first question, i solved this one a bit too long ago... i'll look into it and update this post later. Also, this thread helped me when i had WA2 http://acm.timus.ru/forum/thread.aspx?id=27267&upd=634549324304261511 — if the user has read the tweet, but can't retweet it, he still counts towards the people who know. Maybe that'll help you. UPD: okay, i get it. Your 999..9 user is not in anyone's followers list, so he shouldn't retweet the message from anyone. 444..4 and 55 can repost 999..9 if he posts something, but he never will, cause he's not a follower of anyone. Also, retweets. 10 0000000000000000000000000 --- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2 --- RT @444444444444444444444444: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 11111111111111111111111 --- RT @22222222: RT @6: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 22222222 --- RT @6: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 3333 --- RT @55: RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 444444444444444444444444 --- RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 55 --- RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 6 --- RT @777777: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 777777 --- RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 8888 --- RT @444444444444444444444444: RT @0000000000000000000000000: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 999999999999999999999999 --- [nothing] Some of those retweets (third one only, in fact) exceed 140 symbols, but this is just debug output. Those messages don't get retweeted and don't participate in further retweeting. Still, that user has read the tweet, and so he acknowledges its existance. Edited by author 08.08.2016 21:43Thanks! I read bad problem! I thought that graph not directed. | What is for test 28? | Vitaliy Karelin | 1871. Seismic Waves | 8 Dec 2015 23:27 | 8 | I had wa28 when in dfs-search visited each string ony once, but we must visit strings more than once if coming to this person post became shorter. So Dijkstra looks like is needed. I used many dfs call from v=1 until stabilization("seismic waves from v=1") I use bfs but I also get WA 28. You are using standard bfs, when once formed vertex skipped after, but in this problem we must do processing of each event of vertex echivement on subject of string length. This test help me to solv WA28 10 0000000000000000000000000 2 444444444444444444444444 777777 11111111111111111111111 3 55 777777 8888 22222222 3 11111111111111111111111 444444444444444444444444 8888 3333 1 444444444444444444444444 444444444444444444444444 3 2 55 8888 55 3 3333 444444444444444444444444 6 6 2 22222222 444444444444444444444444 777777 3 444444444444444444444444 6 55 8888 3 11111111111111111111111 22222222 777777 999999999999999999999999 2 444444444444444444444444 55 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX answer 9 0000000000000000000000000 22222222 3333 444444444444444444444444 55 6 777777 11111111111111111111111 8888 Please note that falicos's test is incorrect; the line "444444444444444444444444 3 2 55 8888" implies there is a user named "2", which is not specified by the input and hence illegal. If you remove the "3" from that line you get legally formatted input with the given answer correct. If you interpret the above test to mean there is a user named "2" with no followers, the answer would be 10 0000000000000000000000000 11111111111111111111111 2 22222222 3333 444444444444444444444444 55 6 777777 8888 | WA12 | MOPDOBOPOT (USU) | 1871. Seismic Waves | 27 Jul 2015 22:51 | 2 | WA12 MOPDOBOPOT (USU) 15 Nov 2011 23:17 I'm using dfs and can't find test for my program :( Edited by author 02.08.2012 16:46 Re: WA12 MOPDOBOPOT (USU) 27 Jul 2015 22:51 Now got AC by carefully modeling twitting process. | Probable weak tests | Marginean Ciprian | 1871. Seismic Waves | 15 Oct 2012 13:34 | 2 | Consider the following test: 7 Wayne 2 Bruce Dick Bruce 1 Brown Dick 1 Grayson Brown 1 Gordon Grayson 1 Gordon Gordon 1 Stephanie Stephanie 1 Wayne Master Wayne is going to disguise as Batman and stop the Joker! I must prepare the Batmobile for his quest! My solution fails to print Stephanie as a person who received the tweet about the earthquake. My solution uses a shortest path algorithm and that is why it takes into consideration only the shortest tweet reaching Gordon(the tweet sent by Grayson). So Gordon will try to send the tweet that he received(on the path Wayne Dick Grayson) preappended with "RT @Grayson: "(which is 13 characters long), totalling 141 characters. So the algorithm concludes that Stephanie will receive no tweet. But if we take the path Wayne, Bruce, Brown to Gordon, Gordon will receive a longer tweet than on the other path, but Stephanie will receive a tweet totalling 140 characters so she will actually be notified by a tweet too, although my algo fails to notice this. I believe that there are great chances that other shortest path algos implemented by other users behave the same, so please try to consider improving the tests with a test similar with mine, Regards, Ciprian Edited by author 15.10.2012 00:16 Your test was added. Thank you. | 2 Admins: what's wrong with checker ? | Strekalovsky Oleg [Vologda SPU #1] | 1871. Seismic Waves | 31 Oct 2011 13:26 | 6 | Why my solution ID=3932185, ID=3932184 get's WA against crash ? In my source code i have thrown an Error, but program not crashed ,but get WA 1. If you create new Thread, throwing an exception will lead to WA: another Thread outputs nothing and finishes its work correctly If you create new Thread, throwing an exception will lead to WA: another Thread outputs nothing and finishes its work correctly Are you sure, that after >480 accepted solutions I'v done so stupid mistake ? PS: I don't use threads. Problem was with Timus JVM. It's solved. Anyway, if you throw an exception or write System.exit(-1) in a newly created Thread, you will get WA, not RE. It's that I don't like on Timus. Anyway, if you throw an exception or write System.exit(-1) in a newly created Thread, you will get WA, not RE. It's that I don't like on Timus. I know that. I don't use threads. These sumbissions have verdict Crash 1 now. It was a failure of compiler - any solution was judged as WA1. | To Admins | Siroj Matchanov [TUIT] | 1871. Seismic Waves | 27 Oct 2011 21:16 | 1 | To Admins Siroj Matchanov [TUIT] 27 Oct 2011 21:16 Admins, lease add a "graph theory" tag for this problem. | Please help, what is test #5 | L.E.O. | 1871. Seismic Waves | 25 Oct 2011 09:37 | 6 | I using dfs, but always get WA5. Where was I mistake? Edited by author 18.10.2011 22:18 scanf("\n") ignore first ' ' symbols in next string. Edited by author 18.10.2011 19:43 Thank you, I got AC :) PS: fool mistake :( Tell this ""fool mistake"", please. I'm get WA5, because I'm wrong read data. Example: 2 A 1 B B 1 A message My init length message was 7, but actual init length was 9 (7 + 2 first space). "fool mistake": scanf("\n") - ignoring first '\n', '\t' and ' ', but to me need is ignoring first '\n'. | test 2 | alex kichkin | 1871. Seismic Waves | 23 Oct 2011 02:07 | 8 | test 2 alex kichkin 18 Oct 2011 23:25 could you tell me what is the test #2? I'm trying to find mistake in my solution but it doesn't work at all; my own tests are succses Edited by author 18.10.2011 23:27 Pay attention to that the one can't retweet the message but he has learn it. thank you so much! but one more question... if the fist one tweets "aaaaa earthquake!!!!", the second retweets "RT @name1: aaaaa earthquake!!!!" what should write the third one who wants to retweet: "RT @name2: aaaaa earthquake!!!!" or "RT @name2: RT @name1: aaaaa earthquake!!!!" If the third one retweet the second one's message, should be your second expression "RT @name2: RT @name1: aaaaa earthquake!!!!" ,or if he retweet the first one's message, should be "RT @name1: aaaaa earthquake!!!!" . If both retweet for the third one is legal, choose the shorter one is fine. ""Послано Gao Yang 19 октября 2011 07:52 Pay attention to that the one can't retweet the message but he has learn it."" Please, give this test. Edited by author 21.10.2011 23:54 Edited by author 21.10.2011 23:55 Please, give this test. Where are bugs? =) #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; class my_less{ public: bool operator()( const pair<string,short> a, const pair<string,short> b ){ return a.second < b.second; } }; int main(){ #ifndef ONLINE_JUDGE freopen("input.txt", "rt", stdin); #endif map<string,bool> DidGet; map<string,short> minLengthMessage; map< string, set<string> > users; set<string> informed;//опповещёные long n; string first_man; cin >> n; for( short i = 0; i < n; ++i ){ //cout << i << endl; string name; cin >> name; users[name] = set<string>(); if( !i ) first_man = name; DidGet[name] = false; minLengthMessage[name] = numeric_limits<short>::max(); long kol; if( scanf("%ld", &kol)!=1 ){while(1)printf("12121");}; for( long j = 0; j < kol; ++j ){ string follower; cin >> follower; users[name].insert( follower ); } } //for(map< string, set<string> >::iterator i = users.begin(); // i != users.end(); // ++i //) { // cout << (*i).first << endl; // for( // set<string>::iterator it = (*i).second.begin(); // it != (*i).second.end(); // ++it // ) // { // cout << " " << (*it) << endl; // } //} string SOS_massage; while( cin.get() != '\n' ); getline( cin, SOS_massage ); if( SOS_massage.size() == 0 || SOS_massage.size()>140 ){while(1)puts("1212");} //cout << "|" << SOS_massage << "|" << endl; multiset< pair<string,short>, my_less > Q; Q.insert( pair<string,short>(first_man,SOS_massage.size()) ); while( !Q.empty() ){ pair<string,short> para = *Q.begin(); Q.erase( Q.begin() ); //cout << "Take:" << para.first << " " << para.second << endl; if( para.second <= 140 &&( !DidGet[para.first] || minLengthMessage[para.first] > para.second) ) { informed.insert( para.first ); DidGet[para.first] = true; minLengthMessage[para.first] = para.second; //cout << "adding for: " << para.first << endl; for( set<string>::iterator it = users[para.first].begin(); it != users[para.first].end(); ++it ) { //cout << " " << *it << endl; Q.insert( pair<string,short>( *it, 6 + para.first.length() + para.second// //доп. симв. + длина имени отправителя + длина сообщ. которое получил отправитель ));// } } } cout << informed.size() << endl; for( set<string> ::iterator it = informed.begin(); it != informed.end(); ++it ) cout << *it << endl; return 0; } Edited by author 22.10.2011 00:31 Re: test 2 IgorKoval(from Pskov) 23 Oct 2011 02:07 6 0000000000000000000 2 2222222222222222222222222222 55555555555555555555555555555 111111111111111111111111111111 2 0000000000000000000 2222222222222222222222222222 2222222222222222222222222222 1 55555555555555555555555555555 33333333333333333333333333 4 0000000000000000000 111111111111111111111111111111 2222222222222222222222222222 55555555555555555555555555555 4444444444444444444444444444 4 0000000000000000000 111111111111111111111111111111 33333333333333333333333333 55555555555555555555555555555 55555555555555555555555555555 4 0000000000000000000 111111111111111111111111111111 2222222222222222222222222222 33333333333333333333333333 LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLO answer: 3 0000000000000000000 2222222222222222222222222222 55555555555555555555555555555 this test isn't correct in names of Japanese. =) | Some Problems | William Chou | 1871. Seismic Waves | 17 Oct 2011 18:15 | 2 | Who can help me. '«' and '»' means? If I get a string from "William",does it is "RT @William: ..."? This means the length of my string = 6 + length of nick + length of William's string? I'm from China. I couldn't access twitter because of GFW,the Great Fire Wall. Thank you. Sorry for my poor English. This means the length of my string = 6 + length of nick + length of William's string? ------------------------------------------------------------------ Yes, you're right! That's mean length = length of message + length of nick + 6... | No subject | Enigma [UB of TUIT] | 1871. Seismic Waves | 17 Oct 2011 15:34 | 3 | The last line contains a tweet about an earthquake.... ------------------------------------------------------ Why is it necessary for us???????????????? Edited by author 17.10.2011 13:57 That is the message you should retweet and on which you append the "RT @nick: " sufix. When it gets > 140 characters it isn't retweeted anymore. | Please help, what is test #2 | frehgouehg | 1871. Seismic Waves | 16 Oct 2011 01:26 | 1 | I think that don't understand the task rigth | Hi, could the admin suggest what the string is appended in the beginning? Is it "RT @nick: " or "RT@nick: " or sth else? | zayhero | 1871. Seismic Waves | 15 Oct 2011 20:20 | 2 | Yes, ADMINS please confirm the correctness of the appended string | Hint | Alexey Dergunov [Samara SAU] | 1871. Seismic Waves | 15 Oct 2011 18:29 | 1 | Hint Alexey Dergunov [Samara SAU] 15 Oct 2011 18:29 Note that FIRST PERSON IN THE INPUT sends a message first! |
|
|