Submission #727744

# Submission time Handle Problem Language Result Execution time Memory
727744 2023-04-21T09:01:57 Z anusha777 Mars (APIO22_mars) C++17
0 / 100
0 ms 200 KB
#include "mars.h"
#include <bits/stdc++.h>
#define sz(x)			(int)((x).size())
#define pb				push_back
#define vi				vector<int>
#define vb				vector<bool>
#define vvb				vector<vb>
#define pi				pair<int,int>
#define vpi				vector<pi>
#define vvi				vector<vi>
#define vvs				vector <vector<string>>
#define vc				vector<char>
#define all(x)			x.begin(), x.end()
#define rall(x)			x.rbegin(), x.rend()
#define pbb()			pop_back()
#define f				first
#define s				second
#define ll				long long
//#define int				long long
#define ull				unsigned long long
#define line               cout<<"_____________________________"<<endl;
#define forr(i, a, b)      for(int i=a; i<b; i++)
const int N=1e5+1, mod=998244353, inf=1e18+1;
using namespace std;
string process(vector <vector<string>> a, int x, int y, int kk, int n)
{
    if(kk==0)
    {
        string s;
        forr(i, 0, 3) forr(j, 0, 3) s.pb(a[i][j][0]);
        forr(i , 9, 100) s.pb('0');
        return s;
    }
    vvb vis(5, vb(5));
    vvi g(5, vi(5));
    vi dx={0, 1, 0, -1}, dy={1, 0, -1, 0};
    forr(i, 0, 3) forr(j, 0, 3) forr(k, 0, 9)
            {
                int ii= i  + k%3, jj= j+ k/3;
                g[ii][jj]= a[i][j][k]-'0';
            }
    int total=0;

    forr(i, 0, 5) forr(j, 0, 5) if(!vis[i][j] and g[i][j]==1)
            {
                queue<pi> q;
                q.push({i, j});
                while(!q.empty())
                {
                    pi t= q.front();
                    q.pop();
                    if(vis[t.f][t.s]) continue;
                    vis[t.f][t.s]=1;
                    forr(k, 0, 4)
                    {
                        int xt= t.f+dx[k], yt= t.s+ dy[k];
                        if(xt>=0 and xt<5 and yt>=0 and yt<5) if(!vis[xt][yt] and g[xt][yt]==1)
                                q.push({xt, yt});
                    }
                }
                total++;
            }
    string ans;
    for(int i=0 , mask=1; i<100; i++, mask*=2)
    {
        if((total&mask)==mask) ans.pb('1');
        else ans.pb('0');
    }
    return ans;
    return string(100, '0');
}

Compilation message

mars.cpp:23:43: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   23 | const int N=1e5+1, mod=998244353, inf=1e18+1;
      |                                       ~~~~^~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -