Submission #1105684

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11056842024-10-27 10:29:59FucKanhSnake Escaping (JOI18_snake_escaping)C++11
100 / 100
1081 ms54444 KiB
#include<bits/stdc++.h>
#define ll long long
#define int ll
#define pii pair<int,int>
using namespace std;
const int BIT = 20;
int f[1<<BIT], g[1<<BIT], h[1<<BIT], ans;
void solve2(int i, vector<int> &v, int val) {
if (i==v.size()) {
ans += h[val];
return;
}
val &= ~(1<<v[i]);
solve2(i+1,v,val);
val |= (1<<v[i]);
solve2(i+1,v,val);
}
void solve1(int i, vector<int> &v, int val, int cnt) {
if (i==v.size()) {
if (cnt==0) return;
if (cnt%2) {
ans -= f[val];
}
else {
ans += f[val];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

snake_escaping.cpp: In function 'void solve2(long long int, std::vector<long long int>&, long long int)':
snake_escaping.cpp:13:10: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     if (i==v.size()) {
      |         ~^~~~~~~~~~
snake_escaping.cpp: In function 'void solve1(long long int, std::vector<long long int>&, long long int, long long int)':
snake_escaping.cpp:24:10: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     if (i==v.size()) {
      |         ~^~~~~~~~~~
snake_escaping.cpp: In function 'void solve0(long long int, std::vector<long long int>&, long long int, long long int)':
snake_escaping.cpp:41:10: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |     if (i==v.size()) {
      |         ~^~~~~~~~~~
#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...