제출 #331123

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3311232020-11-27 12:42:09Vladth11정렬하기 (IOI15_sorting)C++14
100 / 100
274 ms24908 KiB
#include <bits/stdc++.h>
#include "sorting.h"
#define debug(x) cerr << #x << " " << x << "\n"
#define debug_with_space(x) cerr << #x << " " << x << " "
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
typedef pair <ll, pii> piii;
const ll NMAX = 200001;
const ll INF = (1 << 30);
const ll MOD = 1000000007;
const ll BLOCK = 101;
const ll nr_of_bits = 20;
const ll delta = 0.0000001;
int viz[NMAX];
int cop[NMAX];
bool OK(int p, int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
for(int i = 0; i < N; i++)
S[i] = cop[i];
for(int i = 0; i < p; i++) {
swap(S[X[i]], S[Y[i]]);
}
for(int i = 0; i < N; i++)
viz[i] = 0;
int cc = 0;
for(int i = 0; i < N; i++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

sorting.cpp:16:18: warning: conversion from 'double' to 'll' {aka 'long long int'} changes value from '9.9999999999999995e-8' to '0' [-Wfloat-conversion]
   16 | const ll delta = 0.0000001;
      |                  ^~~~~~~~~
sorting.cpp: In function 'bool OK(int, int, int*, int, int*, int*, int*, int*)':
sorting.cpp:40:30: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   40 |         cc += ciclu.size() - 1;
      |                              ^
sorting.cpp:21:36: warning: unused parameter 'M' [-Wunused-parameter]
   21 | bool OK(int p, int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                ~~~~^
sorting.cpp:21:61: warning: unused parameter 'P' [-Wunused-parameter]
   21 | bool OK(int p, int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                         ~~~~^~~
sorting.cpp:21:70: warning: unused parameter 'Q' [-Wunused-parameter]
   21 | bool OK(int p, int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                                  ~~~~^~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:53:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   53 |     for(int i = 0; i < N; i++) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:63:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   63 |     for(int i = 0; i < N; i++)
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:65:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   65 |     for(int i = 0; i < r; i++) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:68:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   68 |     for(int i = 0; i < N; i++) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:72:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   72 |     for(int i = 0; i < N; i++) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:82:34: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   82 |         for(int j = ciclu.size() - 2; j >= 0; j--) {
      |                     ~~~~~~~~~~~~~^~~
sorting.cpp:87:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   87 |     for(int i = N - 1; i >= 0; i--) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:90:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   90 |     for(int i = 0; i < N; i++) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:93:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   93 |     for(int i = 0; i < r; i++) {
      |             ^
sorting.cpp:51:9: note: shadowed declaration is here
   51 |     int i;
      |         ^
sorting.cpp:51:9: warning: unused variable 'i' [-Wunused-variable]
#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...