1 条题解
-
0
C++ :
/* ID: cjh-1143 PROG: ride LANG: C++ */ #include<stdio.h> #include<string.h> int main(){ // freopen("ride.in","r",stdin); // freopen("ride.out","w",stdout); char s1[10], s2[10]; int i, x, t; while(scanf("%s%s", s1, s2) != EOF){ for(x = 1, i = 0; s1[i]; i++) x *= (s1[i]-'A'+1); t = x%47; for(x = 1, i = 0; s2[i]; i++) x *= (s2[i]-'A'+1); if(t == x%47) printf("GO\n"); else printf("STAY\n"); } return 0; } /* ------- test 1 ---- COMETQ HVNGAT ------- test 2 ---- STARAB USACO ------- test 3 ---- EARTH LEFTB ------- test 4 ---- PULSAR VENUS ------- test 5 ---- KANSAS UTAH ------- test 6 ---- APPLE URSA ------- test 7 ---- MSFT MARS ------- test 8 ---- PLUTO BKHOLE ------- test 9 ---- COWSBC RIGHT ------- test 10 ---- DRKMTR SNIKER */
- 1
信息
- ID
- 1197
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者