QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#606745 | #8934. Challenge NPC | liguo# | WA | 27ms | 8840kb | C++23 | 1.8kb | 2024-10-03 11:56:27 | 2024-10-03 11:56:28 |
Judging History
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);
}
}
詳細信息
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