QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#758090#6617. Encoded Strings ILoxilante#Compile Error//C++201.2kb2024-11-17 15:46:232024-11-17 15:46:25

Judging History

你现在查看的是最新测评结果

  • [2024-11-17 15:46:25]
  • 评测
  • [2024-11-17 15:46:23]
  • 提交

answer

#define F_C
#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define int ll
using namespace std;
typedef long long ll;
template<typename tn = int> tn next(void) { tn k; cin>>k; return k; }
#ifndef LOCAL
#define D(...) 0
#endif
const int U = 1005;
int cnt[U][300];
signed main(void)
{
    #ifdef LOCAL
//	freopen("C:\\Users\\Loxil\\Desktop\\IN.txt", "r", stdin);
//	freopen("C:\\Users\\Loxil\\Desktop\\OUT.txt", "w", stdout);
    #endif
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int len;
    string str;
    cin>>len>>str;

    rev(i, len-1, 0) rep(j, i+1, len) cnt[i][str[j]]++;

    set<string> st;
    rev(i, len-1, 0)
    {
        string s;
        vector<int> v(300, -1);
        rev(j, i, 0) if (v[str[j]] == -1)
        {
            v[str[j]] = 0;
            hrp(ch, 'a', 'z') v[str[j]] += ch != str[j] && cnt[j][ch], I(ch != str[j] && cnt[j][ch], j);
        }
        hrp(j, 0, i) s += 'a'+v[str[j]];

        st.insert(s);
        hrp(j, 0, i) cnt[j][str[i]]--;
    }

    cout<<*prev(st.end())<<endl;

    
    return 0;
}
/*

 */

Details

answer.code: In function ‘int main()’:
answer.code:39:72: error: ‘I’ was not declared in this scope
   39 |             hrp(ch, 'a', 'z') v[str[j]] += ch != str[j] && cnt[j][ch], I(ch != str[j] && cnt[j][ch], j);
      |                                                                        ^