#256

by Zzzyt

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

962 ms / 257052 KB
Final 285
Problem: fun21.density
Language: GNU C++ 11


#1

950ms / 8904KB / Point
Input
8
Output

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

#2

952ms / 10592KB / Point
Input
16
Output

												
Answer
1
Checker Information
25 Rank: SSS, Score 25. Density=11.00. Delta=5.00

#3

951ms / 25832KB / Point
Input
32
Output

												
Answer
1
Checker Information
25 Rank: SSS, Score 25. Density=27.00. Delta=5.00

#4

955ms / 117032KB / Point
Input
128
Output

												
Answer
1
Checker Information
25 Rank: SSS, Score 25. Density=122.00. Delta=6.00

#5

957ms / 216748KB / Point
Input
233
Output

												
Answer
1
Checker Information
25 Rank: SSS, Score 25. Density=226.00. Delta=7.00

#6

960ms / 244332KB / Point
Input
262
Output

												
Answer
1
Checker Information
25 Rank: SSS, Score 25. Density=254.00. Delta=8.00

#7

962ms / 244384KB / Point
Input
262.144
Output

												
Answer
1
Checker Information
25 Rank: SSS, Score 25. Density=253.00. Delta=9.14

#8

399ms / 256924KB / Point
Input
666.66
Output

												
Answer
1
Checker Information
10 Rank: S, Score 10. Density=642.00. Delta=24.66

#9

263ms / 256936KB / Point
Input
1024.996
Output

												
Answer
1
Checker Information
8 Rank: A, Score 8. Density=973.00. Delta=52.00

#10

199ms / 256996KB / Point
Input
1888.88
Output

												
Answer
1
Checker Information
4 Rank: C, Score 4. Density=1284.00. Delta=604.88

#11

187ms / 256968KB / Point
Input
2048
Output

												
Answer
1
Checker Information
4 Rank: C, Score 4. Density=1366.00. Delta=682.00

#12

210ms / 257052KB / Point
Input
4096
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1218.00. Delta=2878.00

#13

303ms / 257012KB / Point
Input
10000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=845.00. Delta=9155.00

#14

241ms / 256972KB / Point
Input
12345
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1061.00. Delta=11284.00

#15

241ms / 256976KB / Point
Input
20000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1061.00. Delta=18939.00

#16

230ms / 256980KB / Point
Input
100000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1112.00. Delta=98888.00

#17

183ms / 256936KB / Point
Input
114514
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1396.00. Delta=113118.00

#18

183ms / 256968KB / Point
Input
191981.0
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1396.00. Delta=190585.00

#19

196ms / 257052KB / Point
Input
200000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1304.00. Delta=198696.00

#20

194ms / 256968KB / Point
Input
262000
Output

												
Answer
1
Checker Information
1 Rank: D, Score 1. Density=1317.00. Delta=260683.00
/*
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 - 2000;
    if (target < 0)
        return;
    while (--target) {
        malloc(4100);
    }
}

int main(int argc, char *argv[]) {
    cin.tie(0);
    //freopen(".in", "r", stdin);
#ifndef ZZZYT
    //freopen(".out", "w", stdout);
#endif
    double d;
    cin >> d;
    double t = 261550 / d;
    if (t > 950) {
        t = 950;
        double m = 950 * d;
        getmem(m);
    } else {
        getmem(261550);
    }

    while ((clock() + 0.0) / CLOCKS_PER_SEC * 1000 < t + 1) {
    }
    return 0;
}
Main.cpp: In function ‘void getmem(double)’:
Main.cpp:92:15: warning: ignoring return value of ‘void* malloc(size_t)’, declared with attribute warn_unused_result [-Wunused-result]
         malloc(4100);
         ~~~~~~^~~~~~