| Show all threads Hide all threads Show all messages Hide all messages |
| Give me idea of solution pls | Evgeniy[VVV] | 1868. Prediction Contest | 10 Aug 2014 12:46 | 1 |
|
| WA 2 | Evgeniy[VVV] | 1868. Prediction Contest | 10 Aug 2014 12:31 | 1 |
WA 2 Evgeniy[VVV] 10 Aug 2014 12:31 |
| How to take user input | Eejya | 1001. Reverse Root | 10 Aug 2014 12:15 | 1 |
Edited by author 10.08.2014 12:35 Edited by author 10.08.2014 12:35 |
| Java 8 support | Nietzschean | | 10 Aug 2014 00:35 | 1 |
|
| why i always got wrong 3 ? | Kaylin | 1028. Stars | 9 Aug 2014 23:30 | 6 |
why i always got wrong 3 ? me help this test: 4 0 1 0 2 0 3 0 4 right ans is: 1 1 1 1 Because you Ben!___Don't mind!I ever got WA for many times.- - Edited by author 03.10.2013 14:18 |
| WA3 | Evgeniy[VVV] | 1654. Cipher Message | 8 Aug 2014 10:59 | 1 |
WA3 Evgeniy[VVV] 8 Aug 2014 10:59 import java.util.List; import java.util.ArrayList; import java.util.Scanner; public class Spion { public static void main(String[] args) { Scanner in = new Scanner(System.in); List<String>shifr = new ArrayList(); String word = in.next();
shifr.add(""+word.charAt(0));
for(int i =1;i<word.length();i++){ String s =""+word.charAt(i); shifr.add(s);
if(shifr.get(shifr.lastIndexOf(s)).equals(shifr.get(shifr.indexOf(s))) && shifr.lastIndexOf(s)==shifr.indexOf(s)+1) { shifr.remove(shifr.get(shifr.lastIndexOf(s))); shifr.remove(shifr.get(shifr.indexOf(s)));
};
}
for(String n: shifr){
System.out.print(n); }
} } what's wrong? |
| WA #8 | sonamon | 1869. New Year Cruise | 8 Aug 2014 01:01 | 1 |
WA #8 sonamon 8 Aug 2014 01:01 Can you please give me some tests? |
| wa2 | linjek | 1008. Image Encoding | 7 Aug 2014 18:55 | 1 |
wa2 linjek 7 Aug 2014 18:55 Тест №2 противоречит условию задачи , это тест такой : 1 1 0 (подобрал с помощью бинпоиска) |
| Wrong answer in Java 1.7 test12 | Axmadjon | 1876. Centipede's Morning | 5 Aug 2014 21:39 | 2 |
import java.util.Scanner; public class AcmTimusRu { public static void main(String[] args) { Scanner s = new Scanner(System.in); int a = s.nextInt(); int b = s.nextInt(); if (39 + 2 * a > a + 2 * b) { System.out.println(2*a+39); } else { System.out.println(2*b+40); } } } Not a + 2 * b. You must use 40 + 2 * b. |
| Where is the mistake? | Me | 1263. Elections | 5 Aug 2014 20:26 | 1 |
import java.text.DecimalFormat; import java.util.Scanner;
public class prob {
public static void main(String[] args) { Scanner c = new Scanner(System.in); DecimalFormat twoDecimals = new DecimalFormat("0.00%"); int n = c.nextInt(); int counter = 0; double m = c.nextInt(); int []a = new int [c.nextInt()]; for(int i = 0; i < a.length; i++){ a[i]= c.nextInt(); } for(int j = 1; j<=n; j++){ int z = j; for (int i = 0; i < a.length; i++){ if(a[i] == z) counter++; } System.out.println(counter*100 / m); } } } |
| Python - the hard way [from the series of exotic solutions] | Giorgi Dzamashvili | 2001. Mathematicians and Berries | 5 Aug 2014 19:27 | 2 |
parsing in just one line XD from string import * from functools import * [[a1,b1],[a2,b2],[a3,b3]] = map(partial(map,int),map(split,map(raw_input, [""]*3))) & in py3k: from functools import * [[a1,b1],[a2,b2],[a3,b3]] = map(partial(map,int),map(lambda x:x.split(),map(input, [""]*3))) Edited by author 05.04.2014 04:37 a1, b1 = [int(num) for num in input().split()] a2, b2 = [int(num) for num in input().split()] a3, b3 = [int(num) for num in input().split()] print(a1 - a3, b1 - b2) |
| Problem with time | Narek X | 1116. Piecewise Constant Function | 5 Aug 2014 18:00 | 1 |
I can't understand why my program work slow, I don't know any algorithm that can solvе this problem in beter time. My program solve it in 0.125s, when others in 0.031. Why ? Please help me :) |
| Моя мама сказала, что 3 котлеты за 3 минуты жарят только программисты. | IPRIT | 1820. Ural Steaks | 5 Aug 2014 16:28 | 2 |
:D моя ещё не знает, что я программно жарю котлеты :D |
| Just good test | Levon Oganesyan | 1930. Ivan's Car | 5 Aug 2014 16:27 | 1 |
9 15 1 2 3 1 1 5 4 2 6 2 3 4 3 6 4 5 6 5 5 7 6 7 6 8 8 7 7 9 8 9 1 9 Ans: 0 |
| the problem of relative error | Yuiffy | 1936. Roshambo | 4 Aug 2014 18:30 | 1 |
Many AC codes input the n=100, output have many zero before the radix point, the relative error is not enough very much! Why did they accept? |
| '2' is not a prime number for this problem | TommyTT | 1940. Not So Simple Years | 4 Aug 2014 17:31 | 1 |
|
| a simple test | Briana Banks | 1320. Graph Decomposition | 4 Aug 2014 10:42 | 2 |
input 5 4 4 2 2 1 1 3 3 4 I think output should "1" but most of my colleagues' accepted programs print "0". Do I misunderstand the problem ? This is not valid input because the graph has to have an even number of edges. |
| My implementation of FFT is not fast enough, or there is more simple solution to the problem? (-) | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1996. Cipher Message 3 | 4 Aug 2014 02:14 | 3 |
Edited by author 10.02.2014 00:44 Use the FFTW (such fast wow) for AC. Thanks, I already got AC with usual FFT (heavily optimized). Could you give some link to FFTW? |
| why Runtime error (access violation)??? | Saeed | 1001. Reverse Root | 3 Aug 2014 22:39 | 1 |
#include<iostream> #include<conio.h> #include<Math.h> using namespace std; int main() { long long int a[ 100000 ]; int i = 0; do { cin>>a[ i ]; i ++; }while( a[ i - 1 ] != EOF ); for( int j = i - 1; j > -1; j -- ) { if( a[ j ] >= 0 ) cout<<sqrt((double)a[ j ])<<endl; } } |
| My algo | Aram Shatakhtsyan | 1682. Crazy Professor | 3 Aug 2014 11:48 | 4 |
My algo Aram Shatakhtsyan 3 May 2009 20:32 I don't know what is the fastest way to solve this, but I think mine is more complicated than it can be. I've keeped a vector for each remainder i mod k and i*i mod k, to quickly find the numbers which give remainder r. Then you can add edge by edge in graph and use union-find algo to check for cycles. Maybe there is a faster math solution? Yep, graph is very sparse. Almost always (without several trivial cases) you can consider only range [0..2*k]. To avoid any kinds of checking simply get n = max(10, 2*k). For each number in [1..n] try to find cycle with previous ones. Use e.g. disjoint sets for simplicity. Note, that solution always exists! Almost always (without several trivial cases) you can consider only range [0..2*k]. To avoid any kinds of checking simply get n = max(10, 2*k). Is there any mathematical proof for this? if k=1 =>ans is 3 if k=2 =>ans is 5 if k>2 => you can take numbers 1, k-1, 2*k-1, and it will be a cycle |