Submission #1027749

# Submission time Handle Problem Language Result Execution time Memory
1027749 2024-07-19T09:37:05 Z Issa Tiles (BOI24_tiles) C++17
0 / 100
30 ms 5712 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ent "\n"

const int maxn = 1e6 + 100;
const ll INF = (ll)1e18 + 100;
const int inf = 1e9 + 100;
const int MOD = 1e9 + 123;
const int maxl = 26;
const int P = 31;

int n, m;
int a[maxn];
int b[maxn];

void test(){
	cin >> n >> m;
	for(int i = 1; i <= n; i++){
		cin >> a[i] >> b[i];
	}
	assert(a[2]);
	int ans = 0;
	for(int i = 2; i <= n; i++){
		int j = i;
		if(b[i] & 1) break;
		while(j + 1 <= n && b[j+1] == b[j]) j++;
		if((a[j] - a[i]) & 1){
			ans = a[j] - 1;
			break;
		}
		ans = a[j];
		i = j;
	}
	cout << ans;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t; t = 1;
    while(t--) test();
    cout << ent;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 5712 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -