# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
172795 | juggernaut | Gift (IZhO18_nicegift) | C++14 | 188 ms | 14112 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Just try and the idea will come!
#include<bits/stdc++.h>
#define int long long int
using namespace std;
int n,k,i,a,b,j,ind;
main(){
scanf("%lld%lld%lld",&n,&k,&a);
if((n*a)%k!=0){
puts("-1");
return 0;
}
if(a%(__gcd(n,k))!=0)return 1;
b=a/(k/__gcd(n,k));
ind=n*a/k/b;
i=0;
printf("%lld\n",ind);
while(ind--){
printf("%lld",b);
for(j=0;j<k;j++)printf(" %lld",(i+j)%n+1);
i=(i+1)%n;
puts("");
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |