結果
| 問題 |
No.5004 Room Assignment
|
| コンテスト | |
| ユーザー |
fky_
|
| 提出日時 | 2021-12-06 02:18:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,022 bytes |
| コンパイル時間 | 1,473 ms |
| 実行使用メモリ | 37,664 KB |
| スコア | 0 |
| 最終ジャッジ日時 | 2021-12-06 02:18:50 |
| 合計ジャッジ時間 | 14,923 ms |
|
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 99 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define RFOR(i, a, b) for (int i = a; i >= (b); i--)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define MP make_pair
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
using P = pair<int, int>;
const long long INF = 1LL<<60;
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
int main(void){
ios::sync_with_stdio(0);
cin.tie(0);
int T, R;
cin >> T >> R;
queue<int> que;
int cnt = 1;
FOR(t,0,T){
int N;
cin >> N;
FOR(i,0,N){
int s;
cin >> s;
que.push(cnt++);
}
cout << ((int)que.size() / 4) * 3 << endl;
while((int)que.size() >= R){
vector<int> a(4);
FOR(i,0,4){
a[i] = que.front();
que.pop();
}
FOR(i,1,4){
cout << a[0] << " " << a[i] << endl;
}
}
}
return 0;
}
fky_