Runtime error : How do I avoid it for a large test case?

I have been solving the CSES problem set and I am stuck on the following problem : CSES-Labyrinth

Here is my solution :

#include <bits/stdc++.h> using namespace std;  int main() {     int n,m,distance=0,x=0,y=0;     string str1="NO",str2="";     cin>>n>>m;     char grid[n+1][m+1];     int vis[n+1][m+1];     int dis[n+1][m+1];     string path[n+1][m+1];     int dx[]={0,0,1,-1};     int dy[]={1,-1,0,0};     char dz[]={'R','L','D','U'};     queue<pair<int,int>>s;      for(int i=0;i<n;i++)         for(int j=0;j<m;j++){             cin>>grid[i][j];             if(grid[i][j]=='A'){                 x=i; y=j;             }             vis[i][j]=0;             dis[i][j]=0;             path[i][j]="";         }          s.push({x,y});     while(!s.empty()){         pair<int,int>a=s.front();         s.pop();         if(grid[a.first][a.second]=='B'){             distance=dis[a.first][a.second];             str1="YES";             x=a.first; y=a.second;             break;         }         if(vis[a.first][a.second]==1)         continue;         else{             vis[a.first][a.second]=1;             for(int i=0;i<4;i++){                 if(a.first+dx[i]<n && a.first+dx[i]>=0 && a.second+dy[i]<m && a.second+dy[i]>=0 && (grid[a.first+dx[i]][a.second+dy[i]]=='.' || grid[a.first+dx[i]][a.second+dy[i]]=='B')){                     s.push({a.first+dx[i], a.second+dy[i]});                     dis[a.first+dx[i]][ a.second+dy[i]]=dis[a.first][a.second]+1;                     path[a.first+dx[i]][ a.second+dy[i]]=path[a.first][a.second]+dz[i];                 }             }         }     }     if(str1=="YES"){         cout<<str1<<endl<<distance<<endl<<path[x][y];     }     else     cout<<str1; } 

I am getting a Runtime error on 3/15 test cases and this was the best result I could reach (other 12 cases are accepted). How do I avoid runtime errors? What is wrong with my solution?

As a player, how can I avoid stifling new players but also avoid letting things stall?

I have just started a Cyberpunk campaign. 2 of us are experienced RPG-ers, 1 hasn’t played in about 10 years and the other 2 are complete newbies. The GM is not new to RPGs, but is new to Cyberpunk, and this is his first time as GM.

Both myself and the lapsed player have Cyberpunk experience; everyone else is brand new.

My character is a Solo, the only one in the group. My backstory is that I have no personal memories from beyond 6 months ago, but I do remember a lot of “stuff” (how to shoot and fight, history of the world, some local knowledge etc).

The other experienced player is a Netrunner whose personality is that of a weak, sniveling coward who tries to stay out of the way as much as possible if he isn’t hacking.

We have run 2 sessions, and I am finding that I am naturally leading the group – partly because this first mission came from an NPC fixer to me and the other players happened to be around and also looking for work allowing me to put a crew together. I am trying my hardest not to direct the new players’ characters too much and give them a sense of agency to make there own choices, to the point of telling the crew in-game that I am not a leader – I shoot and I kill – but I have so far found myself being put in a position to lead every scene and conversation by the other players, both in and out of game.

The other experienced role-player is playing his role really well, so he allowing himself to be led, becoming distracted and not coming up with many ideas. The ideas he does come up with, he feeds through me, due to the fact that in-game we have known each other the longest and I have protected him the last 3 months.

The lapsed player is a Nomad, as is one of the first-timers. The other first-timer is a Rocker and, to my mind, has the stats that should be leading most conversations; she just doesn’t know at the moment what to ask or do.

Since I’ve never been in a group with such inexperienced players, what techniques can I use as a player to help the new players get a sense that they can come up with ideas and choices? The last thing I want to be is “that player” who makes all the decisions and chooses the route we take, but at the moment, the players are leaning very much on me.

Should I maybe have a chat with the other experienced player and suggest he change his approach slightly to allow him to take a more direct role in making suggestions, so that at least it isn’t all coming from me?

An added complication is that currently we are having to all play online, so we have the vagaries of webcam chat to deal with, which might be stifling things a little more.

How can I ensure that these new players don’t get bored within a few sessions and feel that all they are doing is making up the numbers for dice-rolling in combat?

How to avoid password TCP message sniffing and subsequent hijacking

I’m developing a TCP Streaming API for “IoT” devices in LabView.

The TCP Server will be listening to a certain port, and our devices will try to connect to it. In order to know that the connecting client is from our company, all our servers and clients will share a private key and a password. When the client connects successfully to the socket, it will send the secret password cyphered in AES256 with the private key.

But what prevents an attacker from sniffing a client’s credentials message and resend as it is to the server to gain access? Cyphering doesn’t protect that.

How to avoid the guidance cantrip from dominating the game without creating any benefit?

