|
|
Common Board#include <stdio.h> int main () { int n, m; scanf("%d %d", &n, &m); int ara[n+1]{0}, temp; double result{0}; for (int i = 1; i <= m; i++) { scanf("%d", &temp); ara[temp]++; temp = 0; } for (int i = 1; i <= n; i++) { if(m == 0) { printf("0.00%\n"); continue; } result = (100.0 * ara[i] / m); printf("%2.2lf", result); printf("%\n"); } return 0; } What is test nubmer 4? Anybody know? maybe 6 1 1 1 1 1 1 My program can`t pass this test and i have WA4. It's like this: 15 2 5 6 3 8 2 3 6 10 10 12 13 14 15 11 The right answer is: 5 8 Edited by author 24.01.2010 23:08 No the right answer is 3 8 for (long double N = 1; N < sqrt(2*S)+3; N++) { } Я решил с помощью ДП: f[i,k,d]-число способов выбрать k чисел от i до s, нод которых d. Работает 0.031 sec. Вопрос: как решить эту задачу именно с помощью теории чисел( я использовал в динамике только один факт: gcd(a1,a2,...,ak)=gcd(a1,gcd(a2,...,ak)))? Актуально ли это) но здесь можно решать еще с помощью формулуы включений-исключений. Предподсчитаем простые числа. Признаки в формуле - делимость на i. сочетаниями подсчитаем кол-во способов выбрать наборы. сочетания посчитаем динамикой I have problems with english. Sorry for example you answer is = int(ans) but use int(ans + 0.00001) and you will get AC There are only 6 available combinations. Take a dice and think if you can make it so that 1 is adjacent to 6? 2 to 5? 3 to 4? Test case: 5 5 Ans: 5 1 3 4 2 Test case: 10 2 Ans: 2 4 6 8 1 5 9 7 3 Is it correct ans? Of course 2nd one is wrong, it skips 10. I think, the correct answer for your second test is: 2 4 6 8 10 3 7 1 9 5 Can anybody tell me test 10? "Impossible" should start with uppercase 'I' 参考 百度知道 给定L,M,K,N,求序列A的数量。满足: 1. A的长度为L 2. A中元素均在 [1,M] 间的正整数 3. A的元素之和为K的倍数 求字典序第N小的序列A,排名从0开始标号 (即,称最小为“第0小”) L<=100,M<=50,K<=50 N范围题目没有给 Edited by author 26.12.2021 13:22 Edited by author 26.12.2021 13:22 Can you help me with test 28? Yea, sure. Just try 6 6 ****** ****** **..** **..** ****** ****** answer: 1 Anyone has any tests for WA #6? I am out of ideas already. The problem seems too simple... This test helps you: 10 1 2 3 4 5 6 7 8 9 0 4 3 answer: 39 6 The problem says the program only needs to print out any of the answers. but why i WA in the first test but can pass all my tests? If you are storing hashes in a segtree and using some custom prime divider the values of the parent nodes can be less than the child nodes because the remainder "makes a round", so to subtract u have to add that round, I think this is what is actually happening in test 2. Subj. Btw, what is the problem with the 23rd test? it's help me for wa23 4 0 4 0 4 0 1 0 1 1 0 1 1000000 0 1000000 0 Indeed! Thank you very much! Thank you very much! it's realy helpful!!! Very help!! Thank you again! Help please!! What is test 6???? Just try to replace x, y or z using equation y = x + z (vector form). Count of cells on path is |x| + |y| + |z| + 1. This is brilliant Just try to replace x, y or z using equation y = x + z (vector form). Count of cells on path is |x| + |y| + |z| + 1. Testset for this problem is very weak. Program, that works ~5 secs. on my tests got AC in less than 1 sec. on jury tests... why don't you share your strong tests with us then? Can you help me? I WA test #11 Can you help me? I WA test #11 Sorry. I can't. Oh! I can't help you too. Me neither. I can help you, but I won't |
|
|