# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
282818 | 2020-08-25T02:42:52 Z | Pichon5 | Arranging Shoes (IOI19_shoes) | C++17 | 38 ms | 2040 KB |
#include "shoes.h" #include <bits/stdc++.h> #define lcm(a,b) (a/__gcd(a,b))*b #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long int #define vi vector<int> #define vll vector<ll> #define pb push_back #define F first #define S second #define mp make_pair using namespace std; long long count_swaps(std::vector<int> s) { int n=s.size(); ll res=0; int c; bool ok=true; for(int i=0;i<n/2;i++){ if(s[i]+s[i+n/2]!=0){ ok=false; break; } } if(ok==true){ n=s.size()/2; for(int i=1;i<n;i++){ res+=i; } return res; } for(int i=0;i<n;i++){ if(s[i]==0){ continue; } for(int l=i+1;l<2*n;l++){ if(s[l]+s[i]==0){ s[l]=0; break; } if(s[l]==0){ continue; } res++; } if(s[i]>0){ res++; } } return res; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 0 ms | 256 KB | Output is correct |
5 | Correct | 38 ms | 2040 KB | Output is correct |
6 | Correct | 33 ms | 1912 KB | Output is correct |
7 | Correct | 32 ms | 1912 KB | Output is correct |
8 | Correct | 30 ms | 1920 KB | Output is correct |
9 | Correct | 34 ms | 1912 KB | Output is correct |
10 | Correct | 32 ms | 1912 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Output isn't correct |