|
|
Общий форумAny tests? Try it in this cases: 1. Only one team. 2. No Isenbaev at all. any idea mobius inversion? Did anyone make it to the time limit using Python 3.3? I make it to memory limit To do it in Python 3.3, forget about numbers. Use only strings and Boyer-Moore algorithm :) [AC CODE] Edited by author 24.01.2006 19:33 Why? Edited by author 23.01.2006 22:29 a'a'a'a'a - five words. thanx a lot , i got AC too!!! Can anyone write for me test 18, plz? Any help would be appreciate! what is test 22? i wa 22 what's wrong? #include<stdio.h> #include<string.h> int n,p,a[1000010],min=1000000,max=0,sum=0,ans=0; int main() { int i,x,j,k; memset(a,0,sizeof(a)); scanf("%d%d",&n,&p); for(i=1; i<=n; i++) { scanf("%d",&x); a[x]++; if(x<min) min=x; if(x>max) max=x; } for(i=min; i<=max; i++) if(a[i]!=0) { if(a[i]*i>=p) break; sum+=a[i]; ans++; } for(k=min; k<i; k++) if(a[k]!=0){ for(j=k+1; j<i; j++) if(a[j]!=0) break; if(a[j]==0) break; if(j*(a[k]+a[j])<p) { ans--; a[j]+=a[k]; a[k]=0; } } printf("%d %d\n",sum,ans); return 0; } Edited by author 10.03.2013 08:41 呃…… Edited by author 10.03.2013 08:48 Edited by author 10.03.2013 08:48 you can cast a spell with power of p Hello i wrote the following code in python , but it takes too much time, hwo should it be improved class timus1073: def __init__(self): pass def problem(self,y): a = [0] + range(1,60001) b = [x**2 for x in range(1,246)] for i in b: j = 0 while j+i <= 60000: if (a[j+i] > a[j] + 1): a[j+i] = a[j] + 1 j = j + 1 return a[y] if __name__ == "__main__": p = timus1073() a = input() print p.problem(int(a)) test #2 include 1,when you input 1,you will output 2 not 1 Пример исходные данные результат 3 2 3 ||| - 3 бифштекса, 2 на одной сковороде || - 2 минуты | - 2 минуты итого 4 минуты, а не 3 Please read down the forum.. 12 23 13 их можно недожареные убирать потом опять ложить чтобы всегда на сковороде лежало з штуки! Подумай над этим Как? Если количество месть на сковороде 2 как ты туда одновременно положишь 3? вы че считать не умеете? how u can put third Steak if you can put only 2? Where is the Logic? А все я понял! Но все равно ты не правильно объясняешь!) А другим объяснить видимо нельзя,спасибо. Первая минута: 1 сторона 1-ого Б. , 1 сторона 2-ого Б. Вторая минута: 2 сторона 1-ого Б. , 1 сторона 3-ого Б.(первый готов) Третья минута: 2 сторона 2-ого Б. , 2 сторона 3-ого Б.(второй и третий готов) New tests were added. 123 authors lost AC after rejudge. Which is strange, since everything else is allowed in output. em test thử tren visual 2010 ra kết quả nhung khi nop len acm toan in ra cau tra loi sai without round function i got WA #14. When i used it i got AC! #include <iostream> #include <cmath> using namespace std; double round(double d); int main() {double P, Q; #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif cin>>P>>Q; P/=100; Q/=100; int i=2; while(true) {double min=round(i*P); double max=round(i*Q); int C=int(max); if(C>min && C<max && C>=1) break; i++; } cout<<i; return 0; } //--------------------------------------------------------------------------- double round(double d) {return floor(d*10000+0.5)/10000; } Done :) Edited by author 19.07.2011 09:10 If you get WA# 14 this test maybe help you: 2 0 1 1 0 1 1 2 1 answer: YES 1 4 2 3 |
|
|