QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#321449#4675. Multiple Communicationsbachbeo20070 1ms3824kbC++232.7kb2024-02-04 19:19:472024-02-04 19:19:47

Judging History

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

  • [2024-02-04 19:19:47]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3824kb
  • [2024-02-04 19:19:47]
  • 提交

answer

// Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_supports("avx2"));
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
// Atcoder
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma")
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
- insert(x),erase(x)
- find_by_order(k): return iterator to the k-th smallest element
- order_of_key(x): the number of elements that are strictly smaller
*/
#include<bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_real_distribution<> pp(0.0,1.0);
#define int long long
#define ld long double
#define pii pair<int,int>
#define piii pair<int,pii>
#define mpp make_pair
#define fi first
#define se second
const int inf=1e18;
const int mod=1000;
const int maxn=200005;
const int bl=650;
const int maxs=655;
const int maxm=200005;
const int maxq=1000005;
const int maxl=25;
const int maxa=1000000;
const int root=3;
int power(int a,int n){
    int res=1;
    while(n){
        if(n&1) res=res*a%mod;
        a=a*a%mod;n>>=1;
    }
    return res;
}
const int iroot=power(3,mod-2);
const int base=131;

int f(int x){
    return (x*x%31)%30;
}

void solve(){
    string s;cin >> s;
    if(s!="Clara"){
        string res;
        for(int i=0;i<100;i++){
            string x;cin >> x;
            vector<int> d(30,0);
            for(int j=0;j<1000;j++) d[f(j)]^=(x[j]-'0');
            for(int j=0;j<30;j++) res=res+char(d[j]+'0');
        }
        cout << res << '\n';
    }
    else{
        string A,B;cin >> A >> B;
        vector<int> a(100,0),b(100,0);
        for(int i=0;i<100;i++){
            for(int j=29;j>=0;j--){
                a[i]=a[i]<<1|(A[i*30+j]-'0');
                b[i]=b[i]<<1|(B[i*30+j]-'0');
            }
        }
        for(int i=0;i<100;i++){
            string x;cin >> x;
            int num=0;
            for(int j=0;j<1000;j++) num=num^((x[j]-'0')<<f(j));
            int px=-1,py=-1;
            for(int j=0;j<100;j++) for(int k=0;k<100;k++) if(!(a[j]^b[k]^num)) px=j,py=k;
            cout << px+1 << ' ' << py+1 << '\n';
        }
    }
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int test=1;//cin >> test;
    while(test--) solve();
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3824kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

111011010100001010000000010010010011011100001010011000010010001001001100001000111000010010100000010110000010111000010000011001000100001000011000000000110010011000001010010000010000101011000010001010100000000010100000000100000000110000010010001010010000001010101000010000011000010110000010001000000000...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

100000011010000010011000000010101001011000000000011000000000011010000010001000001000010010100010001000000000111000010010000010000000001010111000010000111011001000001000111000010000110010001000001000001000000010010000010110001000000000010010110000010000000010100000000000101001011100001000011000010000...

Third Run Input

Clara
111011010100001010000000010010010011011100001010011000010010001001001100001000111000010010100000010110000010111000010000011001000100001000011000000000110010011000001010010000010000101011000010001010100000000010100000000100000000110000010010001010010000001010101000010000011000010110000010001000...

Third Run Output

11 8
68 89
74 70
92 97
28 58
6 82
53 98
29 9
81 56
95 31
61 74
99 37
84 44
2 25
74 69
39 25
76 92
77 67
74 95
1 10
100 23
12 3
28 31
85 64
75 49
56 78
42 21
93 20
95 2
47 86
17 93
58 38
95 7
35 50
91 34
87 38
44 3
32 7
30 58
76 16
94 69
48 2
68 27
43 26
100 39
98 61
38 5
93 95
37 49
27 80
64 65
23 8...

Manager to Checker

OK
You answered 96 (out of 100) questions correctly

result:

ok OK

Test #2:

score: 0
Wrong Answer
time: 1ms
memory: 3696kb

First Run Input

Alice
110011001011111111001010001110111101101011010010111100001110010000011100000010100100001110000000010001010111111110100111100101110000101110011101101001001101111010000011110011111011000010010010111111000010101111000010001101100110100010100100111011110000001110100100101000011110100001001001111011...

First Run Output

010011001110000010111000010010010001001110000000100000010000101010011110000010111000010010000011010110001000100000000010010010000010001010011000010000100000011110000000111000010000001000011110000010100000010000001000001110000010010000000000000010000010000000100000010000110001010110001000101000000010...

Second Run Input

Bob
01010101110011100011010110001001000000001100100000000011110100010001110110111000000001001000101010010100011101011010000110010110000000011000101101101101001111111110010101111010010111100100000100101101110011000011110001101001001001001110101100100100110000110100011100100001100110000000010011111101...

Second Run Output

101000010000001000111000010000111000000010001000100000010010010010011110000010110000010000110010001110000010101000000010100001001100001010011000010000101000001110000010100000000010010000000100001010000000010010011000001100000000001000010000010000010110000000100000000010011010001000001010100000010010...

Third Run Input

Clara
010011001110000010111000010010010001001110000000100000010000101010011110000010111000010010000011010110001000100000000010010010000010001010011000010000100000011110000000111000010000001000011110000010100000010000001000001110000010010000000000000010000010000000100000010000110001010110001000101000...

Third Run Output

82 32
36 96
69 8
55 17
38 1
73 22
100 78
31 21
8 63
19 84
85 69
25 49
37 18
80 28
43 13
54 82
27 3
2 25
27 6
50 40
72 28
49 9
45 67
49 5
32 46
37 78
56 19
34 22
47 91
77 19
85 74
38 23
71 26
58 13
95 51
34 36
57 66
6 41
32 55
56 78
62 35
58 95
11 30
66 34
41 51
29 13
62 70
75 72
34 66
19 63
62 31
66...

Manager to Checker

WA
You answered 95 (out of 100) questions correctly

result:

wrong answer WA