•Marius
|
 |
« : Septembrie 08, 2009, 20:55:20 » |
|
Aici puteţi discuta despre problema Logs.
|
|
|
Memorat
|
Faceti lucrurile simplu: pe cat de simplu posibil, dar nu mai simplu.
|
|
|
•anna_bozianu
|
 |
« Răspunde #1 : Septembrie 09, 2009, 21:46:49 » |
|
Am folosit initial parsarea folosind scanf("%s",L). http://infoarena.ro/job_detail/346877Apoi am inlocuit cu fgets(L,m+10,stdin). http://infoarena.ro/job_detail/346881In al doilea caz timpul de executie a scazut foarte tare reusind astfel sa trec de la 90 la 100 de puncte. Poate cineva sa imi explice care este diferenta?
|
|
« Ultima modificare: Septembrie 09, 2009, 21:52:35 de către Bozianu Ana »
|
Memorat
|
|
|
|
•wefgef
|
 |
« Răspunde #2 : Septembrie 10, 2009, 00:21:30 » |
|
Functia scanf() nu inseamna parsare  .
|
|
|
Memorat
|
omului i-au fost date instinctele pentru a supravietui, nu pentru a fi sclavul lor.
|
|
|
•anna_bozianu
|
 |
« Răspunde #3 : Septembrie 10, 2009, 10:32:56 » |
|
Qk. Am inteles. scanf nu inseamna parsare. Intrebarea insa ramane. Ambele procedee fac acelasi lucru adica incarca in stringul L cate o linie din matrice (scanf imi incarca toata linia cat timp ea contine numai caractere 0 si 1 fara spatii) . Apoi procesez linia in exact acelasi mod, aplic acelasi algoritm. Intrebarea era: ce face diferenta intre citirea cu scanf si cea cu fgets? de ce este fgets atat de rapid prin comparatie cu scanf? La unele teste diferenta de timp este de aproape 0.3 sec. iar aceasta diferenta vine din maxim n=15000 citiri de linii. Daca e sa calculez fiecare citire cu fgets e mai rapida fata de o citire cu scanf cu 0.3/15000= 0.00002 sec pentru o linie de maxim 1500 caractere. Interesant.
|
|
|
Memorat
|
|
|
|
•pauldb
|
 |
« Răspunde #4 : Septembrie 10, 2009, 11:43:48 » |
|
Nu stiu exact cum sunt implementate functiile scanf si fgets, dar exista unele diferente intre ele. Probabil scanf face mai multe verificari decat fgets si, din acest motiv, merge mai incet. O diferenta intre cele doua functii e ca fgets citeste pana ce intalneste '\n' sau numarul de caractere specificat, in timp ce scanf citeste pana ce intalneste '\n', spatii, taburi, etc.
|
|
|
Memorat
|
Am zis 
|
|
|
•hendrik
Strain
Karma: 11
Deconectat
Mesaje: 6
|
 |
« Răspunde #5 : Decembrie 25, 2009, 09:55:21 » |
|
Hi, dude.. I'm non Rumanian but I love this site. I just found something really annoying. http://infoarena.ro/job_detail/377564My 8-th test case: 8 532ms 340kb Time limit exceeded. 0 My 9-th test case: 9 600ms 380kb OK 10 Well we can clearly see that the 8th test case( 532ms which is smaller than 0.6 sec) got TLE while my 9th test case (exactly 0.6 sec) got OK. Can someone explain how does it happen? Thanks for your attention.
|
|
|
Memorat
|
|
|
|
•pauldb
|
 |
« Răspunde #6 : Decembrie 25, 2009, 10:33:33 » |
|
We have some problems displaying the exact time when your program stopped running. But otherwise the evaluator works fine meaning that if you get TLE, your program actually does exceed the time limit. The other way around doesn't really happen (to get OK with a running time above the time limit).
For my own curiosity, how do you understand the problem statements if you are not Romanian?
|
|
|
Memorat
|
Am zis 
|
|
|
•hendrik
Strain
Karma: 11
Deconectat
Mesaje: 6
|
 |
« Răspunde #7 : Decembrie 25, 2009, 10:38:08 » |
|
Thanks for your reply. Well google translator is really a great tool which helps me to translate those problems  . But some problems are not translated correctly. I hope one day, there will be an English version for this site. 
|
|
|
Memorat
|
|
|
|
•bogdan2412
|
 |
« Răspunde #8 : Decembrie 25, 2009, 13:45:21 » |
|
It's nice to see that we have reach outside of Romania already since infoarena.org is one of the things we had planned for the future. I'm curios how you heard of us and if you know other people who use our site  The programs do get killed by the kernel after exactly 0.6 seconds, but it doesn't really update the running time in external locations expect when it has time, so as far as we know it's impossible to return the exact running time without plugging in to the kernel, which we don't really need to do.
|
|
|
Memorat
|
|
|
|
•hendrik
Strain
Karma: 11
Deconectat
Mesaje: 6
|
 |
« Răspunde #9 : Decembrie 25, 2009, 15:49:12 » |
|
Unfortunately, I don't know other people outside Romania who use this site. I got this site when I google about something related to programming... after several hours googling, I finally found this site and I'm interested in it. 
|
|
|
Memorat
|
|
|
|
•dushmi
|
 |
« Răspunde #10 : Decembrie 22, 2010, 17:57:13 » |
|
aveti idee daca testul 8 are ceva special  pentru ca tot modific chestii in sursa si nu reusesc sa scap de tle
|
|
« Ultima modificare: Decembrie 22, 2010, 18:02:53 de către Dusmanu Mihai-Alexandru »
|
Memorat
|
|
|
|
•eudanip
|
 |
« Răspunde #11 : Decembrie 22, 2010, 20:02:37 » |
|
Pai folosestete de faptul ca configuratia de la o linie e aceeasi cu cea de la linia precedenta doar ca cateva valori carora li s-a resetat inaltimea pe 0 trec la sfarsit. Din cate m-am uitat eu asta am facut la sursa mea ca sa scap de tle pe testul 8.
Mult noroc.
|
|
|
Memorat
|
|
|
|
•dushmi
|
 |
« Răspunde #12 : Decembrie 23, 2010, 15:14:06 » |
|
Pai folosestete de faptul ca configuratia de la o linie e aceeasi cu cea de la linia precedenta doar ca cateva valori carora li s-a resetat inaltimea pe 0 trec la sfarsit. Din cate m-am uitat eu asta am facut la sursa mea ca sa scap de tle pe testul 8.
Mult noroc.
Fix ceva de genu fac si eu doar ca eu le tin sortate crescator si mut intr-un fel la inceput. Am observat ca exista 2 tipuri de surse : unele care iau timp mare pe 9( aproape de limita) si vreo 300 ms pe 8 si cele cu timp mare pe 8 si vreo 400 ms pe 9 ( cum este si a mea) In for-ul mare am 3 foruri de la 1 la m... In unul pun zerourile, in celalalt pastrez ordinea si in ultimul calculez aria.
|
|
|
Memorat
|
|
|
|
|