結果
問題 |
No.438 Cwwプログラミング入門
|
ユーザー |
![]() |
提出日時 | 2016-10-28 23:32:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,557 bytes |
コンパイル時間 | 1,032 ms |
コンパイル使用メモリ | 95,020 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 20:14:15 |
合計ジャッジ時間 | 11,435 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 38 WA * 60 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #define rep(i,s,n) for(int i = (s); (n) > i; i++) #define REP(i,n) rep(i,0,n) #define RANGE(x,a,b) ((a) <= (x) && (x) <= (b)) #define POWT(x) ((x)*(x)) #define ALL(x) (x).begin(), (x).end() #define MODI 10000 #define bitcheck(a,b) ((a >> b) & 1) #define bitset(a,b) ( a |= (1 << b)) #define bitunset(a,b) (a &= ~(1 << b)) using namespace std; typedef pair<int, int> pii; typedef long long ll; signed main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); printf("mourennaihasimasenn\n"); return 0; int ax = 20000, ay = 20000; REP(i, 10002) { REP(j, 10002) { if ((i - 5001)*x + (j - 5001)*y == z) { if (abs(ax) + abs(ay) > abs(i - 5001) + abs(j - 5001)) { ax = i - 5001; ay = j - 5001; } } } } if (ax == 20000) { printf("mourennaihasimasenn\n"); return 0; } string ans; if (ax > 0) { REP(i, ax) { ans += "c"; } REP(i, ax-1) { ans +="C"; } } if (ay > 0) { REP(i, ay) { ans +="w"; } REP(i, ay) { if (ax == 0 && ay == 1) break; ans +="C"; } } if (ax < 0) { REP(i, abs(ax)) { ans +="c"; ans +="W"; } } if (ay < 0) { REP(i, abs(ay)) { ans +="w"; ans +="W"; } } if (ans.length() > 10000) { printf("mourennaihasimasenn\n"); } else printf("%s\n",ans.c_str()); return 0; }