結果
問題 | No.438 Cwwプログラミング入門 |
ユーザー | crazybbb3 |
提出日時 | 2016-10-29 13:28:08 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,505 bytes |
コンパイル時間 | 2,477 ms |
コンパイル使用メモリ | 80,092 KB |
実行使用メモリ | 54,272 KB |
最終ジャッジ日時 | 2024-11-24 23:08:37 |
合計ジャッジ時間 | 18,360 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 56 ms
50,356 KB |
testcase_01 | WA | - |
testcase_02 | AC | 49 ms
50,556 KB |
testcase_03 | AC | 52 ms
50,152 KB |
testcase_04 | AC | 49 ms
50,276 KB |
testcase_05 | AC | 51 ms
50,240 KB |
testcase_06 | AC | 50 ms
50,400 KB |
testcase_07 | AC | 50 ms
50,244 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 52 ms
50,120 KB |
testcase_14 | WA | - |
testcase_15 | AC | 49 ms
50,056 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 49 ms
50,180 KB |
testcase_19 | AC | 50 ms
50,284 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 53 ms
50,000 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | AC | 50 ms
50,324 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | AC | 53 ms
50,316 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | AC | 49 ms
50,372 KB |
testcase_39 | WA | - |
testcase_40 | AC | 53 ms
50,468 KB |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | AC | 50 ms
50,472 KB |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | AC | 49 ms
50,248 KB |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | AC | 50 ms
50,120 KB |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | AC | 50 ms
50,096 KB |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | AC | 52 ms
50,312 KB |
testcase_63 | WA | - |
testcase_64 | WA | - |
testcase_65 | AC | 51 ms
50,320 KB |
testcase_66 | WA | - |
testcase_67 | AC | 52 ms
50,328 KB |
testcase_68 | WA | - |
testcase_69 | WA | - |
testcase_70 | WA | - |
testcase_71 | WA | - |
testcase_72 | WA | - |
testcase_73 | WA | - |
testcase_74 | WA | - |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | WA | - |
testcase_78 | AC | 51 ms
50,388 KB |
testcase_79 | AC | 50 ms
50,344 KB |
testcase_80 | AC | 49 ms
50,116 KB |
testcase_81 | AC | 48 ms
50,308 KB |
testcase_82 | AC | 49 ms
50,196 KB |
testcase_83 | AC | 49 ms
50,360 KB |
testcase_84 | AC | 50 ms
50,116 KB |
testcase_85 | AC | 49 ms
50,196 KB |
testcase_86 | AC | 48 ms
50,364 KB |
testcase_87 | AC | 50 ms
50,264 KB |
testcase_88 | RE | - |
testcase_89 | WA | - |
testcase_90 | AC | 48 ms
50,300 KB |
testcase_91 | RE | - |
testcase_92 | RE | - |
testcase_93 | RE | - |
testcase_94 | RE | - |
testcase_95 | WA | - |
testcase_96 | WA | - |
testcase_97 | WA | - |
testcase_98 | AC | 50 ms
50,400 KB |
testcase_99 | AC | 50 ms
50,064 KB |
testcase_100 | WA | - |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { static BufferedReader in; static PrintWriter out; static StringTokenizer tok; void solve() throws IOException { int x = ni(); int y = ni(); int z = ni(); for (int i = 0; i <= 4999; i++) { if ((z - x * i) % y == 0) { int t = (z - x * i) / y; if (t >= -4998 && t <= 4999) { output(i, t); return; } } if ((z - x * (-i)) % y == 0) { int t = (z - x * (-i)) / y; if (t >= -4998 && t <= 4999) { output(-i, t); return; } } } out.println("mourennaihasimasenn"); } void output(int x, int y) { String ans = ""; if (x < 0) { for (int i = 0; i < y; i++) { if (i == 0) ans += "w"; else ans += "wC"; } for (int i = 0; i < x; i++) { ans += "cW"; } } else if (y < 0) { for (int i = 0; i < x; i++) { if (i == 0) ans += "c"; else ans += "cC"; } for (int i = 0; i < x; i++) { ans += "wW"; } } else { for (int i = 0; i < y; i++) { if (i == 0) ans+="c"; else ans+="cC"; } for (int i = 0; i < x; i++) { if ("".equals(ans)) ans += "w"; ans+="wC"; } } out.println(ans); } int gcd(int a, int b) { return a == 0 ? b : gcd(b % a, a); } int lcm(int a, int b) { return a / gcd(a, b) * b; } int[] extgcd(int a, int b, int[] is) { if (a == 0) { is[0] = 0; is[1] = 1; is[2] = b; } else { extgcd(b % a, a, is); int x = is[1] - b / a * is[0]; is[1] = is[0]; is[0] = x; } return is; } String ns() throws IOException { while (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine(), " "); } return tok.nextToken(); } int ni() throws IOException { return Integer.parseInt(ns()); } long nl() throws IOException { return Long.parseLong(ns()); } double nd() throws IOException { return Double.parseDouble(ns()); } String[] nsa(int n) throws IOException { String[] res = new String[n]; for (int i = 0; i < n; i++) { res[i] = ns(); } return res; } int[] nia(int n) throws IOException { int[] res = new int[n]; for (int i = 0; i < n; i++) { res[i] = ni(); } return res; } long[] nla(int n) throws IOException { long[] res = new long[n]; for (int i = 0; i < n; i++) { res[i] = nl(); } return res; } public static void main(String[] args) throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); tok = new StringTokenizer(""); Main main = new Main(); main.solve(); out.close(); } }