P11654 题解
getchar_unlocked · · 题解
题目传送门
思路
模拟题。
首先判断打瞌睡的情况,即 System Error。
其次判断代码空间超限,即 Memory Limit Exceeded。
然后判断时间超限,即 Time Limit Exceeded。
最后只剩下 Accepted 的结果。
AC CODE
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read(){int x=0;char f=1,ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();return x*f;}
const int N=1e5+10;
int T[N],M[N];
signed main(){
int n=read(),l=read(),r=read();
for(int i=1;i<=n;++i)
T[i]=read(),M[i]=read();
for(int i=1;i<=n;++i){
int t=read(),m=read();
if(i>=l&&i<=r)
printf("System Error\n");
else{
int temp=T[i]/2;
if(M[i]>m)
printf("Memory Limit Exceeded\n");
else if(temp>t)
printf("Time Limit Exceeded\n");
else printf("Accepted\n");
}
}
return 0;
}