제출 #537755

#제출 시각아이디문제언어결과실행 시간메모리
537755Jarif_RahmanAncient Machine (JOI21_ancient_machine)C++17
70 / 100
79 ms8600 KiB
#include "Anna.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; namespace { } void Anna(int n, vector<char> s){ vector<int> rt(n, 0); int fx = -1; for(int i = 0; i < n; i++) if(s[i] == 'X'){ fx = i; break; } if(fx == -1){ for(int x: rt) Send(x); return; } rt[fx] = 1; for(int i = fx+1; i < n; i++) if(s[i] == 'Z') rt[i] = 1; for(int x: rt) Send(x); }
#include "Bruno.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; namespace { } void Bruno(int n, int m, vector<int> A){ int fx = -1; for(int i = 0; i < n; i++) if(A[i] == 1){ fx = i; break; } if(fx == -1){ for(int i = 0; i < n; i++) Remove(i); return; } for(int i = 0; i < fx; i++) Remove(i); int ls = fx+1; for(int i = fx+1; i < n; i++){ if(A[i] != 1) continue; for(int j = i-1; j >= ls; j--) Remove(j); Remove(i); ls = i+1; } Remove(fx); for(int i = ls; i < n; i++) Remove(i); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...