답안 #1110239

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1110239 2024-11-09T03:09:14 Z vjudge1 Escape Route 2 (JOI24_escape2) C++17
6 / 100
339 ms 7008 KB
#include<bits/stdc++.h>
using namespace std;
int n;
long long t;
long long a[2010],b[2010];
int q;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if(fopen("c.INP","r")){
        freopen("c.INP","r",stdin);
        freopen("c.OUT","w",stdout);
    }
    cin >>n>>t;
    for(int i=1;i<n;i++){
        int x;
        cin >>x>>a[i]>>b[i];
    }
    cin >>q;
    while(q--){
        int s,e;
        cin >>s>>e;
        long long asw=-a[s];
        long long cr=0;
        for(int i=s;i<e;i++){
            if(cr>a[i]){
                asw=asw+t-cr;
                cr=0;
            }
            asw=asw+b[i]-cr;
            cr=b[i];
        }
        cout <<asw<<'\n';
    }
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:12:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         freopen("c.INP","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:13:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         freopen("c.OUT","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 47 ms 4588 KB Output is correct
3 Correct 180 ms 5292 KB Output is correct
4 Correct 299 ms 6948 KB Output is correct
5 Correct 241 ms 5452 KB Output is correct
6 Correct 313 ms 7008 KB Output is correct
7 Correct 339 ms 6988 KB Output is correct
8 Correct 177 ms 5340 KB Output is correct
9 Correct 310 ms 6920 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 47 ms 4588 KB Output is correct
3 Correct 180 ms 5292 KB Output is correct
4 Correct 299 ms 6948 KB Output is correct
5 Correct 241 ms 5452 KB Output is correct
6 Correct 313 ms 7008 KB Output is correct
7 Correct 339 ms 6988 KB Output is correct
8 Correct 177 ms 5340 KB Output is correct
9 Correct 310 ms 6920 KB Output is correct
10 Incorrect 1 ms 336 KB Output isn't correct
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 47 ms 4588 KB Output is correct
3 Correct 180 ms 5292 KB Output is correct
4 Correct 299 ms 6948 KB Output is correct
5 Correct 241 ms 5452 KB Output is correct
6 Correct 313 ms 7008 KB Output is correct
7 Correct 339 ms 6988 KB Output is correct
8 Correct 177 ms 5340 KB Output is correct
9 Correct 310 ms 6920 KB Output is correct
10 Runtime error 2 ms 592 KB Execution killed with signal 11
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 47 ms 4588 KB Output is correct
3 Correct 180 ms 5292 KB Output is correct
4 Correct 299 ms 6948 KB Output is correct
5 Correct 241 ms 5452 KB Output is correct
6 Correct 313 ms 7008 KB Output is correct
7 Correct 339 ms 6988 KB Output is correct
8 Correct 177 ms 5340 KB Output is correct
9 Correct 310 ms 6920 KB Output is correct
10 Incorrect 1 ms 336 KB Output isn't correct
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 47 ms 4588 KB Output is correct
3 Correct 180 ms 5292 KB Output is correct
4 Correct 299 ms 6948 KB Output is correct
5 Correct 241 ms 5452 KB Output is correct
6 Correct 313 ms 7008 KB Output is correct
7 Correct 339 ms 6988 KB Output is correct
8 Correct 177 ms 5340 KB Output is correct
9 Correct 310 ms 6920 KB Output is correct
10 Incorrect 1 ms 336 KB Output isn't correct
11 Halted 0 ms 0 KB -