Submission #1027054

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10270542024-07-18 19:34:09vjudge1Sličnost (COI23_slicnost)C++17
0 / 100
21 ms48476 KiB
#include <bits/stdc++.h>
using namespace std;
void f(){
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
}
int n, tl, tr, val, pos, check, id, rid;
vector<int> roots;
int leftt[(int)3e6], rightt[(int)3e6];
array<int, 3> st[(int)3e6];
array<int, 3> TxT(array<int, 3> l, array<int, 3> r){
array<int, 3> res={0, 0, 0};
res[0]=l[0]+r[0];
res[1]=max(l[1], l[0]+r[1]);
if(l[1]==res[1]) res[2]+=l[2];
if(r[1]+l[0]==res[1]) res[2]+=r[2];
return res;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void f()':
Main.cpp:6:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  freopen("in.txt", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:7:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  freopen("out.txt", "w", stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:118:46: warning: iteration 3000000 invokes undefined behavior [-Waggressive-loop-optimizations]
  118 |   for(int l=0; l<4e7; l++) leftt[l]=rightt[l]=-1;
      |                                     ~~~~~~~~~^~~
Main.cpp:118:17: note: within this loop
  118 |   for(int l=0; l<4e7; l++) leftt[l]=rightt[l]=-1;
      |                ~^~~~
Main.cpp:118:46: warning: 'void* __builtin_memset(void*, int, long unsigned int)' forming offset [12000000, 159999999] is out of the bounds [0, 12000000] of object 'rightt' with type 'int [3000000]' [-Warray-bounds]
  118 |   for(int l=0; l<4e7; l++) leftt[l]=rightt[l]=-1;
      |                                     ~~~~~~~~~^~~
Main.cpp:13:22: note: 'rightt' declared here
   13 | int leftt[(int)3e6], rightt[(int)3e6];
      |                      ^~~~~~
Main.cpp:118:36: warning: 'void* __builtin_memset(void*, int, long unsigned int)' forming offset [12000000, 159999999] is out of the bounds [0, 12000000] of object 'leftt' with type 'int [3000000]' [-Warray-bounds]
  118 |   for(int l=0; l<4e7; l++) leftt[l]=rightt[l]=-1;
      |                            ~~~~~~~~^~~~~~~~~~~~~
Main.cpp:13:5: note: 'leftt' declared here
   13 | int leftt[(int)3e6], rightt[(int)3e6];
      |     ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...