Show all threads Hide all threads Show all messages Hide all messages |
AC 0.3 Sec 972 KB | Bourne | 1100. Final Standings | 4 Sep 2015 20:12 | 12 |
program Bourne; var n,i,j,x:longint; a:array[0..150000] of smallint; b:array[0..150000] of longint; begin readln(n); for i:=1 to n do begin readln(b[i],a[i]); end; for x:=100 downto 0 do begin for i:=1 to n do if a[i]=x then writeln(b[i],' ',a[i]); end; end. :) interesting... good done! :) Re:Your code is wrong!!!!..Memory limite exid Edited by author 13.05.2006 17:02 Edited by author 13.05.2006 17:02 Maybe tests were changed since april... Isnt it, Judges? Hmm... It gets MLE, really. Do they count memory on ALL tests, not on every test separately? Update: I've rewrited it, so it doesn't get MLE: #include <stdio.h> void main() { long n; unsigned char a[150000]; unsigned char hi[150000]; unsigned short lo[150000]; scanf("%ld",&n); for(long i=0;i<n;i++) { long bod; scanf("%ld%d",&bod,&a[i]); lo[i]=bod%65536; hi[i]=bod/65536; } for(int v=100;v>=0;v--) { for(int i=0;i<n;i++) if(a[i]==v) printf("%ld %d\n",hi[i]*65536+lo[i],a[i]); } } How can THIS get WA#11??? Edited by author 06.01.2006 21:12 I try so var a: array[0..100,0..150000]of longint; o,p,n,j,i : longint; begin readln(n); for i:=1 to n do begin readln(o,p); inc(a[p,0]); a[p,a[p,0]]:=o; end;
for i:= 100 downto 0 do begin for j:=1 to a[i,0] do writeln(a[i,j],' ',i); end; end. try to concate K and ID into 1 longint variable (because 10000000=3 bytes, 1 extra) using shl, shr. I've goten AC and wish you the same Edited by author 08.02.2006 17:12 Edited by author 08.02.2006 17:12 1. Replace 150000 with 150001 2. C++ solution doesn't get MLE even without hi-lo representation, simply use long. Hmm... It gets MLE, really. Do they count memory on ALL tests, not on every test separately? Update: I've rewrited it, so it doesn't get MLE: #include <stdio.h> void main() { long n; unsigned char a[150000]; unsigned char hi[150000]; unsigned short lo[150000]; scanf("%ld",&n); for(long i=0;i<n;i++) { long bod; scanf("%ld%d",&bod,&a[i]); lo[i]=bod%65536; hi[i]=bod/65536; } for(int v=100;v>=0;v--) { for(int i=0;i<n;i++) if(a[i]==v) printf("%ld %d\n",hi[i]*65536+lo[i],a[i]); } } How can THIS get WA#11??? Edited by author 06.01.2006 21:12 > 1. Replace 150000 with 150001 Thanks, it works! AC You are good! Thank you! You are genius! But my program work faster :-)) But it doesn't work :-| |
How solve this problem faster 0.1 sec? (I got AC) | Felix_Mate | 1314. Chase in Subway | 4 Sep 2015 19:45 | 1 |
|
WA7 = integer overflow | Otrebus | 1246. Tethered Dog | 4 Sep 2015 16:30 | 1 |
|
Проблема с проверкой... | KedrikFeeD | | 4 Sep 2015 10:59 | 3 |
Задачи долго проверяются с чем это связано? И как это исправить? Никак не исправить. Виртуальные машины, на которых идет проверка перемещены между датацентрами университета, и вот уже больше суток администраторам не удается наладить связь между веб-сервером и машинами проверки. Повлиять на этот процесс, увы, возможности нет. Остается только ждать. Edited by author 04.09.2015 11:00 |
Как оптимизировать решение задач на scala? | IvanMeskalin | | 1 Sep 2015 12:00 | 1 |
Сделал небольшой замер выполнения задач на C++, Java, Scala. Взял задачу задачу 1000, так-как на нее есть решения на всех языках. Результаты выполнения: C++ - 0.001, Java - 0.124, Scala - 0.577, Scala с использованием JDK классов - 0,421 Результаты неутешительны, так-как задачи с ограничением в 0.5 с не выполнимы. Воспользоваться стандартными классами JDK но выигрыш был ненамного. Да и не вижу смысла их использовать. Предполагаю что медленно стартует исполнение программ и это особенность JVM. Задачи хочу решать на Scala так-как есть такая возможность. Есть ли какие то решения данной проблемы? |
TLE | Viktor | 1934. Black Spot | 1 Sep 2015 07:26 | 4 |
TLE Viktor 17 Dec 2012 20:19 Don't use cin/cout or Scanner in java. Re: TLE Andrew Sboev [USU] 17 Dec 2012 23:02 Seriously? 10^5, it's so few! Only cin, only hardcore! You shoudn't use cin/cout in every problem, in which n is big enough(n > 1000, for example) Edited by author 17.12.2012 23:02 cin/cout is not TLE, as long as you do cin.sync_with_stdio(false); Re: TLE jacketinsysu 1 Sep 2015 07:26 Yes, you may think that the number of edge can be as large as n * (n - 1) / 2, which is O(n^2), where n is the number of vertex of the graph. (10^5)^2 = 10^10. is a rather large scale data for 1 second. |
After getting TL or WA you might be interested in this not efficient way (java AC 0.5s, 17Mbs) | esbybb | 1603. Erudite | 31 Aug 2015 21:31 | 1 |
i ended up counting all possible Strings can be composed quickly. so preprocessing gives me 552 of the 16 symbols words 27956 of less than 16 symbols words (including those who are 1) |
WA1 | Chen | 1109. Conference | 31 Aug 2015 18:12 | 1 |
WA1 Chen 31 Aug 2015 18:12 WA1 why?can i get the test data? Edited by author 31.08.2015 18:13 |
Test #4 is WA! | Nies | 1306. Sequence Median | 29 Aug 2015 22:02 | 1 |
can anyone please give the #4 test case? |
I am getting this error Runtime error (non-zero exit code). please help. | Md. Salahuddin | 1820. Ural Steaks | 29 Aug 2015 13:06 | 1 |
I understand the problem. There is one frying pan! Edited by author 29.08.2015 13:17 Edited by author 29.08.2015 14:14 Edited by author 29.08.2015 14:15 |
Output seem to match the expectation but still the solution is rejected | ktm | 1001. Reverse Root | 28 Aug 2015 20:58 | 1 |
Can someone please tell me the problem with this code. It looks okay to me. Environment: Linux, G++ C++11, GCC version 4.9.2 #include <cmath> #include <iostream> #include <iomanip> #include <vector> #include <sstream> #include <ios> #include <string> using namespace std; int main(void) { vector<long long> v; string strBuf; long long result; while (getline(cin, strBuf)) { result = atoll(strBuf.c_str()); v.push_back(result); } vector<long long>::reverse_iterator ritr = v.rbegin(); while (ritr != v.rend()) { cout << fixed << setprecision(4) << sqrtl(*ritr) << endl; ++ritr; } return 0; } Compilation: $ g++ ktm_0_1.cpp -std=c++11 Sample execution seems fine to me: $ ./a.out 1427 0 876652098643267843 5276538 <-- After this, I enter CTRL-D manually 2297.0716 936297014.1164 0.0000 37.7757 |
in case of WA#11 | nikitaevg | 1246. Tethered Dog | 28 Aug 2015 18:19 | 1 |
try this one 7 1 1 2 2 4 3 5 3 7 2 9 0 5 7 answer is ccw |
WA#8 | Auslender | 1494. Monobilliards | 28 Aug 2015 18:00 | 1 |
WA#8 Auslender 28 Aug 2015 18:00 have no idea what this test may be |
If you have WA 5 | Andrew Hoffmann aka SKYDOS [Vladimir SU] | 1242. Werewolf | 27 Aug 2015 21:19 | 4 |
this test can help you: 9 4 1 2 4 3 4 6 4 5 4 7 5 8 5 9 7 BLOOD 5 answer is: 2 3 6 Good luck! My answer to this test is right,but i also get wa! why? Edited by author 18.10.2012 18:48 My answer is right but WA 5 ... I got runtime error at test 5. |
Idea | Felix_Mate | 1129. Door Painting | 27 Aug 2015 15:36 | 1 |
Idea Felix_Mate 27 Aug 2015 15:36 My algo works O(N^3) at 0.015 sec. Solution always exist. Idea: We must paint first half of edge in 'Y' and second half in 'G'. 1)Delete cycles (if the edge belongs to the cycle then we delete it from the graph) and paint edges; 2)Paint a tree. Edited by author 27.08.2015 15:36 |
TLE at test case #9 | jacketinsysu | 2034. Caravans | 27 Aug 2015 14:57 | 1 |
I use bfs...but record the route in a map, and maybe the copy of the map cost too much time... How can I get all the routes in another good way? |
WA#8 Need some help! | Vitaliy Pokrovskiy | 2049. Chemistry | 27 Aug 2015 14:36 | 1 |
|
I Love this problem... 47 times... | Programmer | 1806. Mobile Telegraphs | 27 Aug 2015 00:33 | 1 |
47 times i had submitted a code with a small bug in heap... I'm sad... |
почему код у меня работает а в тимусе на 1 тесте ошибка? | saharok | 1243. Divorce of the Seven Dwarfs | 27 Aug 2015 00:18 | 3 |
компилятор visual studio 2010 - 1wa c++11 -4wa c++14 -4wa КАК???!!! код #include <iostream> #include <string> using namespace std; int main() { long int a; cin >> a; if(a < 7){ cout << a; return 0; } if(a>=7) cout << a%7; } I think number's type long more. You don't used long long. |
Some tests | Felix_Mate | 2029. Towers of Hanoi Strike Back | 26 Aug 2015 16:45 | 1 |
3 ABC => 5 13 CCCCCBBBBBAAABC => 992 9 ABCCBACAB => 466 9 CCABBACCB => 292 10 ACCABBACCB => 585 |