제출 #730991

#제출 시각아이디문제언어결과실행 시간메모리
730991vjudge1Emacs (COCI20_emacs)C++14
50 / 50
1 ms308 KiB
#include<iostream> #include<vector> #include<iomanip> #include<algorithm> #include<map> #include<set> #include<climits> #include<numeric> #include<queue> #include<unordered_map> #include<string> #include<climits> #include<unordered_set> #include<bitset> #include<cstring> #include<cmath> #include<stack> #if 1 #define pb push_back #define st first #define nd second #define endl '\n' #define fio ios_base::sync_with_stdio(false);cin.tie(NULL); #define MAXN ((int)(2e5+5)) #define int long long int using namespace std; const int inf = 1e17 + 5; #endif void fileio(string s){ #ifndef ONLINE_JUDGE freopen((s+string(".in")).c_str(),"r",stdin); freopen((s+string(".out")).c_str(),"w",stdout); #endif } signed main(){ //fileio("test"); //fio; int n, m; cin >> n >> m; char grid[n + 1][m + 1]; for(int i = 1; i <= n; ++i){ for(int j = 1; j <= m; ++j){ cin >> grid[i][j]; } } bool ok = true; int ans = 0; for(int i = 1; i <= n; ++i){ for(int j = 1; j <= m; ++j){ if(grid[i][j] == '.')ok = true; else{ if(ok and grid[i-1][j] != '*'){ ans++; ok = false; } } } } cout << ans << endl; }

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

emacs.cpp: In function 'void fileio(std::string)':
emacs.cpp:32:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         freopen((s+string(".in")).c_str(),"r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
emacs.cpp:33:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |         freopen((s+string(".out")).c_str(),"w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...