Revision: 208
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=208&view=rev
Author: Oracle_
Date: 2008-06-03 14:17:32 -0700 (Tue, 03 Jun 2008)
Log Message:
-----------
Added TL coefficient.
Modified Paths:
--------------
ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp
ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h
ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp
Modified: ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp
===================================================================
--- ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp 2008-06-03 16:12:26 UTC (rev 207)
+++ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp 2008-06-03 21:17:32 UTC (rev 208)
@@ -1,5 +1,4 @@
-// TestLibrary.cpp : Defines the exported functions for the DLL application.
-//
+#pragma once
#include "stdafx.h"
#include "TestLibrary.h"
@@ -31,7 +30,7 @@
TESTLIBRARY_API bool CheckTL(int usedtime, int timelimit)
{
- return (usedtime>timelimit);
+ return (usedtime*1.0>(timelimit*TLk+TLx));
}
TESTLIBRARY_API int CheckAnswer(char* input, char* output, char* rightoutput)
Modified: ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h
===================================================================
--- ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h 2008-06-03 16:12:26 UTC (rev 207)
+++ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h 2008-06-03 21:17:32 UTC (rev 208)
@@ -5,6 +5,8 @@
#define TESTLIBRARY_API __declspec(dllimport)
#endif
+double TLx,TLk;
+
TESTLIBRARY_API bool CheckCL(char* src, int cl, char*& details);
TESTLIBRARY_API bool CheckDF(char* src, int lang, char*& details);
TESTLIBRARY_API void FreeChar(char* buf);
Modified: ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp
===================================================================
--- ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp 2008-06-03 16:12:26 UTC (rev 207)
+++ ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp 2008-06-03 21:17:32 UTC (rev 208)
@@ -1,5 +1,8 @@
// dllmain.cpp : Defines the entry point for the DLL application.
+#pragma once
#include "stdafx.h"
+#include <stdio.h>
+extern double TLx,TLk;
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
@@ -8,12 +11,19 @@
{
switch (ul_reason_for_call)
{
- case DLL_PROCESS_ATTACH:
+ case DLL_PROCESS_ATTACH:
+ FILE* f;
+ TLx=0;TLk=1;
+ if (fopen_s(&f,"Times.txt","rt")==0)
+ {
+ fscanf_s(f,"%Lf %Lf",&TLk,&TLx);
+ fclose(f);
+ }
+ break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
-}
-
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|