Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 1 |
WA #20 | Dmitry V. | 1910. Руины титанов: сокрытый вход | 26 авг 2014 23:18 | 1 |
WA #20 Dmitry V. 26 авг 2014 23:18 How come that my code passed all tests except this one? What ability is tested there? |
What`s wrong?? | artur_yarabei | 1910. Руины титанов: сокрытый вход | 1 мар 2014 21:52 | 1 |
First test Var n,i,s,a,g:integer; b:array [1..1000000] of integer; Begin ReadLn(n); s:=0; for i:=1 to n do ReadLn(b[i]); for i:=1 to n do begin a:=b[i]+b[i+1]+b[i+2]; if a>s then begin s:=a; g:=i+1; end; end; WriteLn(s,' ', g); End.
|
Test #6 What's wrong? | Samoylov | 1910. Руины титанов: сокрытый вход | 10 фев 2014 12:30 | 1 |
#include <iostream> using namespace std; int main() { int k,a[1001],i(0),s(0),maxs(0),j(0); cin >> k; while(i<k) { cin >> a[i]; i++; } for (i=0; i<k; i++){ if (a[i]==a[i+1] && a[i]==a[i+2]) { s = a[i]*3; j = i+2; } if (s > maxs) { maxs = s; s = 0; } } cout<<maxs<<"\n"<<j<<endl; } Edited by author 10.02.2014 22:44 |
WA #6 | Max | 1910. Руины титанов: сокрытый вход | 7 ноя 2013 04:04 | 1 |
WA #6 Max 7 ноя 2013 04:04 #include <iostream> using namespace std; int step(long int mas[],int n) { int i; int sum=0; for(i=n;i<n+3;i++) sum=sum+mas[i]; return sum; } int main() { int n,i; long int res; long int mas[1000]; cin >> n; for(i=0;i<1001;i++) mas[i]=0; for(i=0;i<n;i++) cin >> mas[i]; int sum=step(mas,0); res=0; for(i=0;i<n-2;i++) if(step(mas,i)<step(mas,i+1)) { sum=step(mas,i+1); res=i+3; } cout << sum << " " << res; return 0; } |
Help, WA#6 | ellozoid | 1910. Руины титанов: сокрытый вход | 20 окт 2013 00:08 | 1 |
#include <iostream> using namespace std; int main() { int n, i, j; cin >> n; long *a = new long[n]; long *b = new long[n]; long *c = new long[n]; for (i = 0; i < n; i++) cin >> a[i]; for (i = 0; i <= n - 3; i++){ b[i] = a[i] + a[i + 1] + a[i + 2]; c[i] = i + 2; } for (j = 0; j <= n; j++) for (i = j+1; i <= n; i++) if (b[i] == b[j]){ c[i] = c[j]; } long max = b[0]; long imax = c[0]; for (i = 0; i <= n - 4; i++) if (b[i] < b[i + 1]){ max = b[i + 1]; imax = c[i + 1]; } cout << max << ' ' << imax << endl; } Edited by author 20.10.2013 00:12 Edited by author 20.10.2013 00:12 |
Closed. | oxoxonin | 1910. Руины титанов: сокрытый вход | 1 июн 2013 21:36 | 1 |
Edited by author 01.06.2013 22:05 |
wa #7 | Freddy | 1910. Руины титанов: сокрытый вход | 30 май 2013 23:18 | 1 |
wa #7 Freddy 30 май 2013 23:18 what is test case 7? I think my doing well. #include<stdio.h> int main() { int n,val[1001],pos1=2,pos2=1,sum[1001]; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&val[i]); for(int i=2;i<=n-1;i++) { sum[i]=val[i-1]+val[i]+val[i+1]; } for(int i=2;i<=n-1;i++) { if(sum[i]>=sum[i+1]) { sum[i+1]=sum[i]; pos2++; } else if(sum[i]<sum[i+1]) { pos1+=pos2; pos2=1; } } printf("%d %d",sum[n-1],pos1); } |
тест 6 | SamGTU7_Kareva Nadezhda Vladimirovna | 1910. Руины титанов: сокрытый вход | 26 май 2013 19:04 | 1 |
тест 6 SamGTU7_Kareva Nadezhda Vladimirovna 26 май 2013 19:04 Please help pass the test 6. It is very necessary. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _1910 { class Program { static void Main(string[] args) { string str = Console.ReadLine(); int n = int.Parse(str); string[] mas = Console.ReadLine().Split(' '); int[] a=new int[n]; for (int i=0; i<n; i++) a[i]=int.Parse(mas[i]); int sum=0, j=0, maxsum=0; if (n >= 3) { for (int i = 0; i < n - 2; i++) { if ((a[i] == a[i + 1]) && (a[i] == a[i + 2])) { sum = a[i]*3; j = i + 2; } if (sum > maxsum) { maxsum = sum; sum = 0; } } } Console.WriteLine(maxsum + " " + j); } } } |
If you have WA #6 or WA #2 | Plamen_N | 1910. Руины титанов: сокрытый вход | 25 авг 2013 11:34 | 2 |
For WA #6: It is not necessarily the three consecutive numbers to be equal. So if you have the test: 3 1 2 3 the answer should be 6 2. For WA #2: The consecutive numbers, which you sum, have to be exactly three. |
Test #6. Whats wrong? | alexstyle | 1910. Руины титанов: сокрытый вход | 24 фев 2013 00:55 | 1 |
main() { int n,i; long a[1001],maxsum=0,nsum,nmaxsum,sum=0; scanf ("%d",&n); for (i=0; i<n; i++) { scanf ("%ld",&a[i]); if (i>=2) { if (a[i-2]==a[i-1] && a[i-1]==a[i]) { sum=a[i-2]+a[i-1]+a[i]; nsum=i; }
if (sum>=maxsum) { maxsum=sum; nmaxsum=nsum; } }
} printf ("%ld %d",maxsum, nmaxsum);
} |
Test #2 | George | 1910. Руины титанов: сокрытый вход | 13 фев 2013 00:29 | 1 |
|
Still dont see why i get "Crash" | Andrey | 1910. Руины титанов: сокрытый вход | 29 янв 2013 21:18 | 1 |
Guys, i run program and it works. Why does it crash? Could you point me to the problem in my code? public static void main(String[] args) throws IOException { int sum=0; Scanner s = new Scanner (System.in); int a = s.nextInt (); BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); String s1 = br.readLine (); for (int i = 0; i<a-2; i++) { if (s1.charAt (i)==s1.charAt (i+1) && s1.charAt (i) == s1.charAt (i+2)) { String s2 = Character.toString (s1.charAt (i)); sum = Integer.parseInt (s2); System.out.print (sum*3 + " "); } } for (int i = 0; i<a-2; i++) { if (s1.charAt (i)==s1.charAt (i+1) && s1.charAt (i) == s1.charAt (i+2)) { System.out.print (s1.indexOf(s1.charAt (i))+2); } |
My succesfull C# code!!! | Jamshid Ideal | 1910. Руины титанов: сокрытый вход | 28 янв 2013 23:25 | 1 |
using System; static class Module1 { public static void Main() { short n = short.Parse(Console.ReadLine()); string[] a = Console.ReadLine().Split(); int i = 0; int temp = 0; int max = 0; int numb = 0; while (i + 3 <= n) { temp = int.Parse(a[i]) + int.Parse(a[i + 1]) + int.Parse(a[i + 2]); if (temp > max) { max = temp; numb = i + 2; } i += 1; } Console.WriteLine(max + " " + numb); } } |
No subject | Andrey | 1910. Руины титанов: сокрытый вход | 29 янв 2013 16:20 | 3 |
Is input always made in given range or your tests may input not allowed numbers (like -1) and i must write code to handle this input error? Must this numbers 1 4 4 4 1 1 be randomly generated or what? Must numbers other than 4 (in this case) be always 1? Or be the same? Edited by author 25.01.2013 20:56 Edited by author 25.01.2013 20:56 The input data is in the given range. As you can see from the problem statement, instead of the 1 and 4 there could be any number in range [1, 1000000]. Guys, I get 'Crash' message but cant undrestand why. I run programm and it does what it has to do. Could u please look look at the code ant point me to the problem? This is JAVA public static void main(String[] args) throws IOException { int sum=0; Scanner s = new Scanner (System.in); int a = s.nextInt ();
BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); String s1 = br.readLine ();
for (int i = 0; i<a-2; i++) { if (s1.charAt (i)==s1.charAt (i+1) && s1.charAt (i) == s1.charAt (i+2)) { String s2 = Character.toString (s1.charAt (i)); sum = Integer.parseInt (s2); System.out.print (sum*3 + " ");
} }
for (int i = 0; i<a-2; i++) { if (s1.charAt (i)==s1.charAt (i+1) && s1.charAt (i) == s1.charAt (i+2)) {
System.out.print (s1.indexOf(s1.charAt (i))+2);
}
|
Problem statement clarification | Depth Try | 1910. Руины титанов: сокрытый вход | 1 ноя 2014 14:23 | 3 |
"Output two integers separated with a space. They should be the maximum total force of the field acting on three consecutive sections of the wall and the number of the middle section in this segment. It is guaranteed that there is only one answer. " Can anybody tell me what is the number of the middle section in this segment? I tried to print the number of section in three consecutive sections which have the same value with the middle section, but I got WA2. I already tried some other ideas but they didn't work. You should print the index of the middle section of the chosen segment. The example output shows this. Edited by author 18.12.2012 18:03 |
WA#6 | ivan145 | 1910. Руины титанов: сокрытый вход | 4 дек 2012 19:20 | 2 |
WA#6 ivan145 4 дек 2012 18:44 Edited by author 13.01.2013 05:15 |
WA #2 | SpBerkut | 1910. Руины титанов: сокрытый вход | 5 май 2013 23:02 | 2 |
WA #2 SpBerkut 14 ноя 2012 16:53 My solution passed all tests what I could think of. But I got WA on test #2. What's wrong? Give me some tests, please. Edited by author 14.11.2012 16:53 First 3 elements are answer there. Check default answer if nothing better than beggining is given |
Questions about online judge rule | Ade | 1910. Руины титанов: сокрытый вход | 20 окт 2012 22:29 | 5 |
1. What did the question marks ("?") mean in the contest standings page? And they disappeared when the contest finished. 2. In the judge status page, do the memory and time fields show the longest and biggest values in all finished tests or the values of the last test? Thanks Ade 1. "?" means that there were no accepted submissions for this problem in first 4 hours and there were some submissions in the last hour. So results are effectively frozen at 4:00 mark. 2. Longest and biggest. Thank you for your clear answers. One further question: What's the purpose of the freezing? Thanks Ade It was made for "keeping the intrigue". You may argue whether it should or shouldn't be done in internet contests, but in real contests with prizes it definitely makes sense. Thank you very much. What I do is just following the others' steps. I always try to solve the next easiest (solved most times) problem. So I guess it only matters much for the top guys. Ade |
What is test n6 | TUIT-Karshi#2 | 1910. Руины титанов: сокрытый вход | 5 ноя 2012 17:07 | 2 |
Edited by author 05.11.2012 17:17 Edited by author 05.11.2012 17:17 |
is it posible? | Dato Chkhaidze[TSU] | 1910. Руины титанов: сокрытый вход | 27 дек 2014 12:41 | 5 |
This input is invalid according to the problem statement. With input: 1 4 1 4 1 4 The result should be: 9 3 There can be only one answer. The test-case is invalid. |