Submission #940362

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9403622024-03-07 08:31:11SundavarCrossing (JOI21_crossing)C++14
100 / 100
4498 ms339616 KiB
#include <bits/stdc++.h>
using namespace std;
int conv(char c){
if(c == 'I') return 0;
if(c == 'J') return 1;
return 2;
}
struct segTree{
struct node{
vector<int> real_cnt;
node(){
real_cnt.resize(3);
}
int wrong = 0, set_to = -1, all = 0;
};
vector<node> t;
int maxN = (1<<18);
segTree(string& real, string& fake){
t.resize(2*maxN);
for(int i = 0; i < real.size(); i++){
t[i+maxN].real_cnt[conv(real[i])] = 1;
t[i+maxN].wrong = fake[i] != real[i];
t[i+maxN].all = 1;
}
build(1, 0, maxN);
}
void build(int v, int l, int r){
if(r-l == 1) return;
build(2*v, l, (l+r)/2), build(2*v+1, (l+r)/2, r);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In constructor 'segTree::segTree(std::string&, std::string&)':
Main.cpp:21:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |         for(int i = 0; i < real.size(); i++){
      |                        ~~^~~~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:102:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segTree>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  102 |     for(int i = 0; i < trees.size(); i++)
      |                    ~~^~~~~~~~~~~~~~
Main.cpp:111:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segTree>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  111 |         for(int i = 0; i < trees.size(); i++){
      |                        ~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...