|
|
вернуться в форумwa#6?????????? What is it??? Edited by author 16.10.2010 17:42 Edited by author 16.10.2010 17:43 Re: wa#6?????????? Послано Victor 21 окт 2010 04:56 8 1 2 3 5 5 6 7 8 answer 1 Re: wa#6?????????? #include <iostream> #include <math.h> using namespace std; int main() { long i,n,a[102020],b[102020],t=0,u,r=1,e; cin >> n; for (i=1;i<=n;i++){cin >> a[i];}; for (i=1;i<=n;i++){b[i]=0;}; for (i=1;i<=n;i++){if (a[i]==1){cout << i; goto lkj;};}; for (i=1;i<=n;i++){b[a[i]]++;if (b[a[i]]==2){cout << i; goto lkj;};}; lkj: ; cin >> i; return 0; } WHY AN ERROR????????????????? Re: wa#6?????????? Try this one 4 1 1 1 2 Your programm output 1 instead of 3 Re: wa#6?????????? And your algo is wrong!!! Re: wa#6?????????? 8 1 2 3 5 5 6 7 8 answer 1 It is the test number 6??? Edited by author 24.10.2010 18:26Re: wa#6?????????? похоже, что нет. if(n==8) while(true); он вывел WA, так что там другой тест. Re: wa#6?????????? тогда какой там тест? Re: wa#6?????????? There's a test like: 7 3 4 5 6 7 1 1 Answer 6. Or something kinda this. Re: wa#6?????????? There are 100 numbers. Re: wa#6?????????? 12 5 1 2 3 6 3 8 4 10 3 12 7 anaswer 12 Re: wa#6?????????? Edited by author 22.04.2011 01:59 Re: wa#6?????????? >> 12 >> 5 1 2 3 6 3 8 4 10 3 12 7 Why answer 12, but not 2? Edited by author 03.10.2011 17:22 Re: wa#6?????????? I understand... Because 6 . 8 . 10 . 12 maximum ordered subsequence and sequence 7 5 1 2 3 6! 3 8! 4 10! 3 12! 1 2 3 4 5 6! 7 8! 9 10! 11 12! Edited by author 03.10.2011 18:51 Re: wa#6?????????? thanks to all))) acept!!! |
|
|