Show all threads Hide all threads Show all messages Hide all messages | Wrong test | Alexandr | 1219. Symbolic Sequence | 4 Jan 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. | Simple | Mehas | 1219. Symbolic Sequence | 16 May 2020 16:39 | 5 | Simple Mehas 25 Jul 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 | oddiygina kichik harflarning ixtiyoriy ravishda to'ldirsangiz kifoya!!!! | Adhambek | 1219. Symbolic Sequence | 9 Nov 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 | Why WA 1 I've counted 'a','ab','abc' and other subsequences and got satisfying to condition.... | IlushaMax | 1219. Symbolic Sequence | 6 Apr 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 | Bad problem statement | Kuros | 1219. Symbolic Sequence | 11 Sep 2014 12:32 | 2 | Are you sure you really mean "subsequence" and not "substring"? I really can not understand what the problem means. | In fact,the problem is very very very very very very very easy. | Accepted | 1219. Symbolic Sequence | 28 Jan 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. | I got AC 0.093 48 Kb. No random | Furtuna Dan Emanuel | 1219. Symbolic Sequence | 11 Aug 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; } } | Output limit exceeded | ilalex | 1219. Symbolic Sequence | 1 May 2013 06:17 | 1 | Why do I have this error occurs in Python 3.x solution? | Python solution | ilalex | 1219. Symbolic Sequence | 1 May 2013 04:22 | 1 | | Java the best | TUITUF_Bahrom | 1219. Symbolic Sequence | 8 Apr 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(); } } | it's too easy | Nikolo.frost | 1219. Symbolic Sequence | 29 Oct 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 Sep 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. | How should I output? | Dmitry 'Diman_YES' Kovalioff | 1219. Symbolic Sequence | 3 Feb 2011 22:43 | 10 | As you can see the task is to output the sequence consists of 1000000 symbols. I output exactly 1000000 symbols one by one (...Write (sym)...Write(sym)...Write(sym)...), buf after 0.04 seconds I receive "Output Limit". What does it mean and how should I output the sequence? Please, help me! That simply means that you do NOT output 1 million chars! I have the same problem, and I can't solve it. But if I decrease the number of outputs then I get WA. I used putchar(buffer[j]); instead of printf("%s",buffer) and I got accepted. I really don't know why. > As you can see the task is to output the sequence consists of 1000000 > symbols. I output exactly 1000000 symbols one by one (...Write > (sym)...Write(sym)...Write(sym)...), buf after 0.04 seconds I > receive "Output Limit". What does it mean and how should I output the > sequence? > Please, help me! var i:longint; begin randomize; for i:=1 to 1000000 do write(chr(ord('a')+random(26))); end. You are GENIUS!!! The god of programming :)) I think your solution is really perfect! > You are GENIUS!!! The god of programming :)) I think your solution is > really perfect! I made: var i:longint; begin randomize; for i:=1 to 1000000 do write(chr(97+random(26))); end. use 97 instead of ord('a')!!! I still believe u r geinus Aidin To make this program shorter one can substistute "1000000" on 1e6. P.S. To Smilodon_am: You can't use 1e6 with the FOR cycle because it needs only INTEGER expressions. Edited by author 03.01.2009 01:40 Edited by author 03.01.2009 01:41 I also solved like this but the way I got to this solution was kind of intuitive, so I am not still sure why this solution gets AC, I can't prove it. Do you have any proof why it does so? | var i:longint; begin for i:=1 to 1000000 do write(chr(random(26)+ord('a'))); end. | BlackShark | 1219. Symbolic Sequence | 3 Jan 2009 01:34 | 1 | | why is it so easy? just "random"!! | ch95 | 1219. Symbolic Sequence | 21 Dec 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!!! | SIMPLE!!! | Egor Stepanov [mikroz] + Seregka | 1219. Symbolic Sequence | 31 Oct 2008 01:56 | 1 | SIMPLE!!! Egor Stepanov [mikroz] + Seregka 31 Oct 2008 01:56 | I've got WA#1 | Mihran Hovsepyan {1 kurs of <RAU>} | 1219. Symbolic Sequence | 4 Jun 2008 14:51 | 1 | I've got WA#1 Mihran Hovsepyan {1 kurs of <RAU>} 4 Jun 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; } | Help this gets WA. I wrote test program it says that everything is OK? Help | Evil Hacker | 1219. Symbolic Sequence | 25 Feb 2007 11:44 | 3 | program SymbolicSequence; {.$APPTYPE CONSOLE} var RndSeed: LongInt; function MyRandom(Range: Integer): Integer; var RDouble: Extended; begin MyRandom := (RndSeed div 10000) mod Range; RDouble := RndSeed; RDouble := (RDouble * 3141592621 + 184421); RDouble := RDouble - $7FFFFFFF*Int(RDouble/$7FFFFFFF); RndSeed := Trunc(RDouble); end; var i: Integer; begin RndSeed := 98586100; for i := 1 to 1000000 do Write(Chr(MyRandom(26) + Ord('a'))); WriteLn; end. { The tester program } program test; {$APPTYPE CONSOLE} const OneCnt = 39000; TwoCnt = 1600; TriCnt = 97; var i: Integer; S: String[4]; Use1: array['a'..'z'] of Word; Use2: array['a'..'z', 'a'..'z'] of Word; Use3: array['a'..'z', 'a'..'z', 'a'..'z'] of Word; Ch: Char; begin FillChar(Use1, SizeOf(Use1), 0); FillChar(Use2, SizeOf(Use2), 0); FillChar(Use3, SizeOf(Use3), 0); S := '123'; Read(S[1], S[2], S[3]); Inc(Use1[S[1]]); Inc(Use1[S[2]]); Inc(Use1[S[3]]); Inc(Use2[S[1], S[2]]); Inc(Use2[S[2], S[3]]); Inc(Use3[S[1], S[2], S[3]]); for i := 4 to 1000000 do begin Read(Ch); if Ch in ['a'..'z'] then begin Delete(S, 1, 1); S := S + Ch; Inc(Use1[S[3]]); Inc(Use2[S[2], S[3]]); Inc(Use3[S[1], S[2], S[3]]); if Use1[S[3]] > OneCnt then begin WriteLn('Letter ', S[3], ' used more than ', OneCnt, ' times!!!'); Halt; end; if Use2[S[2], S[3]] > TwoCnt then begin WriteLn('Digraph ', S[2],S[3], ' used more than ', TwoCnt, ' times!!!'); Halt; end; if Use3[S[1], S[2], S[3]] > TriCnt then begin WriteLn('Trigraph ', S[1],S[2],S[3], ' used more than ', TriCnt, ' times!!!'); Halt; end; end else begin WriteLn('Error!!!'); WriteLn('Not small latin letter at ', i); Halt; end; end; WriteLn('Ok'); end. Writeln in the end is odd. char s[1000005]; int p1[32]; int p2[32][32]; int p3[32][32][32]; bool ok() { int i; for (i = 0; i < 1000000; i++) p1[s[i]]++; for (i = 1; i < 1000000; i++) p2[s[i-1]][s[i]]++; for (i = 2; i < 1000000; i++) p3[s[i-2]][s[i-1]][s[i]]++; for (i = 0; i < 26; i++) if (p1[i]>40000) return false; int j,k; for (i = 0; i < 26; i++) for (j = 0; j < 26; j++) if (p2[i][j]>2000) return false; for (i = 0; i < 26; i++) for (j = 0; j < 26; j++) for (k = 0; k < 26; k++) if (p3[i][j][k]>200) return false; return true; } | That is very funny | Komendantian Grant Mikaelovich SSAU | 1219. Symbolic Sequence | 2 Jan 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>: Грант, смени ник, на подобии, как у меня!!! | It is impossible to accept it! | Trofimov Dmitry | 1219. Symbolic Sequence | 21 Feb 2006 22:48 | 2 | |
|
|