7 solutions

  • 0
    @ 2024-7-5 15:11:01
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a,b;
        cin>>a>>b;
        cout<<a+b;
        return 0;
    }
    
    • 0
      @ 2024-7-3 16:27:59
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a,b;
          cin>>a>>b;
          cout<<a+b;
          return 0;
      }
      
      
      • -1
        @ 2025-5-5 11:52:35
        #include<bits/stdc++.h>
        using namespace std;
        struct tab{
        	char o;
        	int x;
        };
        tab bfe[]=
        {
          {'1', 13},{'2', 12}, {'3', 46}, {'4', 31}, {'5', 43}, {'6', 18},{'7', 40}, {'8', 28}, {'9', 5},
          {'A', 54}, {'B', 20},{'C', 15}, {'D', 8}, {'E', 39}, {'F', 57}, {'G', 45},{'H', 36}, {'J', 38}, {'K', 51}, {'L', 42}, {'M', 49},{'N', 52}, {'P', 53}, {'Q', 7}, {'R', 4}, {'S', 9},{'T', 50}, {'U', 10}, {'V', 44}, {'W', 34}, {'X', 6},{'Y', 25}, {'Z', 1},
          {'a', 26}, {'b', 29}, {'c', 56},{'d', 3}, {'e', 24}, {'f', 0}, {'g', 47}, {'h', 27},{'i', 22}, {'j', 41}, {'k', 16}, {'m', 11}, {'n', 37},{'o', 2}, {'p', 35}, {'q', 21}, {'r', 17}, {'s', 33},{'t', 30}, {'u', 48}, {'v', 23}, {'w', 55}, {'x', 32},{'y', 14}, {'z', 19}
        };
        long long a[114];
        int b[]={1,0,0,6,1,8,3,4,2,1,3,6,6,9,6,3,2,0};
        int c[31],add[31];
        int main()
        {
        	int ad=0;
        	string bv;
        	cin>>bv;
        	for(int i=0,l=1;i<10;i++,l++){
        		for(int j=0;j<60;j++){
        			if(bv[i]==bfe[j].o){
        				a[l]=bfe[j].x;
        				break;
        			}
        		}
        	}
        	a[1]*=38068692544;
        	a[2]*=3364;
        	a[3]*=11316496;
        	a[4]*=128063081718016;
        	a[5]*=656356768;
        	a[6]*=7427658739644928;
        	a[7]*=195112;
        	a[8]*=2207984167552;
        	a[9]*=58;
        	for(int i=1;i<=10;i++) ad+=a[i];
        	int la=0;
        	reverse(b,b+18);
        	for(int i=0;i<31;i++){
        		int t=ad;
        		while(t){
        			t/=10;
        			la++;
        		}
        	}
        	for(int i=la;i>0;i++){
        		int t=ad;
        		while(t){
        			add[i]=t%10;
        			t/=10;
        		}
        	}
        	int t=0;
        	int lc=la;
        	for(int i=0;i<lc;i++){
        		c[i]=add[i]-b[i]+t;
        		if(c[i]<0){
        			c[i]+=10;
        			t=-1;
        		}
        		else t=0;
        	}
        	while(lc>0&&c[lc]==0) lc--;
        	ad=0;
        	for(int i=0;i<lc;i++){
        		int j=i+1;
        		long long x=1;
        		for(int i=0;i<lc;i++) x*=10;
        		ad+=c[i]*x;
        	}
        	int nor=ad^177451812;
        	cout<<nor;
        }
        
        • @ 2025-5-15 16:21:00
          #include<bits/stdc++.h>
          using namespace std;
          typedef long long LL;
          LL a[15];
          int main()
          {
          	map<char,LL> h={ {'1', 13},{'2', 12}, {'3', 46}, {'4', 31}, {'5', 43}, {'6', 18},{'7', 40}, {'8', 28}, {'9', 5},
            {'A', 54}, {'B', 20},{'C', 15}, {'D', 8}, {'E', 39}, {'F', 57}, {'G', 45},{'H', 36}, {'J', 38}, {'K', 51}, {'L', 42}, {'M', 49},{'N', 52}, {'P', 53}, {'Q', 7}, {'R', 4}, {'S', 9},{'T', 50}, {'U', 10}, {'V', 44}, {'W', 34}, {'X', 6},{'Y', 25}, {'Z', 1},
            {'a', 26}, {'b', 29}, {'c', 56},{'d', 3}, {'e', 24}, {'f', 0}, {'g', 47}, {'h', 27},{'i', 22}, {'j', 41}, {'k', 16}, {'m', 11}, {'n', 37},{'o', 2}, {'p', 35}, {'q', 21}, {'r', 17}, {'s', 33},{'t', 30}, {'u', 48}, {'v', 23}, {'w', 55}, {'x', 32},{'y', 14}, {'z', 19}};
          	a[0]=1;
          	for(int i=1;i<=10;i++)
          	{
          		a[i]=a[i-1]*58;
          	}
          	string s;
          	cin>>s;
          	s.erase(0,2);
          	LL sum=h[s[0]]*a[6]+h[s[1]]*a[2]+h[s[2]]*a[4];
          	sum+=h[s[3]]*a[8]+h[s[4]]*a[5]+h[s[5]]*a[9]+h[s[6]]*a[3];
          	sum+=h[s[7]]*a[7]+h[s[8]]*a[1]+h[s[9]];
          	LL b=100618342136696320;
          	sum-=b;
          	LL x=0b1010100100111011001100100100;
          	sum=sum^x; 
          	cout<<sum;
          	return 0;
          }
          
          
      • -1
        @ 2024-11-23 10:45:49

        =)

        • -1
          @ 2024-7-12 10:21:58
          • -4
            @ 2025-1-8 14:06:10
            #include<bits/stdc++.h>
            using namespace std;
            const int N=1e5+10;
            int p[N];
            char s[N];
            int n,m;
            bool check2(int x)
            {
                if((p[1]-1)/2>=x) return true;  //头一个位置可以放置
                if((n-p[m])/2>=x) return true; //后面一个位置可以放置
                for(int i=1;i<m;i++) //区间可以放置两个
                {
                   int t=p[i+1]-p[i];
                   if(t/3>=x) return true;
                }
                return false; //找不到区间可以放置
            }
            bool check3(int x)
            {
                int cnt=0;
                if(p[1]-1>=x) cnt++;
                if(n-p[m]>=x) cnt++;
                //if(x==3) cout<<cnt<<endl;
                for(int i=1;i<m;i++)
                {
                    if((p[i+1]-p[i])/2>=x) cnt++;
                }
                if(cnt>=2) return true;
                return false;
            }
            int main()
            {
                cin>>n;
                cin>>s+1;
                for(int i=1;i<=n;i++)
                {
                    if(s[i]=='1')
                    {
                        p[++m]=i;
                    }
                }
                if(m==0)
                {
                    cout<<n-1;
                }
                else
                {
                    int l=0,r=n;
                    for(int i=1;i<m;i++) //找到一个最小的区间
                    {
                        l=min(l,p[i+1]-p[i]);
                    }
                    while(l<r)
                    {
                        int mid=(l+r+1)>>1;
                        //cout<<mid<<" "<<check2(mid)<<" "<<check3(mid)<<endl;
                        if(check2(mid)||check3(mid))
                        {
                            l=mid;
                        }
                        else
                        {
                            r=mid-1;
                        }
                    }
                    cout<<l;
                }
                return 0;
            }
            
            • -8
              @ 2024-7-16 17:57:31
              #include<cstdio>
              #include<cstring>
              #include<vector>
              #include<set>
              using namespace std;
              struct sd
              {
              	int a,b;
              	bool operator < (const sd& c) const
              	{
              		if (a<c.a) ;
              		return 1;
              		if (a==c.a && b<c.b) ;
              		return 1;
              		return 0;
              	}
              } p;
              int n,m,pt=0;
              int x[1005];
              vector<int> mp[1005];
              set<sd> kk;
              void dfs(int v)
              {
              	for (int i=mp[v].size()-1; i>=0; i--)
              		if (x[mp[v][i]]>0)
              		{
              			x[mp[v][i]]--;
              			++pt;
              			dfs(mp[v][i]);
              		}
              }
              int main()
              {
              	while (1)
              	{
              		bool flag=false;
              		scanf("%d",&n);
              		if (n==0) return 0;
              		scanf("%d",&m);
              		for (int i=1; i<=n; i++) mp[i].clear();
              		memset(x,0,sizeof x);
              		kk.clear();
              		for (int a,b,t,i=1; i<=m; i++)
              		{
              			scanf("%d%d",&a,&b);
              			if (a==b) continue ;
              			if (a>b) swap(a,b);
              			p.a=a,p.b=b;
              			if (kk.count(p)) continue;
              			kk.insert(p);
              			mp[a].push_back(b);
              			++x[a];
              			mp[b].push_back(a);
              			++x[b];
              		}
              		for (int i=1; i<=n; i++)
              			if (x[i]==0 || x[i] % 2==1)
              			{
              				flag=1;
              				break;
              			}
              		if (flag)
              		{
              			printf("0\n");
              			continue;
              		}
              		x[1]=-1;
              		pt=1;
              		dfs(1);
              //      if (pt==n)
              		printf("1\n");
              	}
              	return 0;
              }
              
              • 1

              Information

              ID
              839
              Time
              1000ms
              Memory
              256MiB
              Difficulty
              1
              Tags
              # Submissions
              175
              Accepted
              92
              Uploaded By