2334.战斗
input:fight.in output:fight.out
时间限制: 1000 ms 空间限制: 524288 KB
题目描述
输入
输出
样例输入
1234567321 033 2 1 62 0 3 2 1
样例输出
123NONOYES
数据范围限制
代码
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include<bits/stdc++.h>using namespace std;int t,n,a[801];bool flag;bool cmp(int x,int y){ return x>y;}int main(){ freopen("fight.in","r",stdin); freopen("fight.out","w",stdout); scanf("%d& ...
2333.深渊
input:abyss.in output:abyss.out
时间限制: 1000 ms
题目描述
输入
输出
样例输入
125 43 1 2 4 7
样例输出
116
数据范围限制
代码
123456789101112131415161718192021222324#include<bits/stdc++.h>using namespace std;int n,m,v[5001],mod[5001],dp[5001][5001];int main(){ freopen("abyss.in","r",stdin); freopen("abyss.out","w",stdout); memset(dp,-0x3f3f3f,sizeof(dp)); scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) { scanf("%d&quo ...
2324.地图
input:map.in output:map.out
时间限制: 1000 ms 空间限制: 262144 KB
题目描述
输入
输出
样例输入
1242 1 1 2
样例输出
12
数据范围限制
代码
123456789101112131415161718192021222324252627282930313233343536373839404142434445#include<bits/stdc++.h>#define ll long long#define maxn 2010#define mod 998244353using namespace std;ll f[maxn][maxn];int main(){ freopen("map.in", "r", stdin); freopen("map.out", "w", stdout); int n, s1 = 0, s2 = 0; scanf("%d", &n) ...
2322.capacitor
input:capacitor.in output:capacitor.out
时间限制: 1000 ms 空间限制: 262144 KB
题目描述
输入
输出
样例输入1
12321 13 2
样例输入2
12326 5199 200
样例输出1
1213
样例输出2
126200
数据范围限制
代码
12345678910111213141516171819202122232425262728293031323334353637#include<bits/stdc++.h>using namespace std;long long gcd(long long a,long long b){ if(!b) return a; return gcd(b,a%b); }int main(){ freopen("capacitor.in","r",stdin); freopen("capacitor.out","w",stdout) ...
2321.方程
input:cti.in output:cti.out
时间限制: 1000 ms 空间限制: 262144 KB
题目描述
输入
输出
样例输入
123121 1
样例输出
12
数据范围限制
提示
代码
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include<bits/stdc++.h>using namespace std;int n,a[300001],s[300001],b[300001],ans=0,p=1,t;void doit(int q){ for(int i=q;i<=n;i++) { b[i]-=s[i-1]+s[i]; if(b[i]==1) { if(i==n) { p=0 ...
2307.选择
input:choose.in output:choose.out
时间限制: 1000 ms 空间限制: 262144 KB
题目描述
输入
输出
样例输入1
12334 2 33 4 2
样例输入2
123538 19 5 17 315 22 0 6 17
样例输出1
10
样例输出2
11
数据范围限制
提示
【样例解释】样例一:L = 1, R = 3 样例二:L = 2, R = 5
代码
123456789101112131415161718192021222324252627282930313233343536373839404142#include <bits/stdc++.h>#define rr register#define int long longusing namespace std;int n,a[2][300005],c[300005];namespace YOUAREJULUO { int abs(int a) { if(a<0) return -a; ...
2306.迷宫
input:maze.in output:maze.out
时间限制: 1000 ms 空间限制: 524288 KB
题目描述
输入
输出
样例输入
12345678910111232 2S##T2 5SB#####P#T4 7SP.....P#...........#B...##T
样例输出
123-1811
数据范围限制
提示
代码
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192#include <bits/stdc++.h>#define rr registerusing namespace std;int n,m,sx,sy,ex,ey,ans=(1<<30);int mx[4]={1,0,0,-1};int my[4 ...
2304.光芒
input:light.in output:light.out
时间限制: 1000 ms 空间限制: 524288 KB
题目描述
输入
输出
样例输入
1251 1 0 1 1
样例输出
13
数据范围限制
提示
按动 1、4 、5 号开关
代码
123456789101112131415161718192021222324252627282930313233#include <bits/stdc++.h>#define rr registerint n,a[100005],ans;signed main(){ freopen("light.in","r",stdin); freopen("light.out","w",stdout); scanf("%d",&n); for(rr int i=1;i<=n;i++) scanf("%d",&a[i]); for( ...
2303.作业
input:homework.in output:homework.out
时间限制: 1000 ms 空间限制: 262144 KB
题目描述
输入
输出
样例输入
125 103 4 6 100 1
样例输出
160
数据范围限制
提示
代码
123456789101112131415161718192021222324252627#include <bits/stdc++.h>#define int long long#define rr registerint T,n,t[2005],sum[2005],f[2005];int min(int a,int b){ if(a>b) return b; return a;}signed main(){ freopen("homework.in","r",stdin); freopen("homework.out","w",stdout); scanf( ...
2301.线索
input:assassin.in output:assassin.out
时间限制: 1000 ms 空间限制: 262144 KB
题目描述
输入
输出
样例输入1
1233())1 2 1
样例输入2
1234))((1 2 2 3
样例输入3
1233()(1 2 2
样例输出1
11
样例输出2
18
样例输出3
12
数据范围限制
代码
1234567891011121314151617181920212223242526272829303132333435363738394041424344#include<bits/stdc++.h>#define ll long longusing namespace std;priority_queue<int,vector<int>,less<int> >q1;priority_queue<int,vector<int>,greater<int> >q2;ll n,k,k1=1,red,ans;char a[100001];int ...