|
|
Общий форумDoes anybody know what the 13-th test is? Edited by author 07.04.2009 15:16 Also Wa15. What are wrong: 1. There are 17 choices 2. Greedy: we choice lexiographic best result at each step. unfortunately the problem is not of greedy type full search according all solutions of equation 10=k1+...+k17 helped to solve. Edited by author 21.10.2009 10:04 I agree with you, svr. Full search works fine. There are only 5311735 different configurations. I don't know why this error occurs, even the execution time is less then the time limit???? Please help me out?
Hi. I find out that test #3 looks like this : p = 3 V = 4 n = 0 When we need to find T, answer will be "undefined" if and only if n = 0 (because, in this way, we get division by zero). In second and in third tests n=0, and we need to find T. I wrote code like this : if( we need find T ) { if( n==0 ) printf("undefined\n"); } But, in this way, I get WA 3. What is wrong? Please, check test, or, if I made mistake, help me figure it out. Thanks. Edited by author 16.07.2012 01:48 the answer is "error" because there is no solution Edited by author 21.08.2012 15:16 But in this case I get WA 2, changing only one string in my code. Добрый день! Я сдал эту задачу, и у меня возникли трудности с условием. Во-первых, нигде не написано, что такое "внутри моря". Во-вторых, когда я догадался до значения вышеупомянутого термина, я не уловил смысла в следующем предложении: "Острова, касающиеся границы карты, не могут быть использованы для захоронений шаманов – шаманы этого очень не любят". Острова, находящиеся на границе, точно не лежат внутри никакого моря. В связи с этим, у меня возникло предположение, что ответ на следующий тест - 1 (что вроде неверно): 5 7 1 1 ..... .#### .#... .#.#. .#... .#### ..... (в ответ входит маленький островок справа). Поправьте условие, пожалуйста! "Write the number that will appear in the window of the magic machine after the rotation." I think 'number' is not a correct definition of a sequence of digits with possible leading zeros. So 8907712345 is number, but 0771234589 is not. So I propose to replace 'number' with 'sequence of digits'. And what the meanging about the number under"Test #" ? Если у вас TL 21 то попробуйте тест у которого корень с 19999 сыновей. Это именно такой тест Edited by author 15.06.2010 15:54 #include <stdio.h> #include <conio.h> #include<string.h> #include <stdlib.h> int main () { char n[4],m[4]; int a,b;
scanf("%s%s",&n,&m); a=atoi(n); b=atoi(m); if(a==0 || a%2==0 || b%2==1 ) printf("yes"); else printf("no"); getch(); return 0 ;
} this is my code so what is the crash error # include <iostream> # include <vector> using namespace std; const int maxN=10000+10; int p[maxN],t[maxN]; vector <int> v; int main () { int n,sum=1;
for (int i=2;i<=maxN;i++) for (int j=2*i;j<=maxN;j+=i) p[j]=1; for (int j=1;j<=10;j++) { cin>>n; for (int i=2;i<=n;i++) { int len = n; while (len>1 && !p[i] && len%i==0) { len/=i; v.push_back(i); } } }
for (int i=0;i<v.size();i++) t[v[i]]++; for (int i=2;i<maxN;i++) if (t[i]>0) { t[i]++; sum*=t[i]; sum%=10; } cout<<sum%10; //cin>>n; return 0; } You have some trash in this test after the usefull part. So, my multitest failed it firstly. i also use suffix array.but i can ac it. It's O(nlogn + n). What is different with case #15. My program runs good for 14 tests. import java.io.*; import java.util.Scanner; public class string { public static void main(String args[]) throws IOException { Scanner sc = new Scanner(System.in); BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in)); String each; int m=0,l=0,e=0; int num = sc.nextInt(); for(int i=0;i<num;i++) { each = bufferedreader.readLine(); if(each.charAt(0)=='M') { m++; } else if(each.charAt(0)=='L') { l++; } else if(each.charAt(0)=='E') { e++; } } if((m>=l) && (m>=e)) System.out.println("Macaroni Penguin"); if((l>=m) && (l>=e)) System.out.println("Little Penguin"); if((e>=m) && (e>=l)) System.out.println("Emperor Penguin");
} Same question, maybe related with BufferedReader. Several times faced with this problem, any idea? Are there exactly two plates to be put on the tray or can there be more/less than two? Can someone clarify this for me? Thanks! I'm using simple DFS from every point and got TLE on 5th test. Wich algo should I use to solve it faster? Yeah, i also have this problem :) Got AC, 0.078 :) MOPDOBOPOT, it it a so easy problem, just generate all words that you can get from table, and using this list just check all words. Edited by author 04.09.2012 21:28 |
|
|