90分WA了解一下

P1200 [USACO1.1] 你的飞碟在这儿 Your Ride Is Here

@[From](/space/show?uid=129528) 用luoguIDE试试
by Jianuo_Zhu @ 2018-10-19 22:18:51


@[From](/space/show?uid=129528) gets()函数换成scanf()试试
by 情谊、暴走 @ 2018-10-19 22:35:44


@[From](/space/show?uid=129528) 我炸了第一个点
by 情谊、暴走 @ 2018-10-19 22:39:03


@[情谊、暴走](/space/show?uid=115923) 如果直接用scanf不知道长度的话可能直接炸吧
by ____蒟蒻____ @ 2018-10-20 06:53:00


@[From](/space/show?uid=129528) 你不是AC这道题目了吗
by Cola @ 2018-10-20 08:09:28


@[Cola](/space/show?uid=120097) 重新写一遍呀
by ____蒟蒻____ @ 2018-10-20 08:55:41


@[From](/space/show?uid=129528) 看不懂大佬的神仙代码 献上蒟蒻的代码: ```cpp #include <iostream> using namespace std; int main() { string hui , dui ; int sumhui = 1 , sumdui = 1 ; cin >> hui >> dui ; for( int i = 0 ; hui[i] ; i++ ) sumhui = sumhui * ( hui[i] - 64 ) ; for( int i = 0 ; dui[i] ; i++) sumdui = sumdui * ( dui[i] - 64 ) ; if( sumhui % 47 == sumdui % 47 ) cout << "GO" ; else cout << "STAY" ; return 0 ; } ```
by Cola @ 2018-10-20 09:12:36


@[From](/space/show?uid=129528) #include<cstdio> #include<cstring> #include<iostream> char a[6],b[6]; int lena,lenb,a1[6]={1},b1[6]={1},ta=1,tb=1; int main() { scanf("%s",&a); for(int i=0;i<strlen(a);i++)ta=ta*(a[i]-'A'+1)%47; scanf("%s",&b); for(int i=0;i<strlen(b);i++)tb=tb*(b[i]-'A'+1)%47; // for(int i=0;i<6;i++) // ta=ta*a1[i]%47; // for(int i=0;i<6;i++) // tb=tb*b1[i]%47; if(ta==tb) printf("GO"); else printf("STAY"); return 0; }
by 情谊、暴走 @ 2018-10-22 13:16:46


#include<cstdio> #include<cstring> #include<iostream> char a[6],b[6]; int lena,lenb,a1[6]={1},b1[6]={1},ta=1,tb=1; int main() { scanf("%s",&a); for(int i=0;i<strlen(a);i++)ta=ta*(a[i]-'A'+1)%47; scanf("%s",&b); for(int i=0;i<strlen(b);i++)tb=tb*(b[i]-'A'+1)%47; // for(int i=0;i<6;i++) // ta=ta*a1[i]%47; // for(int i=0;i<6;i++) // tb=tb*b1[i]%47; if(ta==tb) printf("GO"); else printf("STAY"); return 0; }
by 情谊、暴走 @ 2018-10-22 13:17:26


|