Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 2 |
Why WA 1 I've counted 'a','ab','abc' and other subsequences and got satisfying to condition.... | IlushaMax | 1219. Symbolic Sequence | 6 апр 2017 01:17 | 1 |
#include <bits/stdc++.h> using namespace std; int main() { string letter="abcdefghijklmnopqrstuvwxyz"; int k=letter.size(); int i1,i2,i3; string part,bigpart; for(i1=0;i1<k;i1++) { for(i2=0;i2<k;i2++) { for (i3=0;i3<k;i3++) { part=""; part.pb(letter[i1]); if(part[0]!=letter[i2]) part.pb(letter[i2]); else continue; if(part[0]!=letter[i3]&&part[1]!=letter[i3]) part.pb(letter[i3]); else continue; bigpart.pb(letter[i1]);bigpart.pb(letter[i2]);bigpart.pb(letter[i3]); } } } string ans=""; //cout<<bigpart.size()/3; while(ans.size()<1000000) { ans=ans+bigpart; } /*for (int i=0;i<1000000;i++) { cout<<ans[i]; }*/ int res=0; for (int i=0;i<1000000;i++) { if (ans.substr(i,1)=="a") res++; } cout<<res; return 0; } Maybe 1 test is a sort of tricky? Edited by author 06.04.2017 01:18 |
Wrong test | Alexandr | 1219. Symbolic Sequence | 4 янв 2023 00:21 | 3 |
This solution is OK. But it not satisfy the restrictions. Your tests are too weak. #include <iostream> int main(int argc, char* argv[]) { int i= 0; for (i = 0; i < 1000000; i++) { printf("%c", rand()%26 + 'a'); } return 0; } I think that you miss conditions: Every possible subsequence with two letters length occurs not more than 2 000 times; Every possible subsequence with three letters length occurs not more than 100 times; I think with just a few tweaks, and "some" luck you can get AC on 1589. |
Bad problem statement | Kuros | 1219. Symbolic Sequence | 11 сен 2014 12:32 | 2 |
Are you sure you really mean "subsequence" and not "substring"? I really can not understand what the problem means. |
oddiygina kichik harflarning ixtiyoriy ravishda to'ldirsangiz kifoya!!!! | Adhambek | 1219. Symbolic Sequence | 9 ноя 2018 15:52 | 2 |
Buning uchun rand() funksiyasidan foydalaning. masalan: 1000000 ta ababababbabab.....asdbasdsajkdbksajbdjkasbdkjbskfjbaksjdbfkjsad. faqat ixtiyoriy ravishda bo'lsin k = rand()%26 + 97 ; qilib chiqaring shuni uzi kifoya Edited by author 15.06.2013 11:32 |
Output limit exceeded | ilalex | 1219. Symbolic Sequence | 1 май 2013 06:17 | 1 |
Why do I have this error occurs in Python 3.x solution? |
Python solution | ilalex | 1219. Symbolic Sequence | 1 май 2013 04:22 | 1 |
|
Java the best | TUITUF_Bahrom | 1219. Symbolic Sequence | 8 апр 2013 18:32 | 1 |
public class T_1219_Symbolic_Sequence { public static void main(String[] args) { PrintWriter pw= new PrintWriter(new OutputStreamWriter(System.out)); Random r= new Random(); char a[]=new char[30]; int k = 0 ; for (char j ='a'; j <='z'; j++) a[++k]=j; for (int i = 1; i <=1000000; i++) pw.print(a[r.nextInt(26)+1]); pw.close(); } } |
In fact,the problem is very very very very very very very easy. | Accepted | 1219. Symbolic Sequence | 28 янв 2014 01:48 | 2 |
You can use "random" function to produce a letter. I got curious and tested the "random" solution for 100000 times, and 88058 times (which is about 88%) it worked correctly. |
it's too easy | Nikolo.frost | 1219. Symbolic Sequence | 29 окт 2012 11:50 | 1 |
#include<iostream> #include<cstdlib> using namespace std; int main(){ int i,j,n,m,k; for(i=0;i<1000000;i++){ k=rand()%26; k+=97; cout<<(char)k; } //cin.get(); return 0; } |
MY AC PROGRAM C++!!! | yaho0o0 | 1219. Symbolic Sequence | 11 сен 2011 04:14 | 3 |
#include <cstdlib> #include <ctime> #include <iostream> using namespace std; int main() { int i=1; srand((unsigned)time(0)); char random_integer; while(i<=1000000) { random_integer = (rand()%'z')+1; if(random_integer>='a'&& random_integer<='z') { cout << random_integer; i++; }} cout<<endl; return 0; } Edited by author 10.04.2009 16:54 Hello,friends I tested your program is OK. And it's so cool. But,I don't why? please.help me ! thanks ! Edited by author 11.09.2011 00:50 Edited by author 11.09.2011 00:51 It'll be interesting to see the checker for this problem. |
var i:longint; begin for i:=1 to 1000000 do write(chr(random(26)+ord('a'))); end. | BlackShark | 1219. Symbolic Sequence | 3 янв 2009 01:34 | 1 |
|
why is it so easy? just "random"!! | ch95 | 1219. Symbolic Sequence | 21 дек 2008 13:19 | 1 |
look at my program: program u1219; var a:array[1..26] of char; i:longint; begin randomize; for i:=1 to 26 do a[i]:=chr(ord('a')+i-1); for i:=1 to 1000000 do write(a[random(26)+1]); end. too unbelievable!!! |
Страница 1 |
SIMPLE!!! | Egor Stepanov [mikroz] + Seregka | 1219. Symbolic Sequence | 31 окт 2008 01:56 | 1 |
SIMPLE!!! Egor Stepanov [mikroz] + Seregka 31 окт 2008 01:56 |
I've got WA#1 | Mihran Hovsepyan {1 kurs of <RAU>} | 1219. Symbolic Sequence | 4 июн 2008 14:51 | 1 |
I've got WA#1 Mihran Hovsepyan {1 kurs of <RAU>} 4 июн 2008 14:51 Is my algo wrong? This is my solution # include <stdio.h> main() { int i=0,m,g,k=0; const int n=100000; // const char AZ[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; const char az[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; while(i!=n) { for(m=k;m+k<26&&i<n;m++) for(g=0;g<26&&i<n;g++) { printf("%c",az[m%26]); i++; printf("%c",az[g]); i++; } k++; k%=26; } return 0; } |
That is very funny | Komendantian Grant Mikaelovich SSAU | 1219. Symbolic Sequence | 2 янв 2007 13:28 | 3 |
Just look at my program: [code deleted] Edited by moderator 02.01.2007 18:52 Firstly, do not post your code. Secondly, random doesn't guarantee you right answer. So, few moments to think i AC with out random (10 lines of source) It's not true program, but You can have ACC!!! <OFFTOP>: Грант, смени ник, на подобии, как у меня!!! |
I've got TLE with Pascal solution (with time= 0.014!), but the same C solution was accepted.. O(26 * 10^6)... Very strange... | Bahturin Alexander (SibSUTI#2) | 1219. Symbolic Sequence | 20 ноя 2005 20:35 | 1 |
|
I got AC 0.093 48 Kb. No random | Furtuna Dan Emanuel | 1219. Symbolic Sequence | 11 авг 2013 21:55 | 5 |
var i:longint; function car(k:longint):char; begin car:=chr(k+ord('a')); end; begin for i:=0 to 333332 do begin write(car((i div 676) mod 26),car((i div 26) mod 26),car(i mod 26)); end; write('a'); end. I got AC 0.078 25 Kb var i:longint; begin for i:=1 to 333333 do write(chr(97+((i div 676) mod 26)),chr(97+((i div 26) mod 26)),chr(97+(i mod 26))); write('a'); end. Thank you,it's really amazing!!!!!!!!!! me too. forn(26) fornj(26) fornk(26) { if (i == j && j==k) continue; if (M[i][j][k]) continue;
M[i][j][k]=true; M[k][i][j]=true; M[j][k][i]=true; //and stuff here; } } |
Why "Crash (ACCESS_VIOLATION)" on first test? (+) | Korduban [Kiev] | 1219. Symbolic Sequence | 19 авг 2004 15:21 | 4 |
Here is my program: {$I-,Q-,R-,S-} var ch:char; i,x:longint; s:array[1..5] of longint; function mrandom:integer; begin x:=(s[1]+s[2]+s[3]+s[4]+s[5]) mod $1000001; s[1]:=s[2]; s[2]:=s[3]; s[3]:=s[4]; s[4]:=s[5]; s[5]:=x; mrandom:=trunc((x/$1000001)*26); end; begin s[1]:=99838134; s[2]:=38475378; s[3]:=23746254; s[4]:=23452673; s[5]:=23462343; for i:=1 to 1000000 do write(chr(ord('a')+mrandom)); end. I am very surprised... i submit it and got AC :P and I got AC too... It's strange as you see this simple code get AC it's the power of randomize!!!!! var i : longint; begin randomize; for i:=1 to 1000000 do write(chr(random(26)+ord('a'))); writeln; end. |
Simple | Mehas | 1219. Symbolic Sequence | 16 май 2020 16:39 | 5 |
Simple Mehas 25 июл 2004 01:31 This problem can be solved without random exirsices :) I have got AC just by writing triads in order(without spaces): aaa aab aac aad... aba abb abc abd... zzz. I did it recursivly. And then you must repeat this sequence until number of characters=10^6; I did the same and was actually surprised when it worked! I have got no idea why would people have problems with this one, it's really easy to solve |
Look at my program,please.Some one got AC but I got WA.Why??? | ACM | 1219. Symbolic Sequence | 1 июн 2003 09:07 | 3 |
program ti; var i:longint;
begin randomize; for i:=1 to 1000000 do write(chr(random(26)+97)); end. > program ti; > var i:longint; > > begin > randomize; > for i:=1 to 1000000 do write(chr(random(26)+97)); > end. The function random is forbidden in this problem now. The ones who used this to solve long before can get AC, but now only TLE. > program ti; > var i:longint; > > begin > randomize; > for i:=1 to 1000000 do write(chr(random(26)+97)); > end. |