Submission #709084

# Submission time Handle Problem Language Result Execution time Memory
709084 2023-03-13T06:01:11 Z kxd Password (RMI18_password) C++17
0 / 100
80 ms 420 KB
    #include <bits/stdc++.h>
    //#define int long long
    #define ll unsigned long long
    #define pb push_back
    #define p_q priority_queue
    #define m_p make_pair
    #define pii pair<int,int>
    #define endl '\n'
    #define INIT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define FOR(i, a, b) for(int i = a; i <= b; i++)
    #define forn(i, n) for (int i = 0; i < n; i++)
    #define forn1(i, n) for (int i = 1; i <= n; i++)
    #define all(x) x.begin(),x.end()
    #define ft first
    #define sd second
     
    using namespace std;
    const int N = 1e5+5;
    const int INF = 1e18;
    const int MOD = 1e9+7;
     
    using namespace std;
     
    int tot[26];
    int ans[5000];
    int query(string str); 
    string guess(int n, int s) {
    	forn(i,s) {
    		string S (n,char('a'+i));
    		tot[i] = query(S);
    	}
    	forn(i,s) {
    		forn(j,tot[i]) {
    			int ret = 0;
    			forn(k,s) {
    				if(k==i) continue;
    				string S (j,'a'+i);
    				string S2 (n-j,'a'+k);
    				int t = query(S+S2);
    				if(!t) break;
    				ret += t;
    			}
    			ans[ret] = i;
    		}
    	}
    	string S;
    	forn(i,n) {
    		S = S + (char)(ans[i]+'a');
    	}
    	return S;
    }

Compilation message

password.cpp:19:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   19 |     const int INF = 1e18;
      |                     ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 208 KB Returned early from guess() after 226 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Returned early from guess() after 53 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 80 ms 420 KB Returned early from guess() after 11013 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 208 KB Returned early from guess() after 226 queries.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 208 KB Returned early from guess() after 226 queries.
2 Halted 0 ms 0 KB -