题目链接
A - Creating a Character#include
using namespace std;
#define ll long long
const int mod=10007;
const int maxn=100010;
/*
c=6 d=1
x+y=c
x+d=y
x=(c-d)/2
*/
int main()
{
int t;scanf("%d",&t);
int cas=1;
while(t--){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(b+1>=a){
c-=(b+1-a);
if(cd){
int x=(c-d+1)/2;//
c=c-x+1;
}else{//
c++;
}
}
printf("%d\n",c);
}
return 0;
}
B - Zmei Gorynich(贪心)
#include
using namespace std;
#define ll long long
const int mod=10007;
const int maxn=100010;
struct node{
int d,h;
}a[maxn];
bool cmp(const node &x,const node &y)
{
return (-x.d+x.h)
关注
打赏
热门博文