Submission #1544345
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<string> #include<sstream> #include<algorithm> #include<cmath> #include<vector> #include <map> #include <set> #include <list> #include<fstream> #include<stdio.h> #include<iomanip> #include<climits> #include<list> #include <functional> #include <utility> #include <numeric> #define all(v) ((v).begin()),((v).end()) #define sz(v) ((int)(v).size()) #define PI 3.14159265 typedef long long ll; typedef unsigned long long ull; using namespace std; int sumofdigit(int n) { if (n < 0) n *= -1; if (!n) return 0; return n % 10 + sumofdigit(n / 10); } void prn(int a[], int sz) { if (sz <= 0) return; sz--; prn(a, sz ); cout << a[sz] << endl; } void rprn(int a[], int sz) { if(sz <= 0) return; cout << a[sz-1] << endl; rprn(a, sz-1); } int sum(int n) { if (n == 1) return 1; return n + sum(n - 1); } int fact(int n) { if (n <= 1) return 1; return n*fact(n - 1); } int cnt(int a[], int sz) { sz--; if (sz <= 0) return a[0]==0; if (a[sz] == 0) return 1 + cnt(a, sz); return cnt(a, sz); } int mn(int a[], int sz, int m = INT_MAX) { sz--; if (sz <= 0) return a[0]; m = min(m, mn(a, sz)); return m; } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); //freopen("input.txt", "r", stdin); //freopen("out.txt", "w", stdout); /////////////////////////////////////////// string s; cin >> s; set<string>ss; ss.insert(s); for(int i=0;i<sz(s);i++) { for(int j=i+1;j<sz(s);j++) {if(s[i]==s[j]) continue; string x=s; reverse(x.begin()+i,x.begin()+j+1); ss.insert(x); } } cout<<sz(ss)<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Reverse and Compare |
User | AhmedHafez |
Language | C++14 (Clang 3.8.0) |
Score | 0 |
Code Size | 1752 Byte |
Status | TLE |
Exec Time | 2848 ms |
Memory | 1725056 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 6 ms | 760 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |
subtask_1_01.txt | AC | 1 ms | 256 KB |
subtask_1_02.txt | TLE | 2103 ms | 832 KB |
subtask_1_03.txt | AC | 1 ms | 256 KB |
subtask_1_04.txt | AC | 1 ms | 256 KB |
subtask_1_05.txt | AC | 12 ms | 4096 KB |
subtask_1_06.txt | TLE | 2208 ms | 1725056 KB |
subtask_1_07.txt | TLE | 2273 ms | -1484032 KB |
subtask_1_08.txt | TLE | 2521 ms | -489088 KB |
subtask_1_09.txt | TLE | 2848 ms | -489352 KB |
subtask_1_10.txt | TLE | 2442 ms | -489760 KB |
subtask_1_11.txt | TLE | 2366 ms | -489184 KB |
subtask_1_12.txt | TLE | 2338 ms | -489280 KB |
subtask_1_13.txt | TLE | 2341 ms | -493716 KB |
subtask_1_14.txt | TLE | 2160 ms | 905084 KB |
subtask_1_15.txt | TLE | 2261 ms | -1630212 KB |
subtask_1_16.txt | TLE | 2527 ms | -489216 KB |
subtask_1_17.txt | TLE | 2379 ms | -490200 KB |