通用版1.N - Bullseye

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

double f(double x)
{
    if(x<=9)return 100;
    if(x<=36)return 80;
    if(x<=81)return 60;
    if(x<=144)return 40;
    if(x<=225)return 20;
    return 0;
}
int main()
{
    int i;
    double x[8],y[8],r[8];
    while(1){
        for(i=1;i<=6;i++){
            scanf("%lf%lf",&x[i],&y[i]);
            r[i]=pow(x[i],2)+pow(y[i],2);
        }
        if(x[1]==-100)break;
        double a=0,b=0;
        for(i=1;i<=3;i++){
            a+=f(r[i]);
        }
        for(i=4;i<=6;i++){
            b+=f(r[i]);
        }
        printf("SCORE: %.0lf to %.0lf, ",a,b);
        if(a==b){
            printf("TIE.\n");
        }else if(a>b)
        {
            printf("PLAYER 1 WINS.\n");
        }else
        {
            printf("PLAYER 2 WINS.\n");
        }
    }
    return 0;
}

读题,读题,读题!

刚开始没怎么看题就开始写,看着图瞎想,折腾了好一会,要是直接读题就不会写的这么慢了quq

这里有一个地方要提,就是计算时,可以将r^2和k^2(k=3,6,9,12,15)直接比较,不用开方,可以简化运算,提高精确度

sudo apt install docker.io 将要安装: docker.io 将要安装的依赖: containerd criu docker-buildx docker-cli libcompel1 libintl-perl libintl-xs-perl libmodule-find-perl libproc-processtable-perl libsort-naturally-perl needrestart python3-pycriu runc tini 建议安装: containernetworking-plugins docker-doc aufs-tools btrfs-progs cgroupfs-mount debootstrap rinse rootlesskit xfsprogs zfs-fuse | zfsutils-linux 摘要: 升级:0,安装:15,卸载:0,不升级:1068 下载大小:81.4 MB 所需的空间:335 MB / 63.8 GB 可用 是否继续? [Y/n] y 错误:1 http://http.kali.org/kali kali-rolling/main amd64 runc amd64 1.1.15+ds1-2+b2 404 Not Found [IP: 54.39.128.230 80] 错误:2 http://http.kali.org/kali kali-rolling/main amd64 containerd amd64 1.7.24~ds1-5 404 Not Found [IP: 54.39.128.230 80] 错误:4 http://http.kali.org/kali kali-rolling/main amd64 docker.io amd64 26.1.5+dfsg1-9+b2 404 Not Found [IP: 54.39.128.230 80] 错误:8 http://http.kali.org/kali kali-rolling/main amd64 docker-cli amd64 26.1.5+dfsg1-9+b2 404 Not Found [IP: 54.39.128.230 80] 错误:14 http://http.kali.org/kali kali-rolling/main amd64 needrestart all 3.10-1 404 Not Found [IP: 54.39.128.230 80] 获取:10 http://mirror.keiminem.com/kali kali-rolling/main amd64 libintl-xs-perl amd64 1.35-1 [15.3 kB] 获取:15 http://mirror.hemino.net/kali kali-rolling/main amd64 python3-pycriu all 4.1-1 [43.7 kB] 获取:3 http://mirrors.ustc.edu.cn/kali kali-rolling/main amd64 tini amd64 0.19.0-1 [255 kB] 获取:5 http://kali.download/kali kali-rolling/main amd64 libcompel1 amd64 4.1-1 [64.0 kB] 获取:7 http://http.kali.org/kali kali-rolling/main amd64 docker-buildx amd64 0.13.1+ds1-3 [13.2 MB] 获取:6 http://mirrors.ustc.edu.cn/kali kali-rolling/main amd64 criu amd64 4.1-1 [560 kB] 忽略:7 http://http.kali.org/kali kali-rolling/main amd64 docker-buildx amd64 0.13.1+ds1-3 获取:9 http://kali.download/kali kali-rolling/main amd64 libintl-perl all 1.35-1 [690 kB] 获取:11 http://kali.download/kali kali-rolling/main amd64 libmodule-find-perl all 0.17-1 [10.7 kB] 获取:12 http://http.kali.org/kali kali-rolling/main amd64 libproc-processtable-perl amd64 0.636-1+b3 [42.3 kB] 获取:13 http://kali.download/kali kali-rolling/main amd64 libsort-naturally-perl all 1.03-4 [13.1 kB] 获取:7 http://http.kali.org/kali kali-rolling/main amd64 docker-buildx amd64 0.13.1+ds1-3 [13.2 MB] 已下载 14.1 MB,耗时 21秒 (681 kB/s) 错误: 无法下载 http://http.kali.org/kali/pool/main/r/runc/runc_1.1.15%2bds1-2%2bb2_amd64.deb 404 Not Found [IP: 54.39.128.230 80] 错误: 无法下载 http://http.kali.org/kali/pool/main/c/containerd/containerd_1.7.24%7eds1-5_amd64.deb 404 Not Found [IP: 54.39.128.230 80] 错误: 无法下载 http://http.kali.org/kali/pool/main/d/docker.io/docker.io_26.1.5%2bdfsg1-9%2bb2_amd64.deb 404 Not Found [IP: 54.39.128.230 80] 错误: 无法下载 http://http.kali.org/kali/pool/main/d/docker.io/docker-cli_26.1.5%2bdfsg1-9%2bb2_amd64.deb 404 Not Found [IP: 54.39.128.230 80] 错误: 无法下载 http://http.kali.org/kali/pool/main/n/needrestart/needrestart_3.10-1_all.deb 404 Not Found [IP: 54.39.128.230 80] 错误: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?
06-20
PS D:\PycharmProjects> pip3 install hanlp Collecting hanlp Using cached hanlp-2.1.1-py3-none-any.whl.metadata (13 kB) Collecting hanlp-common>=0.0.23 (from hanlp) Using cached hanlp_common-0.0.23.tar.gz (28 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: hanlp-downloader in d:\python\lib\site-packages (from hanlp) (0.0.25) Collecting hanlp-trie>=0.0.4 (from hanlp) Using cached hanlp_trie-0.0.5.tar.gz (6.7 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pynvml (from hanlp) Using cached pynvml-12.0.0-py3-none-any.whl.metadata (5.4 kB) Collecting sentencepiece>=0.1.91 (from hanlp) Using cached sentencepiece-0.2.0.tar.gz (2.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [48 lines of output] Traceback (most recent call last): File "D:\python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() ~~~~^^ File "D:\python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\qhdata\AppData\Local\Temp\pip-build-env-2ypwjtzl\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\qhdata\AppData\Local\Temp\pip-build-env-2ypwjtzl\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\qhdata\AppData\Local\Temp\pip-build-env-2ypwjtzl\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\qhdata\AppData\Local\Temp\pip-build-env-2ypwjtzl\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 128, in <module> File "D:\python\Lib\subprocess.py", line 414, in check_call retcode = call(*popenargs, **kwargs) File "D:\python\Lib\subprocess.py", line 395, in call with Popen(*popenargs, **kwargs) as p: ~~~~~^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\subprocess.py", line 1039, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pass_fds, cwd, env, ^^^^^^^^^^^^^^^^^^^ ...<5 lines>... gid, gids, uid, umask, ^^^^^^^^^^^^^^^^^^^^^^ start_new_session, process_group) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\subprocess.py", line 1554, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ # no special security ^^^^^^^^^^^^^^^^^^^^^ ...<4 lines>... cwd, ^^^^ startupinfo) ^^^^^^^^^^^^ FileNotFoundError: [WinError 2] 系统找不到指定的文件。 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
07-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值