QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606745#8934. Challenge NPCliguo#WA 27ms8840kbC++231.8kb2024-10-03 11:56:272024-10-03 11:56:28

Judging History

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

  • [2024-10-03 11:56:28]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:8840kb
  • [2024-10-03 11:56:27]
  • 提交

answer

#include <bits/stdc++.h>
#include <experimental/iterator>

#define int long long
#define float long double
#define all( x ) std::ranges::begin(x),std::ranges::end(x)
#define _( x, y ) (views::iota((int)x,(int)y))
#define __( name, ... ) [&](auto const  &name){return __VA_ARGS__ ;}
#define ___( ... ) [&](auto const &x,auto const &y){return __VA_ARGS__ ;}
#define be( x, fn, ... ) (x=fn(x,__VA_ARGS__))
using namespace std;
using std::this_thread::sleep_for;
template< typename T > using v = vector< T >;
using v_ = v< int >;
using pii = pair< int, int >;
using nli = numeric_limits< int >;
using nls = numeric_limits< signed >;
using i128 = __int128;

void log(auto p,ostream  &os){
    ranges::copy(p,ostream_iterator<int>(os," "));
    os<<endl;
}


template< typename T >
T read() {
    T in;
    cin >> in;
    return in;
}
int n=510;
signed main() {
    ios::sync_with_stdio( false );
    v_ color (n*2);
    map<int,int> nx{{1,2},{2,1}};
    auto gen=
            __(start,
            [&,now=start]mutable {
        return exchange(now,nx[now]);
    });
    generate_n(color.begin(),n,gen(1));
    generate_n(color.begin()+n,n,gen(2));

    v_ print2true;
    for(int i=0;i<n;i++){
        print2true.push_back( i);
        print2true.push_back( i+n);
    }

    auto print_c=print2true|views::transform(__(i,color[i]));

    v<pair<int,int>> e;
    for(int i=0;i<print_c.size();i++){
        for(int j:_(i+1,print_c.size())){
            if(print_c[i]!=print_c[j]){
                e.emplace_back(i+1,j+1);
            }

        }
    }

    cout<<format("{} {} 2\n",print_c.size(),e.size());
    ranges::copy(print_c,ostream_iterator<int>(cout," "));
    cout<<endl;
    for(auto [i,j]:e){
        cout<<format("{} {}\n",i,j);
    }

}












Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 27ms
memory: 8840kb

input:

1

output:

1020 260100 2
1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 ...

result:

wrong answer The graph is not correct