Submission #926936

# Submission time Handle Problem Language Result Execution time Memory
926936 2024-02-14T05:23:57 Z manizare Snake Escaping (JOI18_snake_escaping) C++14
0 / 100
5 ms 2704 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#define pb push_back
#define F first
#define S second 
#define ld long double
#define all(a) a.begin(),a.end()
#define int long long 
#define pii pair <int,int>
#define PII pair<pii , pii>
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= (b);i++)
#define per(i , a , b) for(int i=a;i >= (b);i--)
#define deb(x) cout <<#x << " : " << x << "\n" ;
using namespace std ;
const int maxn = 1e6 + 10  , c = 6 , maxp = 15e5 + 10 , inf=  1e18+10 ;
int ans[maxn] , dp[maxn] ,a3[100] , A[maxn] , B[maxn] , id[maxn] , sm[100000] ; 
bitset<258> mark[3000] ;

signed main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    a3[0] = 1;
    rep(i , 1 , 30){
        a3[i] = a3[i-1] * 3 ;
    }
    int n, Q; cin >> n >> Q  ;
    string s;
    cin >> s; 
    rep(i , 1, (1<<(20-c))-1){
        int x= 1  ;
        rep(j , 0 , n-1){
            sm[i] = sm[i] + (i>>j&1)*a3[j] ;
        }
    }
    rep(i , 0 , a3[c+1]-1){
        rep(j , 0 , (1<<(c+1))-1){
            mark[i][j] =1 ;
            rep(k, 0 , c){
                if((i/a3[k])%3!=0 && ((i/a3[k])%3)-1 != (j>>k&1)){
                    mark[i][j] = 0;
                }
            }
        }
    }
    return 0;
}
/*
 
*/

Compilation message

snake_escaping.cpp: In function 'int main()':
snake_escaping.cpp:30:13: warning: unused variable 'x' [-Wunused-variable]
   30 |         int x= 1  ;
      |             ^
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2704 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2704 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2704 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2704 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2704 KB Output isn't correct
2 Halted 0 ms 0 KB -