10
4
2018
1

[UOJ15] 【NOIP2014】生活大爆炸版石头剪刀布

练一下python

以下代码在python2.7编译通过

这个题直接做,循环就可以了

win=[[1, 0, 2, 2, 0], [2, 1, 0, 2, 0], [0, 2, 1, 0, 2], [0, 0, 2, 1, 2], [2, 2, 0, 0, 1]]
xiaoa=[]; xiaob=[]; wina=0; winb=0
n, na, nb=map(int, raw_input().split())
#print n, na, nb
p=raw_input().split()
for i in range(0, na):
    xiaoa.append(int(p[i]))
p=raw_input().split()
for i in range(0, nb):
    xiaob.append(int(p[i]))
for i in range(0, n):
    px=win[int(xiaoa[i%na])][int(xiaob[i%nb])]
    if px==0:
        winb+=1
    elif px==2:
        wina+=1
print wina, winb
Category: 其他OJ | Tags: uoj | Read Count: 1030
JAC 11th Model Paper 说:
Aug 22, 2022 03:31:34 AM

The Jharkhand Academic Council was established by the Jharkhand State Legislature and given the state governor's approval on the Formatted, the day the State of Jharkhand was created. They can check their JAC Important Question Paper 2023 of 11th class from the main web portal site, and we also maintain the direct link to check Jharkhand 1st Inter Important Question Paper 2023 with ease. JAC 11th Model Paper 2023 It was established for holding and organising a variety of examinations, including those at the conclusion of Intermediate, Secondary Education, Education, and Madrasa Education. The JAC 11th Class Important Question Paper 2023 is provided here. Please follow the instructions provided below to view Jharkhand 1st Inter 11th Class Important Question Paper 2023 for students.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com