Diff
Not logged in

Differences From Artifact [8b7e23cf8b869fd6]:

To Artifact [75232ad7ad58abcb]:


1 //----------------------------------------------------------------------------- 1 //----------------------------------------------------------------------------- 2 // >>Code Template<< (for Visual C++) | 2 // >>Code Template<< (for Visual C++ 11) 3 3 4 #include <iostream> 4 #include <iostream> 5 #include <sstream> 5 #include <sstream> 6 #include <iomanip> 6 #include <iomanip> 7 #include <string> < 8 #include <vector> 7 #include <vector> 9 #include <set> | 8 #include <string> 10 #include <map> 9 #include <map> > 10 #include <set> 11 #include <algorithm> 11 #include <algorithm> 12 #include <numeric> 12 #include <numeric> 13 #include <iterator> 13 #include <iterator> 14 #include <complex> < 15 #include <functional> 14 #include <functional> > 15 #include <complex> 16 #include <queue> 16 #include <queue> 17 #include <stack> 17 #include <stack> 18 #include <cmath> 18 #include <cmath> 19 #include <cassert> 19 #include <cassert> 20 #include <cstring> 20 #include <cstring> 21 #define cout os | 21 #include <tuple> 22 using namespace std; 22 using namespace std; 23 typedef long long LL; 23 typedef long long LL; 24 typedef complex<double> CMP; 24 typedef complex<double> CMP; 25 void END_OF_INPUT_FOR_THIS_TEST_CASE(); // stub for multi-threading 25 void END_OF_INPUT_FOR_THIS_TEST_CASE(); // stub for multi-threading 26 26 27 //----------------------------------------------------------------------------- 27 //----------------------------------------------------------------------------- 28 // >>Main<< 28 // >>Main<< ................................................................................................................................................................................ 36 // >>Code Template<< (Multi-Thread Solver) 36 // >>Code Template<< (Multi-Thread Solver) 37 37 38 #if 1 38 #if 1 39 #undef cout 39 #undef cout 40 #include <windows.h> 40 #include <windows.h> 41 #include <process.h> 41 #include <process.h> 42 42 43 static const int THREAD_NUM = 2; | 43 static const int THREAD_NUM = 4; 44 volatile int g_id; 44 volatile int g_id; 45 int g_nCase; 45 int g_nCase; 46 CRITICAL_SECTION g_cs; 46 CRITICAL_SECTION g_cs; 47 vector<string> g_output; 47 vector<string> g_output; 48 48 49 unsigned __stdcall thread_main( void* t_id ) { 49 unsigned __stdcall thread_main( void* t_id ) { 50 for(;;) { 50 for(;;) {