Submission #1077143

# Submission time Handle Problem Language Result Execution time Memory
1077143 2024-08-27T01:42:24 Z duydzs1tg Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 460 KB
#include <bits/stdc++.h>
#define NAME "CASHIER"
#define E <<"\n"
#define O <<" "<<
#define o <<" "
#define se second
#define fi first
#define ll long long
using namespace std;
const int MN=1e6+7;
const int MOD=1e9+7;
int n,z,ans[7] ;
vector<int> a[13];
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    if (fopen(NAME ".INP", "r")){
    freopen(NAME".INP","r",stdin);
    freopen(NAME".OUT","w",stdout);
    }
    if (fopen(".INP", "r")){
    freopen(".INP","r",stdin);
    freopen(".OUT","w",stdout);
    }
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        int t,az,bz;
        cin>>t>>az>>bz;
        a[az].push_back(t);
    }
    for (int i=1;i<=8;i++)
    {
        sort(a[i].begin(),a[i].end());
        int jbef=-999;
        for (int j:a[i])
        {
            ans[i<=4]+=100;
            if (j-jbef<=10)
                ans[i<=4]+=50;
            jbef=j;

        }
    }

    cout<<ans[1] O ans[0];


}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     freopen(NAME".INP","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:19:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     freopen(NAME".OUT","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:22:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     freopen(".INP","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~
Main.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(".OUT","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 460 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 460 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct