제출 #148137

#제출 시각아이디문제언어결과실행 시간메모리
148137WhipppedCreamCoins (IOI17_coins)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #pragma GCC optimize ("O3") #pragma GCC target ("sse4") using namespace std; #define X first #define Y second #define pb push_back typedef pair<int, int> ii; typedef long long ll; const int maxn = 505; const int maxs = 50005; const int sz = 500*500; int n, m, k; char arr[maxn][maxn]; char dir[maxs]; int main() { scanf("%d %d %d", &n, &m, &k); for(int i = 0; i< n; i++) scanf("%s", arr[i]); bitset<sz> mask; bitset<sz> mright, mleft; mright.set(); mleft.set(); for(int i = 0; i< n; i++) { for(int j = 0; j< m; j++) { if(arr[i][j] == '#') mask[i*m+j] = 0; else mask[i*m+j] = 1; if(j == 0) mleft[i*m+j] = 0; if(j == m-1) mright[i*m+j] = 0; } } bitset<sz> dp; for(int i = 0; i< n; i++) { for(int j = 0; j< m; j++) { dp[i*m+j] = 1; } } dp &= mask; // printf("%d\n", dp.count()); scanf("%s", dir); for(int i = 0; i< k; i++) { if(dir[i] == 'N') { dp = dp>>m; } else if(dir[i] == 'S') { dp = dp<<m; } else if(dir[i] == 'E') { dp = (dp<<1)&mleft; } else if(dir[i] == 'W') { dp = (dp>>1)&mright; } else { dp = (dp>>m)|(dp<<m)|((dp<<1)&mleft)|((dp>>1)&mright); } dp &= mask; } printf("%d\n", (int) dp.count()); }

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

coins.cpp: In function 'int main()':
coins.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d", &n, &m, &k);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
coins.cpp:21:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 0; i< n; i++) scanf("%s", arr[i]);
                            ~~~~~^~~~~~~~~~~~~~
coins.cpp:45:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", dir);
  ~~~~~^~~~~~~~~~~
/tmp/cccrFiqs.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccwbzwij.o:coins.cpp:(.text.startup+0x0): first defined here
/tmp/cccrFiqs.o: In function `main':
grader.cpp:(.text.startup+0x411): undefined reference to `find_coin(std::vector<int, std::allocator<int> >)'
grader.cpp:(.text.startup+0x7b1): undefined reference to `coin_flips(std::vector<int, std::allocator<int> >, int)'
collect2: error: ld returned 1 exit status