NOIP模拟(20171026)T1 抄代码
2017-10-26 15:55
337 查看
题意——我不知道,我不知道,我不知道
反正判判就行了
怎么判?不知道不知道不知道……
反正判判就行了
怎么判?不知道不知道不知道……
#include<bits/stdc++.h> using namespace std; inline int getint(){ int x=0,p=1; char c=getchar(); while(!isdigit(c)){ if(c=='-')p=-1; c=getchar(); } while(isdigit(c)){ x=(x<<3)+(x<<1)+(c^'0'); c=getchar(); } return x*p; } inline void putint(long long x){ if(x<0){ x=-x; putchar('-'); } static int buf[30]; int tot=0; do{ buf[tot++]=x%10; x/=10; }while(x); while(tot)putchar(buf[--tot]+'0'); } string s1,s2; char c[30]; inline bool work(){ c055 memset(c,0,sizeof(c)); getline(cin,s1),getline(cin,s2); int l1=s1.length(),l2=s2.length(); if(s1==s2)return true; if(l1!=l2)return false; for(int i=0;i<l1;++i){ if(s1[i]!=s2[i]){ if(s1[i]>'z'||s1[i]<'a')return false; if(s2[i]>'z'||s2[i]<'a')return false; } if(s1[i]>'z'||s1[i]<'a')continue; if(c[s1[i]-'a']){ if(c[s1[i]-'a']!=s2[i])return false; } else{ c[s1[i]-'a']=s2[i]; } } for(int i=0;i<26;++i){ if(!c[i])return true; } int tot[30]; memset(tot,0,sizeof(tot)); for(int i=0;i<26;++i){ ++tot[c[i]-'a']; } for(int i=0;i<26;++i){ if(tot[i]!=1)return true; } return false; } int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string s; getline(cin,s); int t=0; for(int i=0;i<s.length();++i){ if(!isdigit(s[i]))continue; t=(t<<1)+(t<<3)+(s[i]^'0'); } while(t--){ cout<<work()<<endl; } return 0; }
相关文章推荐
- NOIP模拟(10.26)T1 抄代码
- NOIP模拟(20171026)T2 做运动
- NOIP模拟(20171102)T1 活动安排
- NOIP模拟(10.22)T1 姓名匹配
- NOIP模拟(11.07)T1 数列求和
- NOIP模拟(11.02)T1 活动安排
- NOIP模拟(20171030)T1 比赛
- [NOIP模拟](二)T1-操作
- NOIP模拟(20171023)T1 fibonacci
- 生成代码从T到T1、T2、Tn自动生成多个类型的泛型实例代码
- NOIP模拟(20171031)T1 机器清洁工
- NOIP模拟(10.27)T1 寿司
- NOIP模拟(11.03)T1 区间
- 代码详解の使用CountDownLatch解决面试问题:T1和T2线程执行计算,T3线程计算结果的统计
- NOIP模拟(10.30)T1 比赛
- NOIP模拟(11.06)T1 数集
- [NOIP模拟](三)T1-太空电梯
- NOIP模拟(10.23)T1 Fibonacci
- StreamDown中的CTreeCtrl控件处理代码
- 写最好的代码