제출 #1110772

#제출 시각아이디문제언어결과실행 시간메모리
1110772elotelo966Arranging Shoes (IOI19_shoes)C++17
10 / 100
20 ms3256 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; //#define int long long #define OYY LLONG_MAX #define mod 1000000007 #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define FOR for(int i=1;i<=n;i++) #define mid (start+end)/2 #define lim 300005 #define fi first #define se second long long count_swaps(std::vector<int> s) { int n=s.size(); if(n==2){ if(s[0]<0)return 0; return 1; } int tut=1,cev=0; FOR{ if(s[i-1]<0){ cev+=abs(tut-i); tut+=2; } } return cev; } /* int main(){ faster int n;cin>>n; vector<int> v; FOR{ int x,y; cin>>x>>y; v.push_back(x); v.push_back(y); } cout<<count_swaps(v)<<'\n'; return 0; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...