Created
November 22, 2012 14:47
-
-
Save zxytim/4131526 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/time.h> | |
#include <cmath> | |
#include <cstdio> | |
typedef unsigned long long time_ms_t; | |
time_ms_t get_time() | |
{ | |
static timeval tv; | |
gettimeofday(&tv, 0); | |
return tv.tv_sec * 1000 + tv.tv_usec * 0.001; | |
} | |
time_ms_t start_time; | |
bool time_up(time_ms_t time_limit) | |
{ | |
return get_time() - start_time > time_limit; | |
} | |
int main() | |
{ | |
int n, m; | |
scanf("%d%d", &n, &m); | |
time_ms_t start_time = get_time(), | |
time_limit = pow(n * m, 1/ 6.0) * 1000 * 0.9; | |
while (get_time() - start_time < time_limit); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment