神奇的优化方式
Kickstart Round F 2018第一名Benq的参赛代码,光开头几行就把我吓得魂飞魄散。 #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; #define sz(x) (int)(x).size() template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>; void setIn(string s) { freopen(s.c_str(),"r",stdin); } void setOut(string s) { freopen(s.c_str(),"w",stdout); } void io(string s = "") { ios_base::sync_with_stdio(0); cin.tie(0); if (sz(s)) { setIn(s+".in"); setOut(s+".out"); } } int main() { io("A"); // ... } GCC Function Attributes #pragma GCC optimize ("O3") #pragma GCC target ("sse4") Common Function Attributes x86 Function Attributes 指定GCC做O3优化,支持SSE4指令。 ...