#281

by ‮yeknom

Submitted 3 years 6 months 1 day ago
Sun Apr 25 11:38:03 CST 2021
Judger: judger1
Dataset Version: v1

952 ms / 261612 KB
Final 742
Problem: fun21.density
Language: GNU C++ 11


#1

949ms / 8828KB / Point
Input
8
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=9.00. Delta=1.00

#2

949ms / 15216KB / Point
Input
16
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=16.00. Delta=0.00

#3

949ms / 30300KB / Point
Input
32
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=31.00. Delta=1.00

#4

952ms / 121656KB / Point
Input
128
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=127.00. Delta=1.00

#5

947ms / 221324KB / Point
Input
233
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=233.00. Delta=0.00

#6

950ms / 248900KB / Point
Input
262
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=261.00. Delta=1.00

#7

947ms / 249100KB / Point
Input
262.144
Output

												
Answer
1
Checker Information
100 Rank: BULLSEYE, Score 100. Density=262.00. Delta=0.14

#8

398ms / 261476KB / Point
Input
666.66
Output

												
Answer
1
Checker Information
20 Rank: SS, Score 20. Density=655.00. Delta=11.66

#9

262ms / 261612KB / Point
Input
1024.996
Output

												
Answer
1
Checker Information
8 Rank: A, Score 8. Density=994.00. Delta=31.00

#10

1ms / 8788KB / Point
Input
1888.88
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=4394.00. Delta=2505.12

#11

2ms / 8732KB / Point
Input
2048
Output

												
Answer
1
Checker Information
4 Rank: C, Score 4. Density=2910.00. Delta=862.00

#12

2ms / 8836KB / Point
Input
4096
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=2945.00. Delta=1151.00

#13

3ms / 8724KB / Point
Input
10000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=2181.00. Delta=7819.00

#14

3ms / 8800KB / Point
Input
12345
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=2200.00. Delta=10145.00

#15

1ms / 8832KB / Point
Input
20000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=4416.00. Delta=15584.00

#16

1ms / 8904KB / Point
Input
100000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=4452.00. Delta=95548.00

#17

1ms / 8780KB / Point
Input
114514
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=4390.00. Delta=110124.00

#18

3ms / 8796KB / Point
Input
191981.0
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=2199.00. Delta=189782.00

#19

3ms / 8836KB / Point
Input
200000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=2209.00. Delta=197791.00

#20

3ms / 8876KB / Point
Input
262000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=2219.00. Delta=259781.00
//Original Code:
///*
//Code by Zzzyt
//
//Problem: [2021 Fun]Density o' bullseye (HHSOJ fun21.density)
//Algorithm: 
//Status: 
//Date: 20210424
//Version: 1
//*/
//
//#include <algorithm>
//#include <deque>
//#include <iostream>
//#include <map>
//#include <math.h>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include <string>
//#include <time.h>
//#include <utility>
//#include <vector>
//// #include <chrono>
//// #include <random>
//
//using namespace std;
//
//#define popc(x) __builtin_popcount(x)
//#define over(x)        \
//    {                  \
//        printf(x);     \
//        putchar('\n'); \
//        exit(0);       \
//    }
//#define all(x) x.begin(), x.end()
//#define ceil(a, b) ((a - 1) / b + 1)
//#define srand() srand(time(0))
//#define srandx() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
//#define randx(l, r) uniform_int_distribution<int>(l, r)(rng)
//#define pii pair<int, int>
//#define nosync ios::sync_with_stdio(0)
//#define pb push_back
//typedef long long ll;
//typedef unsigned long long ull;
//
//inline int fread() {
//    char ch = getchar();
//    int x = 0, f = 1;
//    while (ch < '0' || ch > '9') {
//        if (ch == '-')
//            f = -1;
//        ch = getchar();
//    }
//    while (ch >= '0' && ch <= '9') {
//        x = x * 10 + ch - '0';
//        ch = getchar();
//    }
//    return x * f;
//}
//
//template <typename T1, typename T2>
//ostream &operator<<(ostream &os, const pair<T1, T2> &ptt) {
//    os << "(" << ptt.first << ", " << ptt.second << ")";
//    return os;
//}
//
//template <typename T>
//ostream &operator<<(ostream &os, const vector<T> &vt) {
//    os << "{";
//    for (int i = 0; i < vt.size() - 1; i++) {
//        os << vt[i] << ", ";
//    }
//    os << vt[vt.size() - 1] << "}";
//    return os;
//}
//
///* -------- End of Template -------- */
//
//#define INF 1000000007
//
//#pragma GCC optimize("O0")
//
//void getmem(double KB) {
//    int target = KB / 4 - 862;
//    if (target < 0)
//        return;
//    while (--target) {
//        malloc(4096);
//    }
//}
//
//int main(int argc, char *argv[]) {
//    //freopen(".in", "r", stdin);
//#ifndef ZZZYT
//    //freopen(".out", "w", stdout);
//#endif
//    double d;
//    cin >> d;
//	if(d>=1500) return 0;
//    double t = 261550 / d;
//    if (t > 950) {
//        t = 950;
//        double m = 950 * d;
//        getmem(m);
//    } else {
//        getmem(261550);
//    }
//    int target = t - 1;
//    if (d > 200 && d < 300) {
//        target -= 9;
//    }
//    while (clock() / 1000 < target) {
//    }
//    return 0;
//}

//substituted with C++ Inliner
/*
Code by Zzzyt

Problem: [2021 Fun]Density o' bullseye (HHSOJ fun21.density)
Algorithm: 
Status: 
Date: 20210424
Version: 1
*/

#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
// #include <chrono>
// #include <random>

using namespace std;

#define popc(x) __builtin_popcount(x)
#define over(x)        \
    {                  \
        printf(x);     \
        putchar('\n'); \
        exit(0);       \
    }
#define all(x) x.begin(), x.end()
#define ceil(a, b) ((a - 1) / b + 1)
#define srand() srand(time(0))
#define srandx() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define randx(l, r) uniform_int_distribution<int>(l, r)(rng)
#define pii pair<int, int>
#define nosync ios::sync_with_stdio(0)
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;

inline int fread() {
    char ch = getchar();
    int x = 0, f = 1;
    while (ch < '0' || ch > '9') {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &ptt) {
    os << "(" << ptt.first << ", " << ptt.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vt) {
    os << "{";
    for (int i = 0; i < vt.size() - 1; i++) {
        os << vt[i] << ", ";
    }
    os << vt[vt.size() - 1] << "}";
    return os;
}

/* -------- End of Template -------- */

#define INF 1000000007

#pragma GCC optimize("O0")

void getmem(double KB) {
    int target = KB / 4 - 862;
    if (target < 0)
        return;
    while (--target) {
        malloc(4096);
    }
}

int main(int argc, char *argv[]) {
    //freopen(".in", "r", stdin);
#ifndef ZZZYT
    //freopen(".out", "w", stdout);
#endif
    double d;
    cin >> d;
	if(d>=1500) return 0;
    double t = 261550 / d;
    if (t > 950) {
        t = 950;
        double m = 950 * d;
        getmem(m);
    } else {
        getmem(261550);
    }
    int target = t - 1;
    if (d > 200 && d < 300) {
        target -= 9;
    }
    while (clock() / 1000 < target) {
    }
    return 0;
}
Main.cpp: In function ‘void getmem(double)’:
Main.cpp:214:15: warning: ignoring return value of ‘void* malloc(size_t)’, declared with attribute warn_unused_result [-Wunused-result]
         malloc(4096);
         ~~~~~~^~~~~~