제출 #1344127

#제출 시각아이디문제언어결과실행 시간메모리
1344127thnhannLjeto (COCI21_ljeto)C++20
50 / 50
0 ms344 KiB
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma,lzcnt,popcnt")
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define ii pair<int,int>
#define el cout<<'\n'
#define int long long
#define miuu ""

const ll mod=1e9+7;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
const int nmax=5e5;
const int inf =2e9;

void add(int &a, int b) {
    a += b;
    if (a >= mod) a -= mod;
    if (a < 0) a += mod;
}

template<typename T> void chkmin(T& x, T y) {if(x > y) x = y;}
template<typename T> void chkmax(T& x, T y) {if(x < y) x = y;}

using namespace std;

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r)
{
    return uniform_int_distribution<int>(l, r) (rd);
}

int A,B;
int n;
int times[105];
int a[105];
int b[105];

signed main()
{
   ios::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);

   if(fopen(miuu".inp","r"))
    {
       freopen(miuu".inp","r",stdin);
       freopen(miuu".out","w",stdout);
    }

   A = B = 0;
   cin >> n;
   for(int i=1;i<=n;i++)
   {
       cin >> times[i] >> a[i] >> b[i];
   }

   for(int i=1;i<=n;i++)
   {
       bool ok = false;
       for(int j=1;j<i;j++)
       {

           if(times[i] - times[j] <= 10)
           {
               if(a[j] == a[i]) ok = true;
           }
       }
       if(a[i] <= 4)
       {
           A += 100;
           if(ok) A += 50;
       }
       else
       {
           B += 100;
           if(ok) B += 50;
       }
   }
   cout << A << " " << B;


}
//  "Can i get a kiss? And can u make it last forever?"

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:48:15: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   48 |        freopen(miuu".inp","r",stdin);
      |        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:49:15: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   49 |        freopen(miuu".out","w",stdout);
      |        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...