Submission #1070506

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10705062024-08-22 14:50:13vjudge1Selling RNA Strands (JOI16_selling_rna)C++17
100 / 100
112 ms60244 KiB
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
using lli = long long;
const int maxN = 1e5 + 5;
const int maxS = 4e6 + 5;
const int maxA = 4;
int tr[maxS][maxA],cnt,h[maxS];
string q[maxN],s[maxN],p[maxN],s1[maxN];
int n,m,idn[maxN],idm[maxN],res[maxN];
int tk(char c)
{
if (c == 'G') return 0;
if (c == 'U') return 1;
if (c == 'C') return 2;
if (c == 'A') return 3;
}
void add(string s)
{
int node = 0;
for (char c : s)
{
if (tr[node][tk(c)] == 0) tr[node][tk(c)] = ++cnt;
node = tr[node][tk(c)];
h[node]++;
}
}
void del(const string& s)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

selling_rna.cpp: In function 'void del(const string&)':
selling_rna.cpp:34:13: warning: unused variable 'pos' [-Wunused-variable]
   34 |         int pos = node;
      |             ^~~
selling_rna.cpp: In function 'bool check(const string&, const string&)':
selling_rna.cpp:78:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   78 |     for (int i = 0;i < a.size();++i)
      |                    ~~^~~~~~~~~~
selling_rna.cpp: In function 'int tk(char)':
selling_rna.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...