| Show all threads Hide all threads Show all messages Hide all messages |
| TL help me | Nodirbek Islomov | 1989. Subpalindromes | 6 Mar 2015 14:25 | 2 |
Hint: A string is palindrome if (and only if) its "RIGHT to LEFT" hash and "LEFT to RIGHT" hash are the same. Also for "Change" queries you need to use some data structure, such as Fenwick Tree or Segment Tree. Edited by author 06.03.2015 14:26 Edited by author 06.03.2015 14:26 |
| What is test 1? | novopashinwm | 2035. Another Dress Rehearsal | 6 Mar 2015 12:48 | 1 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _2035 { class Program { static void Main(string[] args) { string[] arrS = Console.ReadLine().Split(' '); long a = long.Parse(arrS[0]); long b = long.Parse(arrS[1]); long c = long.Parse(arrS[2]); //10^9 =1 000 000 000 if (((c - b) > a && (c-b)>0)) Console.WriteLine("Impossible"); else if (((c - a) > b && (c-a)>0)) Console.WriteLine("Impossible"); else if ((c - b) > 0 ) Console.WriteLine("{0} {1}", (c - b), b); else Console.WriteLine("{0} {1}", (c - a), a);
} } } Edited by author 06.03.2015 12:54 |
| If you get WA3 | Tural Neymanov | 2024. Adventure Time | 4 Mar 2015 21:58 | 2 |
Notice that k maybe be bigger than n. |
| test #11 | Alexander Bondarenco | 2014. Zhenya moves from parents | 4 Mar 2015 21:47 | 1 |
test #11 Alexander Bondarenco 4 Mar 2015 21:47 Could anyone provide any information about the 11-th test? |
| Why i don't get AC? | novopashinwm | 1248. Sequence Sum | 4 Mar 2015 19:48 | 1 |
This is my programm below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Globalization; namespace _1248 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); double s = 0; for (int i = 0; i < n; i++) { string strS = Console.ReadLine(); double ch =0; if (strS.Contains("e")) { string[] arr = strS.Split('e'); double ss = double.Parse (arr[1]); ch = double.Parse(arr[0], CultureInfo.InvariantCulture) * Math.Pow(10, ss); } else ch = double.Parse (strS ); s +=ch; } StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0:0.000000000000000000e0}", s); string sss = sb.ToString(); sss = sss.Replace(',', '.'); //sss = sss.Replace("e0", ""); Console.WriteLine(sss); } } } |
| WA #1 Please Help :( Alteast give me test case | alok13alok | 1263. Elections | 4 Mar 2015 19:12 | 1 |
import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Scanner; public class Election { static long count; public static void main(String agrs[]) { Scanner scan = new Scanner(System.in); long N = scan.nextInt(); long N1 = scan.nextInt(); DecimalFormat form = new DecimalFormat("0.00"); ArrayList<Integer> array = new ArrayList<Integer>(); for (int i = 0; i < N1; i++) { array.add(scan.nextInt()); } for (int i = 1; i <= N; i++) { for (int j = 0; j < N1; j++) { if (array.get(j) == i) { count++; } } System.out.println(form.format((count * 100) / N1) + "%"); count = 0; } } } =================== Cant find any error. :( |
| right or wrong? 1170-desert | svr | 1170. Desert | 3 Mar 2015 06:44 | 7 |
Right or wrong my answer to the next test? 10 1 1 2 2 3 10 1 11 2 1 5 5 6 7 2 3 4 8 7 3 1 3 9 9 3 12 11 15 12 1 3 3 6 6 2 4 6 8 10 3 3 7 4 12 3 2 5 4 7 2 4 50 rez: 107.071068 35.355339 35.355339 and this one: 10 1 1 2 2 8 10 1 11 2 1 5 5 6 7 2 3 4 8 7 3 1 3 9 9 3 12 11 15 12 6 3 3 6 6 5 4 6 8 10 3 3 7 4 12 3 2 5 4 7 2 4 50 rez: 153.263903 19.695965 45.957252 Edited by author 21.11.2007 14:15 Edited by author 15.03.2008 10:46 Edited by author 15.03.2008 10:49 On the first test my AC prog gives 179.034852 36.857707 33.786231 On the second case 191.055728 22.360680 44.721360 Your angle is correct, but the time delay is NOT. My AC programme said that time delay is: 1. 171.265415 2. 184.347524 Good luck~ My AC program got the same answer as 198808xc. Given tests contain nested/overlaped rectangles. And original tests dont (problem statement is not clear enough concerning this, though). Hence, different AC solutions may return different result, these tests don't make sense. |
| If you have TL (with recursion) | Evgeny Shulgin | 1353. Milliard Vasya's Function | 1 Mar 2015 13:05 | 1 |
Let your recursion function is "void dfs1(int k, int curr)", k is digit, curr is current S, then use it code: int start = 0; start = max(start, curr - 9 * (k - 1)); int end = min(9, curr); if(k == 10) { end = min(1, end); } for(int i = start; i <= end; i++) { dfs1(k - 1, curr - i); } It turns out, curr does not go beyond zero at k = 0! I have 937ms with this solution But with precalc I have 31ms :) Good luck |
| Easy way to think about the problem (hint) | Steve | 1820. Ural Steaks | 28 Feb 2015 23:36 | 4 |
Think about how many sides of steaks you need to cook, not in terms of whole steaks. Except you can't cook both sides at the same time (when k > n). AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Thanks!!!! Half a day was decided. Thanks. I was missing the except part. :) |
| I got AC(0.046s) by random algorithm. Any other algorithms? | OIdiot | 1333. Genie Bomber 2 | 28 Feb 2015 13:34 | 1 |
What about Simpson integration ? please. |
| WA#17 and WA#18 Test Examples and Tips | KOTnt | 1777. Anindilyakwa | 28 Feb 2015 01:46 | 2 |
Try these tests on big input data: 1000000000000000000 999999999999999990 999999999999999999 3 1000000000000000000 10 500000000000000000 3 1000000000000000000 500000000000000000 250000000000000000 2 Tips: 1. Remember, that you should not only forget about using big types (for c++ it's long long int or __int64) but not forget to take big input data correctly. For example, if you will use scanf("%d", &i), it will not get correctly a big input digit. 2. If you use min function in you program to find the minimum of two digits, don't forget to initialize your min value variable with the maximum value your can input. For example, __int64 minInit = LLONG_MAX. If you have such problems, you will have incorrect answers on the second and third tests (you'll get 4 and 3 respectively) and you will have WA on the tests 17 (the first tip) and 18 (the second tip). Hi KOTnt, you helped a lot thank you ...!!! |
| Wrong answer -- в чем проблема??? | Pavel | 1000. A+B Problem | 26 Feb 2015 11:56 | 2 |
#include <iostream> using namespace std; int main() { int a, b; cout << "Enter the first number: "; cin >> a; cout << "Enter the second number: "; cin >> b; cout <<"the result: "<< a + b << endl; return 0; } Комментарии к вводу уберите |
| Runtime error (access violation) | Georgy Mogafk | 1001. Reverse Root | 26 Feb 2015 00:32 | 2 |
delete please/ Edited by author 13.11.2014 21:07 I tried the following: #include<stdio.h> #include<math.h> #include<string.h> int main (){
unsigned long long int *inputNumber; int i = -1; int memoryUsed = 0; //256 KB limit
unsigned long long int input= 0;
while( input != EOF ){ scanf("%llu", &input); if( input == EOF) break; if ( memoryUsed > 262144 ){ printf("memory Exceed"); break; } inputNumber[++i] = input; memoryUsed = memoryUsed + 8; };
for( ; i >= 0 ; i-- ){ printf("%.4f\n", sqrt(inputNumber[i])); }
return 0; } but it gives same error |
| Any hints? | Mullabaev | 2006. Kirill the Gardener | 25 Feb 2015 22:47 | 1 |
problem solved Edited by author 14.10.2015 11:08 |
| Hint: no fun, no party | Sirko | 1039. Anniversary Party | 25 Feb 2015 20:35 | 1 |
|
| Wrong answer | Pavel | 1409. Two Gangsters | 24 Feb 2015 16:47 | 2 |
why wrong answer? #include <iostream> using namespace std; int main() { int banki=10, banki_s, bankis_ss; cout << "Harry shot cans: "; cin >> banki_s; cout << "Larry shot cans: "; cin >> bankis_ss; cout << "Harry shot: " << (banki - banki_s) << endl; cout << "Larry shot: " << (banki - bankis_ss) << endl;
return 0; } int main() { code: int banki, banki_s, bankis_ss; cout << "Harry shot cans: "; cin >> banki_s; cout << "Larry shot cans: "; cin >> bankis_ss; banki = (banki_s + bankis_ss) - 1; cout << "Harry shot: " << (banki - banki_s) << endl; cout << "Larry shot: " << (banki - bankis_ss) << endl; system("PAUSE"); return 0; } |
| WA on test nr.4 | Climova Olga | 1120. Sum of Sequential Numbers | 24 Feb 2015 13:12 | 1 |
Sorry for russian comments, I don't speak English well. Why WA? (system("pause"); is only for checking, of course) #include <iostream> using namespace std; int main() { unsigned long N, P, A; cin >> N; for (A = 1; A <= N; A++) // чтобы P было максимальным, начинаем с меньшего А { // прокручиваем P с N/A вниз, т.к. вроде бы это минимальное число с которого следует начинать for (P = N / A; P*A + P*(P - 1) / 2 > N; P--); if (P*A + P*(P - 1) / 2 == N) // если нашли - останавливаемся break; } cout << A << ' ' << P; system("pause"); return 0; } Edited by author 24.02.2015 13:16 |
| I got WA # 4.Give me some test please | xiao | 1105. Observers Coloring | 24 Feb 2015 05:00 | 3 |
OK, if someone came here for spoiler, T0 != 0 in test 4 |
| How fix Runtime error (access violation) at test 9 [ C code] | wolfbrother | 1001. Reverse Root | 23 Feb 2015 02:56 | 4 |
I don't know what problem..... Can help me ...? -------------------------------------------------------------------------- Code: #include <stdio.h> #include <math.h> main(){ unsigned long long int inn[99999],count=0; while(scanf("%llud",&inn[count])!=EOF){ count++; } printf("count:%d\n",count); for(;count>0;){ count--; printf("%0.4f\n",sqrt(inn[count])); } return 0; } ------------------------------------------------------------------------- Thanks for help. Edited by author 17.05.2014 23:37 Here is the solution in Java: import java.io.*; import java.util.*; import java.text.DecimalFormat; public class Task { public static void main(String[] args) { DecimalFormat df=new DecimalFormat("0.0000"); int i,max; double[] massiv=new double[130197];//130196 - runtime error at test #9 Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); max=1; while(in.hasNextDouble()){ massiv[max]=Math.sqrt(in.nextDouble()); max++; } max--; for (i=max;i>=1;i--) System.out.println(df.format(massiv[i])); out.flush(); } } But I don't understand the next thing: if I change the size of array from 130197 to 130196 I'll be given "runtime error" at test #9. Why it should be 130197? How does 256 Kbytes input stream correlate with 130196 double type elements ? Edited by author 20.06.2014 21:46 Edited by author 20.06.2014 21:48 Edited by author 21.10.2014 23:22 Decrease the size of you inn Array. set it to 99 then try. |
| Why the answer is Number_of_Compartments-1 | Pegasus | 1213. Cockroaches! | 21 Feb 2015 22:05 | 2 |
if the amount of baffles that should be opened is equal to N - 2, it will be not enough, because graph will be not connected, and that's why not all cockcroaches will reach the floodgate. But you can build the spanning tree of this graph. It has exactly N - 1 edges, and graph will be connected and now all cockroaches will reach the floodgate. |