题解:P11654 「FAOI-R5」becoder

题解:P11654 「FAOI-R5」becoder

题目传送门

题目思路

按题意模拟即可。

  • \(temp\) 记录一组数据的编号,当 \(L \le temp \le R\) 时,输出 System Error 即可;
  • \(M_i > m_i\) 时,输出 Memory Limit Exceeded 即可;
  • \(M_i \le m_i,\left \lfloor \frac{T_i}{2} \right \rfloor > t_i\) 时,输出 Time Limit Exceeded 即可;
  • 如果上述条件都不满足,输出 Accepted 即可。
  • 注意数据范围、输出格式和换行符。

代码实现

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN=1e5+10;
ll n,L,R;
ll T[MAXN],t[MAXN],M[MAXN],m[MAXN];
ll temp;
int main(){
	cin>>n>>L>>R;
	for(int i=1;i<=n;i++){
		cin>>T[i]>>M[i];
	}
	for(int i=1;i<=n;i++){
		cin>>t[i]>>m[i];
		temp=i;
		if(temp>=L&&temp<=R) cout<<"System Error"<<"\n";
		else if(M[i]>m[i]) cout<<"Memory Limit Exceeded"<<"\n";
		else if(M[i]<=m[i]&&floor(T[i]/2)>t[i]) cout<<"Time Limit Exceeded"<<"\n";
		else cout<<"Accepted"<<"\n";
	}
	return 0;
}
posted @ 2025-02-03 16:23  M1_Byte  阅读(13)  评论(0编辑  收藏  举报