0
点赞
收藏
分享

微信扫一扫

1e7神机

拾杨梅记 2022-01-09 阅读 69
c语言

题目描述

一般来说1000ms的时间限制能跑1e8(100000000)次循环,像codeforcesnowcoder这些网站的的测评机有时候能跑到1e9,而zzulioj的测评机只能跑1e7,现在给你程序的最大循环次数和测评网站,你知道这个代码能通过测评吗? 网站能通过测评的代码时输出 "Accepted" ,不能通过输出 "Time Limit Exceeded,结果未知输出"no response"。codeforces,nowcoder,zzulioj 只有这三个网站的测评机速度已知。 

(最大循环次数都是以 "1ex"(0=<x<=1e9)的形式给出)  

输入

一行两个字符串:s1测评网站,s2最大循环次数。 

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#define N 100000
int main()
{
   char s1[N],s2[N];
   int len;
   scanf("%s%s",s1,s2);
   if(strcmp(s1,"codeforces")==0||strcmp(s1,"nowcoder")==0)
   {
       len=strlen(s2);
       if(len>3)
           printf("Time Limit Exceeded\n");
       else
       {
           if(strcmp(s2,"1e9")<=0)
               printf("Accepted\n");
           else
               printf("Time Limit Exceeded\n");
       }
   }
   else if(strcmp(s1,"zzulioj")==0)
   {
       len=strlen(s2);
       if(len>3)
           printf("Time Limit Exceeded\n");
       else
       {
           if(strcmp(s2,"1e7")<=0)
               printf("Accepted\n");
           else
               printf("Time Limit Exceeded\n");
       }
   }
   else
    printf("no response\n");
   return 0;
}

s2字符串的长度 <= 10。 

输出

一个字符串。  

样例输入 

codeforces 1e9

样例输出 Copy

Accepted

提示

输入 zzuoj 1e9 
输出 no response 

举报

相关推荐

0 条评论