Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
My solution in Python 3 took 0.062s and 220 KB. Can it be faster? | Dhruv Somani | 1545. Иероглифы | 19 апр 2021 15:39 | 3 |
My solution in Python 3 took 0.062s and 220 KB. Can it be faster? Of course it can! my solution took away just 0.001 sec and 172 kB(in C) Python takes more time than lower level languages and thats why it's not the best idea to use it in a speed based setting |
WA 3 | Sperow | 1545. Иероглифы | 7 дек 2020 15:51 | 1 |
WA 3 Sperow 7 дек 2020 15:51 What's the WA 3?? and send me please some tests if u have) |
I got accepted but can you tell me what did they mean by arbitery sequence.... Was it to mislead us?? | Suparna | 1545. Иероглифы | 23 янв 2019 20:39 | 1 |
I didn't do anything for 'arbitary' sequence. But my solution got accepted.Can anybody help me clear this doubt? |
No subject | Suparna | 1545. Иероглифы | 23 янв 2019 20:36 | 1 |
|
C++ 11 STL AC | coldwind | 1545. Иероглифы | 8 авг 2018 14:28 | 1 |
#include<iostream> #include<string> #include<map> #include<set> using namespace std; int main(){ map<char,set<string>> dic; string w; int n; cin>>n; while(--n>=0){ cin>>w; dic[w[0]].insert(w); } char c; cin>>c; for(auto s:dic[c]) cout<<s<<endl; } |
DELETE SOLUTION | mNT | 1545. Иероглифы | 28 июл 2018 15:42 | 1 |
Edited by author 28.07.2018 15:42 |
Runtime error | Unfeeling | 1545. Иероглифы | 12 янв 2018 02:44 | 2 |
using System; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); string [] ch= new string [100]; string c; for (int i=0;i<n;i++) ch[i]=Console.ReadLine(); c=Console.ReadLine(); for (int i=0;i<n;i++) { if (c==ch[i].Substring(0,1)) Console.WriteLine(ch[i]); } Console.ReadKey(); } } } what's the problem??? help me please Use comment for this line (or delete this line) //Console.ReadKey(); |
why I have runtime eror on test 1? | nick nikuradze | 1545. Иероглифы | 23 апр 2016 22:50 | 5 |
This is my code!!! #include <iostream> #include <vector> #include <algorithm> using namespace std; vector <string> str; vector <string> str1; int main() { char k; string s; vector <string> str; vector <string> str1; int n; cin>>n; for(int i=0; i<n; i++) { cin>>s; str.push_back(s); } cin>>k;
for(int i=0; i<n; i++) { if(str[i][0]==k) str1.push_back(str[i]); }
sort(str1.begin(),str1.end()); for(int i=0; i<str.size(); i++) { cout<<str1[i]<<endl; } return 0; } Do you check your code locally, using some C++ IDE or compiler? Why no? You MUST try. You can, using VS or QTCreator: - run task sample using debugger; - catch "vector index out of range" exception/failure; - fix it. Edited by author 23.04.2016 20:06 I check it on c++ compiler and it do right You definitely didn't check. Your code contains mistakes. Your code must fail with some "vector index out of range" error when you run it locally in debug mode. Probably you use "checked" in meaning "compiled without errors". It is wrong meaning. I check it on c++ compiler and it do right |
solution and explanation | Davit Safrastyan [RAU] | 1545. Иероглифы | 9 окт 2014 18:09 | 1 |
Find the solution and explanation of this task in manyprogrammingtutorials.blogspot.com |
Idea[Solution][Java] | Evgeniy[VVV] | 1545. Иероглифы | 29 авг 2014 13:31 | 1 |
So,it's easy problem. just use array and charAt(0); |
use the map | aybek | 1545. Иероглифы | 17 окт 2013 16:08 | 1 |
I think that code is easy to understand. If you got WA, try it. #include <iostream> #include <map> using namespace std; int main() { map<char, string> m; int n; cin >> n; while (n--) { char c1, c2; cin >> c1 >> c2; m[c1].push_back(c2); } char c; cin >> c; for (int i = 0; i < m[c].size(); ++i) cout << c << m[c][i] << endl; return 0; } |
AC using C# | JAMSHID AKHMEDOV | 1545. Иероглифы | 31 янв 2013 21:41 | 1 |
using System;namespace jama{class Program{static void Main(string[] args){ushort n = ushort.Parse(Console .ReadLine());string[] a = new string[n];for (ushort i = 0; i <= n - 1; i++){a[i] = Console.ReadLine();}string b = Console.ReadLine();foreach (string d in a){if (d.Substring(1,1) == b)Console.WriteLine(d);}Console.ReadLine();}}} |
whats wrong and whats test 10 | garra | 1545. Иероглифы | 31 май 2012 21:47 | 3 |
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int n,i,j=0; char a[100][4]; char b; scanf("%d",&n); for(i=0;i<=n;i++) { gets(a[i]); } scanf("%c",&b); for(i=0;i<=n;i++) { if(a[i][j]==b) { puts(a[i]); } } return 0; } there can be more than 100 hieroglyphs |
Why wrong? | Saimon | 1545. Иероглифы | 23 дек 2011 13:12 | 2 |
This is my code var n,i:integer; baza:array[1..1000]of string[2]; tmp,bukva:string[2]; begin read(n); i:=0; repeat i:=i+1; readln(baza[i]); until i=n; read(bukva); for i:=1 to n do begin tmp:=baza[i]; if bukva=tmp[1] then writeln(tmp); end; end. Where mystake? I think to this code is right, but i have WA in test1. Help please tmp:=baza[i]; if bukva=tmp[1] then writeln(tmp); mistake there. Edited by author 23.12.2011 13:14 |
why test 10? | Pop Ioachim | 1545. Иероглифы | 12 дек 2011 14:51 | 1 |
|
WHY WA 9? Everything is right, even for Z symbol; What is TEST 9? Thx | orcchg | 1545. Иероглифы | 23 авг 2011 02:25 | 1 |
np, i have proceed :D Edited by author 23.08.2011 02:26 |
what is wrong?什么毛病呢? | zsyzhbc_china | 1545. Иероглифы | 21 июл 2011 20:16 | 3 |
program t1545; var s,h:array [1..1000] of string; p:array [1..1000] of longint; x,k:string; a,b,n,i,j,m,l:longint; begin readln(n);a:=1; for i:=1 to n do readln(s[i]); readln(k); b:=length(k); for i:=1 to n do begin l:=0; x:=s[i]; for j:=1 to length(s[i]) do begin if x[j]=k[1] then begin for m:=0 to b-1 do if x[j+m]=k[m+1] then inc(l); if l=b then begin h[a]:=x; inc(a); end; end; end; end; for i:=1 to a-1 do begin l:=0; x:=h[i]; for j:=1 to length(x) do begin if x[j]<>k then l:=l+ord(x[j]); end; p[i]:=l; end; for i:=1 to a-2 do for j:=i+1 to a-1 do begin if p[i]>p[j] then begin l:=p[i]; p[i]:=p[j]; p[j]:=l; k:=h[i]; h[i]:=h[j]; h[j]:=k; end; end; for i:=1 to a-1 do writeln(h[i]); end. If I'm not mistaking, the string in Pascal can't be longer than 255 symbols. But may be I am... oh men ! what are you doing ? is this the program we want to write??? try this type myarray=array [1..1000] of string; var i,n:integer; a:myarray; s,s1:string; begin readln (n); for i:=1 to n do readln (a[i]); readln (s); for i:=1 to n do begin s1:=a[i]; if s1[1]=s then writeln (a[i]) end; end. |
WA 11 | hatred | 1545. Иероглифы | 18 июл 2011 20:43 | 1 |
WA 11 hatred 18 июл 2011 20:43 I create alphabetic-sorted binary tree and find strings in it. I got WA 11, why? |
Why 13 test "CRASH" ?? | =NeRRouZ= | 1545. Иероглифы | 24 апр 2011 15:20 | 3 |
#include <iostream> using namespace std; int main() { int n; int i; char s; char a[1001]; cin>>n;
for (i = 0; i<n*2; i++) cin>>a[i]; cin>>s; for (i=0; i<n*2; i++) {
if (s == a[i] && i % 2 == 0) cout<<a[i]<<a[i+1]<<endl; }
system("pause"); return 0; } a[1001] should be a[2000] at least; |
What is "Crash (access violation)"? | Nęmø..! | 1545. Иероглифы | 28 янв 2011 00:30 | 1 |
I've just understood!! 1<=n<=1000 not n<=100 =))! Edited by author 28.01.2011 00:34 |