Submission #432366

# Submission time Handle Problem Language Result Execution time Memory
432366 2021-06-18T08:35:51 Z juggernaut Miners (IOI07_miners) C++17
0 / 100
1500 ms 332 KB
#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(){
    set<char>st;
    int n;
    scanf("%d",&n);
    scanf("%s",&s);
    for(int i=0;i<n;i++)st.insert(s[i]);
    if(st.size()==1)puts("1");
    else if(st.size()==2)while(true);
    else return -1;
}

Compilation message

miners.cpp: In function 'int main()':
miners.cpp:25:13: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[100005]' [-Wformat=]
   25 |     scanf("%s",&s);
      |            ~^  ~~
      |             |  |
      |             |  char (*)[100005]
      |             char*
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:24:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
miners.cpp:25:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |     scanf("%s",&s);
      |     ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 1590 ms 204 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 204 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Execution timed out 1577 ms 204 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 204 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Execution timed out 1579 ms 204 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1591 ms 204 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 204 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Execution timed out 1572 ms 204 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 204 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 204 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 332 KB Execution failed because the return code was nonzero