結果
| 問題 |
No.438 Cwwプログラミング入門
|
| コンテスト | |
| ユーザー |
hiyokko2
|
| 提出日時 | 2016-10-29 19:32:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,143 bytes |
| コンパイル時間 | 1,421 ms |
| コンパイル使用メモリ | 160,488 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-24 23:10:15 |
| 合計ジャッジ時間 | 10,132 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 52 WA * 41 RE * 5 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef long long ll;
int x, y, z;
/*
int extgcd(int a, int b, int& x, int& y) {
int d = a;
if (b != 0) {
d = extgcd(b, a % b, y, x);
y -= (a / b) * x;
} else {
x = 1; y = 0;
}
return d;
}
*/
signed main()
{
cin >> x >> y >> z;
for (int a=-5000; a<=5000; a++) {
if ((z - a * x) % y == 0) {
int b = (z - a * x) / y;
if (2 * a + 2 * b - 1 <= 10000) {
//printf("a = %lld, b = %lld\n", a, b);
if (a * b < 0) {
if (a < 0) {
rep(i,-a) cout << 'c';
rep(i,-a-1) cout << 'C';
rep(i,b) cout << 'w';
rep(i,b-1) cout << 'C';
cout << 'W' << endl;
return 0;
} else if (b < 0) {
rep(i,-b) cout << 'w';
rep(i,-b-1) cout << 'C';
rep(i,a) cout << 'c';
rep(i,a-1) cout << 'C';
cout << 'W' << endl;
return 0;
}
} else {
rep(i,a) cout << 'c';
rep(i,a-1) cout << 'C';
rep(i,b) cout << 'w';
rep(i,b-1) cout << 'C';
cout << 'C' << endl;
return 0;
}
}
}
}
cout << "mourennaihasimasenn" << endl;
}
hiyokko2