Show all threads Hide all threads Show all messages Hide all messages |
WA#19 Time limit exceeded 19 1.046s 636 КБ =( | =NRZ= | 1510. Order | 1 Jun 2013 17:11 | 4 |
Edited by author 02.05.2011 23:00 There is a method that you can find the solution with one loop. here is a hint: 1. if solution is s and sn is the number of s, then 2 * sn > n 2. if you delete any two different numbers until there is no different number, so this number is s.(because 2 * sn > n). And you can do deleting with one loop. good luck use quickSort and output [n/2] value... |
wa #7 | Freddy | 1910. Titan Ruins: Hidden Entrance | 30 May 2013 23:18 | 1 |
wa #7 Freddy 30 May 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); } |
WA #1 please help! | Freddy | 1197. Lonesome Knight | 30 May 2013 19:45 | 1 |
I don't understand where I'm wrong. I tried the sample and the result is right! #include<iostream> #include<map> using namespace std; int main() { int n,num; map<char,int> val; val['a']=1;val['b']=2;val['c']=3;val['d']=3;val['e']=3;val['f']=3;val['g']=2;val['h']=1; val['1']=1;val['2']=2;val['3']=3;val['4']=3;val['5']=3;val['6']=3;val['7']=2;val['8']=1; char xy[1]; cin>>n; while(n--) { cin>>xy; num=val[xy[0]]+val[xy[1]]; if(num==6) num+=2; if(num==5) num++; cout <<num<<endl; } } |
My Successfully code | Paata Julakidze | 1585. Penguins | 30 May 2013 14:47 | 1 |
import java.util.*; public class Penguins1585 { /** * @param args */ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = Integer.parseInt(in.nextLine()); int a=0,b=0,c=0; for(int i=0; i<n; i++){ String s = in.nextLine(); String s1=s.substring(0,1); if(s1.equals("E"))a++; else if(s1.equals("M"))b++; else c++; }
if(a>=b && a>=c)System.out.print("Emperor Penguin"); else if(b>=a && b>=c) System.out.print("Macaroni Penguin"); else System.out.print("Little Penguin");
} } |
Difference in compilers? | Ade | 1001. Reverse Root | 29 May 2013 22:09 | 1 |
The question is simple. So is my code. See below It gets AC in VC++2000. But why does it get WA#1 in gcc4.7.2 and gcc4.7.2-c++11, until I replace the while-scanf loop with the commented while-cin loop? Thanks. -- #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> int main() { std::vector<long long> v; long long t; while (std::scanf("%lld", &t) != EOF) { // while (std::cin >> t) { v.push_back(t); } for (int i=v.size()-1; i>=0; --i) { printf("%.5f\n", sqrt((double)(v[i]))); } } |
Test 3 | 49warrior | 1131. Copying | 29 May 2013 03:49 | 2 |
Test 3 49warrior 22 Oct 2008 23:58 In this test use LONG INT. I use INT and got WA, but later I use LONG INT and got AC. |
Help me. What's wrong? C++ task 1001 | Vladislav | 1001. Reverse Root | 28 May 2013 20:19 | 1 |
#include <stdio.h> #include <math.h> #define N 4 int main() { long double a[N]; long double b[N]; int i = 0; while(i < N) { scanf("%Lf",&a[i]); b[i]=sqrt((long double)a[i]); i++; } if(i == N) for(i= N - 1; i>=0; i--) { printf("%.4Lf\n", b[i]); }
} seems to return the right values. But writes "Wrong answer". Thanks! |
why it is wrong ? (JAVA) | shaihin | 1820. Ural Steaks | 27 May 2013 23:42 | 2 |
import java.util.*; public class Bifshteks //zadacha -1820 { int n; int k; int clock; public static void main(String args[]) { Bifshteks b = new Bifshteks(); Scanner in = new Scanner(System.in); System.out.println("Skolko bifshteksov zakazat? - "); b.n = in.nextInt(); while(b.n > 1000 || b.n<0 ) {System.out.println("Skajite zanovo . Vam Skolko bifshteksov zakazat? - "); b.n = in.nextInt(); } System.out.println("Skolko bifshteksov mojet gotovitsia odnoremenno? - "); b.k = in.nextInt(); int y = b.n/b.k; int x = b.n-(y*b.k); if(x==0) y+=0; else y+=1; System.out.println("Vaw zakaz budet gotov cherez "+y*2+" minut."); } } Обратите внимание на постановку задачи: "В единственной строке через пробел записаны целые числа n и k (1 ≤ n, k ≤ 1000)." В Вашем случае одновременно 2 целых числа ввести нельзя. |
what is outcome change? | melkiy | 1718. Rejudge | 27 May 2013 13:01 | 3 |
"...solutions for which the outcome has changed." Is the outcome change "WA 6" -> "WA 8" a real change on which a letter is sent? Or only outcome code (WA, AC, ...) make sense, not a test number?? Edited by author 10.10.2009 14:54 Edited by author 10.10.2009 14:54 sorry, the condition contains the answer it's both change in code and change in test number. |
wa2 | SamGTU7_Kareva Nadezhda Vladimirovna | 1196. History Exam | 26 May 2013 21:50 | 1 |
wa2 SamGTU7_Kareva Nadezhda Vladimirovna 26 May 2013 21:50 Help me find a mistake using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace курсач_1196 { class Program { static void Main(string[] args) { int n1 = int.Parse(Console.ReadLine()); int[] a = new int[n1]; for (int i = 0; i < n1; i++) a[i] = int.Parse(Console.ReadLine()); int n2 = int.Parse(Console.ReadLine()); int[] b = new int[n2]; for (int j = 0; j < n2; j++) b[j] = int.Parse(Console.ReadLine()); Array.Sort(a); int[] ab = a.Intersect(b).ToArray(); Console.WriteLine(ab.Length); } } } |
тест 6 | SamGTU7_Kareva Nadezhda Vladimirovna | 1910. Titan Ruins: Hidden Entrance | 26 May 2013 19:04 | 1 |
тест 6 SamGTU7_Kareva Nadezhda Vladimirovna 26 May 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); } } } |
Why WA5 ? | hliu20 | 1371. Cargo Agency | 25 May 2013 15:11 | 1 |
|
WA16 | Radostin Chonev | 1029. Ministry | 25 May 2013 14:12 | 1 |
WA16 Radostin Chonev 25 May 2013 14:12 Can anyone help me ? I have WA16 and i don't know what is wrong with my code . UPD : Test 16 is a big test . I replaced in one place int with long long and i got AC. Good Luck :) ! Edited by author 25.05.2013 14:23 |
test case to help with WA #23 | Samsonov Ivan (Rybinsk SAAT) | 1106. Two Teams | 25 May 2013 10:57 | 2 |
5 3 4 5 0 4 0 1 4 0 1 2 3 0 1 0 |
What is this Test #14? | Inacio Medeiros | 1877. Bicycle Codes | 25 May 2013 03:37 | 1 |
What are the values of input in it? |
WA in test #7 ?? | naros1988 | 1090. In the Army Now | 24 May 2013 20:55 | 2 |
Can someone give me the test #7. I've got WA in this test. Thank's. Please try for the test: 2 2 1 2 2 1 The correct answer: 2 |
Something really strange... | Vedernikoff Sergey | 1575. Yekaterinburg Subway 2 | 24 May 2013 00:04 | 5 |
It seems that my program gives right answers to all tests, but, nevertheless, WA #2 :((( 1)check better names 2)find all distance 1 - 2 1 - 3 .... 69 - 70 and after try find a b c L[a,b] + L[b,c] < L[a,c] P.S. if 1 and 2 correct check you constans But I have WA #2. All constants are correct, and I use Floyd-Worshall to find all distances. Mysterious WA... Edited by author 26.10.2008 21:06 Did you find the problem? I also use Floyd-Warshall, but WA2. |
To admins: rejudge forgotten | Nike (Vologda ML) | 1269. Obscene Words Filter | 23 May 2013 19:45 | 1 |
TL for this problem is 0.5s but list of successful submissions contains times up to 2s. |
No subject | Paata Julakidze | 1902. Neo-Venice | 23 May 2013 13:43 | 1 |
Edited by author 03.07.2013 00:29 |
greedy | hliu20 | 1346. Intervals of Monotonicity | 23 May 2013 13:38 | 1 |
greedy hliu20 23 May 2013 13:38 the turning point should be left to LAST group. |