diff --git a/TangDou/LanQiaoBei/ZhongGaoJi/LanQiao14STEMA202301/TD.cpp b/TangDou/LanQiaoBei/ZhongGaoJi/LanQiao14STEMA202301/TD.cpp index fdd5816..8200967 100644 --- a/TangDou/LanQiaoBei/ZhongGaoJi/LanQiao14STEMA202301/TD.cpp +++ b/TangDou/LanQiaoBei/ZhongGaoJi/LanQiao14STEMA202301/TD.cpp @@ -1,48 +1,9 @@ #include using namespace std; -const int INF = 0x3f3f3f3f; -const int N = 110; -double a[N]; -int n; -int f1[N], f2[N]; +#define endl '\n' int main() { - cin >> n; - for (int i = 1; i <= n; i++) cin >> a[i]; - for (int i = 1; i <= n; i++) { - f1[i] = 1; - for (int j = 1; j < i; j++) - if (a[i] > a[j]) f1[i] = max(f1[i], f1[j] + 1); - } - for (int i = n; i >= 1; i--) { - f2[i] = 1; - for (int j = 1; j < i; j++) - if (a[i] > a[j]) f2[i] = max(f1[i], f1[j] + 1); - } - bool flag = true; - for (int i = 1; i <= n; i++) - if (f1[i] != 1) { - flag = false; - break; - } - if (flag) { - cout << -1 << endl; - exit(0); - } - flag = true; - for (int i = 1; i <= n; i++) - if (f2[i] != 1) { - flag = false; - break; - } - if (flag) { - cout << -1 << endl; - exit(0); - } - int mx = -1; - for (int i = 1; i <= n; i++){ - int t = f1[i] + f2[i]; - mx = max(mx, t); - } - cout << n - mx + 1; + // 加快读入 + ios::sync_with_stdio(false), cin.tie(0); + cout << "dd" << endl; return 0; } \ No newline at end of file diff --git a/TangDou/Test/HuangHai.cpp b/TangDou/Test/HuangHai.cpp index 6f0fb4e..6445306 100644 --- a/TangDou/Test/HuangHai.cpp +++ b/TangDou/Test/HuangHai.cpp @@ -1,16 +1,9 @@ #include - using namespace std; -int n; -const int N = 110; -typedef long long LL; -LL a[N]; -LL res; - +#define endl '\n' int main() { - while (cin >> a[++n]); - n--; - for (int i = 1; i <= n; i++)res += a[i] * pow(2, n - 1); - printf("%d", res); + // 加快读入 + ios::sync_with_stdio(false), cin.tie(0); + cout << "aaa" << endl; return 0; } \ No newline at end of file diff --git a/文档/.vscode/c_cpp_properties.json b/文档/.vscode/c_cpp_properties.json index 97b96fc..65b9b7c 100644 --- a/文档/.vscode/c_cpp_properties.json +++ b/文档/.vscode/c_cpp_properties.json @@ -1,25 +1,25 @@ -{ - "configurations": [ - { - "name": "Win32", - "compilerArgs": [ - "-fexec-charset=GBK" - ], - "includePath": [ - "${workspaceFolder}/**", - "C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/10.3.0/**", - "C:/TDM-GCC-64/x86_64-w64-mingw32/include/**" - ], - "defines": [ - "_DEBUG", - "UNICODE", - "_UNICODE" - ], - "compilerPath": "C:/TDM-GCC-64/bin/gcc.exe", - "cStandard": "c11", - "cppStandard": "c++17", - "intelliSenseMode": "gcc-x64" - } - ], - "version": 4 +{ + "configurations": [ + { + "name": "Win32", + "compilerArgs": [ + "-fexec-charset=GBK" + ], + "includePath": [ + "${workspaceFolder}/**", + "C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/10.3.0/**", + "C:/TDM-GCC-64/x86_64-w64-mingw32/include/**" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "compilerPath": "C:/TDM-GCC-64/bin/gcc.exe", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-x64" + } + ], + "version": 4 } \ No newline at end of file