zoukankan      html  css  js  c++  java
  • Codeforces Round #679 (Div. 2, based on Technocup 2021 Elimination Round 1) (个人题解)

    1434A. Finding Sasuke

    // Author : RioTian
    // Time : 20/10/25
    #include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    ll _, n;
    void solve() {
        cin >> n;
        int a[n + 1];
        for (int i = 0; i < n; ++i) cin >> a[i];
        for (int i = 0; i < n; i += 2) cout << a[i + 1] << ' ' << -a[i] << ' ';
        cout << endl;
    }
    int main() {
        // freopen("in.txt", "r", stdin);
        ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
        cin >> _;
        while (_--) solve();
    }
    

    1435B. A New Technique

    // Author : RioTian
    // Time : 20/10/25
    #include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    const int N = 500 + 10;
    int T;
    
    int n, m, a[N][N], b[N][N], to[N * N];
    bool mark[N * N];
    
    int main(){
        ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
        cin >> T;
        while (T--) {
            cin >> n >> m;
    
            for (int i = 0; i <= n * m; i++)
                mark[i] = to[i] = 0;
            
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++)
                    cin >> a[i][j];
                
                mark[a[i][0]] = 1;
                to[a[i][0]] = i;
            }
    
            for (int i = 0; i < m; i++)
                for (int j = 0; j < n; j++)
                    cin >> b[i][j];
    
            for (int k = 0; k < m; k++)
                if (mark[b[k][0]]){
                    for (int ii = 0; ii < n; ii++) {
                        int i = to[b[k][ii]];
    
                        for (int j = 0; j < m; j++) cout << a[i][j] << ' ';
                        cout << '
    ';
                    }
    
                    break;
                }
        }
    }
    

    The desire of his soul is the prophecy of his fate
    你灵魂的欲望,是你命运的先知。

  • 相关阅读:
    做接口测试最重要的知识点
    HTTP和HTTPS区别
    UVA, 686 Goldbach's Conjecture (II)
    UVA, 543 Goldbach's Conjecture
    UVA, 580 Critical Mass
    UVA, 900 Brick Wall Patterns
    UVA, 11000 Bee
    UVA, 10079 Pizza Cutting
    C++ 向量<vector>的学习
    jenkins入门
  • 原文地址:https://www.cnblogs.com/RioTian/p/13875820.html
Copyright © 2011-2022 走看看