| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| What is wrong ? | Oleksandr | 1014. Произведение цифр | 29 июн 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. Экзамен по истории | 28 июн 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. А олени лучше! | 28 июн 2015 04:21 | 1 |
|
| To admins | Adhambek | 1269. Антимат | 26 июн 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. Охранник компота | 26 июн 2015 05:19 | 1 |
1+sqrt(2) Edited by author 26.06.2015 05:22 |
| Please help with WA #11 | Kergan | 2027. URCAPL, эпизод 1 | 25 июн 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. ПДВАС и ПВИПАС | 25 июн 2015 14:58 | 1 |
|
| WA #8 | Kergan | 2027. URCAPL, эпизод 1 | 25 июн 2015 14:30 | 2 |
WA #8 Kergan 25 июн 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. Два бандита | 25 июн 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. Кратчайшая подцепь | 24 июн 2015 22:44 | 1 |
Help!!! Felix_Mate 24 июн 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. Таблица результатов | 24 июн 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. Дежурства | 24 июн 2015 14:07 | 1 |
wa#12 twocoldz 24 июн 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! |
| Why WA1 with GoLang? | RemmargorP | 1644. Куча орехов | 23 июн 2015 16:37 | 1 |
[delete] Edited by author 23.06.2015 16:37 Edited by author 23.06.2015 16:37 |
| Why ''crash'?' | a.kim | 1263. Выборы | 23 июн 2015 16:31 | 2 |
var n,m,i,j:integer; a:array[1..1000]of integer; b:array[1..1000]of real; begin read(n,m); for i:=1 to m do readln(a[i]); for j:=1 to n do begin for i:=1 to m do begin if j=a[i] then b[j]:=b[j]+1; end; end; for i:=1 to n do begin b[i]:=(b[i]/m)*100; writeln(b[i]:0:2,'%'); end; end. read(n,m); ---> readln(n,m); try this |
| What is Test 7? | Sherxon WIUT | 2035. Очередной пробный тур | 23 июн 2015 13:05 | 3 |
Hi, how do you fixed this test? Remember that X ONLY applies to A and Y ONLY applies to B. For example: 7 5 11 Your answer can be 6 5, but it cant be 5 6. |
| Pascal's criterion | Kergan | 1243. Развод семи гномов | 23 июн 2015 11:20 | 1 |
Just use it to solve this problem. |
| My Accepted Solution in Java | Md johirul Islam | 1880. Собственные числа Psych Up | 22 июн 2015 19:26 | 1 |
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class T1880 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); List<Integer> an=new ArrayList<Integer>(); List<Integer> bn=new ArrayList<Integer>(); List<Integer> cn=new ArrayList<Integer>(); int a=sc.nextInt(); int count=0; int a1=a; while(a1-->0) { int n=sc.nextInt(); an.add(n); }
int b=sc.nextInt(); int b1=b; while(b1-->0) { int n=sc.nextInt(); bn.add(n); }
int c=sc.nextInt(); int c1=c; while(c1-->0) { int n=sc.nextInt(); cn.add(n); }
if(a>=b && a>=c) { for (Integer integer : an) { if(bn.contains(integer)&&cn.contains(integer)) count++; } }
else if(b>=a && b>=c) { for (Integer integer : bn) { if(an.contains(integer)&&cn.contains(integer)) count++; } } else if(c>=b && c>=a) { for (Integer integer : cn) { if(bn.contains(integer)&&bn.contains(integer)) count++; } }
System.out.println(count); } } |
| Why WA 5? | kvsmirnov | 1151. Радиомаяки | 22 июн 2015 19:03 | 1 |
|
| Consider these test cases...Hope it will help u to overcome WA | Ealham Al Musabbir | 1607. Такси | 22 июн 2015 17:09 | 3 |
Test 1: 150 50 1000 100 200 900 250 800 300 700 350 600 400 500 450 400 Answer:450 Test 2: 1 2 12 3 3 9 5 6 7 3 Answer:6 Test 3: 4 3 6 1 Answer:6 Test 4: 11 1 10 2 Answer:11 Test 5: 1000 2 2000 3 ............. ............. 1388 1418 1390 1415 1392 1412 1394 1409 1396 1406 1398 1403 1400 1400 Answer:1400 Hi, Can you please explain the test cases 2, 3, 4, 5 from your list on how do they work ? I have queries on how these answers come to the above asked test cases with respect to the logic given in the question. kindly help please! Thanks I Understood the logic myself.:) :D |
| Solution 3(Idea). | Felix_Mate | 1398. Слон и пешка | 22 июн 2015 14:00 | 1 |
Можно решить задачу эмпирически. В начале найдем решения по-честному,когда пешка стоит на 1 горизонтали(т.е. игра почти завершена). Все состояния A[x,y,1] нам уже известны,а состояния A[x,y,i] i>1 неизвестны. Из очередного состояния (т.е. увеличив i и рассмотрев любые x,y-коорд. слона) будем выбирать макс. значение среди всех переходов. Если состояние,в которое мы попадаем неизвестно,то снова вызываем рекурсию,пока не попадем в известное(такое всегда будет,т.к. на каждом шаге пешка сдвигается хотя бы на 1,а состояния А[x,y,1] известны). Как только из данного состоя ния мы попадаем во все известные, то данное состояние становится известным. |