Submission #1077143

#TimeUsernameProblemLanguageResultExecution timeMemory
1077143duydzs1tgLjeto (COCI21_ljeto)C++17
50 / 50
1 ms460 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...