Show all threads Hide all threads Show all messages Hide all messages |
Test 8: | Adhambek | 1427. SMS | 30 Oct 2017 22:57 | 2 |
4 100 aaaaaaaaaaaaaaaaaaaa11aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111 ans : 4 I still get this one right and get WA on test 8. Is this test real? |
I do simple check to what part does the point below. What's wrong? WA#6. Some tricky tests? Thanks (-) | Alexey | 1489. Points on a Parallelepiped | 30 Oct 2017 01:20 | 11 |
Edited by author 15.10.2006 11:24 Check each region by x and y, e.g. if (b+c<=y && y<=b+c+b && c <= x && x<=c+a) // bottom region I had some mistakes like If y>=a+b+c ... but must be If y>=b+b+c I have one check per one side. For example If y<=b - the point is on the lowest side (on the picture). If x<=c - the point is on the leftest side. etc. So, it is enough to check, you see, but WA#7. Thanks for help but still need it. ) You need check y > b+b+c and y < b+c.. because when point on the edge .... You can do mistake ... (I was wrong in this) I have AC, so thank U very much! But I still don't understand my mistake. It is guaranted that the point is in the picture, so I can only check one coordinate... Cann't understand... be careful when you do checks like if (x <= a) then ... it can produce WA, becouse if x = a, point can lie on another side Yes, that is true. Thank you. The test that makes the difference is: ------- 2 2 2 0 4 4 0 ------- before this correction the answer was 4.8989794856 (wrong!) but the right answer is 2.8284271247 (verifyed with AC program). This is great test. Thank you! TY, Paul Diac! Edited by author 30.10.2017 01:21 no mes SuperLight 26 Jun 2009 19:31 If you use real numbers, you can get situation, when point lies on none of 6 sides. So you should work with epsilon. Or you can use exact arithmetic, just multiply numbers by 100! It means 100 and !, not 100! :) Edited by author 26.06.2009 17:41 |
(1489!) Please, what answer is for this test: | Nickolas | 1489. Points on a Parallelepiped | 30 Oct 2017 01:14 | 4 |
346 158 618 955.0 105.0 891.0 93.0 65.1152, isn't it????? Edited by author 21.04.2008 16:38 65.11528238 Should be 65.1153 if you print 4 digits (but the problem requires to print at least 6). |
я сделал С++ | Vadim23 | 2012. About Grisha N. | 29 Oct 2017 19:56 | 1 |
#include <iostream> using namespace std; int main() { int n; cin>>n; if(1<=n&&n<=12) { int a=12-n; if(a*45<=4*60) cout<<"YES"; else cout<<"NO"; } return 0; } |
How you've get 0.001 ? | KOTnt | 1025. Democracy in Danger | 29 Oct 2017 14:31 | 4 |
Tell me please how you have get timing 0.001 ? It mustn't be a code, may be just method or algorithm. Thanks I think it's impossible to get time less than 0,015 sec at new testing system (since approx. end of 2008). Look at problem 1000 - simple operation, but you can't now get time less than 0.015 neither on C++ nor on Pascal. Furthermore, step between time measurment is about 0,016 (so you can get 0,015 or 0,031 but nothing between) And furthermore, when you run you some hard solution sequental some times, it will get significant different time result. For example, my Pascal AC solution for 1001 sended a few of times takes 0.078, 0.093 or 0.109 sec I think it because mistake in time-measurment method. I think they using a system-clock (RTC) that renew after significant time. So, if testing system is hard loaded (for example testing many authors in parallel) the testing will take more time relatively ro Real-Time Clock, than when system is idle (at early morning, for example). So, testing system is incorrect and you can't reach time less than 0.015 until realisation of system will be changed Excuse my English I understood, thank you ) Your English is OK My code runtime is 0.001. If you use bitwise operation your code will get AC in 0.001. Here is my code. If you want you can learn. [code deleted] Edited by moderator 20.11.2019 00:08 |
I didn't Understand the solution | Iamyeasin | 1025. Democracy in Danger | 29 Oct 2017 14:10 | 1 |
If I divide first and then add 1 with (n or other group numbers), I get WA. But if I add 1 at first and then I divide that time i get AC. I have seen some of the discussion, but couldn't find the logic.Can someone help me out? |
my simple accepted code | kazanski | 1226. esreveR redrO | 29 Oct 2017 07:20 | 1 |
#include <iostream> #include <iomanip> #include <map> #include <vector> #include <cmath> #include <vector> #include <algorithm> #include <cmath> using namespace std; int letter(char c) { return (('a'<=c&&c<='z')||('A'<=c&&c<='Z')); } int main() { //freopen("a","r",stdin); string s; while(getline(cin,s)) { vector<int> l,r; for (size_t i=0;i<s.length();i++) { if (letter(s[i])) { if (!i||!letter(s[i-1])) { l.push_back(i); } if (i+1==s.length()||!letter(s[i+1])) { r.push_back(i+1); } } } for (int i=0;i<l.size();i++) { reverse(s.begin()+l[i],s.begin()+r[i]); } cout << s << endl; } return 0; } |
No subject | DarkSun1997 | 1826. Minefield | 28 Oct 2017 19:28 | 1 |
Edited by author 28.10.2017 19:36 |
WA3…… | LeiQ | 1221. Malevich Strikes Back! | 28 Oct 2017 16:53 | 3 |
WA3…… LeiQ 31 Oct 2016 17:50 I test all case in discussion,but all answers right... Can someone help..Thanks!!! ...solved... one test case: 8 1 1 0 0 1 0 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 answer: 3 It's working for me but still WA3 |
is there any effient algo to solve n<=11,m<=11?? | Shen Yang | 1596. Knight Mare | 28 Oct 2017 12:27 | 2 |
I know how to construct larger cases when knowing solution n<=11&&m<=11,but brute_force for small tests is tooooooooo slow.. |
Little help for solve by Python (dict of numbers) | sergovoy | 2081. Faulty dial | 28 Oct 2017 12:20 | 3 |
d = {'._.\n|.|\n|_|': 0, '...\n..|\n..|': 1, '._.\n._|\n|_.': 2, '._.\n._|\n._|': 3, '...\n|_|\n..|': 4, '._.\n|_.\n._|': 5, '._.\n|_.\n|_|': 6, '._.\n..|\n..|': 7, '._.\n|_|\n|_|': 8, '._.\n|_|\n._|': 9 } 7590680 - Топ среди Питона 3 по использованию памяти) |
all is ok,but why getting wrong answer??C language | Chowdhury Md. Ishmam Rahman | 1068. Sum | 28 Oct 2017 12:00 | 2 |
#include<stdio.h> #include<math.h> int main() { int i,sum=0,n; scanf("%d",&n); if(abs(n)<=10000){
if(n<0){
for(i=1;i>=n;i--){ sum+=i; } } else{ sum=((n*n)+n)/2; } printf("%d",sum);} return 0; } Your code is almost okay.It's wrong only for one test case. When n=0 then according to your code output will be 0.But right answer is 1. Please check again output condition of this problem. Otherwise https://ideone.com/Q6C1gh |
mathmatical problem, just use program output answer | clyde | 1009. K-based Numbers | 28 Oct 2017 11:38 | 1 |
|
Result | Ion | 2056. Scholarship | 27 Oct 2017 19:35 | 1 |
#include <stdio.h> #include <stdlib.h> int main() { int a,p=0,i,*b; float f,s=0; scanf("%d",&a); b=(int *)malloc(sizeof(int)*a); for(i=0;i<a;i++){ scanf("%d",&b[i]);} /*if (b[i]<3||b[i]>5) scanf("%d",&b[i]); }*/ for(i=0;i<a;i++) s+=b[i]; f=s/a; for(i=0;i<a;i++) { if(b[i]==3){ p=1;} } if(f==5) {printf("Named"); } else if(f>=4.5&&p==0){ printf("High"); } else if(f<4.5&&p==0){ printf("Common");} else {printf("None");} free(b); return 0; } |
WA #14 please help | James Gregory | 1998. The old Padawan | 27 Oct 2017 08:19 | 1 |
I've passed all of the user tests on here, and any test I can think of. Still getting WA on #14. Here's my non-working code. import java.io.*; public class P1998 { static StreamTokenizer in; static PrintWriter out;
static int nextInt() throws IOException{ do{ in.nextToken(); }while(in.ttype != StreamTokenizer.TT_NUMBER); return (int)in.nval; }
public static void main(String[] args) throws IOException{ in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); out = new PrintWriter(System.out);
int n = nextInt(); int m = nextInt(); int k = nextInt();
int[] stones = new int[n]; int[] dropsTo = new int[n];
int tmp = 0, j = 0; for(int i = 0; i < n; i++){ stones[i] = nextInt();
while(j < i - 1 && tmp - stones[j] > k){ tmp -= stones[j]; j++; } tmp += stones[i]; dropsTo[i] = j; }
j = 0; int moment, time = 0; for(int i = 0; i < m; i++){ moment = nextInt() - time; time += moment; j += moment - 1; if(j >= n){ time -= moment - n; j = n; break; } j = dropsTo[j]; }
out.println(time + n - j); out.flush(); } } |
MY AC Solution 0.203 (Be careful, spoilers!) | KOTMAKRUS | 1196. History Exam | 27 Oct 2017 01:58 | 3 |
Create an array of Boolean elements. Size = billion. For i:=1 to n {{ introduce a variable; element of array with index [variable] equals true }} For i:=1 to m {{ introduce a variable; if element of array with index [variable] equals true then increase the counter }} And finally, we output counter)) That's all), sorry for bad english But this solution takes 58 mb of memory... (( Edited by author 06.04.2014 16:17 Then, your code is just using a hash table method. But I check the solution rating, someone can do it in 0.015, and many persons do it below 0.1. How can they do that? Is because that compiler different? Then, your code is just using a hash table method. But I check the solution rating, someone can do it in 0.015, and many persons do it below 0.1. How can they do that? Is because that compiler different? It's not that hard to do it under 0.1 with C. Decent hash implementation and optimized input reading (scanf is too slow!) will actually do the 0.031 trick. 0.062 is achievable with a binary search. I achieved 0.015 by optimizing things speedwise a bit more and using as much memory as was allowed. (studied just for fun a bit how slightly different schemes perform, have to try a few more ideas later, my current 0.015 solution is far from the optimum.) |
Getting TLE test 27 | Shubham | 2070. Interesting Numbers | 26 Oct 2017 23:09 | 1 |
Used Sieve to generate primes till 10^6, and then used those primes to generate larger primes. counted all such numbers satisfying L <= p^(q-1) <=R where p & q are primes (q>2). Subtracted it from R-L+1 How to optimize? |
WA 4 | BIGfoot | 1242. Werewolf | 26 Oct 2017 21:38 | 1 |
WA 4 BIGfoot 26 Oct 2017 21:38 I got WA on test 4, but on all tests I could make myself and also on those, which were in the problem, my program answered correctly. Please, suggest some tests, that could help. |
What is wrong with this solution? Judge is giving output as Wrong Answer | nahusha | 1001. Reverse Root | 26 Oct 2017 19:50 | 1 |
import java.util.Scanner; import java.util.Stack; public class ReverseRoot_SplitDecimal {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in); Stack<Integer> integerNumberStack = new Stack<Integer>(); Stack<Short> floatingNumberStack = new Stack<Short>();
Double tempDouble = new Double(0);
while(sc.hasNextInt()) { tempDouble = Math.sqrt(sc.nextDouble()); integerNumberStack.push(Integer.parseInt(String.format("%.4f", tempDouble).split("\\.")[0])); floatingNumberStack.push(Short.parseShort(String.format("%.4f", tempDouble).split("\\.")[1])); }
while(!integerNumberStack.isEmpty()) { System.out.printf("\n%d.%04d", integerNumberStack.pop(), floatingNumberStack.pop()); } System.out.println();
sc.close(); } } |
How to solve | Zurg | 1674. Drunk King | 26 Oct 2017 12:35 | 4 |
Just drawing different patterns on paper for several hours and the solution will come! thx, I try 4 days, and accepted 0.031 s. !!!! get AC by Divide and Conquer?? is there idea more simple?? |