結果
| 問題 |
No.1328 alligachi-problem
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2020-12-25 00:06:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 708 bytes |
| コンパイル時間 | 2,242 ms |
| コンパイル使用メモリ | 199,196 KB |
| 最終ジャッジ日時 | 2025-01-17 06:45:58 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 7 WA * 18 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
const string colors = "RB";
int colorid(char c){ return colors.find(c); }
struct Ball{ int x,y,i; };
bool cmp_Ball_y(Ball l,Ball r){ return l.y<r.y; }
int main(){
int N; cin>>N;
vector<Ball> D[2];
rep(i,N){ char c,x; int y; cin>>c>>x>>y; D[colorid(c)].push_back({colorid(x),y,i}); }
rep(i,2) sort(D[i].begin(),D[i].end(),cmp_Ball_y);
bool ok=true;
rep(i,2) rep(j,D[i].size()) if(D[i][j].y!=j) ok=false;
if(ok){
cout<<"Yes"<<endl;
bool sp=false;
rep(i,2) for(auto b:D[i]){ if(sp)cout<<" "; cout<<(b.i+1); sp=true; }
}
else cout<<"No"<<endl;
return 0;
}
Nachia