A couple of things:
1) Don't be rude and lazy: post your code to the site you are asking for help from, rather than expecting others to go to a random site and look at your code. Think about it: if you help people to help you they are more likely to want to.
2) Syntax errors are simple to fix if you just look at them closely: you shouldn't even be thinking of entering contests if you can't fix simple problems. Particularly when the error message explicitly tells you what the problem is, and where ...
main.cpp:44:24: error: expected ‘;’ before ‘}’ token
44 | a[p-t-1]=-1
| ^
| ;
45 | }
| ~
if it's complaining that a semicolon is missing, and showing you the line it is missing from, isn't it easier to add the semicolon than find someone else who can tell you "add the missing semicolon to this line:
a[p-t-1]=-1
So it looks like this:"
a[p-t-1]=-1;
This may help you next time you get a compilation error:
How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[
^]