제출 #476489

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4764892021-09-27 10:56:34keta_tsimakuridzeSnake Escaping (JOI18_snake_escaping)C++14
22 / 100
582 ms65540 KiB
#include<bits/stdc++.h>
#define f first
#define s second
////#define int long long
#define pii pair<int,int>
using namespace std;
const int N = 2e6 + 5, mod = 1e9 + 7; // !
int t,dp1[N][22],dp2[N][22],L,q;
vector<int> cnt[4];
main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin >> L >> q;
string s;
cin >> s;
for(int i = 0; i < (1 << L); i++) {
dp1[i][0] = s[i] - '0';
for(int j = 0; j < L; j++) {
if(j) dp1[i][j] = dp1[i][j - 1];
if((1 << j) & i) dp1[i][j] += dp1[i ^ (1 << j)][j];
}
}
for(int i = (1 << L) - 1; i >= 0; i--) {
dp2[i][0] = s[i] - '0';
for(int j = 0; j < L; j++) {
if(j) dp2[i][j] = dp2[i][j - 1];
if(!((1 << j) & i)) dp2[i][j] += dp2[i ^ (1 << j)][j];
}
}
while(q--) {
string t;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

snake_escaping.cpp:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   10 | main(){
      | ^~~~
snake_escaping.cpp: In function 'int main()':
snake_escaping.cpp:36:42: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |                         for(int i = 0; i < t.size(); i++) {
      |                                        ~~^~~~~~~~~~
snake_escaping.cpp:32:29: warning: unused variable 'x' [-Wunused-variable]
   32 |                         int x = 0;
      |                             ^
#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...