Show all threads Hide all threads Show all messages Hide all messages |
Silly Problem R.I.P Timus | Shariar Kabir (Himel) | 1290. Sabotage | 2 Jul 2015 13:16 | 1 |
|
solution du problem 1785 accepted in gcc\c++ | Imane | 1785. Lost in Localization | 2 Jul 2015 03:52 | 1 |
#include <stdio.h> #include<math.h> int main(){ int a=1; while ( a!= 0){ scanf("%d",&a); if (a>=1) if (a<=4) printf("few\n"); if (a>=5) if (a<=9) printf("several\n"); if (a>=10) if (a<=19) printf("pack\n"); if (a>=20) if (a<=49) printf("lots\n"); if (a>=50) if (a<=99) printf("horde\n"); if (a>=100) if (a<=249) printf("throng\n"); if (a>=250) if (a<=499) printf("swarm\n"); if (a>=500) if (a<=999) printf("zounds\n"); if (a>=1000) printf("legion\n"); } return 0; } Edited by author 02.07.2015 03:53 |
Should f>=7 be allowed? | Saquib-Ul Haque | 2012. About Grisha N. | 1 Jul 2015 23:57 | 1 |
Or should we have our program do all calculations? |
WA3 | popolwooh | 1074. Very Short Problem | 1 Jul 2015 13:43 | 1 |
WA3 popolwooh 1 Jul 2015 13:43 |
How I got TL while i'm using the binary tree | fadi.masalmah | 1028. Stars | 1 Jul 2015 11:15 | 2 |
I got TL although i'm using the binary tree , and when I looked for a solution on the net i found the same of mine but in another words here is my code: #include <cstdio> #include <cstring> using namespace std; #define max 32002 int a[max]; void update(int i,int n,int v) { while(i<=n) { a[i]+=v; i+=i&(-i); } } int read(int i) { int v=0; while(i>0) { v+=a[i]; i-=i&(-i); } return v; } int main() { int n; scanf("%d",&n);
int b[15010]; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(int i=1;i<=n;i++) { int x,y; scanf("%d %d",&x,&y);
b[read(x)]++; update(x,32002,1); } for(int i=0;i<n;i++) printf("%d \n",b[i]); return 0; } so please help me cause i'm about to lose my mind!!! x and y can be 0; but you are using a 1 indexed FenwickTree! so your update goes on indefinitely! |
WA #4 | Ivan Tyamgin (TNU) | 1963. Kite | 29 Jun 2015 19:36 | 3 |
WA #4 Ivan Tyamgin (TNU) 16 Nov 2014 21:59 My solution gives right answer on this test, but I still WA on test #4 :( Fixed, now WA 7. PS. Forget it, it was fail of my code. Now AC. Edited by author 04.05.2015 02:54 Edited by author 04.05.2015 16:49 |
Very simple! | Mescheryakov_Kirill | 1640. Circle of Winter | 29 Jun 2015 19:00 | 1 |
Sandro't have anywhere to teleport him to stay in the point (0;0). Simply calculate the distance of most distant demon! |
characteristics of numbres | anwar_sust | 1009. K-based Numbers | 29 Jun 2015 15:19 | 1 |
First digit of the numbers will start from 1 and end with non-zero digit.and there will not present any successive zero. |
What is wrong ? | Oleksandr | 1014. Product of Digits | 29 Jun 2015 12:55 | 2 |
Edited by moderator 23.08.2020 01:25 For example I'm going to enter "40". Your program shows "2225", though should have been seen something like "58". If I understood the clause right. |
WA? why? | vitya | 1196. History Exam | 28 Jun 2015 21:40 | 3 |
var a:array[1..15000] of integer; i:integer; m,n,k:integer; b:array[1..1000000] of longint; j:integer; Begin k:=0; readln(n); for i:=1 to n do read(a[i]); readln(m); for j:=1 to m do readln(b[j]); for i:=1 to n do for j:=1 to m do if b[j]=a[i] then k:=k+1; writeln(k); end. 2 22 22 4 22 22 22 22 Because your answer is 8? |
AC for java | esbybb | 1740. Deer is Better! | 28 Jun 2015 04:21 | 1 |
|
To admins | Adhambek | 1269. Obscene Words Filter | 26 Jun 2015 19:00 | 1 |
why authors didn't rejudge??? some authors got accepted more than 0.5 sec.... i don't understand why? |
The Answer for 4 bottles | esbybb | 1984. Dummy Guy | 26 Jun 2015 05:19 | 1 |
1+sqrt(2) Edited by author 26.06.2015 05:22 |
Please help with WA #11 | Kergan | 2027. URCAPL, Episode 1 | 25 Jun 2015 15:49 | 2 |
I've just looked through the submission list. Almost everyone had WA #11. Maybe someone with AC can give me some hint about it? Ok, WA #11 is all about TLE |
WA#23 please help! | Nodirbek Islomov | 1315. MDPAR and MIIAR | 25 Jun 2015 14:58 | 1 |
|
WA #8 | Kergan | 2027. URCAPL, Episode 1 | 25 Jun 2015 14:30 | 2 |
WA #8 Kergan 25 Jun 2015 12:43 Can somebody give some hints about that test? My mistake. Forget to add two registers (M and N). Dont have any idea how that happened XD |
1409 Runtime Error | Nitchakarn | 1409. Two Gangsters | 25 Jun 2015 10:06 | 1 |
Dear All, I am a student and I got an assignment from my teacher to run "1409 Two Gangsters". I write Python program v.2.7 as per following codes. I run the program many times, but it still showed "Runtime Error". I could not fix it. It would be appreciated if someone can help me. Thanks. # 1409 Two Gangsters (Created: 24th June 2015 / Python 2.7) # -------------------- Start of Program -------------------- # # Set initial values total = 0 # total number of cans shot by Harry and Larry Harry = 0 # the number of cans shot by Harry Larry = 0 # the number of cans shot by Larry h = 0 # the number of cans that were not shot by Harry l = 0 # the number of cans that were not shot by Larry Harry = int(input("Please enter the number of cans shot by Harry: ") Larry = int(input("Please enter the number of cans shot by Larry: ")
# Calculation of "The number of cans that were not shot by Harry and Larry" total = Harry + Larry -1 h = total - Harry l = total - Larry # Output print "-"*100 print "Total number of cans are : ", total print "The number of cans that were not shot by Harry and Larry are ", h, "and", l, "respectively." print "-"*100 # -------------------- End of Program -------------------- # |
Help!!! | Felix_Mate | 1651. Shortest Subchain | 24 Jun 2015 22:44 | 1 |
Help!!! Felix_Mate 24 Jun 2015 22:44 My code got WA7. const Nmax=100500; var Dp:array[1..Nmax] of longint; A,V:array[1..Nmax] of longint; N,i:longint;
BEGIN readln(N); for i:=1 to N do begin read(A[i]); Dp[a[i]]:=Nmax+5; end;
Dp[a[n]]:=0; V[a[n]]:=0; for i:=N-1 downto 1 do begin if(Dp[a[i]]>Dp[a[i+1]]+1) then begin Dp[a[i]]:=Dp[a[i+1]]+1; V[a[i]]:=a[i+1]; end; end;
write(a[1],' '); i:=V[a[1]]; while(i<>0) do begin write(i,' '); i:=V[i]; end; END. |
shows wrong answer! | Ajinkya | 1100. Final Standings | 24 Jun 2015 16:40 | 1 |
#include<iostream> int main() { using namespace std; unsigned long long n,id[10000],x; int m[100],y,i,j; cin>>n; for(i=0;i<n;i++) cin>>id[i]>>m[i]; for(i=0;i<n;i++) { for(j=i;j<n;j++) { if(m[i]<m[i+1]) { x=id[i]; id[i]=id[i+1]; id[i+1]=x; y=m[i]; m[i]=m[i+1]; m[i+1]=y; } } }
for(i=0;i<n;i++) cout<<id[i]<<" "<<m[i]<<"\n"; return 0; } |
wa#12 | twocoldz | 1641. Duties | 24 Jun 2015 14:07 | 1 |
wa#12 twocoldz 24 Jun 2015 14:07 i try use hungary to get some line use more student,than try the no use student,but wa on #12,pls help me! |