結果

問題 No.405 ローマ数字の腕時計
ユーザー Yugimn
提出日時 2022-04-25 23:35:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 2,159 ms
コンパイル使用メモリ 194,808 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 19:34:40
合計ジャッジ時間 2,364 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:9:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
    9 | void print(auto a){
      |            ^~~~
main.cpp:13:13: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   13 | void prints(auto a){
      |             ^~~~
main.cpp:21:13: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   21 | void printl(auto a){
      |             ^~~~
main.cpp: In function 'int main()':
main.cpp:42:16: warning: 'now' may be used uninitialized [-Wmaybe-uninitialized]
   42 |   printl(X[(now+T)%12]);
      |            ~~~~^~~
main.cpp:36:7: note: 'now' was declared here
   36 |   int now;
      |       ^~~

ソースコード

diff #

//Normal

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void print(auto a){
  cout << a;
}

void prints(auto a){
  cout << a << " ";
}

void prints(){
  cout << " ";
}

void printl(auto a){
  cout << a << endl;
}

void printl(){
  cout << endl;
}

void fix(int n){
  cout << fixed << setprecision(n);
}

int main(){
  vector<string> X = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"};
  string S1; cin >> S1;
  int now;
  for(int i = 0; i < 12; i++){
    if(S1 == X[i]) now = i+1200;
  }
  int T; cin >> T;
  
  printl(X[(now+T)%12]);
  
  return 0;
}
0