제출 #1107832

#제출 시각아이디문제언어결과실행 시간메모리
1107832KasymKGift (IZhO18_nicegift)C++17
0 / 100
196 ms23852 KiB
#include "bits/stdc++.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define pli pair<ll, int> #define pll pair<ll, ll> #define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i) #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} const int N = 1e6+6; ll v[N]; int main(){ int n, k; scanf("%d%d", &n, &k); for(int i = 1; i <= n; ++i){ ll x; scanf("%lld", &x); v[i] = x; } if(n%k==0){ printf("%d\n", n/k); int a = 1; while(a<=n){ printf("%lld ", v[1]); int cnt = 0; while(cnt<k) printf("%d ", a+cnt), cnt++; a += k; puts(""); } return 0; } puts("-1"); return 0; }

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

nicegift.cpp: In function 'int main()':
nicegift.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |  scanf("%d%d", &n, &k);
      |  ~~~~~^~~~~~~~~~~~~~~~
nicegift.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |   scanf("%lld", &x);
      |   ~~~~~^~~~~~~~~~~~
#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...