设为首页 加入收藏

TOP

The 12th Zhejiang Provincial Collegiate Programming Contest(部分)(二)
2015-11-21 01:03:50 来源: 作者: 【 】 浏览:13
Tags:The 12th Zhejiang Provincial Collegiate Programming Contest (部分
Input
2
1 3 2
Fresh_Cucumber 4
Chow_Mein 5
Rice_Served_with_Duck_Leg 12
Fried_Vermicelli 7
Steamed_Dumpling 3
Steamed_Stuffed_Bun 4
2 3 1
Stir-fried_Loofah_with_Dried_Bamboo_Shoot 33
West_Lake_Water_Shield_Soup 36
DongPo's_Braised_Pork 54
West_Lake_Fish_in_Vinegar 48
Longjing_Shrimp 188
DongPo's_Crisp 18

Sample Output

15 Fresh_Cucumber Fried_Vermicelli Steamed_Stuffed_Bun
108 West_Lake_Water_Shield_Soup DongPo's_Braised_Pork DongPo's_Crisp





#include
  
   
#include
   
     #include
    
      #include
     
       #include
      
        using namespace std; struct node { int ans; char str[110]; } q[10010]; int cmp(const void *a,const void *b) { struct node *aa,*bb; aa = (struct node*)a; bb = (struct node*)b; return aa->ans - bb->ans; } int main() { int T; scanf("%d",&T); while(T--) { int x,y,z; int sum = 0; scanf("%d%d%d",&x,&y,&z); for(int i=0; i
       
        

?

?

?

?

?

H May Day Holiday

Time Limit: 2 Seconds Memory Limit: 65536 KB

?

As a university advocating self-learning and work-rest balance, Marjar University has so many days of rest, including holidays and weekends. Each weekend, which consists of Saturday and Sunday, is a rest time in the Marjar University.

The May Day, also known as International Workers' Day or International Labour Day, falls on May 1st. In Marjar University, the May Day holiday is a five-day vacation from May 1st to May 5th. Due to Saturday or Sunday may be adjacent to the May Day holiday, the continuous vacation may be as long as nine days in reality. For example, the May Day in 2015 is Friday so the continuous vacation is only 5 days (May 1st to May 5th). And the May Day in 2016 is Sunday so the continuous vacation is 6 days (April 30th to May 5th). In 2017, the May Day is Monday so the vacation is 9 days (April 29th to May 7th). How excited!

Edward, the headmaster of Marjar University, is very curious how long is the continuous vacation containing May Day in different years. Can you help him?

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case, there is an integer y (1928 <= y <= 9999) in one line, indicating the year of Edward's query.

Output

For each case, print the number of days of the continuous vacation in that year.

Sample Input

3
2015
2016
2017

Output

5
6
9


?

?

?

#include
         
          
#include
          
            #include
           
             #include
            
              using namespace std; int a[10001]; void Init() { int i,h; h=3; a[2018]=2; for(i=1929;i<=10000;i++) { if((i%4==0&&i%100!=0)||i%400==0) { h++; a[i]=h%7; } a[i]=h%7; h++; } } int main() { Init(); int n; int T; scanf("%d",&T); while(T--) { scanf("%d",&n); if(a[n]==1) { printf("%d\n",9); } else if(a[n]==2) { printf("%d\n",6); } else if(a[n]==3) { printf("%d\n",5); } else if(a[n]==4) { printf("%d\n",5); } else if(a[n]==5) { printf("%d\n",5); } else if(a[n]==6) { printf("%d\n",5); } else if(a[n]==0) { printf("%d\n",6); } } return 0; } 
            
           
          
         


?

?

?

?

?

J Convert QWERTY to Dvorak

Time Limit: 2 Seconds Memory Limit: 65536 KB

?

Edward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a broken Caps Lock key, so Edward never presses the broken Caps Lock key. Luckily, all the other keys on the QWERTY keyboard work well. Every day, he has a lot of documents to type. Thus he needs a converter to translate QWERTY into Dvorak. Can you help him?

The QWERTY Layout and the Dvorak Layout are in the following:

Qwerty Layout
The QWERTY Layout

DvZ??http://www.2cto.com/kf/ware/vc/vcmFrIExheW91dA==" src="https://www.cppentry.com/upload_files/article/49/1_at8a0__.png" />
The Dvorak Layout

Input

A QWERTY document Edward typed. The document has no more than 100 kibibytes. And there are no invalid characters in the document.

Output

The Dvorak document.

Sample Input

Jgw Gqm Andpw a H.soav Patsfk f;doe
Nfk Gq.d slpt a X,dokt vdtnsaohe
Kjd yspps,glu pgld; aod yso kd;kgluZ
1234567890
`~!@#$%^&*()}"']_+-=ZQqWEwe{[\|
ANIHDYf.,bt/
ABCDEFuvwxyz

Sample Output

Hi, I'm Abel, a Dvorak Layout user.
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇算法学习 - 动态规划(DP问题)(C++) 下一篇C++ 的 const和const_cast

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: