Submission #727744

#TimeUsernameProblemLanguageResultExecution timeMemory
727744anusha777Mars (APIO22_mars)C++17
0 / 100
0 ms200 KiB
#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 (stderr)

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 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...