The guidance cantrip is bothering me – not because it makes ability checks easier but because it does not have a relevant opportunity cost and because it disrupts the flow of the game. Any time a skill check is required that can be foreseen players can just use the cantrip. I find this very annoying, since it causes a lot of extra dice rolling and discussion without any meaningful decisions that would add anything to the game.

I do know that the spell requires concentration, that I can create opportunity costs through my content and that I could just ban the spell outright. This was extensively discussed in this question: Casting Guidance cantrip for every roll?

I could ban the spell but I would like to avoid that and creating additional complications specifically for this spell is a lot of work. Are there other, easier solutions?

How to describe that an enemy can avoid opportunity attacks?

I’m the DM of my group. When we are playing I try to describe the effects and actions of enemies and npcs without spelling out exactly what they are to keep some mystique to the actions. Like describing that “the mage shoots a large electrical beam” instead of calling it lighting bolt outright.

I want to add a Flyby effect to a soon to be boss enemy, the description of Flyby is

Flyby: The [creature] doesn’t provoke Opportunity Attacks when it flies out of an enemy’s reach.

However I don’t want to make it seem as if the enemy is avoiding opportunity attacks just because, but neither I want to spell the effect out so they still have to think about it.

How then can I describe an enemy that has immunity to Opportunity Attacks without saying it exactly like that?

Can I Avoid Joining The Same Table 3 Times?

I have this database schema on a Oracle 12c database :

Database schema

I’m trying to answer this question :

What is the game in which Dallas Mavericks had the biggest percentage of successful 3-point shots ?

I’ve managed to answer this question with this query:

SELECT HOME_TEAMS.TEAM_NAME                    "HOME TEAM",        AWAY_TEAMS.TEAM_NAME                    "AWAY TEAM",        GAMES.GAME_DATE                         "DATE",        TEAMS.TEAM_ID                           "GENERIC ID",        HOME_TEAMS.TEAM_ID                      "HOME_ID",        AWAY_TEAMS.TEAM_ID                      "AWAY_ID",        GAME_STATISTICS.X3POINTSHOTS_PERCENTAGE "3 POINTS PERCENTAGE" FROM GAMES_TEAMS_STATISTICS          INNER JOIN GAMES ON GAMES_TEAMS_STATISTICS.GAME_ID = GAMES.GAME_ID          INNER JOIN TEAMS ON GAMES_TEAMS_STATISTICS.TEAM_ID = TEAMS.TEAM_ID          INNER JOIN TEAMS HOME_TEAMS ON GAMES.HOME_TEAM = HOME_TEAMS.TEAM_ID          INNER JOIN TEAMS AWAY_TEAMS ON GAMES.AWAY_TEAM = AWAY_TEAMS.TEAM_ID          INNER JOIN GAME_STATISTICS ON GAMES_TEAMS_STATISTICS.STATS_ID = GAME_STATISTICS.STATS_ID WHERE TEAMS.TEAM_ACRONYM = 'DAL' ORDER BY GAME_STATISTICS.X3POINTSHOTS_PERCENTAGE DESC     FETCH FIRST 1 ROWS WITH TIES; 

However, to answer this question , I join the teams table 3 times. Is there any way I can write this query in a more efficient way , avoiding so many joins ?

Can you ready disengage to avoid opportunity attacks on your turn? [duplicate]

Can you ready the disengage action (say when the enemy gets within 5 feet of you), so that on your turn you can move away from that enemy without provoking opportunity attacks as you have already disengaged?

In other posts I have seen that readying disengage is legal, but I’ve not seen this particular question asked before.

Are there official ways to avoid level adjustment while keeping racial features?

I’m familiar with UA’s “LA Buyoff”, wherein a high-level character can spend XP to reduce their level adjustment, as well as PGtF’s “Powerful Races at 1st Level”, which basically gives negative level penalties for LA races that turn into regular level adjustments as you gain your first few levels. (There’s also “Savage Progressions”, but those aren’t really ways for getting rid of LA, since they come with the full LA of the final monster.)

Both of these approaches simply take the issue of level adjustments and move them to different spots in character progression, though. Is there any way to simply get rid of level adjustments altogether?

I have seen one method, used in E6, where LA races simply get fewer points with which to buy ability scores. Does this have any basis in official Dungeons and Dragons products, though, or is it just for E6? It seems to imply that regular races get a 32-point point buy, so I’m guessing the latter, but I thought I’d bring it up.

(I also know Savage Species had some general guidelines on how to determine level adjustments, but they seem more intent on giving LA based on features rather reducing LA, like by converting LA into RHD (since working backwards with its LA guidelines is basically going backwards through a savage progression, aka removing racial features))

All that is to say, I’m looking for a method that: Gets rid of LA (from 1st level all the way up), doesn’t sacrifice racial features, and isn’t homebrew/houserule. Is there such a thing, or would I have better luck chasing unicorns?