Submission #432364

#TimeUsernameProblemLanguageResultExecution timeMemory
432364juggernautMiners (IOI07_miners)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define fr first #define sc second using namespace std; void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);} typedef long long ll; #define USING_ORDERED_SET 0 #if USING_ORDERED_SET #include<bits/extc++.h> using namespace __gnu_pbds; template<class T>using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; #endif template<class T>void umax(T &a,T b){if(a<b)a=b;} template<class T>void umin(T &a,T b){if(b<a)a=b;} #ifdef IOI2021SG #define printl(args...)printf(args) #else #define printl(args...)((void)0) #endif char s[100005]; int main(){ int n; scanf("%d",&n); scanf("%s",&s); for(int i=0;i<n;i++)add(s[i]); printf("%d",mx); }

Compilation message (stderr)

miners.cpp: In function 'int main()':
miners.cpp:24:13: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[100005]' [-Wformat=]
   24 |     scanf("%s",&s);
      |            ~^  ~~
      |             |  |
      |             |  char (*)[100005]
      |             char*
miners.cpp:25:25: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
   25 |     for(int i=0;i<n;i++)add(s[i]);
      |                         ^~~
      |                         std::filesystem::perm_options::add
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from miners.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:202:7: note: 'std::filesystem::perm_options::add' declared here
  202 |       add = 0x2,
      |       ^~~
miners.cpp:26:17: error: 'mx' was not declared in this scope
   26 |     printf("%d",mx);
      |                 ^~
miners.cpp: In function 'void usaco(std::string)':
miners.cpp:5:29: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 | void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
      |                      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
miners.cpp:5:66: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 | void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
      |                                                           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
miners.cpp: In function 'int main()':
miners.cpp:23:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
miners.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     scanf("%s",&s);
      |     ~~~~~^~~~~~~~~