Submission #1264370

#TimeUsernameProblemLanguageResultExecution timeMemory
1264370testaccountInfinite Race (EGOI24_infiniterace2)C++20
34 / 100
20 ms1864 KiB
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3") #include <bits/stdc++.h> using namespace std; #define ios ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr) #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define yes cout << "YES" << '\n' #define no cout << "NO" << '\n' #define stop return 0 #define str string #define int long long #define veci vector<int> #define skip continue #define sz size() #define pii pair<int,int> const int MOD = 1e9 + 7; const int INF = 1e18; const int N = 1e6 + 5; const int inf = 1e9 + 7; int b[N]; int dp[N]; int n, m; str s; void tin() { cin >> n >> m; veci a(n, 0); int kol = 0; int kol1 = 1; for(int i = 0;i < m;i++) { int x; cin >> x; int x1 = abs(x); if(a[x1] == kol1) { kol++; kol1++; } a[x1] = kol1; } cout << kol; } signed main() { ios; int t = 1; //cin >> t; while(t--) { tin(); } stop; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...