前言
由于本人比较菜,只会这十道题,如果哪里写的不对,请在评论区指出,剩下的三道题会尽力去补 比赛连接:https://ac.nowcoder.com/acm/contest/27302
A.大学期末现状(语法) 思路根据输入的成绩,输出相应的字符串即可
代码#include
using namespace std;
#define ll long long
#define mod 1000000009
#define endl "\n"
#define PII pair
ll ksm(ll a,ll b) {
ll ans = 1;
for(;b;b>>=1LL) {
if(b & 1) ans = ans * a % mod;
a = a * a % mod;
}
return ans;
}
ll lowbit(ll x){return -x & x;}
const int N = 2e6+10;
int n,a[N];
int main()
{
int n;
cin>>n;
if(n >= 60) puts("jige,haoye!");
else puts("laoshi,caicai,laolao");
return 0;
}
B.G1024(语法)
思路
我们只需要判断是否有一天火车的位置能全部装下n个人数即可
代码#include
using namespace std;
#define ll long long
#define mod 1000000009
#define endl "\n"
#define PII pair
ll ksm(ll a,ll b) {
ll ans = 1;
for(;b;b>>=1LL) {
if(b & 1) ans = ans * a % mod;
a = a * a % mod;
}
return ans;
}
ll lowbit(ll x){return -x & x;}
const int N = 2e6+10;
int n,k,a[N],b[N];
int main()
{
cin>>n>>k;
int ans = 0;
bool fg = true;
for(int i = 1;i >a[i]>>b[i];
if(b[i]-a[i] >= n && fg) {
ans = i;
fg = false;
}
}
if(fg) puts("G!");
else coutn;
cin>>ch;
int cnt = 0;//计算不需要删除的字符数量
int j = 0;
for(int i = 0;i x>>y;
a[x][y] = true;
}
int t;
cin>>t;
int sx,sy,ex,ey;
for(int i = 0;i >sx>>sy>>ex>>ey;
Ssx[i] = sx;
Ssy[i] = sy;
Eex[i] = ex;
Eey[i] = ey;
a[sx][sy] = a[ex][ey] = true;
}
for(int i = 0;i a[i];
}
for(int i = 1,j;i =mx2)
{
mx2=a[j];
}
ans+=mx2;
}
}
cout>=1LL) {
if(b & 1) ans = ans * a % mod;
a = a * a % mod;
}
return ans;
}
ll lowbit(ll x){return -x & x;}
const int N = 1e7+10;
vector a(N);
ll b[N];
int main()
{
string ch;
cin>>ch;
ll sum = 0;
ll n = ch.size();
for(ll i = 0;i >=1LL) {
if(b & 1) ans = ans * a % mod;
a = a * a % mod;
}
return ans;
}
ll lowbit(ll x){return -x & x;}
const int N = 2e6+10;
ll n,sum;
ll slove(ll x){
ll ans = 0;
for(int i = 1;i * i >n;
for(int i = 1;i >a;
sum+=a;
}
coutch;
cin>>a>>b>>c;
int n = ch.size();
int l = 0,r = 0;
for(int i = 0;i
关注
打赏
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?