| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| if you have WA3 (C++) | Vas | 1307. Архиватор | 13 дек 2012 03:10 | 1 |
Check that all of arrays in your source less that 64 KB! (MS VC compiler limitation) |
| WA test #14 | hisp | 1226. йынтарбО кодяроп | 13 дек 2012 03:01 | 2 |
use only ''while not eof'' |
| AC | Baz | 1880. Собственные числа Psych Up | 13 дек 2012 00:28 | 4 |
#include <cstdio> #include <map> std :: map<int, int> a; int ans = 0, n, c; int main() { while (scanf("%d", &n) == 1) for (; n; n--) scanf("%d", &c), ans += ++a[c] == 3; printf("%d", ans); } Edited by author 05.11.2011 20:31 Re: AC HaiyangZheng 29 сен 2012 22:08 can you explain the function/name "map" ? which language used in code above? Re: AC sysu2012zzp 14 ноя 2012 16:58 map is in C++ STL and it is like a binary search tree. Re: AC Egor Stepanov 13 дек 2012 00:28 |
| test 8 - wrong answer. | Kirill Pugachev | 1820. Уральские бифштексы | 12 дек 2012 23:46 | 7 |
my program work. but timus don't accept answer. var n,k,m:word; begin read(n,k); if 2*n mod k=0 then m:=2*n div k else m:=(2*n div k)+1; write(m); end. why is this take wrong answer? var n,k,m:word; begin read(n,k); if n>k then if 2*n mod k=0 then m:=2*n div k else m:=(2*n div k)+1; if n<= k then m:=2*n; write(m); end. When k >= n then we can cook all of them in two minutes (first minute one side, second minute second side) not in 2*n minutes. Edited by author 23.09.2011 20:06 Thank you!!!! I did it!!! why if 2n div k <> 0 you add 1? |
| Help me please it's wa14 | lyan.artyom | 1348. Пусти козла в огород 2 | 12 дек 2012 23:42 | 1 |
So i watch for cases when point a is the same with point b, when they are reversed, when b = a = kozel and when rope is longer then distance to the plant Could you give me some tests? |
| WA Help please | Alexandr Zhelanov | 1083. Факториалы!!! | 12 дек 2012 21:39 | 1 |
var n,i,j,ans:Integer; k:integer; kvoskl:string; begin ans:=1; j:=1; read(n,kvoskl); k:=length(kvoskl); i:=n; if n mod k = 0 then begin while i>=k do begin ans:=ans*i; i:=n-j*k; inc(j); end; end else begin while i>=n mod k do begin ans:=ans*i; i:=n-j*k; inc(j); end; end; writeln(ans); end. what`s wrong? |
| waiting | cena | 1000. A+B Problem | 12 дек 2012 12:09 | 3 |
what's wrong with this site?? it's about 36 hours that all problems have waiting status. Sorry, due to hardware problem we have to stop judging at least until tomorrow. You may continue to submit your solutions, they will be judged as soon as the problem is fixed. Looks like hardware problems are resolved now. Judgement system is working in its usual mode. Have fun! |
| No subject | Mika | | 12 дек 2012 12:09 | 8 |
What's happened to the system? Already more than 200 people are waiting for testing... We have hardware problem. It will be fixed ASAP. Judging is working. But it will work very slow in the next few days. Sorry, due to hardware problem we have to stop judging at least until tomorrow. You may continue to submit your solutions, they will be judged as soon as the problem is fixed. Looks like hardware problems are resolved now. Judgement system is working in its usual mode. Have fun! |
| thx admins! | AGrigorii [Yaroslavl SU]🔥 | 1297. Палиндромы | 12 дек 2012 00:15 | 1 |
thx admins! AGrigorii [Yaroslavl SU]🔥 12 дек 2012 00:15 I'm happy that i solved it! I'm think it is a basis of programming, that's why I'm happy! There is no english.. only runglish.. I'm Sorry for this, but it is so cool! |
| Hint | TakeOver [MSU] | 1005. Куча камней | 11 дек 2012 22:10 | 4 |
Hint TakeOver [MSU] 7 дек 2012 22:45 Just use Greedy algorithm =) Re: Hint Andrew Sboev [USU] 7 дек 2012 23:51 > Just use Greedy algorithm =) Greedy is wrong for this problem. Re: Hint TakeOver [MSU] 11 дек 2012 22:10 |
| AC Programm on Pascal | n0eR | 1001. Обратный корень | 11 дек 2012 00:24 | 1 |
uses SysUtils; var x:array [1..150000] of real; size,i:integer; n:double; begin size:=0; while not seekeof do begin read(n); inc(size); x[size] := sqrt(n); end; for i:=size downto 1 do writeln(x[i]:0:4); readln; readln; readln; end. |
| (Pascal) well... I don't see any mistakes ._. | [nkfi]_FaZz | 1068. Сумма | 10 дек 2012 01:10 | 3 |
var N,X:integer; begin readln(N); if N>0 then X:=round((1+N)*N/2); if N<0 then X:=round((1+N)*(abs(N)+2)/2); writeln(X); end. попробуйте ввести 0 оно выводит 0 хотя от 0 до 1 если включительно то ответ должен быть 1 Edited by author 10.12.2012 01:14 |
| WA 23 | Dmitri Belous | 1915. Руины титанов: воссоздание былого | 8 дек 2012 15:58 | 1 |
WA 23 Dmitri Belous 8 дек 2012 15:58 |
| What is Test 4? | Helberg | 1224. Спираль | 8 дек 2012 01:54 | 1 |
I have correct answer on PC and wrong - here?Why? |
| Please tell me how to write it | AmInO | 1820. Уральские бифштексы | 8 дек 2012 00:45 | 1 |
I donno how to make it work somebody give me hint |
| I love BigInteger in C# ! | Lochinbek_Boboyev_TUIT | 1110. Степень | 7 дек 2012 18:07 | 1 |
|
| Who knows what is WA 6?! my program works correctly I think! | MaWhsh! | 1110. Степень | 7 дек 2012 17:52 | 5 |
c++: #include<iostream> using namespace std; long long sqr(int x, int y){ long long a=1; for(int i=1;i<=y;i++) a*=x; return a; } int main(){ int n,y,m,a=-1; cin>>n>>m>>y; if(y>=m){ cout<<-1<<endl; return 0; } for(int x=0;x<m;x++) if((sqr(x,n))%m==y){ cout<<x<<" "; a+=2; } cout<<endl; if(a==-1 && y<m) cout<<-1<<endl; return 0; } please help me! Edited by author 20.01.2011 20:31 Edited by author 20.01.2011 20:33 You should include math libarary like <math.h> or <cmath> Of course not! I've coded function sqr! Problem is in "long long int" - not enough for 998^999 |
| How to read in C#? | Hikmat Ahmedov | 1102. Странный диалог | 7 дек 2012 12:45 | 1 |
Reading by Console.Readline() or Console.ReadToEnd gets Memory Limit, reading by Console.Read() gets Time Limit. Is there any other way to read without getting MLE and TLE? |
| WA15 | Capitan | 1029. Министерство | 7 дек 2012 02:24 | 1 |
WA15 Capitan 7 дек 2012 02:24 Hint is wrong. I had WA#15, but after changing in Java code "int" to "long" task was accepted. |
| WA9. Can someone give me test for this code | esekkelle | 1018. Двоичная яблоня | 6 дек 2012 14:41 | 1 |
# include <stdio.h> # include <algorithm> using namespace std; struct daw { long long rg,lf,nd,vl,mx; }; long long a,b; long long w[409]; long long c[409][5]; long long v[409][409]; daw d[409]; void btr(long long x) { if(d[x*2+1].vl!=0) btr(x*2+1);
if(d[x*2+2].vl!=0) btr(x*2+2);
if(x!=0) d[(x-1)/2].nd=d[(x-1)/2].nd+d[x].nd+1; } long long dp(long long x, long long y) { // prlong longf("%d %d",x,y);getchar();
if(y==0) return 0;
if(v[x][y]>0) return v[x][y];
for(long long i=0;i<=y;i++) if(d[x].nd-d[x*2+2].nd>=i && d[x*2+1].vl>0 && d[x*2+2].vl>0) { long long q=0;
if(i!=0) q+=d[x].lf;
if(i!=y) q+=d[x].rg;
if(i==0) v[x][y]=max(v[x][y],dp(x*2+2,y-1)+q);
else if(i==y) v[x][y]=max(v[x][y],dp(x*2+1,y-1)+q);
else v[x][y]=max(v[x][y],dp(x*2+1,i-1)+dp(x*2+2,y-i-1)+q); }
return v[x][y]; } int main() { scanf("%lld %lld",&a,&b);
for(long long i=0;i<a-1;i++) scanf("%lld %lld %lld",&c[i][0],&c[i][1],&c[i][2]);
d[0].vl=1; w[1]=1;
for(long long i=0;i<a-1;i++) for(long long j=0;j<a-1;j++) { if(d[i].vl==c[j][0] && w[c[j][1]]==0) { if(d[i*2+1].vl==0) {d[i].lf=c[j][2]; d[i*2+1].vl=c[j][1];}
else {d[i].rg=c[j][2]; d[i*2+2].vl=c[j][1];}
w[c[j][0]]=1; }
if(d[i].vl==c[j][1] && w[c[j][0]]==0) { if(d[i*2+1].vl==0) {d[i].lf=c[j][2]; d[i*2+1].vl=c[j][0];}
else {d[i].rg=c[j][2]; d[i*2+2].vl=c[j][0];}
w[c[j][0]]=1; } }
btr(0);
if(b==1) {printf("%lld",max(d[0].rg,d[0].lf));return 0;}
printf("%lld",dp(0,b));
getchar(); getchar(); } Thanks |