| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Why | Alel | 1114. Коробки | 15 май 2010 18:23 | 1 |
Why Alel 15 май 2010 18:23 My Ac code,but I don't know why? #include<stdio.h> #include <iostream> using namespace std; int main() { unsigned long long int c[25][20],sum; int a,b,n,i,j; for(i=1;i<=20;i++) c[i][1]=i+1; for(i=1;i<=15;i++) c[1][i]=i+1; for(i=2;i<=20;i++) for(j=2;j<=15;j++) c[i][j]=c[i][j-1]+c[i-1][j]; for(i=1;i<=20;i++)c[i][0]=1; scanf("%d%d%d",&n,&a,&b); sum=c[n][a]*c[n][b]; cout<<sum; printf("\n"); return 0; } |
| admins,What is WA7? | Ferhad R | 1161. Stripies | 15 май 2010 02:14 | 9 |
please tell me:admins,What is WA7? Your programs gives wrong answer on 7th test. But what is the 7yh test.I am working on it till morning.PLease help ,me What is wrong with my programm.in my pc it works correctly. What is wrong with my programm.in my pc it works correctly. When i enter 100 there is error in exe,Why? Why WA#1?I can't understand,my program runs weel in my |
| WA 1... What's wrong? | Drema [KhAI] Tihov Ilya | 1563. Баяны | 15 май 2010 01:58 | 4 |
#include <stdlib.h> #include <iostream> using namespace std; int main() { int n, cnt = 0; register int j; char shop[1001][31]; char used[5] = "stop"; cin >> n; for(register int i = 0; i < n; i++) cin >> shop[i]; for(register int i = 0; i < n; i++) { if(shop[i] == "stop") break; for(j = i + 1; j <= n; j++) { if(strcmp(shop[j], "stop") != 0) if(strcmp(shop[i], shop[j]) == 0) { cnt++; strcpy(shop[j], "stop"); } } } cout << cnt; } WA 1 Tolya_wolf 20 янв 2010 11:11 The same problem: #include <stdio.h> #include <string.h> void main(void) { char n[1000][31]={'/'}; int i,y,qw,bayan=0; scanf("%d",&qw); for(i=0;i<qw;i++) { scanf("%s",&n[i][0]); for(y=0;y<=i-1;y++) if(strcmp(n[y],n[i])==0) { n[y][0]='/'; bayan++;} } printf("%d",bayan); } Edited by author 20.01.2010 11:12 Edited by author 20.01.2010 11:12 Re: WA 1 Sergey Lazarev (SPb AU) 20 янв 2010 12:30 "The brands are the strings of Latin letters and blanks"! scanf doesn't read blanks ("aaa bbb" - two words for scanf). Re: WA 1 DnS [Samara SAU] 15 май 2010 01:58 I use getline(cin,str); // !!! for(int i=0; i<n;i++){getline(cin,str)... and Accepted. |
| My solution | Alel | 1047. Простые вычисления | 15 май 2010 00:35 | 2 |
a[n+1]-a[n]=a[1]-a[0]+2*(c[1]+c[2]+...+c[n]); code: #include<stdio.h> #define N 3000 float c[N+5]; int main() { int i,k,m; float sum,a0,an,t; scanf("%d",&m); scanf("%f%f",&a0,&an); for(i=1;i<=m;i++) scanf("%f",&c[i]); sum=0; k=m; for(i=1;i<=m;i++) { sum=sum+k*c[i]; k--; } sum=sum*2; t=(an+m*a0-sum)/(m+1); printf("%.2f",t); return 0; } Edited by author 14.05.2010 19:53 |
| BinarySearch and BinaryTree) | Tural Neymanov | 1028. Звёзды | 14 май 2010 22:11 | 1 |
Hi! I solved the problem with binary search and got TL. After the search for some test I have found that the actual solution includes use of binary tree. So, what the difference? I actually thought that search is better because it doesn't use any memory, isn't it? |
| add,minus,multi,div big interger | headshot | | 14 май 2010 19:56 | 1 |
example: input int A: 12345678910111212 int B: 12345678910111212 output: Add is: 24691357820222424 Minus is: 0 Multi: 1.5241578775156476338589020810894..... div is: 1 You have full code (write by C) share with my Thanks a lots |
| pattenr matching [boyer-moore and Knuth-moris-part] | headshot | | 14 май 2010 19:50 | 1 |
Example: text: abc abc accabcb acc pattenr: acc Position: 8 Position: 16 code full used Boyer-More Algorithms and Knuth-moris-part Algorithms ( written by C ) Thanks |
| Note (for clear problem description understanding) | Alexey Shmelev | 1435. Финансовая ошибка | 14 май 2010 00:37 | 1 |
You are not allowed to swap digits in the last number (the sum of N numbers) Example ------- Input: 2 11 20 13 Output: Unrecoverable error. |
| Where is Greenpeace? | Dimidrol94 | 1070. Местное время | 13 май 2010 18:00 | 1 |
Where is Greenpeace? Oh,rebits,rebits... |
| ** | Mukhametianov Den[PsychUp] | 1421. Кредитные операции | 13 май 2010 02:51 | 2 |
** Mukhametianov Den[PsychUp] 9 май 2010 13:26 Test: 2 1 2 3 4 My Ac program gives YES 1 0 2 0 I dont know if other solutions will fail on this test, but.. =) |
| Test #3 | FlashKa | 1116. Кусочно-постоянная функция | 12 май 2010 23:57 | 2 |
Try to test with zero-length sequences (containing no one interval) |
| Precision in 24 test | Adler | 1369. Тараканьи бега | 12 май 2010 18:28 | 1 |
In 24 test precision greater than 18? why? |
| Format input | alp | 1759. Долгожители | 12 май 2010 13:32 | 2 |
Always format input is dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy or may be (for example) 2 dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy ? Edited by author 09.05.2010 02:02 Format is dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy dd.mm.yyyy |
| Test for your WA#4 | Mihran Hovsepyan | 1038. Проверка орфографии | 11 май 2010 22:03 | 4 |
,.'A'..'Z'a'..'z in this test my program gave "2" and got WA4, but now I got AC, because the correct answer is "1". , . // . ' A // Ok ' . // . . // . ' Z // Ok ' a // ok ' . // . . // . ' z // mistake thank you very much!!!This test has helped me to receive AC!!!=)) |
| Java -> System.exit(1) | Sasha Bar [TNU] | | 11 май 2010 20:01 | 6 |
Why does System.exit(1) get WA instead of Crash? I want to get CRASH on Timus in run() function, how can i do this? public class Main implements Runnable { ....public void run() { ........throw new RuntimeException(); ....} ....public static void main(String[] args) { ........new Thread(new Main()).start(); ....} } This code gets WA instead of Crash! Edited by author 15.04.2010 03:34 I didn't check it, but something like this should cause CRASH: int[] a = new int[10]; System.out.println(a[20]); or... System.out.println(1/0); Yes, it gets WA... But why? Can anybody explain me? |
| I do need some help in the 1068 problem, When using IDE is OK, but submit crash many times. | Hufeng Zhou | 1068. Сумма | 11 май 2010 15:38 | 3 |
Hello, I tried many times, but do not know where is the problem, I wrote java and run on IDE it seems OK, but every time when I submitted it can not be accepted. Would you please give me some help. Thank you so much! import java.util.*; public class SumAllInt1068 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); int f = sc.nextInt(); int e = a+b+c+d+f; System.out.println(e); } } The input consists of a SINGLE integer. You have got Crash because try to read 5 integers. Look Sample test. I understand, thank you so much for your help. |
| wa4 | Milanin | 1524. Men in Black | 11 май 2010 13:32 | 2 |
wa4 Milanin 11 май 2010 01:03 Tell please something helpful to pass fourth test. Maybe it is a misunderstanding of statement. Re: wa4 re.nikonoff (ONPU) 11 май 2010 13:32 you must perform the quests in order, that they become available (not in order of appearance in input data) |
| Compilation error... | Yermakov Alex <ONPU> | 1225. Флаги | 11 май 2010 02:34 | 2 |
#include <iostream> long int fibonacci(const int ); int main() { int N; std:: cin>>N; const int M=N; std::cout << fibonacci(M)*2;; return 0; } long int fibonacci(const int n) { const int m = n; long int t[m],i; int first = 0, second = 1; t[first]=0; t[second]=1; for (i=second+1; i<m-1; ++i) { t[i] = t[first] + t[second]; first = second; second = i; }
return t[i]; } Edited by author 10.05.2010 18:58 When you got Compil. Error you may check the reason clicking on red Caompilation error link at your submit. |
| No subject | lql1993 | 1772. Лыжни для роботов | 10 май 2010 21:07 | 2 |
why I get wa on test 39? Edited by author 30.04.2010 17:12 |
| test 5 | ghostfreak | 1053. Пиноккио | 9 май 2010 19:59 | 4 |
test 5 ghostfreak 14 июл 2009 20:48 does anybody knows what is this fucking test 5? if you know write the answer please:) sorry i've mistaked i've written knows instead of know Re: SuperLight 14 июл 2009 22:45 |