1 条题解

  • 0
    @ 2024-8-16 11:00:02

    AC记录https://hydro.ac/d/atcoder/record/66bec06a1c6820319e01d390

    分析

    一道字符串水题,直接输出就行(判断一下奇数位偶数位)

    #include <bits/stdc++.h>
    #include <algorithm>
    
    #define endl '\n';
    
    
    const int N = 1e6 + 10;
    const int M = 2e6 + 10;
    const int P = 998244353; 
    const int Base = 3221225477;
    const int INF = 0x3f3f3f3f3f3f3f3f; 
    
    int mod(int x)
    {
       return x % P;
    }
    using namespace std;
    string o,e;
    signed main()
    {
    	cin >> o >> e;
    	int op = 0;
    	int ep = 0;
    	for(int i = 0;i < o.size()+e.size();i++)
    	{
    		if(i % 2 != 0)
    		{
    			cout << e[ep];ep++;
    		}else if(i % 2 == 0)
    		{
    			cout << o[op];op++;
    		}
    	}
    	cout << endl;return 0;
    }
    
    • 1

    信息

    ID
    242
    时间
    2000ms
    内存
    256MiB
    难度
    1
    标签
    递交数
    7
    已通过
    4
    上传者