Submission #939570

# Submission time Handle Problem Language Result Execution time Memory
939570 2024-03-06T14:19:51 Z guymmk Poi (IOI09_poi) C++14
5 / 100
212 ms 16468 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl "\n"
#define vi vector<int>
#define vpii vector<pair<int,int> >
#define umap unordered_map
#define uset unordered_set
#define mk make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define read(x) for (auto& zu: (x)) cin >> zu;
#define F first
#define S second
#define mustawa ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define pii pair<int,int>
#define mishari main
const int inf=1e9+7;
void fa(bool ok){ cout << (ok ? "YES": "NO") << "\n";}
void usaco(string s) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
}
void solve(){
    int n,t,p;
    cin>>n>>t>>p;
    vector<array<int,3>> v(n);
    vector<int>points(n);
    bool solved[n][t]={};
    for(int i=0;i<n;i++){
        for(int j=0;j<t;j++){
            int x;
            cin>>x;
            solved[i][j]=x;
            points[j]+=!x;
            v[n-i][1]+=x;
        }
    }for(int i=0;i<n;i++){
        v[i][2]=n-i;
        for(int j=0;j<t;j++){
            if(solved[i][j]){
                v[i][0]+=points[j];
            }
        }
    }sort(allr(v));
    for(int i=0;i<n;i++){
        if(v[i][2]==n-p+1){
            cout<<v[i][0]<<" "<<i+1<<endl;
        }
    }
}signed mishari(){
    mustawa;
    int t=1;
    //usaco("")
    //cin>>t;
    while(t--)solve();
}

Compilation message

poi.cpp: In function 'void usaco(std::string)':
poi.cpp:23:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |     freopen((s + ".in").c_str(), "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
poi.cpp:24:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     freopen((s + ".out").c_str(), "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1 ms 460 KB Execution killed with signal 11
3 Runtime error 1 ms 604 KB Execution killed with signal 6
4 Incorrect 0 ms 348 KB Output isn't correct
5 Runtime error 1 ms 604 KB Execution killed with signal 6
6 Runtime error 1 ms 604 KB Execution killed with signal 6
7 Runtime error 1 ms 464 KB Execution killed with signal 6
8 Runtime error 1 ms 604 KB Execution killed with signal 6
9 Runtime error 1 ms 504 KB Execution killed with signal 11
10 Runtime error 2 ms 604 KB Execution killed with signal 6
11 Runtime error 6 ms 860 KB Execution killed with signal 11
12 Runtime error 12 ms 1284 KB Execution killed with signal 6
13 Runtime error 28 ms 2732 KB Execution killed with signal 11
14 Runtime error 46 ms 3984 KB Execution killed with signal 6
15 Runtime error 69 ms 6392 KB Execution killed with signal 6
16 Runtime error 76 ms 6996 KB Execution killed with signal 6
17 Runtime error 113 ms 10100 KB Execution killed with signal 6
18 Runtime error 126 ms 11312 KB Execution killed with signal 6
19 Runtime error 166 ms 14672 KB Execution killed with signal 11
20 Runtime error 212 ms 16468 KB Execution killed with signal 6