結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-26 22:46:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,037 bytes |
| コンパイル時間 | 776 ms |
| コンパイル使用メモリ | 87,964 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 1.00 |
| 最終ジャッジ日時 | 2024-07-16 16:32:48 |
| 合計ジャッジ時間 | 7,347 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 13 |
ソースコード
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
#include <fstream>
#include <cassert>
using namespace std;
//#include<bits/stdc++.h>
string input(istream& is) {
string ret;
getline(is, ret); //回答コードから受け取った文字列
assert(ret.size() == 10); //長さは 10
for (char c : ret) { //数字のみかチェック
assert('0' <= c && c <= '9');
}
return ret;
}
int main(int argc, char* argv[]) {
ifstream ifs(argv[1]);
string ans = input(ifs);
while (1) {
string p;
p = input(cin);
if (ans == p) {
cout << p.size() << " unlocked" << endl;
return 0;
}
int t = 0;
for (int i = 0; i < p.size(); i++) {
if (p[i] == ans[i])t++;
}
cout << t << " locked" << endl;
}
return 0;
}