제출 #173644

#제출 시각아이디문제언어결과실행 시간메모리
173644Nucleist회문 (APIO14_palindrome)C++14
8 / 100
1086 ms904 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define debug(x) cerr << " - " << #x << ": " << x << endl; #define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl; #define all(x) (x).begin(),(x).end() #define sz(x) (ll)x.size() #define ll long long #define INF 1000000000 #define MOD 1000000007 #define pb push_back #define ve vector<ll> #define dos pair<ll,ll> #define vedos vector<dos> #define rand mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()) struct greateri { template<class T> bool operator()(T const &a, T const &b) const { return a > b; } }; int main() { //flash; string a; cin>>a; ll ans=0; for (ll i = 0; i < a.size(); ++i) { for (ll j = i; j < a.size(); ++j) { string dol; ll ka=0; for (ll k = i; k <= j; ++k) { dol+=a[k]; } string hey=dol; reverse(hey.begin(),hey.end()); if(hey==dol) { for (ll k = 0; k < a.size()-j+i; ++k) { string nol = a.substr(k,(j-i+1)); if(nol==dol)ka++; } ans=max(ans,ka*(j-i+1)); } } } cout<<ans; return 0; } //code the AC sol ! // BS/queue/map

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

palindrome.cpp:4:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization ("O3")
 
palindrome.cpp:5:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization ("unroll-loops")
 
palindrome.cpp: In function 'int main()':
palindrome.cpp:30:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (ll i = 0; i < a.size(); ++i)
                  ~~^~~~~~~~~~
palindrome.cpp:32:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (ll j = i; j < a.size(); ++j)
                    ~~^~~~~~~~~~
palindrome.cpp:44:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (ll k = 0; k < a.size()-j+i; ++k)
                      ~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...