Submission #370599

# Submission time Handle Problem Language Result Execution time Memory
370599 2021-02-24T08:14:43 Z leinad2 Seats (IOI18_seats) C++17
11 / 100
4000 ms 40940 KB
#include "seats.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>r, c;
int h, w;
void give_initial_chart(int H, int W, vector<int>R, vector<int>C)
{
    h=H;w=W;r=R;c=C;
}
int swap_seats(int a, int b)
{
    swap(r[a], r[b]);
    swap(c[a], c[b]);
    int minr=h+1, maxr=-1, minw=w+1, maxw=-1, ans=0;
    for(int i=0;i<h*w;i++)
    {
        minr=min(minr, r[i]);
        maxr=max(maxr, r[i]);
        minw=min(minw, c[i]);
        maxw=max(maxw, c[i]);
        if((maxr-minr+1)*(maxw-minw+1)==i+1)ans++;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 492 KB Output is correct
2 Correct 3 ms 492 KB Output is correct
3 Correct 6 ms 492 KB Output is correct
4 Correct 4 ms 492 KB Output is correct
5 Correct 4 ms 492 KB Output is correct
6 Correct 4 ms 492 KB Output is correct
7 Correct 4 ms 492 KB Output is correct
8 Correct 4 ms 492 KB Output is correct
9 Correct 4 ms 492 KB Output is correct
10 Correct 4 ms 492 KB Output is correct
11 Correct 4 ms 492 KB Output is correct
12 Correct 4 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 492 KB Output is correct
2 Correct 3 ms 492 KB Output is correct
3 Correct 6 ms 492 KB Output is correct
4 Correct 4 ms 492 KB Output is correct
5 Correct 4 ms 492 KB Output is correct
6 Correct 4 ms 492 KB Output is correct
7 Correct 4 ms 492 KB Output is correct
8 Correct 4 ms 492 KB Output is correct
9 Correct 4 ms 492 KB Output is correct
10 Correct 4 ms 492 KB Output is correct
11 Correct 4 ms 492 KB Output is correct
12 Correct 4 ms 640 KB Output is correct
13 Correct 159 ms 748 KB Output is correct
14 Correct 161 ms 876 KB Output is correct
15 Correct 160 ms 876 KB Output is correct
16 Correct 159 ms 748 KB Output is correct
17 Correct 158 ms 748 KB Output is correct
18 Correct 157 ms 1024 KB Output is correct
19 Correct 186 ms 876 KB Output is correct
20 Correct 159 ms 876 KB Output is correct
21 Correct 162 ms 828 KB Output is correct
22 Correct 165 ms 888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4075 ms 39788 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 164 ms 876 KB Output is correct
2 Correct 1480 ms 3820 KB Output is correct
3 Execution timed out 4059 ms 39788 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 19 ms 2024 KB Output is correct
2 Correct 21 ms 2024 KB Output is correct
3 Correct 35 ms 2024 KB Output is correct
4 Correct 173 ms 2024 KB Output is correct
5 Correct 1622 ms 2580 KB Output is correct
6 Execution timed out 4043 ms 40940 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 492 KB Output is correct
2 Correct 3 ms 492 KB Output is correct
3 Correct 6 ms 492 KB Output is correct
4 Correct 4 ms 492 KB Output is correct
5 Correct 4 ms 492 KB Output is correct
6 Correct 4 ms 492 KB Output is correct
7 Correct 4 ms 492 KB Output is correct
8 Correct 4 ms 492 KB Output is correct
9 Correct 4 ms 492 KB Output is correct
10 Correct 4 ms 492 KB Output is correct
11 Correct 4 ms 492 KB Output is correct
12 Correct 4 ms 640 KB Output is correct
13 Correct 159 ms 748 KB Output is correct
14 Correct 161 ms 876 KB Output is correct
15 Correct 160 ms 876 KB Output is correct
16 Correct 159 ms 748 KB Output is correct
17 Correct 158 ms 748 KB Output is correct
18 Correct 157 ms 1024 KB Output is correct
19 Correct 186 ms 876 KB Output is correct
20 Correct 159 ms 876 KB Output is correct
21 Correct 162 ms 828 KB Output is correct
22 Correct 165 ms 888 KB Output is correct
23 Execution timed out 4075 ms 39788 KB Time limit exceeded
24 Halted 0 ms 0 KB -