QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#322142#4675. Multiple Communicationstuanlinh1230 0ms0kbC++205.3kb2024-02-06 12:13:582024-02-06 12:13:59

Judging History

你现在查看的是最新测评结果

  • [2024-02-06 12:13:59]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-02-06 12:13:58]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;

vector <ll> order={7, 19, 20, 1, 3, 15, 24, 7, 4, 4, 4, 17, 14, 21, 17, 28, 28, 13, 27, 24, 0, 10, 20, 25, 28, 0, 19, 8, 11, 26, 14, 5, 24, 26, 28, 14, 19, 24, 27, 27, 3, 16, 1, 12, 5, 3, 15, 7, 5, 20, 10, 10, 16, 11, 12, 29, 23, 3, 23, 21, 19, 19, 16, 2, 27, 7, 27, 29, 27, 4, 16, 15, 22, 18, 10, 16, 21, 15, 3, 28, 11, 13, 19, 24, 1, 18, 20, 12, 18, 7, 27, 8, 22, 28, 22, 5, 4, 0, 5, 6, 21, 20, 14, 2, 1, 22, 1, 14, 6, 5, 19, 19, 25, 23, 22, 15, 21, 0, 2, 2, 18, 12, 26, 10, 9, 12, 7, 29, 19, 6, 2, 3, 22, 0, 7, 26, 22, 12, 14, 26, 17, 20, 25, 2, 16, 2, 14, 24, 1, 11, 17, 14, 5, 3, 19, 25, 21, 8, 12, 22, 1, 0, 16, 20, 8, 15, 24, 17, 12, 8, 6, 23, 29, 29, 26, 6, 3, 18, 7, 12, 17, 19, 4, 7, 29, 11, 27, 16, 28, 10, 12, 10, 4, 14, 4, 13, 27, 15, 20, 19, 0, 12, 22, 5, 5, 8, 18, 21, 14, 9, 13, 1, 24, 25, 19, 7, 25, 26, 10, 25, 3, 26, 18, 29, 21, 19, 19, 13, 16, 3, 2, 25, 8, 11, 4, 12, 4, 10, 4, 3, 21, 8, 27, 6, 22, 19, 13, 22, 9, 3, 3, 10, 0, 0, 8, 15, 29, 25, 28, 11, 0, 27, 5, 8, 28, 16, 27, 1, 13, 15, 23, 7, 27, 13, 22, 27, 1, 6, 9, 28, 26, 15, 11, 26, 28, 2, 1, 2, 7, 15, 23, 1, 22, 10, 8, 29, 29, 21, 17, 20, 27, 13, 2, 4, 23, 19, 21, 4, 13, 16, 8, 22, 22, 18, 17, 23, 6, 2, 16, 2, 15, 14, 19, 16, 17, 9, 1, 27, 1, 14, 24, 1, 17, 10, 3, 20, 24, 26, 19, 25, 3, 6, 11, 29, 27, 25, 14, 12, 15, 24, 4, 12, 3, 19, 20, 24, 5, 8, 1, 16, 17, 29, 23, 14, 5, 7, 11, 20, 17, 3, 24, 14, 20, 9, 10, 21, 18, 3, 9, 15, 21, 19, 5, 17, 24, 20, 19, 5, 18, 18, 27, 24, 26, 27, 10, 12, 10, 22, 19, 18, 12, 28, 25, 24, 15, 25, 17, 11, 12, 5, 20, 27, 20, 25, 18, 11, 2, 27, 26, 27, 15, 15, 9, 2, 21, 24, 14, 27, 17, 9, 20, 28, 16, 8, 19, 8, 29, 19, 13, 14, 8, 22, 28, 19, 17, 6, 28, 11, 11, 16, 21, 21, 12, 1, 0, 13, 23, 3, 16, 20, 17, 15, 20, 0, 21, 2, 28, 25, 5, 19, 15, 21, 2, 8, 2, 24, 5, 28, 7, 9, 5, 26, 26, 6, 26, 21, 13, 22, 28, 18, 21, 2, 2, 14, 0, 3, 17, 29, 16, 15, 13, 22, 18, 24, 21, 3, 1, 22, 2, 6, 11, 0, 1, 3, 22, 9, 29, 26, 7, 8, 23, 4, 8, 14, 13, 0, 29, 0, 9, 19, 15, 13, 13, 4, 21, 27, 7, 19, 20, 19, 17, 2, 16, 23, 28, 21, 20, 22, 19, 27, 2, 18, 26, 8, 21, 28, 14, 17, 5, 18, 28, 26, 10, 1, 17, 14, 9, 11, 22, 18, 4, 19, 24, 29, 17, 1, 2, 26, 3, 0, 0, 0, 2, 17, 26, 18, 26, 24, 14, 13, 9, 13, 17, 16, 15, 22, 10, 10, 12, 8, 17, 4, 22, 0, 24, 13, 23, 11, 19, 1, 6, 9, 13, 10, 0, 8, 5, 16, 10, 6, 3, 12, 15, 2, 19, 7, 22, 13, 26, 25, 25, 3, 4, 25, 17, 18, 1, 0, 4, 25, 14, 8, 9, 4, 13, 18, 18, 15, 11, 0, 3, 19, 25, 25, 15, 10, 6, 28, 25, 6, 22, 24, 29, 24, 18, 12, 6, 25, 28, 8, 13, 28, 22, 1, 24, 25, 20, 15, 2, 29, 3, 25, 25, 24, 11, 24, 16, 2, 23, 10, 5, 17, 6, 3, 19, 4, 28, 29, 11, 13, 8, 13, 6, 12, 24, 2, 2, 16, 3, 22, 16, 15, 7, 7, 29, 25, 25, 1, 13, 10, 17, 12, 6, 0, 18, 24, 28, 17, 0, 19, 0, 23, 22, 1, 27, 4, 0, 26, 10, 9, 21, 17, 4, 16, 12, 8, 26, 4, 29, 25, 15, 13, 18, 19, 22, 14, 14, 0, 12, 24, 6, 21, 2, 9, 7, 12, 1, 27, 10, 24, 8, 21, 8, 7, 9, 12, 13, 11, 2, 25, 7, 6, 16, 2, 29, 12, 24, 0, 18, 29, 9, 23, 14, 25, 20, 18, 19, 0, 17, 7, 5, 26, 22, 24, 29, 21, 2, 16, 1, 14, 25, 1, 26, 22, 12, 4, 4, 9, 16, 26, 27, 9, 5, 11, 3, 11, 9, 1, 16, 13, 2, 15, 11, 10, 16, 10, 12, 17, 22, 12, 18, 23, 17, 22, 12, 22, 10, 11, 7, 10, 15, 24, 15, 8, 28, 29, 16, 9, 20, 13, 19, 2, 8, 10, 22, 28, 24, 22, 16, 13, 8, 6, 5, 18, 8, 4, 3, 29, 0, 4, 23, 16, 21, 19, 14, 3, 23, 24, 14, 14, 10, 8, 23, 19, 14, 12, 21, 11, 12, 28, 3, 4, 7, 1, 17, 13, 14, 9, 22, 27, 25, 27, 26, 28, 29, 14, 15, 0, 15, 11, 29, 27, 3, 25, 12, 16, 17, 8, 28, 25, 16, 14, 18, 8, 13, 0, 22, 23, 19, 5, 20, 29, 22, 28, 23, 22, 20, 3, 24, 4, 16, 10, 7, 7, 11, 15, 0, 25, 6, 9, 25, 29, 16, 29, 3, 11, 10, 6, 11, 17, 19, 5, 20, 21, 10, 10, 2, 13, 25, 27, 14, 13, 24, 17, 29, 28, 24, 6, 10, 26, 6, 4, 26, 14, 23, 21, 21, 16, 28, 17};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    string s; cin >> s;
    if (s=="Alice" || s=="Bob")
    {
        string ans="";
        for (ll i=1; i<=100; i++)
        {
            string t; cin >> t;
            ll res=0;
            for (ll j=0; j<1000; j++)
                res^=(t[j]-'0')<<order[j];
            for (ll j=0; j<30; j++)
            {
                if (res&1<<j) ans.pb('1');
                else ans.pb('0');
            }
        }
        cout << ans << "\n";
    }
    else
    {
        string A, B; cin >> A >> B;
        map <ll, ll> Map;
        for (ll i=0; i<100; i++)
        {
            ll num=0;
            for (ll j=0; j<30; j++)
                num=num*2+A[i*30+j]-'0';
            Map[num]=i+1;
        }
        vector <ll> val;
        for (ll i=0; i<100; i++)
        {
            ll num=0;
            for (ll j=0; j<30; j++)
                num=num*2+B[i*30+j]-'0';
            val.pb(num);
        }
        for (ll i=1; i<=100; i++)
        {
            string s; cin >> s;
            ll num=0, ok=0;
            for (ll j=0; j<1000; j++)
                num^=(s[j]-'0')<<order[j];
            for (ll j=0; j<100; j++)
            {
                ll f=num^val[j];
                if (Map[f])
                {
                    cout << Map[f] << " " << j+1 << "\n";
                    ok=1; break;
                } 
            }
            assert(ok);
        }
    }
}

詳細信息

Test #1:

score: 0
Instance #2 Runtime Error

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

100101110110111101011010010100011001011001110000111010111100101010001011100101110011100110001001111111110110100100110100010111000000101000110010010001011011001000111000110010110011010100100100001100010101010010111111011101111010000010110001010011010100000101110011100000010001001100111011101101010001...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

010000011111000100110010100001000011011111110111001011101011010011011010110100001001001011010001111110001000010100001010011011010010100000100001101000000101111001100100110010010001000100111011111100111101100111111010010100100011010111111001011100101100110001010011110010101110000011000111001101101011...

Third Run Input

Clara
100101110110111101011010010100011001011001110000111010111100101010001011100101110011100110001001111111110110100100110100010111000000101000110010010001011011001000111000110010110011010100100100001100010101010010111111011101111010000010110001010011010100000101110011100000010001001100111011101101...

Third Run Output


Manager to Checker

WA
Wrong Answer on Third Run: failed to read your solution

result: