結果
問題 | No.1806 Rotating Golem |
ユーザー |
|
提出日時 | 2022-01-14 21:44:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 262 bytes |
コンパイル時間 | 1,593 ms |
コンパイル使用メモリ | 166,900 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-20 09:03:55 |
合計ジャッジ時間 | 2,272 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 4 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:12:21: warning: 'idx2' may be used uninitialized [-Wmaybe-uninitialized] 12 | cout << abs(idx1-idx2); | ~~~~^~~~~ main.cpp:7:14: note: 'idx2' was declared here 7 | int idx1,idx2; | ^~~~ main.cpp:12:21: warning: 'idx1' may be used uninitialized [-Wmaybe-uninitialized] 12 | cout << abs(idx1-idx2); | ~~~~^~~~~ main.cpp:7:9: note: 'idx1' was declared here 7 | int idx1,idx2; | ^~~~
ソースコード
// USING C++ #include<bits/stdc++.h> using namespace std; int main(){ string t,s="ESWN"; char c1,c2;cin >> c1 >> c2; int idx1,idx2; for(int i=0;i<4;i++){ if(c1==s[i])idx1=i; if(c2==s[i])idx2=i; } cout << abs(idx1-idx2); }