제출 #334386

#제출 시각아이디문제언어결과실행 시간메모리
334386beksultan04Gift (IZhO18_nicegift)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define OK puts("OK"); #define fr first #define sc second #define ret return #define scan1(a) scanf("%lld",&a); #define scan2(a,b) scanf("%lld %lld",&a, &b); #define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define all(s) s.begin(),s.end() #define pb push_back #define endi puts(""); const int N = 1e5+12,INF=1e9+7; int resh[N],q[N],n; multiset<int> s; main(){ int n,m,i,j,sum=0; __int32 ans=1; scan2(n,m) for (i=0;i<n;++i){ scan1(q[i]) sum+=q[i]; } if (sum%m == 0){ printf("%lld\n",sum/m); while (sum > 0){ sum -= q[0]*m; int c=0; printf("%lld ",q[0]); while (c < m){ c++; printf("%d ",ans++); } endi } } else { cout <<-1; } }

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

nicegift.cpp:18:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      |      ^
nicegift.cpp: In function 'int main()':
nicegift.cpp:21:5: error: '__int32' was not declared in this scope; did you mean '__rintf32'?
   21 |     __int32 ans=1;
      |     ^~~~~~~
      |     __rintf32
nicegift.cpp:35:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |                 printf("%d ",ans++);
      |                              ^~~
      |                              abs
nicegift.cpp:20:15: warning: unused variable 'j' [-Wunused-variable]
   20 |     int n,m,i,j,sum=0;
      |               ^
nicegift.cpp:10:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 | #define scan2(a,b) scanf("%lld %lld",&a, &b);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~~
nicegift.cpp:22:5: note: in expansion of macro 'scan2'
   22 |     scan2(n,m)
      |     ^~~~~
nicegift.cpp:9:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 | #define scan1(a) scanf("%lld",&a);
      |                  ~~~~~^~~~~~~~~~~
nicegift.cpp:24:9: note: in expansion of macro 'scan1'
   24 |         scan1(q[i])
      |         ^~~~~