제출 #83485

#제출 시각아이디문제언어결과실행 시간메모리
83485nikolapesic2802새로운 문제 (POI13_usu)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define pb push_back using namespace std; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; ///find_by_order(),order_of_key() int main() { //ios_base::sync_with_stdio(0); //cin.tie(NULL); int n,k; scanf("%i %i",&n,&k); char s[n]; scanf("%s",s); int i=0,j=n-1; int c=1,b=k; set<int> index; while(i<=j) {      index.clear(); c=1,b=k; while(c>0&&b>0) { index.insert(i); if(s[i]=='c') c--; else b--; i++; } while(c!=0||b!=0) { index.insert(j); if(s[i]=='c') { c--; if(c<0) { index.erase(i); i--; } } else { b--; if(b<0) { index.erase(i); i--; } } j--; } for(auto p:index) { printf("%i ",p); } printf("\n"); } return 0; }

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

usu.cpp:26:2: error: stray '\302' in program
       index.clear();
  ^
usu.cpp:26:3: error: stray '\240' in program
       index.clear();
   ^
usu.cpp:26:5: error: stray '\302' in program
       index.clear();
     ^
usu.cpp:26:6: error: stray '\240' in program
       index.clear();
      ^
usu.cpp:26:8: error: stray '\302' in program
       index.clear();
        ^
usu.cpp:26:9: error: stray '\240' in program
       index.clear();
         ^
usu.cpp: In function 'int main()':
usu.cpp:18:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%i %i",&n,&k);
  ~~~~~^~~~~~~~~~~~~~~
usu.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",s);
  ~~~~~^~~~~~~~