제출 #1259432

#제출 시각아이디문제언어결과실행 시간메모리
1259432phtungLasers (NOI19_lasers)C++20
0 / 100
21 ms16964 KiB
#include <bits/stdc++.h>

using namespace std;

#define name "IO"
#define int long long 

const int inf = 1e18 + 7; 
const int maxn = 5e5 + 5; 
int L, R; 
vector<int> row[maxn]; 

void sub1()
{
    int len = row[1].back(); 
    if(len <= L / 2)
    {
        cout << 0 << "\n";
        return; 
    }
    
    int res = len - (L / 2); 

    if(L % 2)
    {
        cout << res * 2 - 1 << "\n"; 
    }
    else cout << res * 2 << "\n"; 
}

void solve()
{
    cin >> L >> R;

    for(int i = 1; i <= R; i++)
    {
        int x; cin >> x; 
        for(int i = 1; i <= x; i++)
        {
            int len;
            cin >> len ;
            row[i].push_back(len); 
        }
    }   


}

signed main()
{
    if (fopen (name".INP", "r"))
    {
        freopen (name".INP", "r", stdin);
        freopen (name".OUT", "w", stdout);
    }

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    clock_t start = clock(); 

    int t = 1;

    while(t--) solve(); 

    std::cerr << "Time: " << clock() - start << "ms\n";

    return 0; 

}

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

lasers.cpp: In function 'int main()':
lasers.cpp:53:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   53 |         freopen (name".INP", "r", stdin);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
lasers.cpp:54:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   54 |         freopen (name".OUT", "w", stdout);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...