제출 #335304

#제출 시각아이디문제언어결과실행 시간메모리
335304Vladth11Nautilus (BOI19_nautilus)C++14
100 / 100
238 ms876 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define debug(x) cerr << #x << " " << x << "\n" #define debug_with_space(x) cerr << #x << " " << x << " " using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef pair <ll, ll> pii; typedef pair <ll, pii> piii; typedef tree <pii, null_type, less <pii>, rb_tree_tag, tree_order_statistics_node_update> OST; const ll NMAX = 100001; const ll INF = (1LL << 60); const ll MOD = 1000000007; const ll BLOCK = 101; const ll nr_of_bits = 35; bitset <505 * 505> init, b, nou, cop; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m, t; cin >> n >> m >> t; int cc = 0; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ char c; cin >> c; if(c != '#'){ cc++; init[i * (m + 2) + j + 1].flip(); } } } string s; cin >> s; b = init; m+=2; n+=2; for(int i = 0; i < s.size(); i++){ if(s[i] != '?'){ if(s[i] == 'E'){ b <<= 1; }else if(s[i] == 'W'){ b >>= 1; }else if(s[i] == 'N'){ b >>= m; }else{ b <<= m; } b &= init; }else{ cop = b; nou = b; nou <<= 1; nou &= init; b = nou; nou = cop; nou >>= 1; nou &= init; b |= nou; nou = cop; nou >>= m; nou &= init; b |= nou; nou = cop; nou <<= m; nou &= init; b |= nou; b &= init; } } cout << b.count(); return 0; }

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

nautilus.cpp: In function 'int main()':
nautilus.cpp:44:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     for(int i = 0; i < s.size(); i++){
      |                    ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...