제출 #1061429

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10614292024-08-16 08:58:07Halym2007서열 (APIO23_sequence)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
//#include "sequence.h"
using namespace std;
#define ll long long
#define sz size()
#define ff first
#define ss second
#define pb push_back
#define pii pair <int, int>
const int N = 5e5 + 5;
int a[N], st[N], n, val[N], sana[N];
int sequence(int N, vector<int> A) {
n = N;
for (int i = 0; i < n; ++i) {
a[i] = A[i];
}
int jogap = 0;
int bir = 0, iki = 0, uc = 0;
for (int i = 0; i < n; ++i) {
if (a[i] == 1) {
bir++;
}
else if (a[i] == 2) {
iki++;
}
else uc++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

sequence.cpp: In function 'int sequence(int, std::vector<int>)':
sequence.cpp:31:22: warning: left operand of comma operator has no effect [-Wunused-value]
   31 |   pii orta = ({i / 2 + 1, (i + 1) / 2 + 1});
      |                ~~~~~~^~~
sequence.cpp:31:42: error: expected ';' before '}' token
   31 |   pii orta = ({i / 2 + 1, (i + 1) / 2 + 1});
      |                                          ^
      |                                          ;
sequence.cpp:31:39: error: conversion from 'int' to non-scalar type 'std::pair<int, int>' requested
   31 |   pii orta = ({i / 2 + 1, (i + 1) / 2 + 1});
      |                           ~~~~~~~~~~~~^~~
sequence.cpp:43:1: warning: no return statement in function returning non-void [-Wreturn-type]
   43 | }
      | ^