提出 #39233151
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define L0(i,n) for(int i=0;i<n;++i)
#define Ln(i,n) for(int i = 1;i<=n;++i)
#define R0(i,n) for(int i = n-1;i>=0;i--)
#define MX 10000000001
#define pow2(a) ((a)*(a))
#define pb push_back
#define vp <vector<pair<ll,ll>>
#define vi vector<ll>
#define mp make_pair
#define pf push_front
#define all(v) v.begin(), v.end()
#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define PI 3.14159265
#define Y() printf("YES\n");
#define N() printf("NO\n");
#define y() printf("Yes\n");
#define n() printf("No\n");
#define print3(x,y,z); cout << x << " " << y << " " << z << "\n";
#define print1(x); cout << x << "\n";
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
int longestIncreasingSubsequenceLenghtDP(int a[],int n){
int dp[n],ans=0;
for(int k = 0;k<n;k++){
dp[k] = 1;
for(int i = 0;i<k;i++){
if(a[i] <= a[k]){
dp[k] = max(dp[k],dp[i] + 1);
ans = max(dp[k],ans);
}
}
}
return ans;
}
int result[1000] = {0};
int factDP(int n) {
if (n >= 0) {
result[0] = 1;
for (int i = 1; i <= n; ++i) {
result[i] = i * result[i - 1];
}
return result[n];
}
}
bool isPrime(ll n){
if(n<2) return false;
for(ll x = 2;x*x <=n;x++){
if(n%x == 0)return false;
}
return true;
}
vector<int> primeFactors(int n){
vector<int> f;
for(int x = 2;x*x<=n;x++){
while(n%x==0){
f.push_back(x);
n/=x;
}
}
if(n>1)f.push_back(n);
return f;
}
bool isPerfectSquare(long double x) {
long double sr = sqrt(x);
return ((sr - floor(sr)) == 0);
}
int countDistinctCharsString(string s) {
unordered_map<char, int> m;
for (int i = 0; i <(int)s.length(); i++) {
m[s[i]]++;
}
return m.size();
}
void sortStringByLenght(string s[], int n) {
for (int i=1 ;i<n; i++) {
string temp = s[i];
int j = i - 1;
while (j >= 0 && temp.length() < s[j].length()) {
s[j+1] = s[j];
j--;
}
s[j+1] = temp;
}
}
int isSubstring(string s1, string s2) {
int M = s1.length();
int N = s2.length();
for (int i = 0; i <= N - M; i++) {
int j;
for (j = 0; j < M; j++)
if (s2[i + j] != s1[j])
break;
if (j == M)
return true;
}
return false;
}
vector<int> primes;
void SieveOfEratosthenes(int n) {
bool prime[n+1];
memset(prime, true, sizeof(prime));
for (int p=2; p*p<=n; p++) {
if (prime[p] == true) {
for (int i=p*p; i<=n; i += p)
prime[i] = false;
}
}
for (int p=2; p<=n; p++)
if (prime[p])
primes.pb(p);
}
int lowerboundNum(vector<int> vc,int x){
vector<int>::iterator it = lower_bound(vc.begin(),vc.end(),x);
return *it;
}
int upperboundNum(vector<int> vc,int x){
vector<int>::iterator it = upper_bound(vc.begin(),vc.end(),x);
return *it;
}
bool isPresent(vector<int> vc,int x){
return binary_search(all(vc),x);
}
bool isSubSequence(string str1,string str2, int m, int n)
{
if (m == 0) return true;
if (n == 0) return false;
if (str1[m-1] == str2[n-1])
return isSubSequence(str1, str2, m-1, n-1);
return isSubSequence(str1, str2, m, n-1);
}
ll binpow(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
return res;
}
void calc(){
string s;cin>>s;
for(int i = 0;i<s.size();i++){
if(isupper(s[i])){
cout<<i+1;
return;
}
}
}
int main()
{
FAST
int t=1;//cin>>t;
while(t--) calc();
}
提出情報
提出日時
2023-02-26 21:06:56+0900
問題
A - camel Case
ユーザ
Sagor0078
言語
C++ (GCC 9.2.1)
得点
100
コード長
4026 Byte
結果
AC
実行時間
9 ms
メモリ
3544 KiB
コンパイルエラー
./Main.cpp: In function ‘void calc()’:
./Main.cpp:148:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
148 | for(int i = 0;i<s.size();i++){
| ~^~~~~~~~~
./Main.cpp: In function ‘int factDP(int)’:
./Main.cpp:47:1: warning: control reaches end of non-void function [-Wreturn-type]
47 | }
| ^
ジャッジ結果
セット名
Sample
All
得点 / 配点
0 / 0
100 / 100
結果
セット名
テストケース
Sample
example_00.txt, example_01.txt, example_02.txt
All
example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
ケース名
結果
実行時間
メモリ
example_00.txt
AC
9 ms
3336 KiB
example_01.txt
AC
2 ms
3368 KiB
example_02.txt
AC
2 ms
3532 KiB
hand_00.txt
AC
2 ms
3408 KiB
hand_01.txt
AC
3 ms
3488 KiB
hand_02.txt
AC
2 ms
3488 KiB
hand_03.txt
AC
2 ms
3344 KiB
hand_04.txt
AC
2 ms
3344 KiB
random_00.txt
AC
2 ms
3504 KiB
random_01.txt
AC
2 ms
3420 KiB
random_02.txt
AC
2 ms
3428 KiB
random_03.txt
AC
2 ms
3420 KiB
random_04.txt
AC
3 ms
3544 KiB
random_05.txt
AC
2 ms
3536 KiB
random_06.txt
AC
1 ms
3408 KiB
random_07.txt
AC
3 ms
3544 KiB
random_08.txt
AC
3 ms
3536 KiB
random_09.txt
AC
2 ms
3388 KiB