Submission #420015

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4200152021-06-07 22:26:50Runtime_error_Crossing (JOI21_crossing)C++14
100 / 100
950 ms28520 KiB
//JOIOC 2021 p1 crossing
#include <bits/stdc++.h>
#define pb push_back
#define le node+node
#define ri node+node+1
#define mid (l+r)/2
#define all(v) v.begin(),v.end()
using namespace std;
const int inf = 2e5+2,lg = 10;
int n,k,q;
bool ans;
string s;
vector<string> v;
int pre[lg][3][inf];
char ss[inf];
int mp[99];
string in(){
scanf("%s",ss);
return string(ss);
}
string cross(string &a,string &b){
string ret = a;
for(int i=0;i<n;i++){
if(a[i] == b[i])
continue;
else if(a[i] != 'J' && b[i] != 'J')
ret[i]= 'J';
else if(a[i] != 'O' && b[i] != 'O')
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void go()':
Main.cpp:58:76: warning: array subscript has type 'char' [-Wchar-subscripts]
   58 |                     pre[i][let][j] = (j>0?pre[i][let][j-1]:0) + (mp[v[i][j]] == let);
      |                                                                            ^
Main.cpp: In function 'void push(int, int, int)':
Main.cpp:81:9: warning: unused variable 'sz' [-Wunused-variable]
   81 |     int sz = r-l+1,let= lazy[node];
      |         ^~
Main.cpp: In function 'int main()':
Main.cpp:122:38: warning: array subscript has type 'char' [-Wchar-subscripts]
  122 |         update(1,0,n-1,l-1,r-1,mp[c[0]]);
      |                                   ~~~^
Main.cpp: In function 'std::string in()':
Main.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     scanf("%s",ss);
      |     ~~~~~^~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:105:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  105 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
Main.cpp:108:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  108 |     scanf("%d",&q);
      |     ~~~~~^~~~~~~~~
Main.cpp:120:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  120 |         scanf("%d%d",&l,&r);
      |         ~~~~~^~~~~~~~~~~~~~
Main.cpp:121:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  121 |         scanf("%s",c);
      |         ~~~~~^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...