倒计时27,26天

A-S 老师的公式_牛客挑战赛73 (nowcoder.com)

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=2e8+6;
const int inf=0x3f3f3f3f;
int dir1[8][2]={{0,1},{0,-1},{-1,0},{1,0},{1,1},{-1,-1},{1,-1},{-1,1}};
int dir2[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
int dp[N];
//round(a)
//int a=strtoll(s.c_str(),NULL,10);
void solve()
{
    int n;cin>>n;
    int cn=n*(n+1)/2,hhh=1;
    for(int i=1;i<=n;i++)
    {
        int r=__gcd(cn,i);
        cn/=r,hhh*=r;
    }
    cout<<hhh;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}

2.B-S 老师的签到_牛客挑战赛73 (nowcoder.com)

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=2e3+6;
const int inf=0x3f3f3f3f;
int dir1[8][2]={{0,1},{0,-1},{-1,0},{1,0},{1,1},{-1,-1},{1,-1},{-1,1}};
int dir2[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
int dp[N];
string s[N];
//round(a)
//int a=strtoll(s.c_str(),NULL,10);
void solve()
{
    int n,m;cin>>n>>m;
    char c;string s[N];
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            cin>>c;
            if(i==1)s[j]=s[j-1]+c;
            else if(j==1)s[j]=s[j]+c;
            else s[j]=min(s[j],s[j-1])+c;
        }
    }
    cout<<s[m];
}
signed main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(0),cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}

3.L1-035 情人节 - 2024团体程序设计天梯赛(历年真题)练习集 (pintia.cn)

//printf输出时要注意:string类型printf输出要在之后加.c_str();

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=2e5+6;
const int inf=0x3f3f3f3f; 
map<int,string>mp;
void solve()
{
	string s;
    int cn=0;
    mp[2]="0",mp[14]="0";
    while(cin>>s&&s!=".")
    {
        cn++;
        mp[cn]=s;
    }
    if(mp[2]!="0"&&mp[14]!="0")
    {
        printf("%s and %s are inviting you to dinner...",mp[2].c_str(),mp[14].c_str());
    }
    else if(mp[2]!="0")
    {
        printf("%s is the only one for you...",mp[2].c_str());
    }
    else printf("Momo... No one is for you ...");
}
signed main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(nullptr),cout.tie(nullptr);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=2e5+6;
const int inf=0x3f3f3f3f; 
void solve()
{
	string s;cin>>s;
	int a=strtoll(s.c_str(),NULL,10);
	double aa=3.555;
	cout<<round(aa*100.0)/100.0<<endl<<a<<endl;
	printf("%s",s.c_str());
}
signed main()
{
	ios_base::sync_with_stdio(false);
	//cin.tie(nullptr),cout.tie(nullptr);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}
  • 18
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值