QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#104182#5011. Course SelectionjoesmittyRE 2ms3504kbC++202.6kb2023-05-09 10:40:102023-05-09 10:40:15

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-09 10:40:15]
  • 评测
  • 测评结果:RE
  • 用时:2ms
  • 内存:3504kb
  • [2023-05-09 10:40:10]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef vector<int> vi;
typedef vector< vector <int> > vvi;
typedef pair<int, int> pii;
typedef pair < pair < int, int >, int > piii;
typedef pair < pair <int, int > , pair <int, int> > piiii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
 
#define FOR(i,a,b) for(int i = a; i < b; i ++)
#define RFOR(i,a,b) for(int i = a-1; i >= b; i --)
#define all(a) a.begin(), a.end()
#define endl '\n';
#define sz(x) (int)(x).size()
 
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
 
template <typename T>
void pr(vector<T> &v) {
    FOR(i, 0, sz(v)) cout << v[i] << " ";
    cout << endl;
}
template <typename T>
void pr(vector<vector<T> > &v) {
    FOR(i, 0, sz(v)) { pr(v[i]); }
}
template <typename T>
void re(T &x) {
    cin >> x;
}
template <typename T>
void re(vector<T> &a) {
    FOR(i, 0, sz(a)) re(a[i]);
}
template <class Arg, class... Args>
void re(Arg &first, Args &... rest) {
    re(first);
    re(rest...);
}
template <typename T>
void pr(T x) {
    cout << x << endl;
}
template <class Arg, class... Args>
void pr(const Arg &first, const Args &... rest) {
    cout << first << " ";
    pr(rest...);
    cout << endl;
}
void ps() { cout << endl; }
template<class T, class... Ts>
void ps(const T& t, const Ts&... ts) {
    cout << t; if (sizeof...(ts)) cout << " "; ps(ts...);
}
 
const ll MOD  =  1000000007;
#define inf 1e18;
#define INF INT_MAX;

long double PI = 4*atan(1);
long double eps = 1e-12;

vi ass[1005] = {};
int cap[1005] = {};
int main() {
    //auto start = chrono::high_resolution_clock::now();
    ios_base::sync_with_stdio(0);cin.tie(0);
    // freopen("promote.in", "r", stdin);
	// freopen("promote.out", "w", stdout);
    #ifdef DEBUG
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    #endif 


    
    int n,s; cin >> n >> s;
    FOR(i,0,n) {
        cin >> cap[i];
    }

    int ans = 0;
    FOR(i,0,s) {
        FOR(j,0,5) {
            int d; cin >> d;
            d--;
            if(cap[d] > 0) {
                ans++;
                cap[d]--;
                ass[i].pb(d+1);
            }
        }
    }

    cout << ans << endl;
    FOR(i,0,s) {
        pr(ass[i]);
    }



    




    // auto stop = chrono::high_resolution_clock::now();
    // auto duration = chrono::duration_cast<chrono::microseconds>(stop - start);
    // cout << duration.count() << endl;
    //cin.close();
    //cout.close();
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3504kb

input:

6 3
1
2
3
1
1
1
1 2 3 4 5
1 2 3 4 5
1 2 3 4 6

output:

9
1 2 3 4 5 
2 3 
3 6 

result:

ok All good..

Test #2:

score: -100
Runtime Error

input:

1000 10000
8
8
1
1
1
2
7
7
8
4
3
7
9
3
7
7
7
7
6
7
10
2
3
6
6
8
4
7
1
4
7
6
1
5
4
2
8
10
5
10
9
2
5
1
5
10
8
9
4
5
5
3
10
1
3
8
10
1
1
10
6
2
8
4
6
2
1
10
6
2
9
7
9
6
10
3
8
6
8
8
2
1
1
5
3
10
1
8
9
9
5
1
4
5
3
5
8
5
5
10
10
4
5
4
10
5
10
9
6
4
1
2
4
1
5
10
7
6
3
3
4
5
9
4
9
10
3
8
10
4
9
2
8
3
5
6
...

output:


result: