結果
| 問題 |
No.536 人工知能
|
| コンテスト | |
| ユーザー |
mMqrMruYrNII4Td
|
| 提出日時 | 2017-06-30 22:24:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 971 bytes |
| コンパイル時間 | 436 ms |
| コンパイル使用メモリ | 66,104 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 19:21:57 |
| 合計ジャッジ時間 | 889 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:40:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
40 | scanf("%s", s);
| ~~~~~^~~~~~~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
using namespace std;
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
long gcd(long a, long b){
if (a%b==0){
return b;
}
else{
return gcd(b,a%b);
}
}
long lcm(long a, long b){
return (a*b) / gcd(a,b);
}
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;
char s[11];
int main(){
scanf("%s", s);
int len = strlen(s);
if (s[len-2] == 'a' && s[len-1] == 'i'){
REP(i,len-2) printf("%c", s[i]);
cout << "AI" << endl;
}
else {
REP(i,len) printf("%c", s[i]);
cout << "-AI" << endl;
}
return 0;
}
mMqrMruYrNII4Td