Submission #11583454
Source Code Expand
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
vector<int> B, R;
REP(i,N){
int X;
char c;
cin >> X >> c;
if(c == 'B') B.push_back(X);
else R.push_back(X);
}
sort(B.begin(), B.end());
sort(R.begin(), R.end());
for(auto x : R) cout << x << endl;
for(auto x : B) cout << x << endl;
}
Submission Info
| Submission Time |
|
| Task |
B - Picking Balls |
| User |
Bondo416 |
| Language |
C++ (GCC 9.2.1) |
| Score |
200 |
| Code Size |
1207 Byte |
| Status |
AC |
| Exec Time |
8 ms |
| Memory |
3680 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
s1.txt, s2.txt |
| All |
01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, s1.txt, s2.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 01.txt |
AC |
8 ms |
3568 KiB |
| 02.txt |
AC |
2 ms |
3612 KiB |
| 03.txt |
AC |
2 ms |
3556 KiB |
| 04.txt |
AC |
2 ms |
3612 KiB |
| 05.txt |
AC |
2 ms |
3512 KiB |
| 06.txt |
AC |
2 ms |
3624 KiB |
| 07.txt |
AC |
2 ms |
3588 KiB |
| 08.txt |
AC |
2 ms |
3460 KiB |
| 09.txt |
AC |
2 ms |
3460 KiB |
| 10.txt |
AC |
2 ms |
3576 KiB |
| 11.txt |
AC |
2 ms |
3516 KiB |
| 12.txt |
AC |
2 ms |
3620 KiB |
| 13.txt |
AC |
2 ms |
3516 KiB |
| 14.txt |
AC |
2 ms |
3512 KiB |
| 15.txt |
AC |
2 ms |
3680 KiB |
| 16.txt |
AC |
2 ms |
3580 KiB |
| 17.txt |
AC |
2 ms |
3592 KiB |
| 18.txt |
AC |
5 ms |
3612 KiB |
| 19.txt |
AC |
2 ms |
3608 KiB |
| s1.txt |
AC |
2 ms |
3652 KiB |
| s2.txt |
AC |
2 ms |
3500 KiB |