The Solutions of Hydro.ac-Undertale2

The Solutions of Hydro.ac-Undertale2


Hydro.ac-Undertale
last Solutions

U1015

#include<bits/stdc++.h>
#include"WATER.h"
using namespace std;
Num ins;
double t1,t2,k;
int main(){
	Give_In();
	ins=GetIn();
	W_D1(ins.k);
	t1=Drink();
	W_D2(ins.k);
	t2=Drink();
	W_D1((t2-((ins.l+ins.r)/2))*(ins.a+ins.e)/2/(t2-t1));
	W_D2((((ins.l+ins.r)/2)-t1)*(ins.a+ins.e)/2/(t2-t1));
	submit();
	return 0;
}

additional file

config.yaml:

checker_type: testlib
checker: spj.cc
user_extra_files:
  -  WATER.h

Water.h

#include<bits/stdc++.h>
#define rand(x,y) (rand()%(y-x+1))+x
namespace Water {
    static bool hasSubmitted = false,hasGiVe_In = false;
    static double TPT = 0;
    static int l,r,x,y,a=1000000,k,e,num=0;
    struct Num{int a,k,l,r,e;}N_U_M;
    Num GetIn(){return N_U_M;}
    void RE() {puts("re");exit(0);}
    void W_D1(int s){if(s+num>a)s=a-num;TPT+=s*x;num+=s;}
    void W_D2(int s){if(s+num>a)s=a-num;TPT+=s*y;num+=s;}
    double Drink(){if(num>=k){double ret=1.0*TPT/num;num-=k;TPT-=1.0*k*ret;return ret;}else return -1.0;}
    void submit(){if(hasSubmitted)RE();if(num<e)puts("Le55");else if(l>TPT/num)puts("Co1d");else if(TPT/num>r)puts("H0t");else if(l<=TPT/num&&TPT/num<=r)puts("Ye5");else puts("ERR");hasSubmitted=1;}
    void Give_In(){if(hasGiVe_In)RE();srand(time(0));l=rand(100,500),r=rand(500,999),x=rand(0,l),y=rand(r,1500),a=1000000,k=rand(100,999),e=rand(100000,500000);hasGiVe_In=1;N_U_M=(Num){a,k,l,r,e};};
}
using Water::RE;using Water::W_D1;using Water::W_D2;using Water::Drink;using Water::GetIn;using Water::submit;using Water::Give_In;using Water::Num;

spj.cc:

#include <bits/stdc++.h>
#include "testlib.h"
using namespace std;
int main(int argc, char* argv[]) {
    registerTestlibCmd(argc, argv);
    string out=ouf.readString();
    if(out=="Ye5")quitf(_ok, "Correct");
    else if(out=="H0t")quitf(_wa,"The Water is too hot.");
    else if(out=="Co1d")quitf(_wa,"The Water is too cold.");
    else if(out=="Le55")quitf(_wa,"The Water is too less.");
    quitf(_wa,"You have done something strangly.");
}

U1016

#include<iostream>
#include<cstdio>
#define maxn 1000005 
using namespace std;
int n;
int a[maxn],vis[maxn],prime[maxn],cnt=0;
int main(){
	for(int i=2;i<maxn;i++){
		if(!vis[i]){
			vis[i]=1;
			a[i]=1;
			prime[++cnt]=i;
		}
		for(int j=i+i;j<maxn;j+=i){
			vis[j]=1;
		}
	}
	while(1){
		scanf("%d",&n);
		if(n==0){
			return 0;
		}
		if(n==1){
			printf("ASGORE DREEMURR is wrong\n");
			continue;
		}
		for(int i=2;i<=n/2+1;i++){
			if(a[i]&&a[n-i]){
				printf("%d = %d + %d\n",n,i,n-i);
				break;
			}
			if(i==n/2+1){
				printf("ASGORE DREEMURR is wrong\n");
			}
		}
	}
	return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
wrf_hydro_arcgis-preprocessor是一个用于WRF-Hydro模型的预处理工具,它集成了WRF(Weather Research and Forecasting)模型和ArcGIS(地理信息系统软件),以便进行水文模拟和分析。 该预处理工具主要用于将大气和水文数据准备为WRF-Hydro模型所需的输入格式。它能够导入地理空间数据,包括高程(DEM)、土地利用、土壤类型等,并将这些数据转换为与WRF-Hydro模型所需的格式相匹配的GIS地图。此外,还可以导入大气数据,如降水、蒸发、风速等,并对其进行处理,以便在水文模拟中使用。 wrf_hydro_arcgis-preprocessor还提供了一些功能来帮助用户进行水文模拟的准备工作。例如,它可以生成网格参数文件,用于定义计算网格的空间分辨率和拓扑关系。它还可以根据用户的需求设置模型的时间和空间范围,并对输入数据进行剪切和插值。 另外,该工具还提供了一些可视化和分析功能,以帮助用户理解和评估模型的输出结果。用户可以使用ArcGIS中的地图工具来查看模拟结果,如地表径流、地下径流、土壤湿度等。此外,还可以通过绘制图表和统计数据来分析模拟结果,以便进行水资源管理和决策制定。 总之,wrf_hydro_arcgis-preprocessor是一个方便实用的工具,它能够帮助用户准备数据并进行水文模拟和分析。它的集成了WRF和ArcGIS的功能,使得用户可以更加便捷地进行水文研究和实践。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值